@inspectr/mcplab 1.6.0 → 1.7.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 (37) hide show
  1. package/dist/app/assets/index-CYs1291A.css +1 -0
  2. package/dist/app/assets/index-Fe4npghI.js +249 -0
  3. package/dist/app/index.html +2 -2
  4. package/dist/app-server/app-context.d.ts +77 -129
  5. package/dist/app-server/app-context.d.ts.map +1 -1
  6. package/dist/app-server/oauth-debugger-domain.d.ts +174 -194
  7. package/dist/app-server/oauth-debugger-domain.d.ts.map +1 -1
  8. package/dist/app-server/oauth-debugger-domain.js +105 -32
  9. package/dist/app-server/oauth-debugger-domain.js.map +1 -1
  10. package/dist/app-server/oauth-runtime-domain.d.ts +60 -0
  11. package/dist/app-server/oauth-runtime-domain.d.ts.map +1 -0
  12. package/dist/app-server/oauth-runtime-domain.js +198 -0
  13. package/dist/app-server/oauth-runtime-domain.js.map +1 -0
  14. package/dist/app-server/oauth-runtime-routes.d.ts +18 -0
  15. package/dist/app-server/oauth-runtime-routes.d.ts.map +1 -0
  16. package/dist/app-server/oauth-runtime-routes.js +109 -0
  17. package/dist/app-server/oauth-runtime-routes.js.map +1 -0
  18. package/dist/app-server/router.d.ts.map +1 -1
  19. package/dist/app-server/router.js +18 -0
  20. package/dist/app-server/router.js.map +1 -1
  21. package/dist/app-server/runs-routes.d.ts +30 -54
  22. package/dist/app-server/runs-routes.d.ts.map +1 -1
  23. package/dist/app-server/runs-routes.js +38 -7
  24. package/dist/app-server/runs-routes.js.map +1 -1
  25. package/dist/app-server/tool-analysis-domain.d.ts +166 -173
  26. package/dist/app-server/tool-analysis-domain.d.ts.map +1 -1
  27. package/dist/app-server/tool-analysis-domain.js +18 -4
  28. package/dist/app-server/tool-analysis-domain.js.map +1 -1
  29. package/dist/app-server/tool-analysis.d.ts +12 -19
  30. package/dist/app-server/tool-analysis.d.ts.map +1 -1
  31. package/dist/app-server/tool-analysis.js +23 -2
  32. package/dist/app-server/tool-analysis.js.map +1 -1
  33. package/dist/cli.js +18 -0
  34. package/dist/cli.js.map +1 -1
  35. package/package.json +4 -4
  36. package/dist/app/assets/index-2w0pnVLj.js +0 -249
  37. package/dist/app/assets/index-C9_UrDPP.css +0 -1
@@ -1,249 +0,0 @@
1
- function EU(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 Wp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ay={exports:{}},Hu={},sy={exports:{}},Rt={};var dE;function PU(){if(dE)return Rt;dE=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,L,ee){this.props=z,this.context=L,this.refs=b,this.updater=ee||g}y.prototype.isReactComponent={},y.prototype.setState=function(z,L){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,L,"setState")},y.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function S(){}S.prototype=y.prototype;function C(z,L,ee){this.props=z,this.context=L,this.refs=b,this.updater=ee||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 T(z,L,ee){var se,G={},ue=null,le=null;if(L!=null)for(se in L.ref!==void 0&&(le=L.ref),L.key!==void 0&&(ue=""+L.key),L)_.call(L,se)&&!O.hasOwnProperty(se)&&(G[se]=L[se]);var oe=arguments.length-2;if(oe===1)G.children=ee;else if(1<oe){for(var ie=Array(oe),fe=0;fe<oe;fe++)ie[fe]=arguments[fe+2];G.children=ie}if(z&&z.defaultProps)for(se in oe=z.defaultProps,oe)G[se]===void 0&&(G[se]=oe[se]);return{$$typeof:e,type:z,key:ue,ref:le,props:G,_owner:P.current}}function R(z,L){return{$$typeof:e,type:z.type,key:L,ref:z.ref,props:z.props,_owner:z._owner}}function I(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function D(z){var L={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(ee){return L[ee]})}var $=/\/+/g;function H(z,L){return typeof z=="object"&&z!==null&&z.key!=null?D(""+z.key):L.toString(36)}function F(z,L,ee,se,G){var ue=typeof z;(ue==="undefined"||ue==="boolean")&&(z=null);var le=!1;if(z===null)le=!0;else switch(ue){case"string":case"number":le=!0;break;case"object":switch(z.$$typeof){case e:case t:le=!0}}if(le)return le=z,G=G(le),z=se===""?"."+H(le,0):se,E(G)?(ee="",z!=null&&(ee=z.replace($,"$&/")+"/"),F(G,L,ee,"",function(fe){return fe})):G!=null&&(I(G)&&(G=R(G,ee+(!G.key||le&&le.key===G.key?"":(""+G.key).replace($,"$&/")+"/")+z)),L.push(G)),1;if(le=0,se=se===""?".":se+":",E(z))for(var oe=0;oe<z.length;oe++){ue=z[oe];var ie=se+H(ue,oe);le+=F(ue,L,ee,ie,G)}else if(ie=x(z),typeof ie=="function")for(z=ie.call(z),oe=0;!(ue=z.next()).done;)ue=ue.value,ie=se+H(ue,oe++),le+=F(ue,L,ee,ie,G);else if(ue==="object")throw L=String(z),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.");return le}function q(z,L,ee){if(z==null)return z;var se=[],G=0;return F(z,se,"","",function(ue){return L.call(ee,ue,G++)}),se}function Q(z){if(z._status===-1){var L=z._result;L=L(),L.then(function(ee){(z._status===0||z._status===-1)&&(z._status=1,z._result=ee)},function(ee){(z._status===0||z._status===-1)&&(z._status=2,z._result=ee)}),z._status===-1&&(z._status=0,z._result=L)}if(z._status===1)return z._result.default;throw z._result}var J={current:null},B={transition:null},U={ReactCurrentDispatcher:J,ReactCurrentBatchConfig:B,ReactCurrentOwner:P};function Z(){throw Error("act(...) is not supported in production builds of React.")}return Rt.Children={map:q,forEach:function(z,L,ee){q(z,function(){L.apply(this,arguments)},ee)},count:function(z){var L=0;return q(z,function(){L++}),L},toArray:function(z){return q(z,function(L){return L})||[]},only:function(z){if(!I(z))throw Error("React.Children.only expected to receive a single React element child.");return z}},Rt.Component=y,Rt.Fragment=n,Rt.Profiler=a,Rt.PureComponent=C,Rt.StrictMode=r,Rt.Suspense=d,Rt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=U,Rt.act=Z,Rt.cloneElement=function(z,L,ee){if(z==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+z+".");var se=j({},z.props),G=z.key,ue=z.ref,le=z._owner;if(L!=null){if(L.ref!==void 0&&(ue=L.ref,le=P.current),L.key!==void 0&&(G=""+L.key),z.type&&z.type.defaultProps)var oe=z.type.defaultProps;for(ie in L)_.call(L,ie)&&!O.hasOwnProperty(ie)&&(se[ie]=L[ie]===void 0&&oe!==void 0?oe[ie]:L[ie])}var ie=arguments.length-2;if(ie===1)se.children=ee;else if(1<ie){oe=Array(ie);for(var fe=0;fe<ie;fe++)oe[fe]=arguments[fe+2];se.children=oe}return{$$typeof:e,type:z.type,key:G,ref:ue,props:se,_owner:le}},Rt.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},Rt.createElement=T,Rt.createFactory=function(z){var L=T.bind(null,z);return L.type=z,L},Rt.createRef=function(){return{current:null}},Rt.forwardRef=function(z){return{$$typeof:c,render:z}},Rt.isValidElement=I,Rt.lazy=function(z){return{$$typeof:h,_payload:{_status:-1,_result:z},_init:Q}},Rt.memo=function(z,L){return{$$typeof:f,type:z,compare:L===void 0?null:L}},Rt.startTransition=function(z){var L=B.transition;B.transition={};try{z()}finally{B.transition=L}},Rt.unstable_act=Z,Rt.useCallback=function(z,L){return J.current.useCallback(z,L)},Rt.useContext=function(z){return J.current.useContext(z)},Rt.useDebugValue=function(){},Rt.useDeferredValue=function(z){return J.current.useDeferredValue(z)},Rt.useEffect=function(z,L){return J.current.useEffect(z,L)},Rt.useId=function(){return J.current.useId()},Rt.useImperativeHandle=function(z,L,ee){return J.current.useImperativeHandle(z,L,ee)},Rt.useInsertionEffect=function(z,L){return J.current.useInsertionEffect(z,L)},Rt.useLayoutEffect=function(z,L){return J.current.useLayoutEffect(z,L)},Rt.useMemo=function(z,L){return J.current.useMemo(z,L)},Rt.useReducer=function(z,L,ee){return J.current.useReducer(z,L,ee)},Rt.useRef=function(z){return J.current.useRef(z)},Rt.useState=function(z){return J.current.useState(z)},Rt.useSyncExternalStore=function(z,L,ee){return J.current.useSyncExternalStore(z,L,ee)},Rt.useTransition=function(){return J.current.useTransition()},Rt.version="18.3.1",Rt}var fE;function qS(){return fE||(fE=1,sy.exports=PU()),sy.exports}var pE;function kU(){if(pE)return Hu;pE=1;var e=qS(),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 Hu.Fragment=n,Hu.jsx=o,Hu.jsxs=o,Hu}var hE;function OU(){return hE||(hE=1,ay.exports=kU()),ay.exports}var s=OU(),Vp={},iy={exports:{}},Rr={},oy={exports:{}},ly={};var mE;function TU(){return mE||(mE=1,(function(e){function t(B,U){var Z=B.length;B.push(U);e:for(;0<Z;){var z=Z-1>>>1,L=B[z];if(0<a(L,U))B[z]=U,B[Z]=L,Z=z;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var U=B[0],Z=B.pop();if(Z!==U){B[0]=Z;e:for(var z=0,L=B.length,ee=L>>>1;z<ee;){var se=2*(z+1)-1,G=B[se],ue=se+1,le=B[ue];if(0>a(G,Z))ue<L&&0>a(le,G)?(B[z]=le,B[ue]=Z,z=ue):(B[z]=G,B[se]=Z,z=se);else if(ue<L&&0>a(le,Z))B[z]=le,B[ue]=Z,z=ue;else break e}}return U}function a(B,U){var Z=B.sortIndex-U.sortIndex;return Z!==0?Z:B.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(B){for(var U=n(f);U!==null;){if(U.callback===null)r(f);else if(U.startTime<=B)r(f),U.sortIndex=U.expirationTime,t(d,U);else break;U=n(f)}}function E(B){if(b=!1,N(B),!j)if(n(d)!==null)j=!0,Q(_);else{var U=n(f);U!==null&&J(E,U.startTime-B)}}function _(B,U){j=!1,b&&(b=!1,S(T),T=-1),g=!0;var Z=x;try{for(N(U),p=n(d);p!==null&&(!(p.expirationTime>U)||B&&!D());){var z=p.callback;if(typeof z=="function"){p.callback=null,x=p.priorityLevel;var L=z(p.expirationTime<=U);U=e.unstable_now(),typeof L=="function"?p.callback=L:p===n(d)&&r(d),N(U)}else r(d);p=n(d)}if(p!==null)var ee=!0;else{var se=n(f);se!==null&&J(E,se.startTime-U),ee=!1}return ee}finally{p=null,x=Z,g=!1}}var P=!1,O=null,T=-1,R=5,I=-1;function D(){return!(e.unstable_now()-I<R)}function $(){if(O!==null){var B=e.unstable_now();I=B;var U=!0;try{U=O(!0,B)}finally{U?H():(P=!1,O=null)}}else P=!1}var H;if(typeof C=="function")H=function(){C($)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,q=F.port2;F.port1.onmessage=$,H=function(){q.postMessage(null)}}else H=function(){y($,0)};function Q(B){O=B,P||(P=!0,H())}function J(B,U){T=y(function(){B(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(B){B.callback=null},e.unstable_continueExecution=function(){j||g||(j=!0,Q(_))},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(B){switch(x){case 1:case 2:case 3:var U=3;break;default:U=x}var Z=x;x=U;try{return B()}finally{x=Z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(B,U){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var Z=x;x=B;try{return U()}finally{x=Z}},e.unstable_scheduleCallback=function(B,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,B){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=Z+L,B={id:h++,callback:U,priorityLevel:B,startTime:Z,expirationTime:L,sortIndex:-1},Z>z?(B.sortIndex=Z,t(f,B),n(d)===null&&B===n(f)&&(b?(S(T),T=-1):b=!0,J(E,Z-z))):(B.sortIndex=L,t(d,B),j||g||(j=!0,Q(_))),B},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(B){var U=x;return function(){var Z=x;x=U;try{return B.apply(this,arguments)}finally{x=Z}}}})(ly)),ly}var vE;function RU(){return vE||(vE=1,oy.exports=TU()),oy.exports}var gE;function IU(){if(gE)return Rr;gE=1;var e=qS(),t=RU();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,M){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=M}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"),T=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),I=Symbol.for("react.provider"),D=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),J=Symbol.for("react.offscreen"),B=Symbol.iterator;function U(l){return l===null||typeof l!="object"?null:(l=B&&l[B]||l["@@iterator"],typeof l=="function"?l:null)}var Z=Object.assign,z;function L(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 ee=!1;function se(l,u){if(!l||ee)return"";ee=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(u)if(u=function(){throw Error()},Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(ge){var w=ge}Reflect.construct(l,[],u)}else{try{u.call()}catch(ge){w=ge}l.call(u.prototype)}else{try{throw Error()}catch(ge){w=ge}l()}}catch(ge){if(ge&&w&&typeof ge.stack=="string"){for(var A=ge.stack.split(`
3
- `),k=w.stack.split(`
4
- `),M=A.length-1,X=k.length-1;1<=M&&0<=X&&A[M]!==k[X];)X--;for(;1<=M&&0<=X;M--,X--)if(A[M]!==k[X]){if(M!==1||X!==1)do if(M--,X--,0>X||A[M]!==k[X]){var te=`
5
- `+A[M].replace(" at new "," at ");return l.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",l.displayName)),te}while(1<=M&&0<=X);break}}}finally{ee=!1,Error.prepareStackTrace=m}return(l=l?l.displayName||l.name:"")?L(l):""}function G(l){switch(l.tag){case 5:return L(l.type);case 16:return L("Lazy");case 13:return L("Suspense");case 19:return L("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 ue(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 R:return"Profiler";case T:return"StrictMode";case H:return"Suspense";case F:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case D:return(l.displayName||"Context")+".Consumer";case I:return(l._context.displayName||"Context")+".Provider";case $:var u=l.render;return l=l.displayName,l||(l=u.displayName||u.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case q:return u=l.displayName||null,u!==null?u:ue(l.type)||"Memo";case Q:u=l._payload,l=l._init;try{return ue(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 ue(u);case 8:return u===T?"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 oe(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function ie(l){var u=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function fe(l){var u=ie(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(M){w=""+M,k.call(this,M)}}),Object.defineProperty(l,u,{enumerable:m.enumerable}),{getValue:function(){return w},setValue:function(M){w=""+M},stopTracking:function(){l._valueTracker=null,delete l[u]}}}}function Ae(l){l._valueTracker||(l._valueTracker=fe(l))}function re(l){if(!l)return!1;var u=l._valueTracker;if(!u)return!0;var m=u.getValue(),w="";return l&&(w=ie(l)?l.checked?"true":"false":l.value),l=w,l!==m?(u.setValue(l),!0):!1}function Te(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 _e(l,u){var m=u.checked;return Z({},u,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:m??l._wrapperState.initialChecked})}function Ge(l,u){var m=u.defaultValue==null?"":u.defaultValue,w=u.checked!=null?u.checked:u.defaultChecked;m=oe(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 je(l,u){u=u.checked,u!=null&&N(l,"checked",u,!1)}function Me(l,u){je(l,u);var m=oe(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")?ye(l,u.type,m):u.hasOwnProperty("defaultValue")&&ye(l,u.type,oe(u.defaultValue)),u.checked==null&&u.defaultChecked!=null&&(l.defaultChecked=!!u.defaultChecked)}function Y(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 ye(l,u,m){(u!=="number"||Te(l.ownerDocument)!==l)&&(m==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+m&&(l.defaultValue=""+m))}var de=Array.isArray;function Pe(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=""+oe(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 wt(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(de(m)){if(1<m.length)throw Error(n(93));m=m[0]}u=m}u==null&&(u=""),m=u}l._wrapperState={initialValue:oe(m)}}function It(l,u){var m=oe(u.value),w=oe(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 ve(l){var u=l.textContent;u===l._wrapperState.initialValue&&u!==""&&u!==null&&(l.value=u)}function ce(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 Ce(l,u){return l==null||l==="http://www.w3.org/1999/xhtml"?ce(u):l==="http://www.w3.org/2000/svg"&&u==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var we,Fe=(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(we=we||document.createElement("div"),we.innerHTML="<svg>"+u.valueOf().toString()+"</svg>",u=we.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;u.firstChild;)l.appendChild(u.firstChild)}});function et(l,u){if(u){var m=l.firstChild;if(m&&m===l.lastChild&&m.nodeType===3){m.nodeValue=u;return}}l.textContent=u}var Pt={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},Gn=["Webkit","ms","Moz","O"];Object.keys(Pt).forEach(function(l){Gn.forEach(function(u){u=u+l.charAt(0).toUpperCase()+l.substring(1),Pt[u]=Pt[l]})});function xn(l,u,m){return u==null||typeof u=="boolean"||u===""?"":m||typeof u!="number"||u===0||Pt.hasOwnProperty(l)&&Pt[l]?(""+u).trim():u+"px"}function cr(l,u){l=l.style;for(var m in u)if(u.hasOwnProperty(m)){var w=m.indexOf("--")===0,A=xn(m,u[m],w);m==="float"&&(m="cssFloat"),w?l.setProperty(m,A):l[m]=A}}var ur=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 $n(l,u){if(u){if(ur[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 dr(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 _r=null;function Ur(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var qr=null,Yn=null,Xt=null;function _n(l){if(l=Ou(l)){if(typeof qr!="function")throw Error(n(280));var u=l.stateNode;u&&(u=sp(u),qr(l.stateNode,l.type,u))}}function pe(l){Yn?Xt?Xt.push(l):Xt=[l]:Yn=l}function De(){if(Yn){var l=Yn,u=Xt;if(Xt=Yn=null,_n(l),u)for(l=0;l<u.length;l++)_n(u[l])}}function st(l,u){return l(u)}function yt(){}var Lt=!1;function nn(l,u,m){if(Lt)return l(u,m);Lt=!0;try{return st(l,u,m)}finally{Lt=!1,(Yn!==null||Xt!==null)&&(yt(),De())}}function ln(l,u){var m=l.stateNode;if(m===null)return null;var w=sp(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 Xn=!1;if(c)try{var Nn={};Object.defineProperty(Nn,"passive",{get:function(){Xn=!0}}),window.addEventListener("test",Nn,Nn),window.removeEventListener("test",Nn,Nn)}catch{Xn=!1}function rr(l,u,m,w,A,k,M,X,te){var ge=Array.prototype.slice.call(arguments,3);try{u.apply(m,ge)}catch(ke){this.onError(ke)}}var fr=!1,Wr=null,ci=!1,ui=null,ul={onError:function(l){fr=!0,Wr=l}};function K(l,u,m,w,A,k,M,X,te){fr=!1,Wr=null,rr.apply(ul,arguments)}function xe(l,u,m,w,A,k,M,X,te){if(K.apply(this,arguments),fr){if(fr){var ge=Wr;fr=!1,Wr=null}else throw Error(n(198));ci||(ci=!0,ui=ge)}}function Ve(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 ct(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 Ot(l){if(Ve(l)!==l)throw Error(n(188))}function Mt(l){var u=l.alternate;if(!u){if(u=Ve(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 Ot(A),l;if(k===w)return Ot(A),u;k=k.sibling}throw Error(n(188))}if(m.return!==w.return)m=A,w=k;else{for(var M=!1,X=A.child;X;){if(X===m){M=!0,m=A,w=k;break}if(X===w){M=!0,w=A,m=k;break}X=X.sibling}if(!M){for(X=k.child;X;){if(X===m){M=!0,m=k,w=A;break}if(X===w){M=!0,w=k,m=A;break}X=X.sibling}if(!M)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 Tt(l){return l=Mt(l),l!==null?En(l):null}function En(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var u=En(l);if(u!==null)return u;l=l.sibling}return null}var He=t.unstable_scheduleCallback,Vt=t.unstable_cancelCallback,Ft=t.unstable_shouldYield,Pn=t.unstable_requestPaint,cn=t.unstable_now,Ng=t.unstable_getCurrentPriorityLevel,dl=t.unstable_ImmediatePriority,Bf=t.unstable_UserBlockingPriority,di=t.unstable_NormalPriority,zf=t.unstable_LowPriority,hu=t.unstable_IdlePriority,ks=null,la=null;function Cg(l){if(la&&typeof la.onCommitFiberRoot=="function")try{la.onCommitFiberRoot(ks,l,void 0,(l.current.flags&128)===128)}catch{}}var Vr=Math.clz32?Math.clz32:_g,Uf=Math.log,Ag=Math.LN2;function _g(l){return l>>>=0,l===0?32:31-(Uf(l)/Ag|0)|0}var fl=64,pl=4194304;function V(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 be(l,u){var m=l.pendingLanes;if(m===0)return 0;var w=0,A=l.suspendedLanes,k=l.pingedLanes,M=m&268435455;if(M!==0){var X=M&~A;X!==0?w=V(X):(k&=M,k!==0&&(w=V(k)))}else M=m&~A,M!==0?w=V(M):k!==0&&(w=V(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-Vr(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 M=31-Vr(k),X=1<<M,te=A[M];te===-1?((X&m)===0||(X&w)!==0)&&(A[M]=rt(X,u)):te<=u&&(l.expiredLanes|=X),k&=~X}}function kt(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function dt(){var l=fl;return fl<<=1,(fl&4194240)===0&&(fl=64),l}function Ht(l){for(var u=[],m=0;31>m;m++)u.push(l);return u}function Dn(l,u,m){l.pendingLanes|=u,u!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,u=31-Vr(u),l[u]=m}function Qt(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-Vr(m),k=1<<A;u[A]=0,w[A]=-1,l[A]=-1,m&=~k}}function ca(l,u){var m=l.entangledLanes|=u;for(l=l.entanglements;m;){var w=31-Vr(m),A=1<<w;A&u|l[w]&u&&(l[w]|=u),m&=~A}}var zt=0;function qf(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var hl,Eg,VC,HC,KC,Pg=!1,Wf=[],fi=null,pi=null,hi=null,mu=new Map,vu=new Map,mi=[],X8="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 GC(l,u){switch(l){case"focusin":case"focusout":fi=null;break;case"dragenter":case"dragleave":pi=null;break;case"mouseover":case"mouseout":hi=null;break;case"pointerover":case"pointerout":mu.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":vu.delete(u.pointerId)}}function gu(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=Ou(u),u!==null&&Eg(u)),l):(l.eventSystemFlags|=w,u=l.targetContainers,A!==null&&u.indexOf(A)===-1&&u.push(A),l)}function Q8(l,u,m,w,A){switch(u){case"focusin":return fi=gu(fi,l,u,m,w,A),!0;case"dragenter":return pi=gu(pi,l,u,m,w,A),!0;case"mouseover":return hi=gu(hi,l,u,m,w,A),!0;case"pointerover":var k=A.pointerId;return mu.set(k,gu(mu.get(k)||null,l,u,m,w,A)),!0;case"gotpointercapture":return k=A.pointerId,vu.set(k,gu(vu.get(k)||null,l,u,m,w,A)),!0}return!1}function YC(l){var u=ao(l.target);if(u!==null){var m=Ve(u);if(m!==null){if(u=m.tag,u===13){if(u=ct(m),u!==null){l.blockedOn=u,KC(l.priority,function(){VC(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 Vf(l){if(l.blockedOn!==null)return!1;for(var u=l.targetContainers;0<u.length;){var m=Og(l.domEventName,l.eventSystemFlags,u[0],l.nativeEvent);if(m===null){m=l.nativeEvent;var w=new m.constructor(m.type,m);_r=w,m.target.dispatchEvent(w),_r=null}else return u=Ou(m),u!==null&&Eg(u),l.blockedOn=m,!1;u.shift()}return!0}function XC(l,u,m){Vf(l)&&m.delete(u)}function J8(){Pg=!1,fi!==null&&Vf(fi)&&(fi=null),pi!==null&&Vf(pi)&&(pi=null),hi!==null&&Vf(hi)&&(hi=null),mu.forEach(XC),vu.forEach(XC)}function xu(l,u){l.blockedOn===u&&(l.blockedOn=null,Pg||(Pg=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,J8)))}function yu(l){function u(A){return xu(A,l)}if(0<Wf.length){xu(Wf[0],l);for(var m=1;m<Wf.length;m++){var w=Wf[m];w.blockedOn===l&&(w.blockedOn=null)}}for(fi!==null&&xu(fi,l),pi!==null&&xu(pi,l),hi!==null&&xu(hi,l),mu.forEach(u),vu.forEach(u),m=0;m<mi.length;m++)w=mi[m],w.blockedOn===l&&(w.blockedOn=null);for(;0<mi.length&&(m=mi[0],m.blockedOn===null);)YC(m),m.blockedOn===null&&mi.shift()}var ml=E.ReactCurrentBatchConfig,Hf=!0;function Z8(l,u,m,w){var A=zt,k=ml.transition;ml.transition=null;try{zt=1,kg(l,u,m,w)}finally{zt=A,ml.transition=k}}function e6(l,u,m,w){var A=zt,k=ml.transition;ml.transition=null;try{zt=4,kg(l,u,m,w)}finally{zt=A,ml.transition=k}}function kg(l,u,m,w){if(Hf){var A=Og(l,u,m,w);if(A===null)Gg(l,u,w,Kf,m),GC(l,w);else if(Q8(A,l,u,m,w))w.stopPropagation();else if(GC(l,w),u&4&&-1<X8.indexOf(l)){for(;A!==null;){var k=Ou(A);if(k!==null&&hl(k),k=Og(l,u,m,w),k===null&&Gg(l,u,w,Kf,m),k===A)break;A=k}A!==null&&w.stopPropagation()}else Gg(l,u,w,null,m)}}var Kf=null;function Og(l,u,m,w){if(Kf=null,l=Ur(w),l=ao(l),l!==null)if(u=Ve(l),u===null)l=null;else if(m=u.tag,m===13){if(l=ct(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 Kf=l,null}function QC(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(Ng()){case dl:return 1;case Bf:return 4;case di:case zf:return 16;case hu:return 536870912;default:return 16}default:return 16}}var vi=null,Tg=null,Gf=null;function JC(){if(Gf)return Gf;var l,u=Tg,m=u.length,w,A="value"in vi?vi.value:vi.textContent,k=A.length;for(l=0;l<m&&u[l]===A[l];l++);var M=m-l;for(w=1;w<=M&&u[m-w]===A[k-w];w++);return Gf=A.slice(l,1<w?1-w:void 0)}function Yf(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 Xf(){return!0}function ZC(){return!1}function Hr(l){function u(m,w,A,k,M){this._reactName=m,this._targetInst=A,this.type=w,this.nativeEvent=k,this.target=M,this.currentTarget=null;for(var X in l)l.hasOwnProperty(X)&&(m=l[X],this[X]=m?m(k):k[X]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?Xf:ZC,this.isPropagationStopped=ZC,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=Xf)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=Xf)},persist:function(){},isPersistent:Xf}),u}var vl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Rg=Hr(vl),bu=Z({},vl,{view:0,detail:0}),t6=Hr(bu),Ig,Mg,wu,Qf=Z({},bu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dg,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!==wu&&(wu&&l.type==="mousemove"?(Ig=l.screenX-wu.screenX,Mg=l.screenY-wu.screenY):Mg=Ig=0,wu=l),Ig)},movementY:function(l){return"movementY"in l?l.movementY:Mg}}),eA=Hr(Qf),n6=Z({},Qf,{dataTransfer:0}),r6=Hr(n6),a6=Z({},bu,{relatedTarget:0}),$g=Hr(a6),s6=Z({},vl,{animationName:0,elapsedTime:0,pseudoElement:0}),i6=Hr(s6),o6=Z({},vl,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),l6=Hr(o6),c6=Z({},vl,{data:0}),tA=Hr(c6),u6={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},d6={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"},f6={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function p6(l){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(l):(l=f6[l])?!!u[l]:!1}function Dg(){return p6}var h6=Z({},bu,{key:function(l){if(l.key){var u=u6[l.key]||l.key;if(u!=="Unidentified")return u}return l.type==="keypress"?(l=Yf(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?d6[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dg,charCode:function(l){return l.type==="keypress"?Yf(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?Yf(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),m6=Hr(h6),v6=Z({},Qf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nA=Hr(v6),g6=Z({},bu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dg}),x6=Hr(g6),y6=Z({},vl,{propertyName:0,elapsedTime:0,pseudoElement:0}),b6=Hr(y6),w6=Z({},Qf,{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}),j6=Hr(w6),S6=[9,13,27,32],Lg=c&&"CompositionEvent"in window,ju=null;c&&"documentMode"in document&&(ju=document.documentMode);var N6=c&&"TextEvent"in window&&!ju,rA=c&&(!Lg||ju&&8<ju&&11>=ju),aA=" ",sA=!1;function iA(l,u){switch(l){case"keyup":return S6.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function oA(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var gl=!1;function C6(l,u){switch(l){case"compositionend":return oA(u);case"keypress":return u.which!==32?null:(sA=!0,aA);case"textInput":return l=u.data,l===aA&&sA?null:l;default:return null}}function A6(l,u){if(gl)return l==="compositionend"||!Lg&&iA(l,u)?(l=JC(),Gf=Tg=vi=null,gl=!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 rA&&u.locale!=="ko"?null:u.data;default:return null}}var _6={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 lA(l){var u=l&&l.nodeName&&l.nodeName.toLowerCase();return u==="input"?!!_6[l.type]:u==="textarea"}function cA(l,u,m,w){pe(w),u=np(u,"onChange"),0<u.length&&(m=new Rg("onChange","change",null,m,w),l.push({event:m,listeners:u}))}var Su=null,Nu=null;function E6(l){_A(l,0)}function Jf(l){var u=jl(l);if(re(u))return l}function P6(l,u){if(l==="change")return u}var uA=!1;if(c){var Fg;if(c){var Bg="oninput"in document;if(!Bg){var dA=document.createElement("div");dA.setAttribute("oninput","return;"),Bg=typeof dA.oninput=="function"}Fg=Bg}else Fg=!1;uA=Fg&&(!document.documentMode||9<document.documentMode)}function fA(){Su&&(Su.detachEvent("onpropertychange",pA),Nu=Su=null)}function pA(l){if(l.propertyName==="value"&&Jf(Nu)){var u=[];cA(u,Nu,l,Ur(l)),nn(E6,u)}}function k6(l,u,m){l==="focusin"?(fA(),Su=u,Nu=m,Su.attachEvent("onpropertychange",pA)):l==="focusout"&&fA()}function O6(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return Jf(Nu)}function T6(l,u){if(l==="click")return Jf(u)}function R6(l,u){if(l==="input"||l==="change")return Jf(u)}function I6(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var ka=typeof Object.is=="function"?Object.is:I6;function Cu(l,u){if(ka(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)||!ka(l[A],u[A]))return!1}return!0}function hA(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function mA(l,u){var m=hA(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=hA(m)}}function vA(l,u){return l&&u?l===u?!0:l&&l.nodeType===3?!1:u&&u.nodeType===3?vA(l,u.parentNode):"contains"in l?l.contains(u):l.compareDocumentPosition?!!(l.compareDocumentPosition(u)&16):!1:!1}function gA(){for(var l=window,u=Te();u instanceof l.HTMLIFrameElement;){try{var m=typeof u.contentWindow.location.href=="string"}catch{m=!1}if(m)l=u.contentWindow;else break;u=Te(l.document)}return u}function zg(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 M6(l){var u=gA(),m=l.focusedElem,w=l.selectionRange;if(u!==m&&m&&m.ownerDocument&&vA(m.ownerDocument.documentElement,m)){if(w!==null&&zg(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=mA(m,k);var M=mA(m,w);A&&M&&(l.rangeCount!==1||l.anchorNode!==A.node||l.anchorOffset!==A.offset||l.focusNode!==M.node||l.focusOffset!==M.offset)&&(u=u.createRange(),u.setStart(A.node,A.offset),l.removeAllRanges(),k>w?(l.addRange(u),l.extend(M.node,M.offset)):(u.setEnd(M.node,M.offset),l.addRange(u)))}}for(u=[],l=m;l=l.parentNode;)l.nodeType===1&&u.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<u.length;m++)l=u[m],l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}var $6=c&&"documentMode"in document&&11>=document.documentMode,xl=null,Ug=null,Au=null,qg=!1;function xA(l,u,m){var w=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;qg||xl==null||xl!==Te(w)||(w=xl,"selectionStart"in w&&zg(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}),Au&&Cu(Au,w)||(Au=w,w=np(Ug,"onSelect"),0<w.length&&(u=new Rg("onSelect","select",null,u,m),l.push({event:u,listeners:w}),u.target=xl)))}function Zf(l,u){var m={};return m[l.toLowerCase()]=u.toLowerCase(),m["Webkit"+l]="webkit"+u,m["Moz"+l]="moz"+u,m}var yl={animationend:Zf("Animation","AnimationEnd"),animationiteration:Zf("Animation","AnimationIteration"),animationstart:Zf("Animation","AnimationStart"),transitionend:Zf("Transition","TransitionEnd")},Wg={},yA={};c&&(yA=document.createElement("div").style,"AnimationEvent"in window||(delete yl.animationend.animation,delete yl.animationiteration.animation,delete yl.animationstart.animation),"TransitionEvent"in window||delete yl.transitionend.transition);function ep(l){if(Wg[l])return Wg[l];if(!yl[l])return l;var u=yl[l],m;for(m in u)if(u.hasOwnProperty(m)&&m in yA)return Wg[l]=u[m];return l}var bA=ep("animationend"),wA=ep("animationiteration"),jA=ep("animationstart"),SA=ep("transitionend"),NA=new Map,CA="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 gi(l,u){NA.set(l,u),i(u,[l])}for(var Vg=0;Vg<CA.length;Vg++){var Hg=CA[Vg],D6=Hg.toLowerCase(),L6=Hg[0].toUpperCase()+Hg.slice(1);gi(D6,"on"+L6)}gi(bA,"onAnimationEnd"),gi(wA,"onAnimationIteration"),gi(jA,"onAnimationStart"),gi("dblclick","onDoubleClick"),gi("focusin","onFocus"),gi("focusout","onBlur"),gi(SA,"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 _u="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(" "),F6=new Set("cancel close invalid load scroll toggle".split(" ").concat(_u));function AA(l,u,m){var w=l.type||"unknown-event";l.currentTarget=m,xe(w,u,void 0,l),l.currentTarget=null}function _A(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 M=w.length-1;0<=M;M--){var X=w[M],te=X.instance,ge=X.currentTarget;if(X=X.listener,te!==k&&A.isPropagationStopped())break e;AA(A,X,ge),k=te}else for(M=0;M<w.length;M++){if(X=w[M],te=X.instance,ge=X.currentTarget,X=X.listener,te!==k&&A.isPropagationStopped())break e;AA(A,X,ge),k=te}}}if(ci)throw l=ui,ci=!1,ui=null,l}function un(l,u){var m=u[ex];m===void 0&&(m=u[ex]=new Set);var w=l+"__bubble";m.has(w)||(EA(u,l,2,!1),m.add(w))}function Kg(l,u,m){var w=0;u&&(w|=4),EA(m,l,w,u)}var tp="_reactListening"+Math.random().toString(36).slice(2);function Eu(l){if(!l[tp]){l[tp]=!0,r.forEach(function(m){m!=="selectionchange"&&(F6.has(m)||Kg(m,!1,l),Kg(m,!0,l))});var u=l.nodeType===9?l:l.ownerDocument;u===null||u[tp]||(u[tp]=!0,Kg("selectionchange",!1,u))}}function EA(l,u,m,w){switch(QC(u)){case 1:var A=Z8;break;case 4:A=e6;break;default:A=kg}m=A.bind(null,u,m,l),A=void 0,!Xn||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 Gg(l,u,m,w,A){var k=w;if((u&1)===0&&(u&2)===0&&w!==null)e:for(;;){if(w===null)return;var M=w.tag;if(M===3||M===4){var X=w.stateNode.containerInfo;if(X===A||X.nodeType===8&&X.parentNode===A)break;if(M===4)for(M=w.return;M!==null;){var te=M.tag;if((te===3||te===4)&&(te=M.stateNode.containerInfo,te===A||te.nodeType===8&&te.parentNode===A))return;M=M.return}for(;X!==null;){if(M=ao(X),M===null)return;if(te=M.tag,te===5||te===6){w=k=M;continue e}X=X.parentNode}}w=w.return}nn(function(){var ge=k,ke=Ur(m),Ie=[];e:{var Ee=NA.get(l);if(Ee!==void 0){var Xe=Rg,nt=l;switch(l){case"keypress":if(Yf(m)===0)break e;case"keydown":case"keyup":Xe=m6;break;case"focusin":nt="focus",Xe=$g;break;case"focusout":nt="blur",Xe=$g;break;case"beforeblur":case"afterblur":Xe=$g;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=eA;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Xe=r6;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Xe=x6;break;case bA:case wA:case jA:Xe=i6;break;case SA:Xe=b6;break;case"scroll":Xe=t6;break;case"wheel":Xe=j6;break;case"copy":case"cut":case"paste":Xe=l6;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Xe=nA}var at=(u&4)!==0,kn=!at&&l==="scroll",he=at?Ee!==null?Ee+"Capture":null:Ee;at=[];for(var ae=ge,me;ae!==null;){me=ae;var Le=me.stateNode;if(me.tag===5&&Le!==null&&(me=Le,he!==null&&(Le=ln(ae,he),Le!=null&&at.push(Pu(ae,Le,me)))),kn)break;ae=ae.return}0<at.length&&(Ee=new Xe(Ee,nt,null,m,ke),Ie.push({event:Ee,listeners:at}))}}if((u&7)===0){e:{if(Ee=l==="mouseover"||l==="pointerover",Xe=l==="mouseout"||l==="pointerout",Ee&&m!==_r&&(nt=m.relatedTarget||m.fromElement)&&(ao(nt)||nt[Os]))break e;if((Xe||Ee)&&(Ee=ke.window===ke?ke:(Ee=ke.ownerDocument)?Ee.defaultView||Ee.parentWindow:window,Xe?(nt=m.relatedTarget||m.toElement,Xe=ge,nt=nt?ao(nt):null,nt!==null&&(kn=Ve(nt),nt!==kn||nt.tag!==5&&nt.tag!==6)&&(nt=null)):(Xe=null,nt=ge),Xe!==nt)){if(at=eA,Le="onMouseLeave",he="onMouseEnter",ae="mouse",(l==="pointerout"||l==="pointerover")&&(at=nA,Le="onPointerLeave",he="onPointerEnter",ae="pointer"),kn=Xe==null?Ee:jl(Xe),me=nt==null?Ee:jl(nt),Ee=new at(Le,ae+"leave",Xe,m,ke),Ee.target=kn,Ee.relatedTarget=me,Le=null,ao(ke)===ge&&(at=new at(he,ae+"enter",nt,m,ke),at.target=me,at.relatedTarget=kn,Le=at),kn=Le,Xe&&nt)t:{for(at=Xe,he=nt,ae=0,me=at;me;me=bl(me))ae++;for(me=0,Le=he;Le;Le=bl(Le))me++;for(;0<ae-me;)at=bl(at),ae--;for(;0<me-ae;)he=bl(he),me--;for(;ae--;){if(at===he||he!==null&&at===he.alternate)break t;at=bl(at),he=bl(he)}at=null}else at=null;Xe!==null&&PA(Ie,Ee,Xe,at,!1),nt!==null&&kn!==null&&PA(Ie,kn,nt,at,!0)}}e:{if(Ee=ge?jl(ge):window,Xe=Ee.nodeName&&Ee.nodeName.toLowerCase(),Xe==="select"||Xe==="input"&&Ee.type==="file")var ot=P6;else if(lA(Ee))if(uA)ot=R6;else{ot=O6;var pt=k6}else(Xe=Ee.nodeName)&&Xe.toLowerCase()==="input"&&(Ee.type==="checkbox"||Ee.type==="radio")&&(ot=T6);if(ot&&(ot=ot(l,ge))){cA(Ie,ot,m,ke);break e}pt&&pt(l,Ee,ge),l==="focusout"&&(pt=Ee._wrapperState)&&pt.controlled&&Ee.type==="number"&&ye(Ee,"number",Ee.value)}switch(pt=ge?jl(ge):window,l){case"focusin":(lA(pt)||pt.contentEditable==="true")&&(xl=pt,Ug=ge,Au=null);break;case"focusout":Au=Ug=xl=null;break;case"mousedown":qg=!0;break;case"contextmenu":case"mouseup":case"dragend":qg=!1,xA(Ie,m,ke);break;case"selectionchange":if($6)break;case"keydown":case"keyup":xA(Ie,m,ke)}var ht;if(Lg)e:{switch(l){case"compositionstart":var jt="onCompositionStart";break e;case"compositionend":jt="onCompositionEnd";break e;case"compositionupdate":jt="onCompositionUpdate";break e}jt=void 0}else gl?iA(l,m)&&(jt="onCompositionEnd"):l==="keydown"&&m.keyCode===229&&(jt="onCompositionStart");jt&&(rA&&m.locale!=="ko"&&(gl||jt!=="onCompositionStart"?jt==="onCompositionEnd"&&gl&&(ht=JC()):(vi=ke,Tg="value"in vi?vi.value:vi.textContent,gl=!0)),pt=np(ge,jt),0<pt.length&&(jt=new tA(jt,l,null,m,ke),Ie.push({event:jt,listeners:pt}),ht?jt.data=ht:(ht=oA(m),ht!==null&&(jt.data=ht)))),(ht=N6?C6(l,m):A6(l,m))&&(ge=np(ge,"onBeforeInput"),0<ge.length&&(ke=new tA("onBeforeInput","beforeinput",null,m,ke),Ie.push({event:ke,listeners:ge}),ke.data=ht))}_A(Ie,u)})}function Pu(l,u,m){return{instance:l,listener:u,currentTarget:m}}function np(l,u){for(var m=u+"Capture",w=[];l!==null;){var A=l,k=A.stateNode;A.tag===5&&k!==null&&(A=k,k=ln(l,m),k!=null&&w.unshift(Pu(l,k,A)),k=ln(l,u),k!=null&&w.push(Pu(l,k,A))),l=l.return}return w}function bl(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function PA(l,u,m,w,A){for(var k=u._reactName,M=[];m!==null&&m!==w;){var X=m,te=X.alternate,ge=X.stateNode;if(te!==null&&te===w)break;X.tag===5&&ge!==null&&(X=ge,A?(te=ln(m,k),te!=null&&M.unshift(Pu(m,te,X))):A||(te=ln(m,k),te!=null&&M.push(Pu(m,te,X)))),m=m.return}M.length!==0&&l.push({event:u,listeners:M})}var B6=/\r\n?/g,z6=/\u0000|\uFFFD/g;function kA(l){return(typeof l=="string"?l:""+l).replace(B6,`
6
- `).replace(z6,"")}function rp(l,u,m){if(u=kA(u),kA(l)!==u&&m)throw Error(n(425))}function ap(){}var Yg=null,Xg=null;function Qg(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 Jg=typeof setTimeout=="function"?setTimeout:void 0,U6=typeof clearTimeout=="function"?clearTimeout:void 0,OA=typeof Promise=="function"?Promise:void 0,q6=typeof queueMicrotask=="function"?queueMicrotask:typeof OA<"u"?function(l){return OA.resolve(null).then(l).catch(W6)}:Jg;function W6(l){setTimeout(function(){throw l})}function Zg(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),yu(u);return}w--}else m!=="$"&&m!=="$?"&&m!=="$!"||w++;m=A}while(m);yu(u)}function xi(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 TA(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 wl=Math.random().toString(36).slice(2),rs="__reactFiber$"+wl,ku="__reactProps$"+wl,Os="__reactContainer$"+wl,ex="__reactEvents$"+wl,V6="__reactListeners$"+wl,H6="__reactHandles$"+wl;function ao(l){var u=l[rs];if(u)return u;for(var m=l.parentNode;m;){if(u=m[Os]||m[rs]){if(m=u.alternate,u.child!==null||m!==null&&m.child!==null)for(l=TA(l);l!==null;){if(m=l[rs])return m;l=TA(l)}return u}l=m,m=l.parentNode}return null}function Ou(l){return l=l[rs]||l[Os],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function jl(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(n(33))}function sp(l){return l[ku]||null}var tx=[],Sl=-1;function yi(l){return{current:l}}function dn(l){0>Sl||(l.current=tx[Sl],tx[Sl]=null,Sl--)}function rn(l,u){Sl++,tx[Sl]=l.current,l.current=u}var bi={},pr=yi(bi),Er=yi(!1),so=bi;function Nl(l,u){var m=l.type.contextTypes;if(!m)return bi;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 Pr(l){return l=l.childContextTypes,l!=null}function ip(){dn(Er),dn(pr)}function RA(l,u,m){if(pr.current!==bi)throw Error(n(168));rn(pr,u),rn(Er,m)}function IA(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 op(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||bi,so=pr.current,rn(pr,l),rn(Er,Er.current),!0}function MA(l,u,m){var w=l.stateNode;if(!w)throw Error(n(169));m?(l=IA(l,u,so),w.__reactInternalMemoizedMergedChildContext=l,dn(Er),dn(pr),rn(pr,l)):dn(Er),rn(Er,m)}var Ts=null,lp=!1,nx=!1;function $A(l){Ts===null?Ts=[l]:Ts.push(l)}function K6(l){lp=!0,$A(l)}function wi(){if(!nx&&Ts!==null){nx=!0;var l=0,u=zt;try{var m=Ts;for(zt=1;l<m.length;l++){var w=m[l];do w=w(!0);while(w!==null)}Ts=null,lp=!1}catch(A){throw Ts!==null&&(Ts=Ts.slice(l+1)),He(dl,wi),A}finally{zt=u,nx=!1}}return null}var Cl=[],Al=0,cp=null,up=0,ua=[],da=0,io=null,Rs=1,Is="";function oo(l,u){Cl[Al++]=up,Cl[Al++]=cp,cp=l,up=u}function DA(l,u,m){ua[da++]=Rs,ua[da++]=Is,ua[da++]=io,io=l;var w=Rs;l=Is;var A=32-Vr(w)-1;w&=~(1<<A),m+=1;var k=32-Vr(u)+A;if(30<k){var M=A-A%5;k=(w&(1<<M)-1).toString(32),w>>=M,A-=M,Rs=1<<32-Vr(u)+A|m<<A|w,Is=k+l}else Rs=1<<k|m<<A|w,Is=l}function rx(l){l.return!==null&&(oo(l,1),DA(l,1,0))}function ax(l){for(;l===cp;)cp=Cl[--Al],Cl[Al]=null,up=Cl[--Al],Cl[Al]=null;for(;l===io;)io=ua[--da],ua[da]=null,Is=ua[--da],ua[da]=null,Rs=ua[--da],ua[da]=null}var Kr=null,Gr=null,hn=!1,Oa=null;function LA(l,u){var m=ma(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 FA(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,Kr=l,Gr=xi(u.firstChild),!0):!1;case 6:return u=l.pendingProps===""||u.nodeType!==3?null:u,u!==null?(l.stateNode=u,Kr=l,Gr=null,!0):!1;case 13:return u=u.nodeType!==8?null:u,u!==null?(m=io!==null?{id:Rs,overflow:Is}:null,l.memoizedState={dehydrated:u,treeContext:m,retryLane:1073741824},m=ma(18,null,null,0),m.stateNode=u,m.return=l,l.child=m,Kr=l,Gr=null,!0):!1;default:return!1}}function sx(l){return(l.mode&1)!==0&&(l.flags&128)===0}function ix(l){if(hn){var u=Gr;if(u){var m=u;if(!FA(l,u)){if(sx(l))throw Error(n(418));u=xi(m.nextSibling);var w=Kr;u&&FA(l,u)?LA(w,m):(l.flags=l.flags&-4097|2,hn=!1,Kr=l)}}else{if(sx(l))throw Error(n(418));l.flags=l.flags&-4097|2,hn=!1,Kr=l}}}function BA(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;Kr=l}function dp(l){if(l!==Kr)return!1;if(!hn)return BA(l),hn=!0,!1;var u;if((u=l.tag!==3)&&!(u=l.tag!==5)&&(u=l.type,u=u!=="head"&&u!=="body"&&!Qg(l.type,l.memoizedProps)),u&&(u=Gr)){if(sx(l))throw zA(),Error(n(418));for(;u;)LA(l,u),u=xi(u.nextSibling)}if(BA(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){Gr=xi(l.nextSibling);break e}u--}else m!=="$"&&m!=="$!"&&m!=="$?"||u++}l=l.nextSibling}Gr=null}}else Gr=Kr?xi(l.stateNode.nextSibling):null;return!0}function zA(){for(var l=Gr;l;)l=xi(l.nextSibling)}function _l(){Gr=Kr=null,hn=!1}function ox(l){Oa===null?Oa=[l]:Oa.push(l)}var G6=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(M){var X=A.refs;M===null?delete X[k]:X[k]=M},u._stringRef=k,u)}if(typeof l!="string")throw Error(n(284));if(!m._owner)throw Error(n(290,l))}return l}function fp(l,u){throw l=Object.prototype.toString.call(u),Error(n(31,l==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":l))}function UA(l){var u=l._init;return u(l._payload)}function qA(l){function u(he,ae){if(l){var me=he.deletions;me===null?(he.deletions=[ae],he.flags|=16):me.push(ae)}}function m(he,ae){if(!l)return null;for(;ae!==null;)u(he,ae),ae=ae.sibling;return null}function w(he,ae){for(he=new Map;ae!==null;)ae.key!==null?he.set(ae.key,ae):he.set(ae.index,ae),ae=ae.sibling;return he}function A(he,ae){return he=Pi(he,ae),he.index=0,he.sibling=null,he}function k(he,ae,me){return he.index=me,l?(me=he.alternate,me!==null?(me=me.index,me<ae?(he.flags|=2,ae):me):(he.flags|=2,ae)):(he.flags|=1048576,ae)}function M(he){return l&&he.alternate===null&&(he.flags|=2),he}function X(he,ae,me,Le){return ae===null||ae.tag!==6?(ae=Jx(me,he.mode,Le),ae.return=he,ae):(ae=A(ae,me),ae.return=he,ae)}function te(he,ae,me,Le){var ot=me.type;return ot===O?ke(he,ae,me.props.children,Le,me.key):ae!==null&&(ae.elementType===ot||typeof ot=="object"&&ot!==null&&ot.$$typeof===Q&&UA(ot)===ae.type)?(Le=A(ae,me.props),Le.ref=Tu(he,ae,me),Le.return=he,Le):(Le=$p(me.type,me.key,me.props,null,he.mode,Le),Le.ref=Tu(he,ae,me),Le.return=he,Le)}function ge(he,ae,me,Le){return ae===null||ae.tag!==4||ae.stateNode.containerInfo!==me.containerInfo||ae.stateNode.implementation!==me.implementation?(ae=Zx(me,he.mode,Le),ae.return=he,ae):(ae=A(ae,me.children||[]),ae.return=he,ae)}function ke(he,ae,me,Le,ot){return ae===null||ae.tag!==7?(ae=vo(me,he.mode,Le,ot),ae.return=he,ae):(ae=A(ae,me),ae.return=he,ae)}function Ie(he,ae,me){if(typeof ae=="string"&&ae!==""||typeof ae=="number")return ae=Jx(""+ae,he.mode,me),ae.return=he,ae;if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case _:return me=$p(ae.type,ae.key,ae.props,null,he.mode,me),me.ref=Tu(he,null,ae),me.return=he,me;case P:return ae=Zx(ae,he.mode,me),ae.return=he,ae;case Q:var Le=ae._init;return Ie(he,Le(ae._payload),me)}if(de(ae)||U(ae))return ae=vo(ae,he.mode,me,null),ae.return=he,ae;fp(he,ae)}return null}function Ee(he,ae,me,Le){var ot=ae!==null?ae.key:null;if(typeof me=="string"&&me!==""||typeof me=="number")return ot!==null?null:X(he,ae,""+me,Le);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case _:return me.key===ot?te(he,ae,me,Le):null;case P:return me.key===ot?ge(he,ae,me,Le):null;case Q:return ot=me._init,Ee(he,ae,ot(me._payload),Le)}if(de(me)||U(me))return ot!==null?null:ke(he,ae,me,Le,null);fp(he,me)}return null}function Xe(he,ae,me,Le,ot){if(typeof Le=="string"&&Le!==""||typeof Le=="number")return he=he.get(me)||null,X(ae,he,""+Le,ot);if(typeof Le=="object"&&Le!==null){switch(Le.$$typeof){case _:return he=he.get(Le.key===null?me:Le.key)||null,te(ae,he,Le,ot);case P:return he=he.get(Le.key===null?me:Le.key)||null,ge(ae,he,Le,ot);case Q:var pt=Le._init;return Xe(he,ae,me,pt(Le._payload),ot)}if(de(Le)||U(Le))return he=he.get(me)||null,ke(ae,he,Le,ot,null);fp(ae,Le)}return null}function nt(he,ae,me,Le){for(var ot=null,pt=null,ht=ae,jt=ae=0,Zn=null;ht!==null&&jt<me.length;jt++){ht.index>jt?(Zn=ht,ht=null):Zn=ht.sibling;var Ut=Ee(he,ht,me[jt],Le);if(Ut===null){ht===null&&(ht=Zn);break}l&&ht&&Ut.alternate===null&&u(he,ht),ae=k(Ut,ae,jt),pt===null?ot=Ut:pt.sibling=Ut,pt=Ut,ht=Zn}if(jt===me.length)return m(he,ht),hn&&oo(he,jt),ot;if(ht===null){for(;jt<me.length;jt++)ht=Ie(he,me[jt],Le),ht!==null&&(ae=k(ht,ae,jt),pt===null?ot=ht:pt.sibling=ht,pt=ht);return hn&&oo(he,jt),ot}for(ht=w(he,ht);jt<me.length;jt++)Zn=Xe(ht,he,jt,me[jt],Le),Zn!==null&&(l&&Zn.alternate!==null&&ht.delete(Zn.key===null?jt:Zn.key),ae=k(Zn,ae,jt),pt===null?ot=Zn:pt.sibling=Zn,pt=Zn);return l&&ht.forEach(function(ki){return u(he,ki)}),hn&&oo(he,jt),ot}function at(he,ae,me,Le){var ot=U(me);if(typeof ot!="function")throw Error(n(150));if(me=ot.call(me),me==null)throw Error(n(151));for(var pt=ot=null,ht=ae,jt=ae=0,Zn=null,Ut=me.next();ht!==null&&!Ut.done;jt++,Ut=me.next()){ht.index>jt?(Zn=ht,ht=null):Zn=ht.sibling;var ki=Ee(he,ht,Ut.value,Le);if(ki===null){ht===null&&(ht=Zn);break}l&&ht&&ki.alternate===null&&u(he,ht),ae=k(ki,ae,jt),pt===null?ot=ki:pt.sibling=ki,pt=ki,ht=Zn}if(Ut.done)return m(he,ht),hn&&oo(he,jt),ot;if(ht===null){for(;!Ut.done;jt++,Ut=me.next())Ut=Ie(he,Ut.value,Le),Ut!==null&&(ae=k(Ut,ae,jt),pt===null?ot=Ut:pt.sibling=Ut,pt=Ut);return hn&&oo(he,jt),ot}for(ht=w(he,ht);!Ut.done;jt++,Ut=me.next())Ut=Xe(ht,he,jt,Ut.value,Le),Ut!==null&&(l&&Ut.alternate!==null&&ht.delete(Ut.key===null?jt:Ut.key),ae=k(Ut,ae,jt),pt===null?ot=Ut:pt.sibling=Ut,pt=Ut);return l&&ht.forEach(function(_U){return u(he,_U)}),hn&&oo(he,jt),ot}function kn(he,ae,me,Le){if(typeof me=="object"&&me!==null&&me.type===O&&me.key===null&&(me=me.props.children),typeof me=="object"&&me!==null){switch(me.$$typeof){case _:e:{for(var ot=me.key,pt=ae;pt!==null;){if(pt.key===ot){if(ot=me.type,ot===O){if(pt.tag===7){m(he,pt.sibling),ae=A(pt,me.props.children),ae.return=he,he=ae;break e}}else if(pt.elementType===ot||typeof ot=="object"&&ot!==null&&ot.$$typeof===Q&&UA(ot)===pt.type){m(he,pt.sibling),ae=A(pt,me.props),ae.ref=Tu(he,pt,me),ae.return=he,he=ae;break e}m(he,pt);break}else u(he,pt);pt=pt.sibling}me.type===O?(ae=vo(me.props.children,he.mode,Le,me.key),ae.return=he,he=ae):(Le=$p(me.type,me.key,me.props,null,he.mode,Le),Le.ref=Tu(he,ae,me),Le.return=he,he=Le)}return M(he);case P:e:{for(pt=me.key;ae!==null;){if(ae.key===pt)if(ae.tag===4&&ae.stateNode.containerInfo===me.containerInfo&&ae.stateNode.implementation===me.implementation){m(he,ae.sibling),ae=A(ae,me.children||[]),ae.return=he,he=ae;break e}else{m(he,ae);break}else u(he,ae);ae=ae.sibling}ae=Zx(me,he.mode,Le),ae.return=he,he=ae}return M(he);case Q:return pt=me._init,kn(he,ae,pt(me._payload),Le)}if(de(me))return nt(he,ae,me,Le);if(U(me))return at(he,ae,me,Le);fp(he,me)}return typeof me=="string"&&me!==""||typeof me=="number"?(me=""+me,ae!==null&&ae.tag===6?(m(he,ae.sibling),ae=A(ae,me),ae.return=he,he=ae):(m(he,ae),ae=Jx(me,he.mode,Le),ae.return=he,he=ae),M(he)):m(he,ae)}return kn}var El=qA(!0),WA=qA(!1),pp=yi(null),hp=null,Pl=null,lx=null;function cx(){lx=Pl=hp=null}function ux(l){var u=pp.current;dn(pp),l._currentValue=u}function dx(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 kl(l,u){hp=l,lx=Pl=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&u)!==0&&(kr=!0),l.firstContext=null)}function fa(l){var u=l._currentValue;if(lx!==l)if(l={context:l,memoizedValue:u,next:null},Pl===null){if(hp===null)throw Error(n(308));Pl=l,hp.dependencies={lanes:0,firstContext:l}}else Pl=Pl.next=l;return u}var lo=null;function fx(l){lo===null?lo=[l]:lo.push(l)}function VA(l,u,m,w){var A=u.interleaved;return A===null?(m.next=m,fx(u)):(m.next=A.next,A.next=m),u.interleaved=m,Ms(l,w)}function Ms(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 ji=!1;function px(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function HA(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 $s(l,u){return{eventTime:l,lane:u,tag:0,payload:null,callback:null,next:null}}function Si(l,u,m){var w=l.updateQueue;if(w===null)return null;if(w=w.shared,(Bt&2)!==0){var A=w.pending;return A===null?u.next=u:(u.next=A.next,A.next=u),w.pending=u,Ms(l,m)}return A=w.interleaved,A===null?(u.next=u,fx(w)):(u.next=A.next,A.next=u),w.interleaved=u,Ms(l,m)}function mp(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,ca(l,m)}}function KA(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 M={eventTime:m.eventTime,lane:m.lane,tag:m.tag,payload:m.payload,callback:m.callback,next:null};k===null?A=k=M:k=k.next=M,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 vp(l,u,m,w){var A=l.updateQueue;ji=!1;var k=A.firstBaseUpdate,M=A.lastBaseUpdate,X=A.shared.pending;if(X!==null){A.shared.pending=null;var te=X,ge=te.next;te.next=null,M===null?k=ge:M.next=ge,M=te;var ke=l.alternate;ke!==null&&(ke=ke.updateQueue,X=ke.lastBaseUpdate,X!==M&&(X===null?ke.firstBaseUpdate=ge:X.next=ge,ke.lastBaseUpdate=te))}if(k!==null){var Ie=A.baseState;M=0,ke=ge=te=null,X=k;do{var Ee=X.lane,Xe=X.eventTime;if((w&Ee)===Ee){ke!==null&&(ke=ke.next={eventTime:Xe,lane:0,tag:X.tag,payload:X.payload,callback:X.callback,next:null});e:{var nt=l,at=X;switch(Ee=u,Xe=m,at.tag){case 1:if(nt=at.payload,typeof nt=="function"){Ie=nt.call(Xe,Ie,Ee);break e}Ie=nt;break e;case 3:nt.flags=nt.flags&-65537|128;case 0:if(nt=at.payload,Ee=typeof nt=="function"?nt.call(Xe,Ie,Ee):nt,Ee==null)break e;Ie=Z({},Ie,Ee);break e;case 2:ji=!0}}X.callback!==null&&X.lane!==0&&(l.flags|=64,Ee=A.effects,Ee===null?A.effects=[X]:Ee.push(X))}else Xe={eventTime:Xe,lane:Ee,tag:X.tag,payload:X.payload,callback:X.callback,next:null},ke===null?(ge=ke=Xe,te=Ie):ke=ke.next=Xe,M|=Ee;if(X=X.next,X===null){if(X=A.shared.pending,X===null)break;Ee=X,X=Ee.next,Ee.next=null,A.lastBaseUpdate=Ee,A.shared.pending=null}}while(!0);if(ke===null&&(te=Ie),A.baseState=te,A.firstBaseUpdate=ge,A.lastBaseUpdate=ke,u=A.shared.interleaved,u!==null){A=u;do M|=A.lane,A=A.next;while(A!==u)}else k===null&&(A.shared.lanes=0);fo|=M,l.lanes=M,l.memoizedState=Ie}}function GA(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 Ru={},as=yi(Ru),Iu=yi(Ru),Mu=yi(Ru);function co(l){if(l===Ru)throw Error(n(174));return l}function hx(l,u){switch(rn(Mu,u),rn(Iu,l),rn(as,Ru),l=u.nodeType,l){case 9:case 11:u=(u=u.documentElement)?u.namespaceURI:Ce(null,"");break;default:l=l===8?u.parentNode:u,u=l.namespaceURI||null,l=l.tagName,u=Ce(u,l)}dn(as),rn(as,u)}function Ol(){dn(as),dn(Iu),dn(Mu)}function YA(l){co(Mu.current);var u=co(as.current),m=Ce(u,l.type);u!==m&&(rn(Iu,l),rn(as,m))}function mx(l){Iu.current===l&&(dn(as),dn(Iu))}var yn=yi(0);function gp(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 vx=[];function gx(){for(var l=0;l<vx.length;l++)vx[l]._workInProgressVersionPrimary=null;vx.length=0}var xp=E.ReactCurrentDispatcher,xx=E.ReactCurrentBatchConfig,uo=0,bn=null,Ln=null,Qn=null,yp=!1,$u=!1,Du=0,Y6=0;function hr(){throw Error(n(321))}function yx(l,u){if(u===null)return!1;for(var m=0;m<u.length&&m<l.length;m++)if(!ka(l[m],u[m]))return!1;return!0}function bx(l,u,m,w,A,k){if(uo=k,bn=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,xp.current=l===null||l.memoizedState===null?Z6:eU,l=m(w,A),$u){k=0;do{if($u=!1,Du=0,25<=k)throw Error(n(301));k+=1,Qn=Ln=null,u.updateQueue=null,xp.current=tU,l=m(w,A)}while($u)}if(xp.current=jp,u=Ln!==null&&Ln.next!==null,uo=0,Qn=Ln=bn=null,yp=!1,u)throw Error(n(300));return l}function wx(){var l=Du!==0;return Du=0,l}function ss(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qn===null?bn.memoizedState=Qn=l:Qn=Qn.next=l,Qn}function pa(){if(Ln===null){var l=bn.alternate;l=l!==null?l.memoizedState:null}else l=Ln.next;var u=Qn===null?bn.memoizedState:Qn.next;if(u!==null)Qn=u,Ln=l;else{if(l===null)throw Error(n(310));Ln=l,l={memoizedState:Ln.memoizedState,baseState:Ln.baseState,baseQueue:Ln.baseQueue,queue:Ln.queue,next:null},Qn===null?bn.memoizedState=Qn=l:Qn=Qn.next=l}return Qn}function Lu(l,u){return typeof u=="function"?u(l):u}function jx(l){var u=pa(),m=u.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=l;var w=Ln,A=w.baseQueue,k=m.pending;if(k!==null){if(A!==null){var M=A.next;A.next=k.next,k.next=M}w.baseQueue=A=k,m.pending=null}if(A!==null){k=A.next,w=w.baseState;var X=M=null,te=null,ge=k;do{var ke=ge.lane;if((uo&ke)===ke)te!==null&&(te=te.next={lane:0,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null}),w=ge.hasEagerState?ge.eagerState:l(w,ge.action);else{var Ie={lane:ke,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null};te===null?(X=te=Ie,M=w):te=te.next=Ie,bn.lanes|=ke,fo|=ke}ge=ge.next}while(ge!==null&&ge!==k);te===null?M=w:te.next=X,ka(w,u.memoizedState)||(kr=!0),u.memoizedState=w,u.baseState=M,u.baseQueue=te,m.lastRenderedState=w}if(l=m.interleaved,l!==null){A=l;do k=A.lane,bn.lanes|=k,fo|=k,A=A.next;while(A!==l)}else A===null&&(m.lanes=0);return[u.memoizedState,m.dispatch]}function Sx(l){var u=pa(),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 M=A=A.next;do k=l(k,M.action),M=M.next;while(M!==A);ka(k,u.memoizedState)||(kr=!0),u.memoizedState=k,u.baseQueue===null&&(u.baseState=k),m.lastRenderedState=k}return[k,w]}function XA(){}function QA(l,u){var m=bn,w=pa(),A=u(),k=!ka(w.memoizedState,A);if(k&&(w.memoizedState=A,kr=!0),w=w.queue,Nx(e_.bind(null,m,w,l),[l]),w.getSnapshot!==u||k||Qn!==null&&Qn.memoizedState.tag&1){if(m.flags|=2048,Fu(9,ZA.bind(null,m,w,A,u),void 0,null),Jn===null)throw Error(n(349));(uo&30)!==0||JA(m,u,A)}return A}function JA(l,u,m){l.flags|=16384,l={getSnapshot:u,value:m},u=bn.updateQueue,u===null?(u={lastEffect:null,stores:null},bn.updateQueue=u,u.stores=[l]):(m=u.stores,m===null?u.stores=[l]:m.push(l))}function ZA(l,u,m,w){u.value=m,u.getSnapshot=w,t_(u)&&n_(l)}function e_(l,u,m){return m(function(){t_(u)&&n_(l)})}function t_(l){var u=l.getSnapshot;l=l.value;try{var m=u();return!ka(l,m)}catch{return!0}}function n_(l){var u=Ms(l,1);u!==null&&Ma(u,l,1,-1)}function r_(l){var u=ss();return typeof l=="function"&&(l=l()),u.memoizedState=u.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Lu,lastRenderedState:l},u.queue=l,l=l.dispatch=J6.bind(null,bn,l),[u.memoizedState,l]}function Fu(l,u,m,w){return l={tag:l,create:u,destroy:m,deps:w,next:null},u=bn.updateQueue,u===null?(u={lastEffect:null,stores:null},bn.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 a_(){return pa().memoizedState}function bp(l,u,m,w){var A=ss();bn.flags|=l,A.memoizedState=Fu(1|u,m,void 0,w===void 0?null:w)}function wp(l,u,m,w){var A=pa();w=w===void 0?null:w;var k=void 0;if(Ln!==null){var M=Ln.memoizedState;if(k=M.destroy,w!==null&&yx(w,M.deps)){A.memoizedState=Fu(u,m,k,w);return}}bn.flags|=l,A.memoizedState=Fu(1|u,m,k,w)}function s_(l,u){return bp(8390656,8,l,u)}function Nx(l,u){return wp(2048,8,l,u)}function i_(l,u){return wp(4,2,l,u)}function o_(l,u){return wp(4,4,l,u)}function l_(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 c_(l,u,m){return m=m!=null?m.concat([l]):null,wp(4,4,l_.bind(null,u,l),m)}function Cx(){}function u_(l,u){var m=pa();u=u===void 0?null:u;var w=m.memoizedState;return w!==null&&u!==null&&yx(u,w[1])?w[0]:(m.memoizedState=[l,u],l)}function d_(l,u){var m=pa();u=u===void 0?null:u;var w=m.memoizedState;return w!==null&&u!==null&&yx(u,w[1])?w[0]:(l=l(),m.memoizedState=[l,u],l)}function f_(l,u,m){return(uo&21)===0?(l.baseState&&(l.baseState=!1,kr=!0),l.memoizedState=m):(ka(m,u)||(m=dt(),bn.lanes|=m,fo|=m,l.baseState=!0),u)}function X6(l,u){var m=zt;zt=m!==0&&4>m?m:4,l(!0);var w=xx.transition;xx.transition={};try{l(!1),u()}finally{zt=m,xx.transition=w}}function p_(){return pa().memoizedState}function Q6(l,u,m){var w=_i(l);if(m={lane:w,action:m,hasEagerState:!1,eagerState:null,next:null},h_(l))m_(u,m);else if(m=VA(l,u,m,w),m!==null){var A=yr();Ma(m,l,w,A),v_(m,u,w)}}function J6(l,u,m){var w=_i(l),A={lane:w,action:m,hasEagerState:!1,eagerState:null,next:null};if(h_(l))m_(u,A);else{var k=l.alternate;if(l.lanes===0&&(k===null||k.lanes===0)&&(k=u.lastRenderedReducer,k!==null))try{var M=u.lastRenderedState,X=k(M,m);if(A.hasEagerState=!0,A.eagerState=X,ka(X,M)){var te=u.interleaved;te===null?(A.next=A,fx(u)):(A.next=te.next,te.next=A),u.interleaved=A;return}}catch{}m=VA(l,u,A,w),m!==null&&(A=yr(),Ma(m,l,w,A),v_(m,u,w))}}function h_(l){var u=l.alternate;return l===bn||u!==null&&u===bn}function m_(l,u){$u=yp=!0;var m=l.pending;m===null?u.next=u:(u.next=m.next,m.next=u),l.pending=u}function v_(l,u,m){if((m&4194240)!==0){var w=u.lanes;w&=l.pendingLanes,m|=w,u.lanes=m,ca(l,m)}}var jp={readContext:fa,useCallback:hr,useContext:hr,useEffect:hr,useImperativeHandle:hr,useInsertionEffect:hr,useLayoutEffect:hr,useMemo:hr,useReducer:hr,useRef:hr,useState:hr,useDebugValue:hr,useDeferredValue:hr,useTransition:hr,useMutableSource:hr,useSyncExternalStore:hr,useId:hr,unstable_isNewReconciler:!1},Z6={readContext:fa,useCallback:function(l,u){return ss().memoizedState=[l,u===void 0?null:u],l},useContext:fa,useEffect:s_,useImperativeHandle:function(l,u,m){return m=m!=null?m.concat([l]):null,bp(4194308,4,l_.bind(null,u,l),m)},useLayoutEffect:function(l,u){return bp(4194308,4,l,u)},useInsertionEffect:function(l,u){return bp(4,2,l,u)},useMemo:function(l,u){var m=ss();return u=u===void 0?null:u,l=l(),m.memoizedState=[l,u],l},useReducer:function(l,u,m){var w=ss();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=Q6.bind(null,bn,l),[w.memoizedState,l]},useRef:function(l){var u=ss();return l={current:l},u.memoizedState=l},useState:r_,useDebugValue:Cx,useDeferredValue:function(l){return ss().memoizedState=l},useTransition:function(){var l=r_(!1),u=l[0];return l=X6.bind(null,l[1]),ss().memoizedState=l,[u,l]},useMutableSource:function(){},useSyncExternalStore:function(l,u,m){var w=bn,A=ss();if(hn){if(m===void 0)throw Error(n(407));m=m()}else{if(m=u(),Jn===null)throw Error(n(349));(uo&30)!==0||JA(w,u,m)}A.memoizedState=m;var k={value:m,getSnapshot:u};return A.queue=k,s_(e_.bind(null,w,k,l),[l]),w.flags|=2048,Fu(9,ZA.bind(null,w,k,m,u),void 0,null),m},useId:function(){var l=ss(),u=Jn.identifierPrefix;if(hn){var m=Is,w=Rs;m=(w&~(1<<32-Vr(w)-1)).toString(32)+m,u=":"+u+"R"+m,m=Du++,0<m&&(u+="H"+m.toString(32)),u+=":"}else m=Y6++,u=":"+u+"r"+m.toString(32)+":";return l.memoizedState=u},unstable_isNewReconciler:!1},eU={readContext:fa,useCallback:u_,useContext:fa,useEffect:Nx,useImperativeHandle:c_,useInsertionEffect:i_,useLayoutEffect:o_,useMemo:d_,useReducer:jx,useRef:a_,useState:function(){return jx(Lu)},useDebugValue:Cx,useDeferredValue:function(l){var u=pa();return f_(u,Ln.memoizedState,l)},useTransition:function(){var l=jx(Lu)[0],u=pa().memoizedState;return[l,u]},useMutableSource:XA,useSyncExternalStore:QA,useId:p_,unstable_isNewReconciler:!1},tU={readContext:fa,useCallback:u_,useContext:fa,useEffect:Nx,useImperativeHandle:c_,useInsertionEffect:i_,useLayoutEffect:o_,useMemo:d_,useReducer:Sx,useRef:a_,useState:function(){return Sx(Lu)},useDebugValue:Cx,useDeferredValue:function(l){var u=pa();return Ln===null?u.memoizedState=l:f_(u,Ln.memoizedState,l)},useTransition:function(){var l=Sx(Lu)[0],u=pa().memoizedState;return[l,u]},useMutableSource:XA,useSyncExternalStore:QA,useId:p_,unstable_isNewReconciler:!1};function Ta(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 Ax(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 Sp={isMounted:function(l){return(l=l._reactInternals)?Ve(l)===l:!1},enqueueSetState:function(l,u,m){l=l._reactInternals;var w=yr(),A=_i(l),k=$s(w,A);k.payload=u,m!=null&&(k.callback=m),u=Si(l,k,A),u!==null&&(Ma(u,l,A,w),mp(u,l,A))},enqueueReplaceState:function(l,u,m){l=l._reactInternals;var w=yr(),A=_i(l),k=$s(w,A);k.tag=1,k.payload=u,m!=null&&(k.callback=m),u=Si(l,k,A),u!==null&&(Ma(u,l,A,w),mp(u,l,A))},enqueueForceUpdate:function(l,u){l=l._reactInternals;var m=yr(),w=_i(l),A=$s(m,w);A.tag=2,u!=null&&(A.callback=u),u=Si(l,A,w),u!==null&&(Ma(u,l,w,m),mp(u,l,w))}};function g_(l,u,m,w,A,k,M){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(w,k,M):u.prototype&&u.prototype.isPureReactComponent?!Cu(m,w)||!Cu(A,k):!0}function x_(l,u,m){var w=!1,A=bi,k=u.contextType;return typeof k=="object"&&k!==null?k=fa(k):(A=Pr(u)?so:pr.current,w=u.contextTypes,k=(w=w!=null)?Nl(l,A):bi),u=new u(m,k),l.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Sp,l.stateNode=u,u._reactInternals=l,w&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=A,l.__reactInternalMemoizedMaskedChildContext=k),u}function y_(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&&Sp.enqueueReplaceState(u,u.state,null)}function _x(l,u,m,w){var A=l.stateNode;A.props=m,A.state=l.memoizedState,A.refs={},px(l);var k=u.contextType;typeof k=="object"&&k!==null?A.context=fa(k):(k=Pr(u)?so:pr.current,A.context=Nl(l,k)),A.state=l.memoizedState,k=u.getDerivedStateFromProps,typeof k=="function"&&(Ax(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&&Sp.enqueueReplaceState(A,A.state,null),vp(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+=G(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 Ex(l,u,m){return{value:l,source:null,stack:m??null,digest:u??null}}function Px(l,u){try{console.error(u.value)}catch(m){setTimeout(function(){throw m})}}var nU=typeof WeakMap=="function"?WeakMap:Map;function b_(l,u,m){m=$s(-1,m),m.tag=3,m.payload={element:null};var w=u.value;return m.callback=function(){kp||(kp=!0,Wx=w),Px(l,u)},m}function w_(l,u,m){m=$s(-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(){Px(l,u)}}var k=l.stateNode;return k!==null&&typeof k.componentDidCatch=="function"&&(m.callback=function(){Px(l,u),typeof w!="function"&&(Ci===null?Ci=new Set([this]):Ci.add(this));var M=u.stack;this.componentDidCatch(u.value,{componentStack:M!==null?M:""})}),m}function j_(l,u,m){var w=l.pingCache;if(w===null){w=l.pingCache=new nU;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=vU.bind(null,l,u,m),u.then(l,l))}function S_(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 N_(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=$s(-1,1),u.tag=2,Si(m,u,1))),m.lanes|=1),l):(l.flags|=65536,l.lanes=A,l)}var rU=E.ReactCurrentOwner,kr=!1;function xr(l,u,m,w){u.child=l===null?WA(u,null,m,w):El(u,l.child,m,w)}function C_(l,u,m,w,A){m=m.render;var k=u.ref;return kl(u,A),w=bx(l,u,m,w,k,A),m=wx(),l!==null&&!kr?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~A,Ds(l,u,A)):(hn&&m&&rx(u),u.flags|=1,xr(l,u,w,A),u.child)}function A_(l,u,m,w,A){if(l===null){var k=m.type;return typeof k=="function"&&!Qx(k)&&k.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(u.tag=15,u.type=k,__(l,u,k,w,A)):(l=$p(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 M=k.memoizedProps;if(m=m.compare,m=m!==null?m:Cu,m(M,w)&&l.ref===u.ref)return Ds(l,u,A)}return u.flags|=1,l=Pi(k,w),l.ref=u.ref,l.return=u,u.child=l}function __(l,u,m,w,A){if(l!==null){var k=l.memoizedProps;if(Cu(k,w)&&l.ref===u.ref)if(kr=!1,u.pendingProps=w=k,(l.lanes&A)!==0)(l.flags&131072)!==0&&(kr=!0);else return u.lanes=l.lanes,Ds(l,u,A)}return kx(l,u,m,w,A)}function E_(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},rn(Il,Yr),Yr|=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,rn(Il,Yr),Yr|=l,null;u.memoizedState={baseLanes:0,cachePool:null,transitions:null},w=k!==null?k.baseLanes:m,rn(Il,Yr),Yr|=w}else k!==null?(w=k.baseLanes|m,u.memoizedState=null):w=m,rn(Il,Yr),Yr|=w;return xr(l,u,A,m),u.child}function P_(l,u){var m=u.ref;(l===null&&m!==null||l!==null&&l.ref!==m)&&(u.flags|=512,u.flags|=2097152)}function kx(l,u,m,w,A){var k=Pr(m)?so:pr.current;return k=Nl(u,k),kl(u,A),m=bx(l,u,m,w,k,A),w=wx(),l!==null&&!kr?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~A,Ds(l,u,A)):(hn&&w&&rx(u),u.flags|=1,xr(l,u,m,A),u.child)}function k_(l,u,m,w,A){if(Pr(m)){var k=!0;op(u)}else k=!1;if(kl(u,A),u.stateNode===null)Cp(l,u),x_(u,m,w),_x(u,m,w,A),w=!0;else if(l===null){var M=u.stateNode,X=u.memoizedProps;M.props=X;var te=M.context,ge=m.contextType;typeof ge=="object"&&ge!==null?ge=fa(ge):(ge=Pr(m)?so:pr.current,ge=Nl(u,ge));var ke=m.getDerivedStateFromProps,Ie=typeof ke=="function"||typeof M.getSnapshotBeforeUpdate=="function";Ie||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(X!==w||te!==ge)&&y_(u,M,w,ge),ji=!1;var Ee=u.memoizedState;M.state=Ee,vp(u,w,M,A),te=u.memoizedState,X!==w||Ee!==te||Er.current||ji?(typeof ke=="function"&&(Ax(u,m,ke,w),te=u.memoizedState),(X=ji||g_(u,m,X,w,Ee,te,ge))?(Ie||typeof M.UNSAFE_componentWillMount!="function"&&typeof M.componentWillMount!="function"||(typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount()),typeof M.componentDidMount=="function"&&(u.flags|=4194308)):(typeof M.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=w,u.memoizedState=te),M.props=w,M.state=te,M.context=ge,w=X):(typeof M.componentDidMount=="function"&&(u.flags|=4194308),w=!1)}else{M=u.stateNode,HA(l,u),X=u.memoizedProps,ge=u.type===u.elementType?X:Ta(u.type,X),M.props=ge,Ie=u.pendingProps,Ee=M.context,te=m.contextType,typeof te=="object"&&te!==null?te=fa(te):(te=Pr(m)?so:pr.current,te=Nl(u,te));var Xe=m.getDerivedStateFromProps;(ke=typeof Xe=="function"||typeof M.getSnapshotBeforeUpdate=="function")||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(X!==Ie||Ee!==te)&&y_(u,M,w,te),ji=!1,Ee=u.memoizedState,M.state=Ee,vp(u,w,M,A);var nt=u.memoizedState;X!==Ie||Ee!==nt||Er.current||ji?(typeof Xe=="function"&&(Ax(u,m,Xe,w),nt=u.memoizedState),(ge=ji||g_(u,m,ge,w,Ee,nt,te)||!1)?(ke||typeof M.UNSAFE_componentWillUpdate!="function"&&typeof M.componentWillUpdate!="function"||(typeof M.componentWillUpdate=="function"&&M.componentWillUpdate(w,nt,te),typeof M.UNSAFE_componentWillUpdate=="function"&&M.UNSAFE_componentWillUpdate(w,nt,te)),typeof M.componentDidUpdate=="function"&&(u.flags|=4),typeof M.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof M.componentDidUpdate!="function"||X===l.memoizedProps&&Ee===l.memoizedState||(u.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||X===l.memoizedProps&&Ee===l.memoizedState||(u.flags|=1024),u.memoizedProps=w,u.memoizedState=nt),M.props=w,M.state=nt,M.context=te,w=ge):(typeof M.componentDidUpdate!="function"||X===l.memoizedProps&&Ee===l.memoizedState||(u.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||X===l.memoizedProps&&Ee===l.memoizedState||(u.flags|=1024),w=!1)}return Ox(l,u,m,w,k,A)}function Ox(l,u,m,w,A,k){P_(l,u);var M=(u.flags&128)!==0;if(!w&&!M)return A&&MA(u,m,!1),Ds(l,u,k);w=u.stateNode,rU.current=u;var X=M&&typeof m.getDerivedStateFromError!="function"?null:w.render();return u.flags|=1,l!==null&&M?(u.child=El(u,l.child,null,k),u.child=El(u,null,X,k)):xr(l,u,X,k),u.memoizedState=w.state,A&&MA(u,m,!0),u.child}function O_(l){var u=l.stateNode;u.pendingContext?RA(l,u.pendingContext,u.pendingContext!==u.context):u.context&&RA(l,u.context,!1),hx(l,u.containerInfo)}function T_(l,u,m,w,A){return _l(),ox(A),u.flags|=256,xr(l,u,m,w),u.child}var Tx={dehydrated:null,treeContext:null,retryLane:0};function Rx(l){return{baseLanes:l,cachePool:null,transitions:null}}function R_(l,u,m){var w=u.pendingProps,A=yn.current,k=!1,M=(u.flags&128)!==0,X;if((X=M)||(X=l!==null&&l.memoizedState===null?!1:(A&2)!==0),X?(k=!0,u.flags&=-129):(l===null||l.memoizedState!==null)&&(A|=1),rn(yn,A&1),l===null)return ix(u),l=u.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?((u.mode&1)===0?u.lanes=1:l.data==="$!"?u.lanes=8:u.lanes=1073741824,null):(M=w.children,l=w.fallback,k?(w=u.mode,k=u.child,M={mode:"hidden",children:M},(w&1)===0&&k!==null?(k.childLanes=0,k.pendingProps=M):k=Dp(M,w,0,null),l=vo(l,w,m,null),k.return=u,l.return=u,k.sibling=l,u.child=k,u.child.memoizedState=Rx(m),u.memoizedState=Tx,l):Ix(u,M));if(A=l.memoizedState,A!==null&&(X=A.dehydrated,X!==null))return aU(l,u,M,w,X,A,m);if(k){k=w.fallback,M=u.mode,A=l.child,X=A.sibling;var te={mode:"hidden",children:w.children};return(M&1)===0&&u.child!==A?(w=u.child,w.childLanes=0,w.pendingProps=te,u.deletions=null):(w=Pi(A,te),w.subtreeFlags=A.subtreeFlags&14680064),X!==null?k=Pi(X,k):(k=vo(k,M,m,null),k.flags|=2),k.return=u,w.return=u,w.sibling=k,u.child=w,w=k,k=u.child,M=l.child.memoizedState,M=M===null?Rx(m):{baseLanes:M.baseLanes|m,cachePool:null,transitions:M.transitions},k.memoizedState=M,k.childLanes=l.childLanes&~m,u.memoizedState=Tx,w}return k=l.child,l=k.sibling,w=Pi(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 Ix(l,u){return u=Dp({mode:"visible",children:u},l.mode,0,null),u.return=l,l.child=u}function Np(l,u,m,w){return w!==null&&ox(w),El(u,l.child,null,m),l=Ix(u,u.pendingProps.children),l.flags|=2,u.memoizedState=null,l}function aU(l,u,m,w,A,k,M){if(m)return u.flags&256?(u.flags&=-257,w=Ex(Error(n(422))),Np(l,u,M,w)):u.memoizedState!==null?(u.child=l.child,u.flags|=128,null):(k=w.fallback,A=u.mode,w=Dp({mode:"visible",children:w.children},A,0,null),k=vo(k,A,M,null),k.flags|=2,w.return=u,k.return=u,w.sibling=k,u.child=w,(u.mode&1)!==0&&El(u,l.child,null,M),u.child.memoizedState=Rx(M),u.memoizedState=Tx,k);if((u.mode&1)===0)return Np(l,u,M,null);if(A.data==="$!"){if(w=A.nextSibling&&A.nextSibling.dataset,w)var X=w.dgst;return w=X,k=Error(n(419)),w=Ex(k,w,void 0),Np(l,u,M,w)}if(X=(M&l.childLanes)!==0,kr||X){if(w=Jn,w!==null){switch(M&-M){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|M))!==0?0:A,A!==0&&A!==k.retryLane&&(k.retryLane=A,Ms(l,A),Ma(w,l,A,-1))}return Xx(),w=Ex(Error(n(421))),Np(l,u,M,w)}return A.data==="$?"?(u.flags|=128,u.child=l.child,u=gU.bind(null,l),A._reactRetry=u,null):(l=k.treeContext,Gr=xi(A.nextSibling),Kr=u,hn=!0,Oa=null,l!==null&&(ua[da++]=Rs,ua[da++]=Is,ua[da++]=io,Rs=l.id,Is=l.overflow,io=u),u=Ix(u,w.children),u.flags|=4096,u)}function I_(l,u,m){l.lanes|=u;var w=l.alternate;w!==null&&(w.lanes|=u),dx(l.return,u,m)}function Mx(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 M_(l,u,m){var w=u.pendingProps,A=w.revealOrder,k=w.tail;if(xr(l,u,w.children,m),w=yn.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&&I_(l,m,u);else if(l.tag===19)I_(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(rn(yn,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&&gp(l)===null&&(A=m),m=m.sibling;m=A,m===null?(A=u.child,u.child=null):(A=m.sibling,m.sibling=null),Mx(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&&gp(l)===null){u.child=A;break}l=A.sibling,A.sibling=m,m=A,A=l}Mx(u,!0,m,null,k);break;case"together":Mx(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function Cp(l,u){(u.mode&1)===0&&l!==null&&(l.alternate=null,u.alternate=null,u.flags|=2)}function Ds(l,u,m){if(l!==null&&(u.dependencies=l.dependencies),fo|=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=Pi(l,l.pendingProps),u.child=m,m.return=u;l.sibling!==null;)l=l.sibling,m=m.sibling=Pi(l,l.pendingProps),m.return=u;m.sibling=null}return u.child}function sU(l,u,m){switch(u.tag){case 3:O_(u),_l();break;case 5:YA(u);break;case 1:Pr(u.type)&&op(u);break;case 4:hx(u,u.stateNode.containerInfo);break;case 10:var w=u.type._context,A=u.memoizedProps.value;rn(pp,w._currentValue),w._currentValue=A;break;case 13:if(w=u.memoizedState,w!==null)return w.dehydrated!==null?(rn(yn,yn.current&1),u.flags|=128,null):(m&u.child.childLanes)!==0?R_(l,u,m):(rn(yn,yn.current&1),l=Ds(l,u,m),l!==null?l.sibling:null);rn(yn,yn.current&1);break;case 19:if(w=(m&u.childLanes)!==0,(l.flags&128)!==0){if(w)return M_(l,u,m);u.flags|=128}if(A=u.memoizedState,A!==null&&(A.rendering=null,A.tail=null,A.lastEffect=null),rn(yn,yn.current),w)break;return null;case 22:case 23:return u.lanes=0,E_(l,u,m)}return Ds(l,u,m)}var $_,$x,D_,L_;$_=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}},$x=function(){},D_=function(l,u,m,w){var A=l.memoizedProps;if(A!==w){l=u.stateNode,co(as.current);var k=null;switch(m){case"input":A=_e(l,A),w=_e(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=ap)}$n(m,w);var M;m=null;for(ge in A)if(!w.hasOwnProperty(ge)&&A.hasOwnProperty(ge)&&A[ge]!=null)if(ge==="style"){var X=A[ge];for(M in X)X.hasOwnProperty(M)&&(m||(m={}),m[M]="")}else ge!=="dangerouslySetInnerHTML"&&ge!=="children"&&ge!=="suppressContentEditableWarning"&&ge!=="suppressHydrationWarning"&&ge!=="autoFocus"&&(a.hasOwnProperty(ge)?k||(k=[]):(k=k||[]).push(ge,null));for(ge in w){var te=w[ge];if(X=A?.[ge],w.hasOwnProperty(ge)&&te!==X&&(te!=null||X!=null))if(ge==="style")if(X){for(M in X)!X.hasOwnProperty(M)||te&&te.hasOwnProperty(M)||(m||(m={}),m[M]="");for(M in te)te.hasOwnProperty(M)&&X[M]!==te[M]&&(m||(m={}),m[M]=te[M])}else m||(k||(k=[]),k.push(ge,m)),m=te;else ge==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,X=X?X.__html:void 0,te!=null&&X!==te&&(k=k||[]).push(ge,te)):ge==="children"?typeof te!="string"&&typeof te!="number"||(k=k||[]).push(ge,""+te):ge!=="suppressContentEditableWarning"&&ge!=="suppressHydrationWarning"&&(a.hasOwnProperty(ge)?(te!=null&&ge==="onScroll"&&un("scroll",l),k||X===te||(k=[])):(k=k||[]).push(ge,te))}m&&(k=k||[]).push("style",m);var ge=k;(u.updateQueue=ge)&&(u.flags|=4)}},L_=function(l,u,m,w){m!==w&&(u.flags|=4)};function Bu(l,u){if(!hn)switch(l.tailMode){case"hidden":u=l.tail;for(var m=null;u!==null;)u.alternate!==null&&(m=u),u=u.sibling;m===null?l.tail=null:m.sibling=null;break;case"collapsed":m=l.tail;for(var 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 mr(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 iU(l,u,m){var w=u.pendingProps;switch(ax(u),u.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mr(u),null;case 1:return Pr(u.type)&&ip(),mr(u),null;case 3:return w=u.stateNode,Ol(),dn(Er),dn(pr),gx(),w.pendingContext&&(w.context=w.pendingContext,w.pendingContext=null),(l===null||l.child===null)&&(dp(u)?u.flags|=4:l===null||l.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Oa!==null&&(Kx(Oa),Oa=null))),$x(l,u),mr(u),null;case 5:mx(u);var A=co(Mu.current);if(m=u.type,l!==null&&u.stateNode!=null)D_(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 mr(u),null}if(l=co(as.current),dp(u)){w=u.stateNode,m=u.type;var k=u.memoizedProps;switch(w[rs]=u,w[ku]=k,l=(u.mode&1)!==0,m){case"dialog":un("cancel",w),un("close",w);break;case"iframe":case"object":case"embed":un("load",w);break;case"video":case"audio":for(A=0;A<_u.length;A++)un(_u[A],w);break;case"source":un("error",w);break;case"img":case"image":case"link":un("error",w),un("load",w);break;case"details":un("toggle",w);break;case"input":Ge(w,k),un("invalid",w);break;case"select":w._wrapperState={wasMultiple:!!k.multiple},un("invalid",w);break;case"textarea":wt(w,k),un("invalid",w)}$n(m,k),A=null;for(var M in k)if(k.hasOwnProperty(M)){var X=k[M];M==="children"?typeof X=="string"?w.textContent!==X&&(k.suppressHydrationWarning!==!0&&rp(w.textContent,X,l),A=["children",X]):typeof X=="number"&&w.textContent!==""+X&&(k.suppressHydrationWarning!==!0&&rp(w.textContent,X,l),A=["children",""+X]):a.hasOwnProperty(M)&&X!=null&&M==="onScroll"&&un("scroll",w)}switch(m){case"input":Ae(w),Y(w,k,!0);break;case"textarea":Ae(w),ve(w);break;case"select":case"option":break;default:typeof k.onClick=="function"&&(w.onclick=ap)}w=A,u.updateQueue=w,w!==null&&(u.flags|=4)}else{M=A.nodeType===9?A:A.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=ce(m)),l==="http://www.w3.org/1999/xhtml"?m==="script"?(l=M.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof w.is=="string"?l=M.createElement(m,{is:w.is}):(l=M.createElement(m),m==="select"&&(M=l,w.multiple?M.multiple=!0:w.size&&(M.size=w.size))):l=M.createElementNS(l,m),l[rs]=u,l[ku]=w,$_(l,u,!1,!1),u.stateNode=l;e:{switch(M=dr(m,w),m){case"dialog":un("cancel",l),un("close",l),A=w;break;case"iframe":case"object":case"embed":un("load",l),A=w;break;case"video":case"audio":for(A=0;A<_u.length;A++)un(_u[A],l);A=w;break;case"source":un("error",l),A=w;break;case"img":case"image":case"link":un("error",l),un("load",l),A=w;break;case"details":un("toggle",l),A=w;break;case"input":Ge(l,w),A=_e(l,w),un("invalid",l);break;case"option":A=w;break;case"select":l._wrapperState={wasMultiple:!!w.multiple},A=Z({},w,{value:void 0}),un("invalid",l);break;case"textarea":wt(l,w),A=Ye(l,w),un("invalid",l);break;default:A=w}$n(m,A),X=A;for(k in X)if(X.hasOwnProperty(k)){var te=X[k];k==="style"?cr(l,te):k==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,te!=null&&Fe(l,te)):k==="children"?typeof te=="string"?(m!=="textarea"||te!=="")&&et(l,te):typeof te=="number"&&et(l,""+te):k!=="suppressContentEditableWarning"&&k!=="suppressHydrationWarning"&&k!=="autoFocus"&&(a.hasOwnProperty(k)?te!=null&&k==="onScroll"&&un("scroll",l):te!=null&&N(l,k,te,M))}switch(m){case"input":Ae(l),Y(l,w,!1);break;case"textarea":Ae(l),ve(l);break;case"option":w.value!=null&&l.setAttribute("value",""+oe(w.value));break;case"select":l.multiple=!!w.multiple,k=w.value,k!=null?Pe(l,!!w.multiple,k,!1):w.defaultValue!=null&&Pe(l,!!w.multiple,w.defaultValue,!0);break;default:typeof A.onClick=="function"&&(l.onclick=ap)}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 mr(u),null;case 6:if(l&&u.stateNode!=null)L_(l,u,l.memoizedProps,w);else{if(typeof w!="string"&&u.stateNode===null)throw Error(n(166));if(m=co(Mu.current),co(as.current),dp(u)){if(w=u.stateNode,m=u.memoizedProps,w[rs]=u,(k=w.nodeValue!==m)&&(l=Kr,l!==null))switch(l.tag){case 3:rp(w.nodeValue,m,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&rp(w.nodeValue,m,(l.mode&1)!==0)}k&&(u.flags|=4)}else w=(m.nodeType===9?m:m.ownerDocument).createTextNode(w),w[rs]=u,u.stateNode=w}return mr(u),null;case 13:if(dn(yn),w=u.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(hn&&Gr!==null&&(u.mode&1)!==0&&(u.flags&128)===0)zA(),_l(),u.flags|=98560,k=!1;else if(k=dp(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[rs]=u}else _l(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;mr(u),k=!1}else Oa!==null&&(Kx(Oa),Oa=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||(yn.current&1)!==0?Fn===0&&(Fn=3):Xx())),u.updateQueue!==null&&(u.flags|=4),mr(u),null);case 4:return Ol(),$x(l,u),l===null&&Eu(u.stateNode.containerInfo),mr(u),null;case 10:return ux(u.type._context),mr(u),null;case 17:return Pr(u.type)&&ip(),mr(u),null;case 19:if(dn(yn),k=u.memoizedState,k===null)return mr(u),null;if(w=(u.flags&128)!==0,M=k.rendering,M===null)if(w)Bu(k,!1);else{if(Fn!==0||l!==null&&(l.flags&128)!==0)for(l=u.child;l!==null;){if(M=gp(l),M!==null){for(u.flags|=128,Bu(k,!1),w=M.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,M=k.alternate,M===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=M.childLanes,k.lanes=M.lanes,k.child=M.child,k.subtreeFlags=0,k.deletions=null,k.memoizedProps=M.memoizedProps,k.memoizedState=M.memoizedState,k.updateQueue=M.updateQueue,k.type=M.type,l=M.dependencies,k.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),m=m.sibling;return rn(yn,yn.current&1|2),u.child}l=l.sibling}k.tail!==null&&cn()>Ml&&(u.flags|=128,w=!0,Bu(k,!1),u.lanes=4194304)}else{if(!w)if(l=gp(M),l!==null){if(u.flags|=128,w=!0,m=l.updateQueue,m!==null&&(u.updateQueue=m,u.flags|=4),Bu(k,!0),k.tail===null&&k.tailMode==="hidden"&&!M.alternate&&!hn)return mr(u),null}else 2*cn()-k.renderingStartTime>Ml&&m!==1073741824&&(u.flags|=128,w=!0,Bu(k,!1),u.lanes=4194304);k.isBackwards?(M.sibling=u.child,u.child=M):(m=k.last,m!==null?m.sibling=M:u.child=M,k.last=M)}return k.tail!==null?(u=k.tail,k.rendering=u,k.tail=u.sibling,k.renderingStartTime=cn(),u.sibling=null,m=yn.current,rn(yn,w?m&1|2:m&1),u):(mr(u),null);case 22:case 23:return Yx(),w=u.memoizedState!==null,l!==null&&l.memoizedState!==null!==w&&(u.flags|=8192),w&&(u.mode&1)!==0?(Yr&1073741824)!==0&&(mr(u),u.subtreeFlags&6&&(u.flags|=8192)):mr(u),null;case 24:return null;case 25:return null}throw Error(n(156,u.tag))}function oU(l,u){switch(ax(u),u.tag){case 1:return Pr(u.type)&&ip(),l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 3:return Ol(),dn(Er),dn(pr),gx(),l=u.flags,(l&65536)!==0&&(l&128)===0?(u.flags=l&-65537|128,u):null;case 5:return mx(u),null;case 13:if(dn(yn),l=u.memoizedState,l!==null&&l.dehydrated!==null){if(u.alternate===null)throw Error(n(340));_l()}return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 19:return dn(yn),null;case 4:return Ol(),null;case 10:return ux(u.type._context),null;case 22:case 23:return Yx(),null;case 24:return null;default:return null}}var Ap=!1,vr=!1,lU=typeof WeakSet=="function"?WeakSet:Set,Je=null;function Rl(l,u){var m=l.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(w){Cn(l,u,w)}else m.current=null}function Dx(l,u,m){try{m()}catch(w){Cn(l,u,w)}}var F_=!1;function cU(l,u){if(Yg=Hf,l=gA(),zg(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 M=0,X=-1,te=-1,ge=0,ke=0,Ie=l,Ee=null;t:for(;;){for(var Xe;Ie!==m||A!==0&&Ie.nodeType!==3||(X=M+A),Ie!==k||w!==0&&Ie.nodeType!==3||(te=M+w),Ie.nodeType===3&&(M+=Ie.nodeValue.length),(Xe=Ie.firstChild)!==null;)Ee=Ie,Ie=Xe;for(;;){if(Ie===l)break t;if(Ee===m&&++ge===A&&(X=M),Ee===k&&++ke===w&&(te=M),(Xe=Ie.nextSibling)!==null)break;Ie=Ee,Ee=Ie.parentNode}Ie=Xe}m=X===-1||te===-1?null:{start:X,end:te}}else m=null}m=m||{start:0,end:0}}else m=null;for(Xg={focusedElem:l,selectionRange:m},Hf=!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,kn=nt.memoizedState,he=u.stateNode,ae=he.getSnapshotBeforeUpdate(u.elementType===u.type?at:Ta(u.type,at),kn);he.__reactInternalSnapshotBeforeUpdate=ae}break;case 3:var me=u.stateNode.containerInfo;me.nodeType===1?me.textContent="":me.nodeType===9&&me.documentElement&&me.removeChild(me.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Le){Cn(u,u.return,Le)}if(l=u.sibling,l!==null){l.return=u.return,Je=l;break}Je=u.return}return nt=F_,F_=!1,nt}function zu(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&&Dx(u,m,k)}A=A.next}while(A!==w)}}function _p(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 Lx(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 B_(l){var u=l.alternate;u!==null&&(l.alternate=null,B_(u)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(u=l.stateNode,u!==null&&(delete u[rs],delete u[ku],delete u[ex],delete u[V6],delete u[H6])),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 z_(l){return l.tag===5||l.tag===3||l.tag===4}function U_(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||z_(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 Fx(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=ap));else if(w!==4&&(l=l.child,l!==null))for(Fx(l,u,m),l=l.sibling;l!==null;)Fx(l,u,m),l=l.sibling}function Bx(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(Bx(l,u,m),l=l.sibling;l!==null;)Bx(l,u,m),l=l.sibling}var ar=null,Ra=!1;function Ni(l,u,m){for(m=m.child;m!==null;)q_(l,u,m),m=m.sibling}function q_(l,u,m){if(la&&typeof la.onCommitFiberUnmount=="function")try{la.onCommitFiberUnmount(ks,m)}catch{}switch(m.tag){case 5:vr||Rl(m,u);case 6:var w=ar,A=Ra;ar=null,Ni(l,u,m),ar=w,Ra=A,ar!==null&&(Ra?(l=ar,m=m.stateNode,l.nodeType===8?l.parentNode.removeChild(m):l.removeChild(m)):ar.removeChild(m.stateNode));break;case 18:ar!==null&&(Ra?(l=ar,m=m.stateNode,l.nodeType===8?Zg(l.parentNode,m):l.nodeType===1&&Zg(l,m),yu(l)):Zg(ar,m.stateNode));break;case 4:w=ar,A=Ra,ar=m.stateNode.containerInfo,Ra=!0,Ni(l,u,m),ar=w,Ra=A;break;case 0:case 11:case 14:case 15:if(!vr&&(w=m.updateQueue,w!==null&&(w=w.lastEffect,w!==null))){A=w=w.next;do{var k=A,M=k.destroy;k=k.tag,M!==void 0&&((k&2)!==0||(k&4)!==0)&&Dx(m,u,M),A=A.next}while(A!==w)}Ni(l,u,m);break;case 1:if(!vr&&(Rl(m,u),w=m.stateNode,typeof w.componentWillUnmount=="function"))try{w.props=m.memoizedProps,w.state=m.memoizedState,w.componentWillUnmount()}catch(X){Cn(m,u,X)}Ni(l,u,m);break;case 21:Ni(l,u,m);break;case 22:m.mode&1?(vr=(w=vr)||m.memoizedState!==null,Ni(l,u,m),vr=w):Ni(l,u,m);break;default:Ni(l,u,m)}}function W_(l){var u=l.updateQueue;if(u!==null){l.updateQueue=null;var m=l.stateNode;m===null&&(m=l.stateNode=new lU),u.forEach(function(w){var A=xU.bind(null,l,w);m.has(w)||(m.add(w),w.then(A,A))})}}function Ia(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,M=u,X=M;e:for(;X!==null;){switch(X.tag){case 5:ar=X.stateNode,Ra=!1;break e;case 3:ar=X.stateNode.containerInfo,Ra=!0;break e;case 4:ar=X.stateNode.containerInfo,Ra=!0;break e}X=X.return}if(ar===null)throw Error(n(160));q_(k,M,A),ar=null,Ra=!1;var te=A.alternate;te!==null&&(te.return=null),A.return=null}catch(ge){Cn(A,u,ge)}}if(u.subtreeFlags&12854)for(u=u.child;u!==null;)V_(u,l),u=u.sibling}function V_(l,u){var m=l.alternate,w=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(Ia(u,l),is(l),w&4){try{zu(3,l,l.return),_p(3,l)}catch(at){Cn(l,l.return,at)}try{zu(5,l,l.return)}catch(at){Cn(l,l.return,at)}}break;case 1:Ia(u,l),is(l),w&512&&m!==null&&Rl(m,m.return);break;case 5:if(Ia(u,l),is(l),w&512&&m!==null&&Rl(m,m.return),l.flags&32){var A=l.stateNode;try{et(A,"")}catch(at){Cn(l,l.return,at)}}if(w&4&&(A=l.stateNode,A!=null)){var k=l.memoizedProps,M=m!==null?m.memoizedProps:k,X=l.type,te=l.updateQueue;if(l.updateQueue=null,te!==null)try{X==="input"&&k.type==="radio"&&k.name!=null&&je(A,k),dr(X,M);var ge=dr(X,k);for(M=0;M<te.length;M+=2){var ke=te[M],Ie=te[M+1];ke==="style"?cr(A,Ie):ke==="dangerouslySetInnerHTML"?Fe(A,Ie):ke==="children"?et(A,Ie):N(A,ke,Ie,ge)}switch(X){case"input":Me(A,k);break;case"textarea":It(A,k);break;case"select":var Ee=A._wrapperState.wasMultiple;A._wrapperState.wasMultiple=!!k.multiple;var Xe=k.value;Xe!=null?Pe(A,!!k.multiple,Xe,!1):Ee!==!!k.multiple&&(k.defaultValue!=null?Pe(A,!!k.multiple,k.defaultValue,!0):Pe(A,!!k.multiple,k.multiple?[]:"",!1))}A[ku]=k}catch(at){Cn(l,l.return,at)}}break;case 6:if(Ia(u,l),is(l),w&4){if(l.stateNode===null)throw Error(n(162));A=l.stateNode,k=l.memoizedProps;try{A.nodeValue=k}catch(at){Cn(l,l.return,at)}}break;case 3:if(Ia(u,l),is(l),w&4&&m!==null&&m.memoizedState.isDehydrated)try{yu(u.containerInfo)}catch(at){Cn(l,l.return,at)}break;case 4:Ia(u,l),is(l);break;case 13:Ia(u,l),is(l),A=l.child,A.flags&8192&&(k=A.memoizedState!==null,A.stateNode.isHidden=k,!k||A.alternate!==null&&A.alternate.memoizedState!==null||(qx=cn())),w&4&&W_(l);break;case 22:if(ke=m!==null&&m.memoizedState!==null,l.mode&1?(vr=(ge=vr)||ke,Ia(u,l),vr=ge):Ia(u,l),is(l),w&8192){if(ge=l.memoizedState!==null,(l.stateNode.isHidden=ge)&&!ke&&(l.mode&1)!==0)for(Je=l,ke=l.child;ke!==null;){for(Ie=Je=ke;Je!==null;){switch(Ee=Je,Xe=Ee.child,Ee.tag){case 0:case 11:case 14:case 15:zu(4,Ee,Ee.return);break;case 1:Rl(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){Cn(w,m,at)}}break;case 5:Rl(Ee,Ee.return);break;case 22:if(Ee.memoizedState!==null){G_(Ie);continue}}Xe!==null?(Xe.return=Ee,Je=Xe):G_(Ie)}ke=ke.sibling}e:for(ke=null,Ie=l;;){if(Ie.tag===5){if(ke===null){ke=Ie;try{A=Ie.stateNode,ge?(k=A.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none"):(X=Ie.stateNode,te=Ie.memoizedProps.style,M=te!=null&&te.hasOwnProperty("display")?te.display:null,X.style.display=xn("display",M))}catch(at){Cn(l,l.return,at)}}}else if(Ie.tag===6){if(ke===null)try{Ie.stateNode.nodeValue=ge?"":Ie.memoizedProps}catch(at){Cn(l,l.return,at)}}else if((Ie.tag!==22&&Ie.tag!==23||Ie.memoizedState===null||Ie===l)&&Ie.child!==null){Ie.child.return=Ie,Ie=Ie.child;continue}if(Ie===l)break e;for(;Ie.sibling===null;){if(Ie.return===null||Ie.return===l)break e;ke===Ie&&(ke=null),Ie=Ie.return}ke===Ie&&(ke=null),Ie.sibling.return=Ie.return,Ie=Ie.sibling}}break;case 19:Ia(u,l),is(l),w&4&&W_(l);break;case 21:break;default:Ia(u,l),is(l)}}function is(l){var u=l.flags;if(u&2){try{e:{for(var m=l.return;m!==null;){if(z_(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&&(et(A,""),w.flags&=-33);var k=U_(l);Bx(l,k,A);break;case 3:case 4:var M=w.stateNode.containerInfo,X=U_(l);Fx(l,X,M);break;default:throw Error(n(161))}}catch(te){Cn(l,l.return,te)}l.flags&=-3}u&4096&&(l.flags&=-4097)}function uU(l,u,m){Je=l,H_(l)}function H_(l,u,m){for(var w=(l.mode&1)!==0;Je!==null;){var A=Je,k=A.child;if(A.tag===22&&w){var M=A.memoizedState!==null||Ap;if(!M){var X=A.alternate,te=X!==null&&X.memoizedState!==null||vr;X=Ap;var ge=vr;if(Ap=M,(vr=te)&&!ge)for(Je=A;Je!==null;)M=Je,te=M.child,M.tag===22&&M.memoizedState!==null?Y_(A):te!==null?(te.return=M,Je=te):Y_(A);for(;k!==null;)Je=k,H_(k),k=k.sibling;Je=A,Ap=X,vr=ge}K_(l)}else(A.subtreeFlags&8772)!==0&&k!==null?(k.return=A,Je=k):K_(l)}}function K_(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:vr||_p(5,u);break;case 1:var w=u.stateNode;if(u.flags&4&&!vr)if(m===null)w.componentDidMount();else{var A=u.elementType===u.type?m.memoizedProps:Ta(u.type,m.memoizedProps);w.componentDidUpdate(A,m.memoizedState,w.__reactInternalSnapshotBeforeUpdate)}var k=u.updateQueue;k!==null&&GA(u,k,w);break;case 3:var M=u.updateQueue;if(M!==null){if(m=null,u.child!==null)switch(u.child.tag){case 5:m=u.child.stateNode;break;case 1:m=u.child.stateNode}GA(u,M,m)}break;case 5:var X=u.stateNode;if(m===null&&u.flags&4){m=X;var te=u.memoizedProps;switch(u.type){case"button":case"input":case"select":case"textarea":te.autoFocus&&m.focus();break;case"img":te.src&&(m.src=te.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(u.memoizedState===null){var ge=u.alternate;if(ge!==null){var ke=ge.memoizedState;if(ke!==null){var Ie=ke.dehydrated;Ie!==null&&yu(Ie)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}vr||u.flags&512&&Lx(u)}catch(Ee){Cn(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 G_(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 Y_(l){for(;Je!==null;){var u=Je;try{switch(u.tag){case 0:case 11:case 15:var m=u.return;try{_p(4,u)}catch(te){Cn(u,m,te)}break;case 1:var w=u.stateNode;if(typeof w.componentDidMount=="function"){var A=u.return;try{w.componentDidMount()}catch(te){Cn(u,A,te)}}var k=u.return;try{Lx(u)}catch(te){Cn(u,k,te)}break;case 5:var M=u.return;try{Lx(u)}catch(te){Cn(u,M,te)}}}catch(te){Cn(u,u.return,te)}if(u===l){Je=null;break}var X=u.sibling;if(X!==null){X.return=u.return,Je=X;break}Je=u.return}}var dU=Math.ceil,Ep=E.ReactCurrentDispatcher,zx=E.ReactCurrentOwner,ha=E.ReactCurrentBatchConfig,Bt=0,Jn=null,Rn=null,sr=0,Yr=0,Il=yi(0),Fn=0,Uu=null,fo=0,Pp=0,Ux=0,qu=null,Or=null,qx=0,Ml=1/0,Ls=null,kp=!1,Wx=null,Ci=null,Op=!1,Ai=null,Tp=0,Wu=0,Vx=null,Rp=-1,Ip=0;function yr(){return(Bt&6)!==0?cn():Rp!==-1?Rp:Rp=cn()}function _i(l){return(l.mode&1)===0?1:(Bt&2)!==0&&sr!==0?sr&-sr:G6.transition!==null?(Ip===0&&(Ip=dt()),Ip):(l=zt,l!==0||(l=window.event,l=l===void 0?16:QC(l.type)),l)}function Ma(l,u,m,w){if(50<Wu)throw Wu=0,Vx=null,Error(n(185));Dn(l,m,w),((Bt&2)===0||l!==Jn)&&(l===Jn&&((Bt&2)===0&&(Pp|=m),Fn===4&&Ei(l,sr)),Tr(l,w),m===1&&Bt===0&&(u.mode&1)===0&&(Ml=cn()+500,lp&&wi()))}function Tr(l,u){var m=l.callbackNode;$e(l,u);var w=be(l,l===Jn?sr:0);if(w===0)m!==null&&Vt(m),l.callbackNode=null,l.callbackPriority=0;else if(u=w&-w,l.callbackPriority!==u){if(m!=null&&Vt(m),u===1)l.tag===0?K6(Q_.bind(null,l)):$A(Q_.bind(null,l)),q6(function(){(Bt&6)===0&&wi()}),m=null;else{switch(qf(w)){case 1:m=dl;break;case 4:m=Bf;break;case 16:m=di;break;case 536870912:m=hu;break;default:m=di}m=sE(m,X_.bind(null,l))}l.callbackPriority=u,l.callbackNode=m}}function X_(l,u){if(Rp=-1,Ip=0,(Bt&6)!==0)throw Error(n(327));var m=l.callbackNode;if($l()&&l.callbackNode!==m)return null;var w=be(l,l===Jn?sr:0);if(w===0)return null;if((w&30)!==0||(w&l.expiredLanes)!==0||u)u=Mp(l,w);else{u=w;var A=Bt;Bt|=2;var k=Z_();(Jn!==l||sr!==u)&&(Ls=null,Ml=cn()+500,ho(l,u));do try{hU();break}catch(X){J_(l,X)}while(!0);cx(),Ep.current=k,Bt=A,Rn!==null?u=0:(Jn=null,sr=0,u=Fn)}if(u!==0){if(u===2&&(A=kt(l),A!==0&&(w=A,u=Hx(l,A))),u===1)throw m=Uu,ho(l,0),Ei(l,w),Tr(l,cn()),m;if(u===6)Ei(l,w);else{if(A=l.current.alternate,(w&30)===0&&!fU(A)&&(u=Mp(l,w),u===2&&(k=kt(l),k!==0&&(w=k,u=Hx(l,k))),u===1))throw m=Uu,ho(l,0),Ei(l,w),Tr(l,cn()),m;switch(l.finishedWork=A,l.finishedLanes=w,u){case 0:case 1:throw Error(n(345));case 2:mo(l,Or,Ls);break;case 3:if(Ei(l,w),(w&130023424)===w&&(u=qx+500-cn(),10<u)){if(be(l,0)!==0)break;if(A=l.suspendedLanes,(A&w)!==w){yr(),l.pingedLanes|=l.suspendedLanes&A;break}l.timeoutHandle=Jg(mo.bind(null,l,Or,Ls),u);break}mo(l,Or,Ls);break;case 4:if(Ei(l,w),(w&4194240)===w)break;for(u=l.eventTimes,A=-1;0<w;){var M=31-Vr(w);k=1<<M,M=u[M],M>A&&(A=M),w&=~k}if(w=A,w=cn()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*dU(w/1960))-w,10<w){l.timeoutHandle=Jg(mo.bind(null,l,Or,Ls),w);break}mo(l,Or,Ls);break;case 5:mo(l,Or,Ls);break;default:throw Error(n(329))}}}return Tr(l,cn()),l.callbackNode===m?X_.bind(null,l):null}function Hx(l,u){var m=qu;return l.current.memoizedState.isDehydrated&&(ho(l,u).flags|=256),l=Mp(l,u),l!==2&&(u=Or,Or=m,u!==null&&Kx(u)),l}function Kx(l){Or===null?Or=l:Or.push.apply(Or,l)}function fU(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(!ka(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 Ei(l,u){for(u&=~Ux,u&=~Pp,l.suspendedLanes|=u,l.pingedLanes&=~u,l=l.expirationTimes;0<u;){var m=31-Vr(u),w=1<<m;l[m]=-1,u&=~w}}function Q_(l){if((Bt&6)!==0)throw Error(n(327));$l();var u=be(l,0);if((u&1)===0)return Tr(l,cn()),null;var m=Mp(l,u);if(l.tag!==0&&m===2){var w=kt(l);w!==0&&(u=w,m=Hx(l,w))}if(m===1)throw m=Uu,ho(l,0),Ei(l,u),Tr(l,cn()),m;if(m===6)throw Error(n(345));return l.finishedWork=l.current.alternate,l.finishedLanes=u,mo(l,Or,Ls),Tr(l,cn()),null}function Gx(l,u){var m=Bt;Bt|=1;try{return l(u)}finally{Bt=m,Bt===0&&(Ml=cn()+500,lp&&wi())}}function po(l){Ai!==null&&Ai.tag===0&&(Bt&6)===0&&$l();var u=Bt;Bt|=1;var m=ha.transition,w=zt;try{if(ha.transition=null,zt=1,l)return l()}finally{zt=w,ha.transition=m,Bt=u,(Bt&6)===0&&wi()}}function Yx(){Yr=Il.current,dn(Il)}function ho(l,u){l.finishedWork=null,l.finishedLanes=0;var m=l.timeoutHandle;if(m!==-1&&(l.timeoutHandle=-1,U6(m)),Rn!==null)for(m=Rn.return;m!==null;){var w=m;switch(ax(w),w.tag){case 1:w=w.type.childContextTypes,w!=null&&ip();break;case 3:Ol(),dn(Er),dn(pr),gx();break;case 5:mx(w);break;case 4:Ol();break;case 13:dn(yn);break;case 19:dn(yn);break;case 10:ux(w.type._context);break;case 22:case 23:Yx()}m=m.return}if(Jn=l,Rn=l=Pi(l.current,null),sr=Yr=u,Fn=0,Uu=null,Ux=Pp=fo=0,Or=qu=null,lo!==null){for(u=0;u<lo.length;u++)if(m=lo[u],w=m.interleaved,w!==null){m.interleaved=null;var A=w.next,k=m.pending;if(k!==null){var M=k.next;k.next=A,w.next=M}m.pending=w}lo=null}return l}function J_(l,u){do{var m=Rn;try{if(cx(),xp.current=jp,yp){for(var w=bn.memoizedState;w!==null;){var A=w.queue;A!==null&&(A.pending=null),w=w.next}yp=!1}if(uo=0,Qn=Ln=bn=null,$u=!1,Du=0,zx.current=null,m===null||m.return===null){Fn=1,Uu=u,Rn=null;break}e:{var k=l,M=m.return,X=m,te=u;if(u=sr,X.flags|=32768,te!==null&&typeof te=="object"&&typeof te.then=="function"){var ge=te,ke=X,Ie=ke.tag;if((ke.mode&1)===0&&(Ie===0||Ie===11||Ie===15)){var Ee=ke.alternate;Ee?(ke.updateQueue=Ee.updateQueue,ke.memoizedState=Ee.memoizedState,ke.lanes=Ee.lanes):(ke.updateQueue=null,ke.memoizedState=null)}var Xe=S_(M);if(Xe!==null){Xe.flags&=-257,N_(Xe,M,X,k,u),Xe.mode&1&&j_(k,ge,u),u=Xe,te=ge;var nt=u.updateQueue;if(nt===null){var at=new Set;at.add(te),u.updateQueue=at}else nt.add(te);break e}else{if((u&1)===0){j_(k,ge,u),Xx();break e}te=Error(n(426))}}else if(hn&&X.mode&1){var kn=S_(M);if(kn!==null){(kn.flags&65536)===0&&(kn.flags|=256),N_(kn,M,X,k,u),ox(Tl(te,X));break e}}k=te=Tl(te,X),Fn!==4&&(Fn=2),qu===null?qu=[k]:qu.push(k),k=M;do{switch(k.tag){case 3:k.flags|=65536,u&=-u,k.lanes|=u;var he=b_(k,te,u);KA(k,he);break e;case 1:X=te;var ae=k.type,me=k.stateNode;if((k.flags&128)===0&&(typeof ae.getDerivedStateFromError=="function"||me!==null&&typeof me.componentDidCatch=="function"&&(Ci===null||!Ci.has(me)))){k.flags|=65536,u&=-u,k.lanes|=u;var Le=w_(k,X,u);KA(k,Le);break e}}k=k.return}while(k!==null)}tE(m)}catch(ot){u=ot,Rn===m&&m!==null&&(Rn=m=m.return);continue}break}while(!0)}function Z_(){var l=Ep.current;return Ep.current=jp,l===null?jp:l}function Xx(){(Fn===0||Fn===3||Fn===2)&&(Fn=4),Jn===null||(fo&268435455)===0&&(Pp&268435455)===0||Ei(Jn,sr)}function Mp(l,u){var m=Bt;Bt|=2;var w=Z_();(Jn!==l||sr!==u)&&(Ls=null,ho(l,u));do try{pU();break}catch(A){J_(l,A)}while(!0);if(cx(),Bt=m,Ep.current=w,Rn!==null)throw Error(n(261));return Jn=null,sr=0,Fn}function pU(){for(;Rn!==null;)eE(Rn)}function hU(){for(;Rn!==null&&!Ft();)eE(Rn)}function eE(l){var u=aE(l.alternate,l,Yr);l.memoizedProps=l.pendingProps,u===null?tE(l):Rn=u,zx.current=null}function tE(l){var u=l;do{var m=u.alternate;if(l=u.return,(u.flags&32768)===0){if(m=iU(m,u,Yr),m!==null){Rn=m;return}}else{if(m=oU(m,u),m!==null){m.flags&=32767,Rn=m;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{Fn=6,Rn=null;return}}if(u=u.sibling,u!==null){Rn=u;return}Rn=u=l}while(u!==null);Fn===0&&(Fn=5)}function mo(l,u,m){var w=zt,A=ha.transition;try{ha.transition=null,zt=1,mU(l,u,m,w)}finally{ha.transition=A,zt=w}return null}function mU(l,u,m,w){do $l();while(Ai!==null);if((Bt&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(Qt(l,k),l===Jn&&(Rn=Jn=null,sr=0),(m.subtreeFlags&2064)===0&&(m.flags&2064)===0||Op||(Op=!0,sE(di,function(){return $l(),null})),k=(m.flags&15990)!==0,(m.subtreeFlags&15990)!==0||k){k=ha.transition,ha.transition=null;var M=zt;zt=1;var X=Bt;Bt|=4,zx.current=null,cU(l,m),V_(m,l),M6(Xg),Hf=!!Yg,Xg=Yg=null,l.current=m,uU(m),Pn(),Bt=X,zt=M,ha.transition=k}else l.current=m;if(Op&&(Op=!1,Ai=l,Tp=A),k=l.pendingLanes,k===0&&(Ci=null),Cg(m.stateNode),Tr(l,cn()),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(kp)throw kp=!1,l=Wx,Wx=null,l;return(Tp&1)!==0&&l.tag!==0&&$l(),k=l.pendingLanes,(k&1)!==0?l===Vx?Wu++:(Wu=0,Vx=l):Wu=0,wi(),null}function $l(){if(Ai!==null){var l=qf(Tp),u=ha.transition,m=zt;try{if(ha.transition=null,zt=16>l?16:l,Ai===null)var w=!1;else{if(l=Ai,Ai=null,Tp=0,(Bt&6)!==0)throw Error(n(331));var A=Bt;for(Bt|=4,Je=l.current;Je!==null;){var k=Je,M=k.child;if((Je.flags&16)!==0){var X=k.deletions;if(X!==null){for(var te=0;te<X.length;te++){var ge=X[te];for(Je=ge;Je!==null;){var ke=Je;switch(ke.tag){case 0:case 11:case 15:zu(8,ke,k)}var Ie=ke.child;if(Ie!==null)Ie.return=ke,Je=Ie;else for(;Je!==null;){ke=Je;var Ee=ke.sibling,Xe=ke.return;if(B_(ke),ke===ge){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 kn=at.sibling;at.sibling=null,at=kn}while(at!==null)}}Je=k}}if((k.subtreeFlags&2064)!==0&&M!==null)M.return=k,Je=M;else e:for(;Je!==null;){if(k=Je,(k.flags&2048)!==0)switch(k.tag){case 0:case 11:case 15:zu(9,k,k.return)}var he=k.sibling;if(he!==null){he.return=k.return,Je=he;break e}Je=k.return}}var ae=l.current;for(Je=ae;Je!==null;){M=Je;var me=M.child;if((M.subtreeFlags&2064)!==0&&me!==null)me.return=M,Je=me;else e:for(M=ae;Je!==null;){if(X=Je,(X.flags&2048)!==0)try{switch(X.tag){case 0:case 11:case 15:_p(9,X)}}catch(ot){Cn(X,X.return,ot)}if(X===M){Je=null;break e}var Le=X.sibling;if(Le!==null){Le.return=X.return,Je=Le;break e}Je=X.return}}if(Bt=A,wi(),la&&typeof la.onPostCommitFiberRoot=="function")try{la.onPostCommitFiberRoot(ks,l)}catch{}w=!0}return w}finally{zt=m,ha.transition=u}}return!1}function nE(l,u,m){u=Tl(m,u),u=b_(l,u,1),l=Si(l,u,1),u=yr(),l!==null&&(Dn(l,1,u),Tr(l,u))}function Cn(l,u,m){if(l.tag===3)nE(l,l,m);else for(;u!==null;){if(u.tag===3){nE(u,l,m);break}else if(u.tag===1){var w=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(Ci===null||!Ci.has(w))){l=Tl(m,l),l=w_(u,l,1),u=Si(u,l,1),l=yr(),u!==null&&(Dn(u,1,l),Tr(u,l));break}}u=u.return}}function vU(l,u,m){var w=l.pingCache;w!==null&&w.delete(u),u=yr(),l.pingedLanes|=l.suspendedLanes&m,Jn===l&&(sr&m)===m&&(Fn===4||Fn===3&&(sr&130023424)===sr&&500>cn()-qx?ho(l,0):Ux|=m),Tr(l,u)}function rE(l,u){u===0&&((l.mode&1)===0?u=1:(u=pl,pl<<=1,(pl&130023424)===0&&(pl=4194304)));var m=yr();l=Ms(l,u),l!==null&&(Dn(l,u,m),Tr(l,m))}function gU(l){var u=l.memoizedState,m=0;u!==null&&(m=u.retryLane),rE(l,m)}function xU(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),rE(l,m)}var aE;aE=function(l,u,m){if(l!==null)if(l.memoizedProps!==u.pendingProps||Er.current)kr=!0;else{if((l.lanes&m)===0&&(u.flags&128)===0)return kr=!1,sU(l,u,m);kr=(l.flags&131072)!==0}else kr=!1,hn&&(u.flags&1048576)!==0&&DA(u,up,u.index);switch(u.lanes=0,u.tag){case 2:var w=u.type;Cp(l,u),l=u.pendingProps;var A=Nl(u,pr.current);kl(u,m),A=bx(null,u,w,l,A,m);var k=wx();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,Pr(w)?(k=!0,op(u)):k=!1,u.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,px(u),A.updater=Sp,u.stateNode=A,A._reactInternals=u,_x(u,w,l,m),u=Ox(null,u,w,!0,k,m)):(u.tag=0,hn&&k&&rx(u),xr(null,u,A,m),u=u.child),u;case 16:w=u.elementType;e:{switch(Cp(l,u),l=u.pendingProps,A=w._init,w=A(w._payload),u.type=w,A=u.tag=bU(w),l=Ta(w,l),A){case 0:u=kx(null,u,w,l,m);break e;case 1:u=k_(null,u,w,l,m);break e;case 11:u=C_(null,u,w,l,m);break e;case 14:u=A_(null,u,w,Ta(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:Ta(w,A),kx(l,u,w,A,m);case 1:return w=u.type,A=u.pendingProps,A=u.elementType===w?A:Ta(w,A),k_(l,u,w,A,m);case 3:e:{if(O_(u),l===null)throw Error(n(387));w=u.pendingProps,k=u.memoizedState,A=k.element,HA(l,u),vp(u,w,null,m);var M=u.memoizedState;if(w=M.element,k.isDehydrated)if(k={element:w,isDehydrated:!1,cache:M.cache,pendingSuspenseBoundaries:M.pendingSuspenseBoundaries,transitions:M.transitions},u.updateQueue.baseState=k,u.memoizedState=k,u.flags&256){A=Tl(Error(n(423)),u),u=T_(l,u,w,m,A);break e}else if(w!==A){A=Tl(Error(n(424)),u),u=T_(l,u,w,m,A);break e}else for(Gr=xi(u.stateNode.containerInfo.firstChild),Kr=u,hn=!0,Oa=null,m=WA(u,null,w,m),u.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(_l(),w===A){u=Ds(l,u,m);break e}xr(l,u,w,m)}u=u.child}return u;case 5:return YA(u),l===null&&ix(u),w=u.type,A=u.pendingProps,k=l!==null?l.memoizedProps:null,M=A.children,Qg(w,A)?M=null:k!==null&&Qg(w,k)&&(u.flags|=32),P_(l,u),xr(l,u,M,m),u.child;case 6:return l===null&&ix(u),null;case 13:return R_(l,u,m);case 4:return hx(u,u.stateNode.containerInfo),w=u.pendingProps,l===null?u.child=El(u,null,w,m):xr(l,u,w,m),u.child;case 11:return w=u.type,A=u.pendingProps,A=u.elementType===w?A:Ta(w,A),C_(l,u,w,A,m);case 7:return xr(l,u,u.pendingProps,m),u.child;case 8:return xr(l,u,u.pendingProps.children,m),u.child;case 12:return xr(l,u,u.pendingProps.children,m),u.child;case 10:e:{if(w=u.type._context,A=u.pendingProps,k=u.memoizedProps,M=A.value,rn(pp,w._currentValue),w._currentValue=M,k!==null)if(ka(k.value,M)){if(k.children===A.children&&!Er.current){u=Ds(l,u,m);break e}}else for(k=u.child,k!==null&&(k.return=u);k!==null;){var X=k.dependencies;if(X!==null){M=k.child;for(var te=X.firstContext;te!==null;){if(te.context===w){if(k.tag===1){te=$s(-1,m&-m),te.tag=2;var ge=k.updateQueue;if(ge!==null){ge=ge.shared;var ke=ge.pending;ke===null?te.next=te:(te.next=ke.next,ke.next=te),ge.pending=te}}k.lanes|=m,te=k.alternate,te!==null&&(te.lanes|=m),dx(k.return,m,u),X.lanes|=m;break}te=te.next}}else if(k.tag===10)M=k.type===u.type?null:k.child;else if(k.tag===18){if(M=k.return,M===null)throw Error(n(341));M.lanes|=m,X=M.alternate,X!==null&&(X.lanes|=m),dx(M,m,u),M=k.sibling}else M=k.child;if(M!==null)M.return=k;else for(M=k;M!==null;){if(M===u){M=null;break}if(k=M.sibling,k!==null){k.return=M.return,M=k;break}M=M.return}k=M}xr(l,u,A.children,m),u=u.child}return u;case 9:return A=u.type,w=u.pendingProps.children,kl(u,m),A=fa(A),w=w(A),u.flags|=1,xr(l,u,w,m),u.child;case 14:return w=u.type,A=Ta(w,u.pendingProps),A=Ta(w.type,A),A_(l,u,w,A,m);case 15:return __(l,u,u.type,u.pendingProps,m);case 17:return w=u.type,A=u.pendingProps,A=u.elementType===w?A:Ta(w,A),Cp(l,u),u.tag=1,Pr(w)?(l=!0,op(u)):l=!1,kl(u,m),x_(u,w,A),_x(u,w,A,m),Ox(null,u,w,!0,l,m);case 19:return M_(l,u,m);case 22:return E_(l,u,m)}throw Error(n(156,u.tag))};function sE(l,u){return He(l,u)}function yU(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 ma(l,u,m,w){return new yU(l,u,m,w)}function Qx(l){return l=l.prototype,!(!l||!l.isReactComponent)}function bU(l){if(typeof l=="function")return Qx(l)?1:0;if(l!=null){if(l=l.$$typeof,l===$)return 11;if(l===q)return 14}return 2}function Pi(l,u){var m=l.alternate;return m===null?(m=ma(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 $p(l,u,m,w,A,k){var M=2;if(w=l,typeof l=="function")Qx(l)&&(M=1);else if(typeof l=="string")M=5;else e:switch(l){case O:return vo(m.children,A,k,u);case T:M=8,A|=8;break;case R:return l=ma(12,m,u,A|2),l.elementType=R,l.lanes=k,l;case H:return l=ma(13,m,u,A),l.elementType=H,l.lanes=k,l;case F:return l=ma(19,m,u,A),l.elementType=F,l.lanes=k,l;case J:return Dp(m,A,k,u);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case I:M=10;break e;case D:M=9;break e;case $:M=11;break e;case q:M=14;break e;case Q:M=16,w=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return u=ma(M,m,u,A),u.elementType=l,u.type=w,u.lanes=k,u}function vo(l,u,m,w){return l=ma(7,l,w,u),l.lanes=m,l}function Dp(l,u,m,w){return l=ma(22,l,w,u),l.elementType=J,l.lanes=m,l.stateNode={isHidden:!1},l}function Jx(l,u,m){return l=ma(6,l,null,u),l.lanes=m,l}function Zx(l,u,m){return u=ma(4,l.children!==null?l.children:[],l.key,u),u.lanes=m,u.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},u}function wU(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=Ht(0),this.expirationTimes=Ht(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ht(0),this.identifierPrefix=w,this.onRecoverableError=A,this.mutableSourceEagerHydrationData=null}function ey(l,u,m,w,A,k,M,X,te){return l=new wU(l,u,m,X,te),u===1?(u=1,k===!0&&(u|=8)):u=0,k=ma(3,null,null,u),l.current=k,k.stateNode=l,k.memoizedState={element:w,isDehydrated:m,cache:null,transitions:null,pendingSuspenseBoundaries:null},px(k),l}function jU(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 iE(l){if(!l)return bi;l=l._reactInternals;e:{if(Ve(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(Pr(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(Pr(m))return IA(l,m,u)}return u}function oE(l,u,m,w,A,k,M,X,te){return l=ey(m,w,!0,l,A,k,M,X,te),l.context=iE(null),m=l.current,w=yr(),A=_i(m),k=$s(w,A),k.callback=u??null,Si(m,k,A),l.current.lanes=A,Dn(l,A,w),Tr(l,w),l}function Lp(l,u,m,w){var A=u.current,k=yr(),M=_i(A);return m=iE(m),u.context===null?u.context=m:u.pendingContext=m,u=$s(k,M),u.payload={element:l},w=w===void 0?null:w,w!==null&&(u.callback=w),l=Si(A,u,M),l!==null&&(Ma(l,A,M,k),mp(l,A,M)),M}function Fp(l){return l=l.current,l.child?(l.child.tag===5,l.child.stateNode):null}function lE(l,u){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var m=l.retryLane;l.retryLane=m!==0&&m<u?m:u}}function ty(l,u){lE(l,u),(l=l.alternate)&&lE(l,u)}function SU(){return null}var cE=typeof reportError=="function"?reportError:function(l){console.error(l)};function ny(l){this._internalRoot=l}Bp.prototype.render=ny.prototype.render=function(l){var u=this._internalRoot;if(u===null)throw Error(n(409));Lp(l,u,null,null)},Bp.prototype.unmount=ny.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var u=l.containerInfo;po(function(){Lp(null,l,null,null)}),u[Os]=null}};function Bp(l){this._internalRoot=l}Bp.prototype.unstable_scheduleHydration=function(l){if(l){var u=HC();l={blockedOn:null,target:l,priority:u};for(var m=0;m<mi.length&&u!==0&&u<mi[m].priority;m++);mi.splice(m,0,l),m===0&&YC(l)}};function ry(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function zp(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function uE(){}function NU(l,u,m,w,A){if(A){if(typeof w=="function"){var k=w;w=function(){var ge=Fp(M);k.call(ge)}}var M=oE(u,w,l,0,null,!1,!1,"",uE);return l._reactRootContainer=M,l[Os]=M.current,Eu(l.nodeType===8?l.parentNode:l),po(),M}for(;A=l.lastChild;)l.removeChild(A);if(typeof w=="function"){var X=w;w=function(){var ge=Fp(te);X.call(ge)}}var te=ey(l,0,!1,null,null,!1,!1,"",uE);return l._reactRootContainer=te,l[Os]=te.current,Eu(l.nodeType===8?l.parentNode:l),po(function(){Lp(u,te,m,w)}),te}function Up(l,u,m,w,A){var k=m._reactRootContainer;if(k){var M=k;if(typeof A=="function"){var X=A;A=function(){var te=Fp(M);X.call(te)}}Lp(u,M,l,A)}else M=NU(m,u,l,A,w);return Fp(M)}hl=function(l){switch(l.tag){case 3:var u=l.stateNode;if(u.current.memoizedState.isDehydrated){var m=V(u.pendingLanes);m!==0&&(ca(u,m|1),Tr(u,cn()),(Bt&6)===0&&(Ml=cn()+500,wi()))}break;case 13:po(function(){var w=Ms(l,1);if(w!==null){var A=yr();Ma(w,l,1,A)}}),ty(l,1)}},Eg=function(l){if(l.tag===13){var u=Ms(l,134217728);if(u!==null){var m=yr();Ma(u,l,134217728,m)}ty(l,134217728)}},VC=function(l){if(l.tag===13){var u=_i(l),m=Ms(l,u);if(m!==null){var w=yr();Ma(m,l,u,w)}ty(l,u)}},HC=function(){return zt},KC=function(l,u){var m=zt;try{return zt=l,u()}finally{zt=m}},qr=function(l,u,m){switch(u){case"input":if(Me(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=sp(w);if(!A)throw Error(n(90));re(w),Me(w,A)}}}break;case"textarea":It(l,m);break;case"select":u=m.value,u!=null&&Pe(l,!!m.multiple,u,!1)}},st=Gx,yt=po;var CU={usingClientEntryPoint:!1,Events:[Ou,jl,sp,pe,De,Gx]},Vu={findFiberByHostInstance:ao,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},AU={bundleType:Vu.bundleType,version:Vu.version,rendererPackageName:Vu.rendererPackageName,rendererConfig:Vu.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=Tt(l),l===null?null:l.stateNode},findFiberByHostInstance:Vu.findFiberByHostInstance||SU,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 qp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qp.isDisabled&&qp.supportsFiber)try{ks=qp.inject(AU),la=qp}catch{}}return Rr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=CU,Rr.createPortal=function(l,u){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ry(u))throw Error(n(200));return jU(l,u,null,m)},Rr.createRoot=function(l,u){if(!ry(l))throw Error(n(299));var m=!1,w="",A=cE;return u!=null&&(u.unstable_strictMode===!0&&(m=!0),u.identifierPrefix!==void 0&&(w=u.identifierPrefix),u.onRecoverableError!==void 0&&(A=u.onRecoverableError)),u=ey(l,1,!1,null,null,m,!1,w,A),l[Os]=u.current,Eu(l.nodeType===8?l.parentNode:l),new ny(u)},Rr.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=Tt(u),l=l===null?null:l.stateNode,l},Rr.flushSync=function(l){return po(l)},Rr.hydrate=function(l,u,m){if(!zp(u))throw Error(n(200));return Up(null,l,u,!0,m)},Rr.hydrateRoot=function(l,u,m){if(!ry(l))throw Error(n(405));var w=m!=null&&m.hydratedSources||null,A=!1,k="",M=cE;if(m!=null&&(m.unstable_strictMode===!0&&(A=!0),m.identifierPrefix!==void 0&&(k=m.identifierPrefix),m.onRecoverableError!==void 0&&(M=m.onRecoverableError)),u=oE(u,null,l,1,m??null,A,!1,k,M),l[Os]=u.current,Eu(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 Bp(u)},Rr.render=function(l,u,m){if(!zp(u))throw Error(n(200));return Up(null,l,u,!1,m)},Rr.unmountComponentAtNode=function(l){if(!zp(l))throw Error(n(40));return l._reactRootContainer?(po(function(){Up(null,null,l,!1,function(){l._reactRootContainer=null,l[Os]=null})}),!0):!1},Rr.unstable_batchedUpdates=Gx,Rr.unstable_renderSubtreeIntoContainer=function(l,u,m,w){if(!zp(m))throw Error(n(200));if(l==null||l._reactInternals===void 0)throw Error(n(38));return Up(l,u,m,!1,w)},Rr.version="18.3.1-next-f1338f8080-20240426",Rr}var xE;function GM(){if(xE)return iy.exports;xE=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),iy.exports=IU(),iy.exports}var yE;function MU(){if(yE)return Vp;yE=1;var e=GM();return Vp.createRoot=e.createRoot,Vp.hydrateRoot=e.hydrateRoot,Vp}var $U=MU(),v=qS();const W=Yt(v),Vm=EU({__proto__:null,default:W},[v]),DU=1,LU=1e6;let cy=0;function FU(){return cy=(cy+1)%Number.MAX_SAFE_INTEGER,cy.toString()}const uy=new Map,bE=e=>{if(uy.has(e))return;const t=setTimeout(()=>{uy.delete(e),dd({type:"REMOVE_TOAST",toastId:e})},LU);uy.set(e,t)},BU=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,DU)};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?bE(n):e.toasts.forEach(r=>{bE(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)}}},gh=[];let xh={toasts:[]};function dd(e){xh=BU(xh,e),gh.forEach(t=>{t(xh)})}function Oe({...e}){const t=FU(),n=a=>dd({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>dd({type:"DISMISS_TOAST",toastId:t});return dd({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}}function zU(){const[e,t]=v.useState(xh);return v.useEffect(()=>(gh.push(t),()=>{const n=gh.indexOf(t);n>-1&&gh.splice(n,1)}),[e]),{...e,toast:Oe,dismiss:n=>dd({type:"DISMISS_TOAST",toastId:n})}}var Kc=GM();const YM=Yt(Kc);function Re(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),n===!1||!a.defaultPrevented)return t?.(a)}}function wE(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Cr(...e){return t=>{let n=!1;const r=e.map(a=>{const i=wE(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():wE(e[a],null)}}}}function vt(...e){return v.useCallback(Cr(...e),e)}function UU(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 lr(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,qU(a,...t)]}function qU(...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 jE(e){const t=WU(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(HU);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 WU(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=GU(a),c=KU(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Cr(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 VU=Symbol("radix.slottable");function HU(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===VU}function KU(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 GU(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 hf(e){const t=e+"CollectionProvider",[n,r]=lr(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=b=>{const{scope:y,children:S}=b,C=W.useRef(null),N=W.useRef(new Map).current;return s.jsx(a,{scope:y,itemMap:N,collectionRef:C,children:S})};o.displayName=t;const c=e+"CollectionSlot",d=jE(c),f=W.forwardRef((b,y)=>{const{scope:S,children:C}=b,N=i(c,S),E=vt(y,N.collectionRef);return s.jsx(d,{ref:E,children:C})});f.displayName=c;const h=e+"CollectionItemSlot",p="data-radix-collection-item",x=jE(h),g=W.forwardRef((b,y)=>{const{scope:S,children:C,...N}=b,E=W.useRef(null),_=vt(y,E),P=i(h,S);return W.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 W.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 YU(e){const t=XU(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(JU);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 XU(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=e7(a),c=ZU(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Cr(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 QU=Symbol("radix.slottable");function JU(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===QU}function ZU(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 e7(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 t7=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ke=t7.reduce((e,t)=>{const n=YU(`Primitive.${t}`),r=v.forwardRef((a,i)=>{const{asChild:o,...c}=a,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function WS(e,t){e&&Kc.flushSync(()=>e.dispatchEvent(t))}function On(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>t.current?.(...n),[])}function n7(e,t=globalThis?.document){const n=On(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 r7="DismissableLayer",Lj="dismissableLayer.update",a7="dismissableLayer.pointerDownOutside",s7="dismissableLayer.focusOutside",SE,XM=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Jo=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:c,...d}=e,f=v.useContext(XM),[h,p]=v.useState(null),x=h?.ownerDocument??globalThis?.document,[,g]=v.useState({}),j=vt(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,_=o7(O=>{const T=O.target,R=[...f.branches].some(I=>I.contains(T));!E||R||(a?.(O),o?.(O),O.defaultPrevented||c?.())},x),P=l7(O=>{const T=O.target;[...f.branches].some(I=>I.contains(T))||(i?.(O),o?.(O),O.defaultPrevented||c?.())},x);return n7(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&&(SE=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),NE(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=SE)}},[h,x,n,f]),v.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),NE())},[h,f]),v.useEffect(()=>{const O=()=>g({});return document.addEventListener(Lj,O),()=>document.removeEventListener(Lj,O)},[]),s.jsx(Ke.div,{...d,ref:j,style:{pointerEvents:N?E?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,P.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,_.onPointerDownCapture)})});Jo.displayName=r7;var i7="DismissableLayerBranch",QM=v.forwardRef((e,t)=>{const n=v.useContext(XM),r=v.useRef(null),a=vt(t,r);return v.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),s.jsx(Ke.div,{...e,ref:a})});QM.displayName=i7;function o7(e,t=globalThis?.document){const n=On(e),r=v.useRef(!1),a=v.useRef(()=>{});return v.useEffect(()=>{const i=c=>{if(c.target&&!r.current){let d=function(){JM(a7,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 l7(e,t=globalThis?.document){const n=On(e),r=v.useRef(!1);return v.useEffect(()=>{const a=i=>{i.target&&!r.current&&JM(s7,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 NE(){const e=new CustomEvent(Lj);document.dispatchEvent(e)}function JM(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?WS(a,i):a.dispatchEvent(i)}var c7=Jo,u7=QM,Vn=globalThis?.document?v.useLayoutEffect:()=>{},d7="Portal",Gc=v.forwardRef((e,t)=>{const{container:n,...r}=e,[a,i]=v.useState(!1);Vn(()=>i(!0),[]);const o=n||a&&globalThis?.document?.body;return o?YM.createPortal(s.jsx(Ke.div,{...r,ref:t}),o):null});Gc.displayName=d7;function f7(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var Hn=e=>{const{present:t,children:n}=e,r=p7(t),a=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),i=vt(r.ref,h7(a));return typeof n=="function"||r.isPresent?v.cloneElement(a,{ref:i}):null};Hn.displayName="Presence";function p7(e){const[t,n]=v.useState(),r=v.useRef(null),a=v.useRef(e),i=v.useRef("none"),o=e?"mounted":"unmounted",[c,d]=f7(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const f=Hp(r.current);i.current=c==="mounted"?f:"none"},[c]),Vn(()=>{const f=r.current,h=a.current;if(h!==e){const x=i.current,g=Hp(f);e?d("MOUNT"):g==="none"||f?.display==="none"?d("UNMOUNT"):d(h&&x!==g?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,d]),Vn(()=>{if(t){let f;const h=t.ownerDocument.defaultView??window,p=g=>{const b=Hp(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=Hp(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 Hp(e){return e?.animationName||"none"}function h7(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 m7=Vm[" useInsertionEffect ".trim().toString()]||Vn;function oa({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,o]=v7({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=g7(h)?h(e):h;p!==e&&o.current?.(p)}else i(h)},[c,e,i,o]);return[d,f]}function v7({defaultProp:e,onChange:t}){const[n,r]=v.useState(e),a=v.useRef(n),i=v.useRef(t);return m7(()=>{i.current=t},[t]),v.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,r,i]}function g7(e){return typeof e=="function"}var ZM=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"}),x7="VisuallyHidden",Hm=v.forwardRef((e,t)=>s.jsx(Ke.span,{...e,ref:t,style:{...ZM,...e.style}}));Hm.displayName=x7;var y7=Hm,VS="ToastProvider",[HS,b7,w7]=hf("Toast"),[e$]=lr("Toast",[w7]),[j7,Km]=e$(VS),t$=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 \`${VS}\`. Expected non-empty \`string\`.`),s.jsx(HS.Provider,{scope:t,children:s.jsx(j7,{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})})};t$.displayName=VS;var n$="ToastViewport",S7=["F8"],Fj="toast.viewportPause",Bj="toast.viewportResume",r$=v.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=S7,label:a="Notifications ({hotkey})",...i}=e,o=Km(n$,n),c=b7(n),d=v.useRef(null),f=v.useRef(null),h=v.useRef(null),p=v.useRef(null),x=vt(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(Fj);S.dispatchEvent(P),o.isClosePausedRef.current=!0}},N=()=>{if(o.isClosePausedRef.current){const P=new CustomEvent(Bj);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,...$7(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 R=b({tabbingDirection:P?"backwards":"forwards"}),I=R.findIndex(D=>D===_);dy(R.slice(I+1))?C.preventDefault():P?f.current?.focus():h.current?.focus()}};return y.addEventListener("keydown",S),()=>y.removeEventListener("keydown",S)}},[c,b]),s.jsxs(u7,{ref:d,role:"region","aria-label":a.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:j?void 0:"none"},children:[j&&s.jsx(zj,{ref:f,onFocusFromOutsideViewport:()=>{const y=b({tabbingDirection:"forwards"});dy(y)}}),s.jsx(HS.Slot,{scope:n,children:s.jsx(Ke.ol,{tabIndex:-1,...i,ref:x})}),j&&s.jsx(zj,{ref:h,onFocusFromOutsideViewport:()=>{const y=b({tabbingDirection:"backwards"});dy(y)}})]})});r$.displayName=n$;var a$="ToastFocusProxy",zj=v.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,i=Km(a$,n);return s.jsx(Hm,{tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:o=>{const c=o.relatedTarget;!i.viewport?.contains(c)&&r()}})});zj.displayName=a$;var mf="Toast",N7="toast.swipeStart",C7="toast.swipeMove",A7="toast.swipeCancel",_7="toast.swipeEnd",s$=v.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:i,...o}=e,[c,d]=oa({prop:r,defaultProp:a??!0,onChange:i,caller:mf});return s.jsx(Hn,{present:n||c,children:s.jsx(k7,{open:c,...o,ref:t,onClose:()=>d(!1),onPause:On(e.onPause),onResume:On(e.onResume),onSwipeStart:Re(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Re(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:Re(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:Re(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)})})})});s$.displayName=mf;var[E7,P7]=e$(mf,{onClose(){}}),k7=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=Km(mf,n),[y,S]=v.useState(null),C=vt(t,F=>S(F)),N=v.useRef(null),E=v.useRef(null),_=a||b.duration,P=v.useRef(0),O=v.useRef(_),T=v.useRef(0),{onToastAdd:R,onToastRemove:I}=b,D=On(()=>{y?.contains(document.activeElement)&&b.viewport?.focus(),o()}),$=v.useCallback(F=>{!F||F===1/0||(window.clearTimeout(T.current),P.current=new Date().getTime(),T.current=window.setTimeout(D,F))},[D]);v.useEffect(()=>{const F=b.viewport;if(F){const q=()=>{$(O.current),f?.()},Q=()=>{const J=new Date().getTime()-P.current;O.current=O.current-J,window.clearTimeout(T.current),d?.()};return F.addEventListener(Fj,Q),F.addEventListener(Bj,q),()=>{F.removeEventListener(Fj,Q),F.removeEventListener(Bj,q)}}},[b.viewport,_,d,f,$]),v.useEffect(()=>{i&&!b.isClosePausedRef.current&&$(_)},[i,_,b.isClosePausedRef,$]),v.useEffect(()=>(R(),()=>I()),[R,I]);const H=v.useMemo(()=>y?f$(y):null,[y]);return b.viewport?s.jsxs(s.Fragment,{children:[H&&s.jsx(O7,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:H}),s.jsx(E7,{scope:n,onClose:D,children:Kc.createPortal(s.jsx(HS.ItemSlot,{scope:n,children:s.jsx(c7,{asChild:!0,onEscapeKeyDown:Re(c,()=>{b.isFocusedToastEscapeKeyDownRef.current||D(),b.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx(Ke.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":b.swipeDirection,...j,ref:C,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Re(e.onKeyDown,F=>{F.key==="Escape"&&(c?.(F.nativeEvent),F.nativeEvent.defaultPrevented||(b.isFocusedToastEscapeKeyDownRef.current=!0,D()))}),onPointerDown:Re(e.onPointerDown,F=>{F.button===0&&(N.current={x:F.clientX,y:F.clientY})}),onPointerMove:Re(e.onPointerMove,F=>{if(!N.current)return;const q=F.clientX-N.current.x,Q=F.clientY-N.current.y,J=!!E.current,B=["left","right"].includes(b.swipeDirection),U=["left","up"].includes(b.swipeDirection)?Math.min:Math.max,Z=B?U(0,q):0,z=B?0:U(0,Q),L=F.pointerType==="touch"?10:2,ee={x:Z,y:z},se={originalEvent:F,delta:ee};J?(E.current=ee,Kp(C7,p,se,{discrete:!1})):CE(ee,b.swipeDirection,L)?(E.current=ee,Kp(N7,h,se,{discrete:!1}),F.target.setPointerCapture(F.pointerId)):(Math.abs(q)>L||Math.abs(Q)>L)&&(N.current=null)}),onPointerUp:Re(e.onPointerUp,F=>{const q=E.current,Q=F.target;if(Q.hasPointerCapture(F.pointerId)&&Q.releasePointerCapture(F.pointerId),E.current=null,N.current=null,q){const J=F.currentTarget,B={originalEvent:F,delta:q};CE(q,b.swipeDirection,b.swipeThreshold)?Kp(_7,g,B,{discrete:!0}):Kp(A7,x,B,{discrete:!0}),J.addEventListener("click",U=>U.preventDefault(),{once:!0})}})})})}),b.viewport)})]}):null}),O7=e=>{const{__scopeToast:t,children:n,...r}=e,a=Km(mf,t),[i,o]=v.useState(!1),[c,d]=v.useState(!1);return I7(()=>o(!0)),v.useEffect(()=>{const f=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(f)},[]),c?null:s.jsx(Gc,{asChild:!0,children:s.jsx(Hm,{...r,children:i&&s.jsxs(s.Fragment,{children:[a.label," ",n]})})})},T7="ToastTitle",i$=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(Ke.div,{...r,ref:t})});i$.displayName=T7;var R7="ToastDescription",o$=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(Ke.div,{...r,ref:t})});o$.displayName=R7;var l$="ToastAction",c$=v.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?s.jsx(d$,{altText:n,asChild:!0,children:s.jsx(KS,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${l$}\`. Expected non-empty \`string\`.`),null)});c$.displayName=l$;var u$="ToastClose",KS=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=P7(u$,n);return s.jsx(d$,{asChild:!0,children:s.jsx(Ke.button,{type:"button",...r,ref:t,onClick:Re(e.onClick,a.onClose)})})});KS.displayName=u$;var d$=v.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...a}=e;return s.jsx(Ke.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function f$(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),M7(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(...f$(r))}}),t}function Kp(e,t,n,{discrete:r}){const a=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?WS(a,i):a.dispatchEvent(i)}var CE=(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 I7(e=()=>{}){const t=On(e);Vn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function M7(e){return e.nodeType===e.ELEMENT_NODE}function $7(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 dy(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var D7=t$,p$=r$,h$=s$,m$=i$,v$=o$,g$=c$,x$=KS;function y$(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=y$(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function _t(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=y$(e))&&(r&&(r+=" "),r+=t);return r}const AE=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,_E=_t,Zo=(e,t)=>n=>{var r;if(t?.variants==null)return _E(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=AE(h)||AE(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 _E(e,o,d,n?.class,n?.className)};const L7=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),b$=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var F7={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 B7=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,...F7,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:b$("lucide",a),...c},[...o.map(([f,h])=>v.createElement(f,h)),...Array.isArray(i)?i:[i]]));const lt=(e,t)=>{const n=v.forwardRef(({className:r,...a},i)=>v.createElement(B7,{ref:i,iconNode:t,className:b$(`lucide-${L7(e)}`,r),...a}));return n.displayName=`${e}`,n};const w$=lt("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 z7=lt("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 Io=lt("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const wa=lt("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 wd=lt("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 hc=lt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Dt=lt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const j$=lt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const fs=lt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const nc=lt("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);const fy=lt("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 rc=lt("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const U7=lt("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 yh=lt("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 q7=lt("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const vf=lt("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Ui=lt("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 S$=lt("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 qa=lt("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 Gm=lt("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 Ah=lt("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 W7=lt("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 N$=lt("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 EE=lt("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 C$=lt("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 GS=lt("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 V7=lt("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 Uj=lt("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 A$=lt("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 H7=lt("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 or=lt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const _$=lt("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 K7=lt("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 E$=lt("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 Xl=lt("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 G7=lt("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);const py=lt("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 hy=lt("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 Ym=lt("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 ko=lt("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const xs=lt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const P$=lt("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 Na=lt("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 Y7=lt("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 YS=lt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const k$=lt("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 XS=lt("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 ya=lt("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 bh=lt("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const O$=lt("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 Ca=lt("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 wh=lt("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 X7=lt("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 QS=lt("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 T$=lt("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 ls=lt("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 ys=lt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),JS="-",Q7=e=>{const t=Z7(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const c=o.split(JS);return c[0]===""&&c.length!==1&&c.shift(),R$(c,t)||J7(o)},getConflictingClassGroupIds:(o,c)=>{const d=n[o]||[];return c&&r[o]?[...d,...r[o]]:d}}},R$=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?R$(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(JS);return t.validators.find(({validator:o})=>o(i))?.classGroupId},PE=/^\[(.+)\]$/,J7=e=>{if(PE.test(e)){const t=PE.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Z7=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return tq(Object.entries(e.classGroups),n).forEach(([i,o])=>{qj(o,r,i,t)}),r},qj=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:kE(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(eq(a)){qj(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,o])=>{qj(o,kE(t,i),n,r)})})},kE=(e,t)=>{let n=e;return t.split(JS).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},eq=e=>e.isThemeGetter,tq=(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,nq=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)}}},I$="!",rq=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(I$),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},aq=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},sq=e=>({cache:nq(e.cacheSize),parseClassName:rq(e),...Q7(e)}),iq=/\s+/,oq=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],o=e.trim().split(iq);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=aq(h).join(":"),S=p?y+I$: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 lq(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=M$(t))&&(r&&(r+=" "),r+=n);return r}const M$=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=M$(e[r]))&&(n&&(n+=" "),n+=t);return n};function cq(e,...t){let n,r,a,i=o;function o(d){const f=t.reduce((h,p)=>p(h),e());return n=sq(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=oq(d,n);return a(d,h),h}return function(){return i(lq.apply(null,arguments))}}const fn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},$$=/^\[(?:([a-z-]+):)?(.+)\]$/i,uq=/^\d+\/\d+$/,dq=new Set(["px","full","screen"]),fq=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pq=/\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$/,hq=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,mq=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,vq=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Fs=e=>ac(e)||dq.has(e)||uq.test(e),Oi=e=>Yc(e,"length",Nq),ac=e=>!!e&&!Number.isNaN(Number(e)),my=e=>Yc(e,"number",ac),Ku=e=>!!e&&Number.isInteger(Number(e)),gq=e=>e.endsWith("%")&&ac(e.slice(0,-1)),Et=e=>$$.test(e),Ti=e=>fq.test(e),xq=new Set(["length","size","percentage"]),yq=e=>Yc(e,xq,D$),bq=e=>Yc(e,"position",D$),wq=new Set(["image","url"]),jq=e=>Yc(e,wq,Aq),Sq=e=>Yc(e,"",Cq),Gu=()=>!0,Yc=(e,t,n)=>{const r=$$.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Nq=e=>pq.test(e)&&!hq.test(e),D$=()=>!1,Cq=e=>mq.test(e),Aq=e=>vq.test(e),_q=()=>{const e=fn("colors"),t=fn("spacing"),n=fn("blur"),r=fn("brightness"),a=fn("borderColor"),i=fn("borderRadius"),o=fn("borderSpacing"),c=fn("borderWidth"),d=fn("contrast"),f=fn("grayscale"),h=fn("hueRotate"),p=fn("invert"),x=fn("gap"),g=fn("gradientColorStops"),j=fn("gradientColorStopPositions"),b=fn("inset"),y=fn("margin"),S=fn("opacity"),C=fn("padding"),N=fn("saturate"),E=fn("scale"),_=fn("sepia"),P=fn("skew"),O=fn("space"),T=fn("translate"),R=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto",Et,t],$=()=>[Et,t],H=()=>["",Fs,Oi],F=()=>["auto",ac,Et],q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Q=()=>["solid","dashed","dotted","double","none"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],B=()=>["start","end","center","between","around","evenly","stretch"],U=()=>["","0",Et],Z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[ac,Et];return{cacheSize:500,separator:":",theme:{colors:[Gu],spacing:[Fs,Oi],blur:["none","",Ti,Et],brightness:z(),borderColor:[e],borderRadius:["none","","full",Ti,Et],borderSpacing:$(),borderWidth:H(),contrast:z(),grayscale:U(),hueRotate:z(),invert:U(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[gq,Oi],inset:D(),margin:D(),opacity:z(),padding:$(),saturate:z(),scale:z(),sepia:U(),skew:z(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",Et]}],container:["container"],columns:[{columns:[Ti]}],"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:[...q(),Et]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],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",Ku,Et]}],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",Et]}],grow:[{grow:U()}],shrink:[{shrink:U()}],order:[{order:["first","last","none",Ku,Et]}],"grid-cols":[{"grid-cols":[Gu]}],"col-start-end":[{col:["auto",{span:["full",Ku,Et]},Et]}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":[Gu]}],"row-start-end":[{row:["auto",{span:[Ku,Et]},Et]}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Et]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Et]}],gap:[{gap:[x]}],"gap-x":[{"gap-x":[x]}],"gap-y":[{"gap-y":[x]}],"justify-content":[{justify:["normal",...B()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...B(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...B(),"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",Et,t]}],"min-w":[{"min-w":[Et,t,"min","max","fit"]}],"max-w":[{"max-w":[Et,t,"none","full","min","max","fit","prose",{screen:[Ti]},Ti]}],h:[{h:[Et,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Et,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Et,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Et,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ti,Oi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",my]}],"font-family":[{font:[Gu]}],"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",Et]}],"line-clamp":[{"line-clamp":["none",ac,my]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Fs,Et]}],"list-image":[{"list-image":["none",Et]}],"list-style-type":[{list:["none","disc","decimal",Et]}],"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",Fs,Oi]}],"underline-offset":[{"underline-offset":["auto",Fs,Et]}],"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:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Et]}],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",Et]}],"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:[...q(),bq]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",yq]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},jq]}],"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":[Fs,Et]}],"outline-w":[{outline:[Fs,Oi]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[Fs,Oi]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ti,Sq]}],"shadow-color":[{shadow:[Gu]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...J(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":J()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",Ti,Et]}],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",Et]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",Et]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",Et]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[Ku,Et]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"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",Et]}],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",Et]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"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",Et]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Fs,Oi,my]}],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"]}}},Eq=cq(_q);function Ne(...e){return Eq(_t(e))}const Pq=D7,L$=v.forwardRef(({className:e,...t},n)=>s.jsx(p$,{ref:n,className:Ne("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}));L$.displayName=p$.displayName;const kq=Zo("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"}}),F$=v.forwardRef(({className:e,variant:t,...n},r)=>s.jsx(h$,{ref:r,className:Ne(kq({variant:t}),e),...n}));F$.displayName=h$.displayName;const Oq=v.forwardRef(({className:e,...t},n)=>s.jsx(g$,{ref:n,className:Ne("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}));Oq.displayName=g$.displayName;const B$=v.forwardRef(({className:e,...t},n)=>s.jsx(x$,{ref:n,className:Ne("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(ys,{className:"h-4 w-4"})}));B$.displayName=x$.displayName;const z$=v.forwardRef(({className:e,...t},n)=>s.jsx(m$,{ref:n,className:Ne("text-sm font-semibold",e),...t}));z$.displayName=m$.displayName;const U$=v.forwardRef(({className:e,...t},n)=>s.jsx(v$,{ref:n,className:Ne("text-sm opacity-90",e),...t}));U$.displayName=v$.displayName;function Tq(){const{toasts:e}=zU();return s.jsxs(Pq,{children:[e.map(function({id:t,title:n,description:r,action:a,...i}){return s.jsxs(F$,{...i,children:[s.jsxs("div",{className:"grid gap-1",children:[n&&s.jsx(z$,{children:n}),r&&s.jsx(U$,{children:r})]}),a,s.jsx(B$,{})]},t)}),s.jsx(L$,{})]})}var OE=["light","dark"],Rq="(prefers-color-scheme: dark)",Iq=v.createContext(void 0),Mq={setTheme:e=>{},themes:[]},$q=()=>{var e;return(e=v.useContext(Iq))!=null?e:Mq};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?OE.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&&OE.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='${Rq}',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 Dq=e=>{switch(e){case"success":return Bq;case"info":return Uq;case"warning":return zq;case"error":return qq;default:return null}},Lq=Array(12).fill(0),Fq=({visible:e,className:t})=>W.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},W.createElement("div",{className:"sonner-spinner"},Lq.map((n,r)=>W.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Bq=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),zq=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Uq=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),qq=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Wq=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},W.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),W.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Vq=()=>{let[e,t]=W.useState(document.hidden);return W.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Wj=1,Hq=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:Wj++,i=this.toasts.find(c=>c.id===a),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(c=>c.id===a?(this.publish({...c,...e,id:a,title:n}),{...c,...e,id:a,dismissible:o,title:n}):c):this.addToast({title:n,...r,dismissible:o,id:a}),a},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),a=n!==void 0,i,o=r.then(async d=>{if(i=["resolve",d],W.isValidElement(d))a=!1,this.create({id:n,type:"default",message:d});else if(Gq(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||Wj++;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}},Ir=new Hq,Kq=(e,t)=>{let n=t?.id||Wj++;return Ir.addToast({title:e,...t,id:n}),n},Gq=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Yq=Kq,Xq=()=>Ir.toasts,Qq=()=>Ir.getActiveToasts();Object.assign(Yq,{success:Ir.success,info:Ir.info,warning:Ir.warning,error:Ir.error,custom:Ir.custom,message:Ir.message,promise:Ir.promise,dismiss:Ir.dismiss,loading:Ir.loading},{getHistory:Xq,getToasts:Qq});function Jq(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))}Jq(`: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 Gp(e){return e.label!==void 0}var Zq=3,e9="32px",t9="16px",TE=4e3,n9=356,r9=14,a9=20,s9=200;function $a(...e){return e.filter(Boolean).join(" ")}function i9(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var o9=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:T,style:R,cancelButtonStyle:I,actionButtonStyle:D,className:$="",descriptionClassName:H="",duration:F,position:q,gap:Q,loadingIcon:J,expandByDefault:B,classNames:U,icons:Z,closeButtonAriaLabel:z="Close toast",pauseWhenPageIsHidden:L}=e,[ee,se]=W.useState(null),[G,ue]=W.useState(null),[le,oe]=W.useState(!1),[ie,fe]=W.useState(!1),[Ae,re]=W.useState(!1),[Te,_e]=W.useState(!1),[Ge,je]=W.useState(!1),[Me,Y]=W.useState(0),[ye,de]=W.useState(0),Pe=W.useRef(g.duration||F||TE),Ye=W.useRef(null),wt=W.useRef(null),It=N===0,ve=N+1<=S,ce=g.type,Ce=g.dismissible!==!1,we=g.className||"",Fe=g.descriptionClassName||"",et=W.useMemo(()=>C.findIndex(De=>De.toastId===g.id)||0,[C,g.id]),Pt=W.useMemo(()=>{var De;return(De=g.closeButton)!=null?De:T},[g.closeButton,T]),Gn=W.useMemo(()=>g.duration||F||TE,[g.duration,F]),xn=W.useRef(0),cr=W.useRef(0),ur=W.useRef(0),$n=W.useRef(null),[dr,_r]=q.split("-"),Ur=W.useMemo(()=>C.reduce((De,st,yt)=>yt>=et?De:De+st.height,0),[C,et]),qr=Vq(),Yn=g.invert||x,Xt=ce==="loading";cr.current=W.useMemo(()=>et*Q+Ur,[et,Ur]),W.useEffect(()=>{Pe.current=Gn},[Gn]),W.useEffect(()=>{oe(!0)},[]),W.useEffect(()=>{let De=wt.current;if(De){let st=De.getBoundingClientRect().height;return de(st),y(yt=>[{toastId:g.id,height:st,position:g.position},...yt]),()=>y(yt=>yt.filter(Lt=>Lt.toastId!==g.id))}},[y,g.id]),W.useLayoutEffect(()=>{if(!le)return;let De=wt.current,st=De.style.height;De.style.height="auto";let yt=De.getBoundingClientRect().height;De.style.height=st,de(yt),y(Lt=>Lt.find(nn=>nn.toastId===g.id)?Lt.map(nn=>nn.toastId===g.id?{...nn,height:yt}:nn):[{toastId:g.id,height:yt,position:g.position},...Lt])},[le,g.title,g.description,y,g.id]);let _n=W.useCallback(()=>{fe(!0),Y(cr.current),y(De=>De.filter(st=>st.toastId!==g.id)),setTimeout(()=>{P(g)},s9)},[g,P,y,cr]);W.useEffect(()=>{if(g.promise&&ce==="loading"||g.duration===1/0||g.type==="loading")return;let De;return _||b||L&&qr?(()=>{if(ur.current<xn.current){let st=new Date().getTime()-xn.current;Pe.current=Pe.current-st}ur.current=new Date().getTime()})():Pe.current!==1/0&&(xn.current=new Date().getTime(),De=setTimeout(()=>{var st;(st=g.onAutoClose)==null||st.call(g,g),_n()},Pe.current)),()=>clearTimeout(De)},[_,b,g,ce,L,qr,_n]),W.useEffect(()=>{g.delete&&_n()},[_n,g.delete]);function pe(){var De,st,yt;return Z!=null&&Z.loading?W.createElement("div",{className:$a(U?.loader,(De=g?.classNames)==null?void 0:De.loader,"sonner-loader"),"data-visible":ce==="loading"},Z.loading):J?W.createElement("div",{className:$a(U?.loader,(st=g?.classNames)==null?void 0:st.loader,"sonner-loader"),"data-visible":ce==="loading"},J):W.createElement(Fq,{className:$a(U?.loader,(yt=g?.classNames)==null?void 0:yt.loader),visible:ce==="loading"})}return W.createElement("li",{tabIndex:0,ref:wt,className:$a($,we,U?.toast,(t=g?.classNames)==null?void 0:t.toast,U?.default,U?.[ce],(n=g?.classNames)==null?void 0:n[ce]),"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":Ge,"data-removed":ie,"data-visible":ve,"data-y-position":dr,"data-x-position":_r,"data-index":N,"data-front":It,"data-swiping":Ae,"data-dismissible":Ce,"data-type":ce,"data-invert":Yn,"data-swipe-out":Te,"data-swipe-direction":G,"data-expanded":!!(_||B&&le),style:{"--index":N,"--toasts-before":N,"--z-index":E.length-N,"--offset":`${ie?Me:cr.current}px`,"--initial-height":B?"auto":`${ye}px`,...R,...g.style},onDragEnd:()=>{re(!1),se(null),$n.current=null},onPointerDown:De=>{Xt||!Ce||(Ye.current=new Date,Y(cr.current),De.target.setPointerCapture(De.pointerId),De.target.tagName!=="BUTTON"&&(re(!0),$n.current={x:De.clientX,y:De.clientY}))},onPointerUp:()=>{var De,st,yt,Lt;if(Te||!Ce)return;$n.current=null;let nn=Number(((De=wt.current)==null?void 0:De.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ln=Number(((st=wt.current)==null?void 0:st.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Xn=new Date().getTime()-((yt=Ye.current)==null?void 0:yt.getTime()),Nn=ee==="x"?nn:ln,rr=Math.abs(Nn)/Xn;if(Math.abs(Nn)>=a9||rr>.11){Y(cr.current),(Lt=g.onDismiss)==null||Lt.call(g,g),ue(ee==="x"?nn>0?"right":"left":ln>0?"down":"up"),_n(),_e(!0),je(!1);return}re(!1),se(null)},onPointerMove:De=>{var st,yt,Lt,nn;if(!$n.current||!Ce||((st=window.getSelection())==null?void 0:st.toString().length)>0)return;let ln=De.clientY-$n.current.y,Xn=De.clientX-$n.current.x,Nn=(yt=e.swipeDirections)!=null?yt:i9(q);!ee&&(Math.abs(Xn)>1||Math.abs(ln)>1)&&se(Math.abs(Xn)>Math.abs(ln)?"x":"y");let rr={x:0,y:0};ee==="y"?(Nn.includes("top")||Nn.includes("bottom"))&&(Nn.includes("top")&&ln<0||Nn.includes("bottom")&&ln>0)&&(rr.y=ln):ee==="x"&&(Nn.includes("left")||Nn.includes("right"))&&(Nn.includes("left")&&Xn<0||Nn.includes("right")&&Xn>0)&&(rr.x=Xn),(Math.abs(rr.x)>0||Math.abs(rr.y)>0)&&je(!0),(Lt=wt.current)==null||Lt.style.setProperty("--swipe-amount-x",`${rr.x}px`),(nn=wt.current)==null||nn.style.setProperty("--swipe-amount-y",`${rr.y}px`)}},Pt&&!g.jsx?W.createElement("button",{"aria-label":z,"data-disabled":Xt,"data-close-button":!0,onClick:Xt||!Ce?()=>{}:()=>{var De;_n(),(De=g.onDismiss)==null||De.call(g,g)},className:$a(U?.closeButton,(a=g?.classNames)==null?void 0:a.closeButton)},(i=Z?.close)!=null?i:Wq):null,g.jsx||v.isValidElement(g.title)?g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title:W.createElement(W.Fragment,null,ce||g.icon||g.promise?W.createElement("div",{"data-icon":"",className:$a(U?.icon,(o=g?.classNames)==null?void 0:o.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||pe():null,g.type!=="loading"?g.icon||Z?.[ce]||Dq(ce):null):null,W.createElement("div",{"data-content":"",className:$a(U?.content,(c=g?.classNames)==null?void 0:c.content)},W.createElement("div",{"data-title":"",className:$a(U?.title,(d=g?.classNames)==null?void 0:d.title)},typeof g.title=="function"?g.title():g.title),g.description?W.createElement("div",{"data-description":"",className:$a(H,Fe,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&&Gp(g.cancel)?W.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||I,onClick:De=>{var st,yt;Gp(g.cancel)&&Ce&&((yt=(st=g.cancel).onClick)==null||yt.call(st,De),_n())},className:$a(U?.cancelButton,(h=g?.classNames)==null?void 0:h.cancelButton)},g.cancel.label):null,v.isValidElement(g.action)?g.action:g.action&&Gp(g.action)?W.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||D,onClick:De=>{var st,yt;Gp(g.action)&&((yt=(st=g.action).onClick)==null||yt.call(st,De),!De.defaultPrevented&&_n())},className:$a(U?.actionButton,(p=g?.classNames)==null?void 0:p.actionButton)},g.action.label):null))};function RE(){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 l9(e,t){let n={};return[e,t].forEach((r,a)=>{let i=a===1,o=i?"--mobile-offset":"--offset",c=i?t9:e9;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 c9=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=Zq,toastOptions:b,dir:y=RE(),gap:S=r9,loadingIcon:C,icons:N,containerAriaLabel:E="Notifications",pauseWhenPageIsHidden:_}=e,[P,O]=W.useState([]),T=W.useMemo(()=>Array.from(new Set([r].concat(P.filter(L=>L.position).map(L=>L.position)))),[P,r]),[R,I]=W.useState([]),[D,$]=W.useState(!1),[H,F]=W.useState(!1),[q,Q]=W.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),J=W.useRef(null),B=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),U=W.useRef(null),Z=W.useRef(!1),z=W.useCallback(L=>{O(ee=>{var se;return(se=ee.find(G=>G.id===L.id))!=null&&se.delete||Ir.dismiss(L.id),ee.filter(({id:G})=>G!==L.id)})},[]);return W.useEffect(()=>Ir.subscribe(L=>{if(L.dismiss){O(ee=>ee.map(se=>se.id===L.id?{...se,delete:!0}:se));return}setTimeout(()=>{YM.flushSync(()=>{O(ee=>{let se=ee.findIndex(G=>G.id===L.id);return se!==-1?[...ee.slice(0,se),{...ee[se],...L},...ee.slice(se+1)]:[L,...ee]})})})}),[]),W.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 L=window.matchMedia("(prefers-color-scheme: dark)");try{L.addEventListener("change",({matches:ee})=>{Q(ee?"dark":"light")})}catch{L.addListener(({matches:se})=>{try{Q(se?"dark":"light")}catch(G){console.error(G)}})}},[h]),W.useEffect(()=>{P.length<=1&&$(!1)},[P]),W.useEffect(()=>{let L=ee=>{var se,G;a.every(ue=>ee[ue]||ee.code===ue)&&($(!0),(se=J.current)==null||se.focus()),ee.code==="Escape"&&(document.activeElement===J.current||(G=J.current)!=null&&G.contains(document.activeElement))&&$(!1)};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[a]),W.useEffect(()=>{if(J.current)return()=>{U.current&&(U.current.focus({preventScroll:!0}),U.current=null,Z.current=!1)}},[J.current]),W.createElement("section",{ref:t,"aria-label":`${E} ${B}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},T.map((L,ee)=>{var se;let[G,ue]=L.split("-");return P.length?W.createElement("ol",{key:L,dir:y==="auto"?RE():y,tabIndex:-1,ref:J,className:c,"data-sonner-toaster":!0,"data-theme":q,"data-y-position":G,"data-lifted":D&&P.length>1&&!i,"data-x-position":ue,style:{"--front-toast-height":`${((se=R[0])==null?void 0:se.height)||0}px`,"--width":`${n9}px`,"--gap":`${S}px`,...g,...l9(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:()=>$(!0),onMouseMove:()=>$(!0),onMouseLeave:()=>{H||$(!1)},onDragEnd:()=>$(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||F(!0)},onPointerUp:()=>F(!1)},P.filter(le=>!le.position&&ee===0||le.position===L).map((le,oe)=>{var ie,fe;return W.createElement(o9,{key:le.id,icons:N,index:oe,toast:le,defaultRichColors:p,duration:(ie=b?.duration)!=null?ie:x,className:b?.className,descriptionClassName:b?.descriptionClassName,invert:n,visibleToasts:j,closeButton:(fe=b?.closeButton)!=null?fe:o,interacting:H,position:L,style:b?.style,unstyled:b?.unstyled,classNames:b?.classNames,cancelButtonStyle:b?.cancelButtonStyle,actionButtonStyle:b?.actionButtonStyle,removeToast:z,toasts:P.filter(Ae=>Ae.position==le.position),heights:R.filter(Ae=>Ae.position==le.position),setHeights:I,expandByDefault:i,gap:S,loadingIcon:C,expanded:D,pauseWhenPageIsHidden:_,swipeDirections:e.swipeDirections})})):null}))});const u9=({...e})=>{const{theme:t="system"}=$q();return s.jsx(c9,{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 d9=Vm[" useId ".trim().toString()]||(()=>{}),f9=0;function Wn(e){const[t,n]=v.useState(d9());return Vn(()=>{n(r=>r??String(f9++))},[e]),e||(t?`radix-${t}`:"")}const p9=["top","right","bottom","left"],qi=Math.min,Zr=Math.max,_h=Math.round,Yp=Math.floor,ps=e=>({x:e,y:e}),h9={left:"right",right:"left",bottom:"top",top:"bottom"},m9={start:"end",end:"start"};function Vj(e,t,n){return Zr(e,qi(t,n))}function Js(e,t){return typeof e=="function"?e(t):e}function Zs(e){return e.split("-")[0]}function Xc(e){return e.split("-")[1]}function ZS(e){return e==="x"?"y":"x"}function eN(e){return e==="y"?"height":"width"}const v9=new Set(["top","bottom"]);function us(e){return v9.has(Zs(e))?"y":"x"}function tN(e){return ZS(us(e))}function g9(e,t,n){n===void 0&&(n=!1);const r=Xc(e),a=tN(e),i=eN(a);let o=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=Eh(o)),[o,Eh(o)]}function x9(e){const t=Eh(e);return[Hj(e),t,Hj(t)]}function Hj(e){return e.replace(/start|end/g,t=>m9[t])}const IE=["left","right"],ME=["right","left"],y9=["top","bottom"],b9=["bottom","top"];function w9(e,t,n){switch(e){case"top":case"bottom":return n?t?ME:IE:t?IE:ME;case"left":case"right":return t?y9:b9;default:return[]}}function j9(e,t,n,r){const a=Xc(e);let i=w9(Zs(e),n==="start",r);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(Hj)))),i}function Eh(e){return e.replace(/left|right|bottom|top/g,t=>h9[t])}function S9(e){return{top:0,right:0,bottom:0,left:0,...e}}function q$(e){return typeof e!="number"?S9(e):{top:e,right:e,bottom:e,left:e}}function Ph(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 $E(e,t,n){let{reference:r,floating:a}=e;const i=us(t),o=tN(t),c=eN(o),d=Zs(t),f=i==="y",h=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2,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(Xc(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 N9(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}=Js(t,e),j=q$(g),y=c[x?p==="floating"?"reference":"floating":p],S=Ph(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},_=Ph(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 C9=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}=$E(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:N9},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}=$E(f,x,d)),y=-1)}return{x:h,y:p,placement:x,strategy:a,middlewareData:g}},A9=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}=Js(e,t)||{};if(f==null)return{};const p=q$(h),x={x:n,y:r},g=tN(a),j=eN(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 T=E/2-_/2,R=O/2-b[j]/2-1,I=qi(p[S],R),D=qi(p[C],R),$=I,H=O-b[j]-D,F=O/2-b[j]/2+T,q=Vj($,F,H),Q=!d.arrow&&Xc(a)!=null&&F!==q&&i.reference[j]/2-(F<$?I:D)-b[j]/2<0,J=Q?F<$?F-$:F-H:0;return{[g]:x[g]+J,data:{[g]:q,centerOffset:F-q-J,...Q&&{alignmentOffset:J}},reset:Q}}}),_9=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}=Js(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const S=Zs(a),C=us(c),N=Zs(c)===c,E=await(d.isRTL==null?void 0:d.isRTL(f.floating)),_=x||(N||!b?[Eh(c)]:x9(c)),P=j!=="none";!x&&P&&_.push(...j9(c,b,j,E));const O=[c,..._],T=await d.detectOverflow(t,y),R=[];let I=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&R.push(T[S]),p){const F=g9(a,o,E);R.push(T[F[0]],T[F[1]])}if(I=[...I,{placement:a,overflows:R}],!R.every(F=>F<=0)){var D,$;const F=(((D=i.flip)==null?void 0:D.index)||0)+1,q=O[F];if(q&&(!(p==="alignment"?C!==us(q):!1)||I.every(B=>us(B.placement)===C?B.overflows[0]>0:!0)))return{data:{index:F,overflows:I},reset:{placement:q}};let Q=($=I.filter(J=>J.overflows[0]<=0).sort((J,B)=>J.overflows[1]-B.overflows[1])[0])==null?void 0:$.placement;if(!Q)switch(g){case"bestFit":{var H;const J=(H=I.filter(B=>{if(P){const U=us(B.placement);return U===C||U==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(U=>U>0).reduce((U,Z)=>U+Z,0)]).sort((B,U)=>B[1]-U[1])[0])==null?void 0:H[0];J&&(Q=J);break}case"initialPlacement":Q=c;break}if(a!==Q)return{reset:{placement:Q}}}return{}}}};function DE(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function LE(e){return p9.some(t=>e[t]>=0)}const E9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...i}=Js(e,t);switch(a){case"referenceHidden":{const o=await r.detectOverflow(t,{...i,elementContext:"reference"}),c=DE(o,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:LE(c)}}}case"escaped":{const o=await r.detectOverflow(t,{...i,altBoundary:!0}),c=DE(o,n.floating);return{data:{escapedOffsets:c,escaped:LE(c)}}}default:return{}}}}},W$=new Set(["left","top"]);async function P9(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),o=Zs(n),c=Xc(n),d=us(n)==="y",f=W$.has(o)?-1:1,h=i&&d?-1:1,p=Js(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 k9=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 P9(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}}}}},O9=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}=Js(e,t),h={x:n,y:r},p=await i.detectOverflow(t,f),x=us(Zs(a)),g=ZS(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=Vj(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=Vj(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}}}}}},T9=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}=Js(e,t),h={x:n,y:r},p=us(a),x=ZS(p);let g=h[x],j=h[p];const b=Js(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=W$.has(Zs(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}}}},R9=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}=Js(e,t),h=await o.detectOverflow(t,f),p=Zs(a),x=Xc(a),g=us(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=qi(b-h[y],C),_=qi(j-h[S],N),P=!t.middlewareData.shift;let O=E,T=_;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=N),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=C),P&&!x){const I=Zr(h.left,0),D=Zr(h.right,0),$=Zr(h.top,0),H=Zr(h.bottom,0);g?T=j-2*(I!==0||D!==0?I+D:Zr(h.left,h.right)):O=b-2*($!==0||H!==0?$+H:Zr(h.top,h.bottom))}await d({...t,availableWidth:T,availableHeight:O});const R=await o.getDimensions(c.floating);return j!==R.width||b!==R.height?{reset:{rects:!0}}:{}}}};function Xm(){return typeof window<"u"}function Qc(e){return V$(e)?(e.nodeName||"").toLowerCase():"#document"}function aa(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ss(e){var t;return(t=(V$(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function V$(e){return Xm()?e instanceof Node||e instanceof aa(e).Node:!1}function Va(e){return Xm()?e instanceof Element||e instanceof aa(e).Element:!1}function bs(e){return Xm()?e instanceof HTMLElement||e instanceof aa(e).HTMLElement:!1}function FE(e){return!Xm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof aa(e).ShadowRoot}const I9=new Set(["inline","contents"]);function gf(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Ha(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!I9.has(a)}const M9=new Set(["table","td","th"]);function $9(e){return M9.has(Qc(e))}const D9=[":popover-open",":modal"];function Qm(e){return D9.some(t=>{try{return e.matches(t)}catch{return!1}})}const L9=["transform","translate","scale","rotate","perspective"],F9=["transform","translate","scale","rotate","perspective","filter"],B9=["paint","layout","strict","content"];function nN(e){const t=rN(),n=Va(e)?Ha(e):e;return L9.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)||F9.some(r=>(n.willChange||"").includes(r))||B9.some(r=>(n.contain||"").includes(r))}function z9(e){let t=Wi(e);for(;bs(t)&&!mc(t);){if(nN(t))return t;if(Qm(t))return null;t=Wi(t)}return null}function rN(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const U9=new Set(["html","body","#document"]);function mc(e){return U9.has(Qc(e))}function Ha(e){return aa(e).getComputedStyle(e)}function Jm(e){return Va(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Wi(e){if(Qc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||FE(e)&&e.host||Ss(e);return FE(t)?t.host:t}function H$(e){const t=Wi(e);return mc(t)?e.ownerDocument?e.ownerDocument.body:e.body:bs(t)&&gf(t)?t:H$(t)}function jd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=H$(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),o=aa(a);if(i){const c=Kj(o);return t.concat(o,o.visualViewport||[],gf(a)?a:[],c&&n?jd(c):[])}return t.concat(a,jd(a,[],n))}function Kj(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function K$(e){const t=Ha(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=bs(e),i=a?e.offsetWidth:n,o=a?e.offsetHeight:r,c=_h(n)!==i||_h(r)!==o;return c&&(n=i,r=o),{width:n,height:r,$:c}}function aN(e){return Va(e)?e:e.contextElement}function sc(e){const t=aN(e);if(!bs(t))return ps(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=K$(t);let o=(i?_h(n.width):n.width)/r,c=(i?_h(n.height):n.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!c||!Number.isFinite(c))&&(c=1),{x:o,y:c}}const q9=ps(0);function G$(e){const t=aa(e);return!rN()||!t.visualViewport?q9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function W9(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==aa(e)?!1:t}function Mo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=aN(e);let o=ps(1);t&&(r?Va(r)&&(o=sc(r)):o=sc(e));const c=W9(i,n,r)?G$(i):ps(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=aa(i),g=r&&Va(r)?aa(r):r;let j=x,b=Kj(j);for(;b&&r&&g!==j;){const y=sc(b),S=b.getBoundingClientRect(),C=Ha(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=aa(b),b=Kj(j)}}return Ph({width:h,height:p,x:d,y:f})}function Zm(e,t){const n=Jm(e).scrollLeft;return t?t.left+n:Mo(Ss(e)).left+n}function Y$(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Zm(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function V9(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",o=Ss(r),c=t?Qm(t.floating):!1;if(r===o||c&&i)return n;let d={scrollLeft:0,scrollTop:0},f=ps(1);const h=ps(0),p=bs(r);if((p||!p&&!i)&&((Qc(r)!=="body"||gf(o))&&(d=Jm(r)),bs(r))){const g=Mo(r);f=sc(r),h.x=g.x+r.clientLeft,h.y=g.y+r.clientTop}const x=o&&!p&&!i?Y$(o,d):ps(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 H9(e){return Array.from(e.getClientRects())}function K9(e){const t=Ss(e),n=Jm(e),r=e.ownerDocument.body,a=Zr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Zr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Zm(e);const c=-n.scrollTop;return Ha(r).direction==="rtl"&&(o+=Zr(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:o,y:c}}const BE=25;function G9(e,t){const n=aa(e),r=Ss(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=rN();(!h||h&&t==="fixed")&&(c=a.offsetLeft,d=a.offsetTop)}const f=Zm(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<=BE&&(i-=j)}else f<=BE&&(i+=f);return{width:i,height:o,x:c,y:d}}const Y9=new Set(["absolute","fixed"]);function X9(e,t){const n=Mo(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=bs(e)?sc(e):ps(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 zE(e,t,n){let r;if(t==="viewport")r=G9(e,n);else if(t==="document")r=K9(Ss(e));else if(Va(t))r=X9(t,n);else{const a=G$(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Ph(r)}function X$(e,t){const n=Wi(e);return n===t||!Va(n)||mc(n)?!1:Ha(n).position==="fixed"||X$(n,t)}function Q9(e,t){const n=t.get(e);if(n)return n;let r=jd(e,[],!1).filter(c=>Va(c)&&Qc(c)!=="body"),a=null;const i=Ha(e).position==="fixed";let o=i?Wi(e):e;for(;Va(o)&&!mc(o);){const c=Ha(o),d=nN(o);!d&&c.position==="fixed"&&(a=null),(i?!d&&!a:!d&&c.position==="static"&&!!a&&Y9.has(a.position)||gf(o)&&!d&&X$(e,o))?r=r.filter(h=>h!==o):a=c,o=Wi(o)}return t.set(e,r),r}function J9(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[...n==="clippingAncestors"?Qm(t)?[]:Q9(t,this._c):[].concat(n),r],c=o[0],d=o.reduce((f,h)=>{const p=zE(t,h,a);return f.top=Zr(p.top,f.top),f.right=qi(p.right,f.right),f.bottom=qi(p.bottom,f.bottom),f.left=Zr(p.left,f.left),f},zE(t,c,a));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Z9(e){const{width:t,height:n}=K$(e);return{width:t,height:n}}function eW(e,t,n){const r=bs(t),a=Ss(t),i=n==="fixed",o=Mo(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const d=ps(0);function f(){d.x=Zm(a)}if(r||!r&&!i)if((Qc(t)!=="body"||gf(a))&&(c=Jm(t)),r){const g=Mo(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?Y$(a,c):ps(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 vy(e){return Ha(e).position==="static"}function UE(e,t){if(!bs(e)||Ha(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ss(e)===n&&(n=n.ownerDocument.body),n}function Q$(e,t){const n=aa(e);if(Qm(e))return n;if(!bs(e)){let a=Wi(e);for(;a&&!mc(a);){if(Va(a)&&!vy(a))return a;a=Wi(a)}return n}let r=UE(e,t);for(;r&&$9(r)&&vy(r);)r=UE(r,t);return r&&mc(r)&&vy(r)&&!nN(r)?n:r||z9(e)||n}const tW=async function(e){const t=this.getOffsetParent||Q$,n=this.getDimensions,r=await n(e.floating);return{reference:eW(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function nW(e){return Ha(e).direction==="rtl"}const rW={convertOffsetParentRelativeRectToViewportRelativeRect:V9,getDocumentElement:Ss,getClippingRect:J9,getOffsetParent:Q$,getElementRects:tW,getClientRects:H9,getDimensions:Z9,getScale:sc,isElement:Va,isRTL:nW};function J$(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function aW(e,t){let n=null,r;const a=Ss(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=Yp(p),b=Yp(a.clientWidth-(h+x)),y=Yp(a.clientHeight-(p+g)),S=Yp(h),N={rootMargin:-j+"px "+-b+"px "+-y+"px "+-S+"px",threshold:Zr(0,qi(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&&!J$(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 sW(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=aN(e),h=a||i?[...f?jd(f):[],...jd(t)]:[];h.forEach(S=>{a&&S.addEventListener("scroll",n,{passive:!0}),i&&S.addEventListener("resize",n)});const p=f&&c?aW(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?Mo(e):null;d&&y();function y(){const S=Mo(e);b&&!J$(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 iW=k9,oW=O9,lW=_9,cW=R9,uW=E9,qE=A9,dW=T9,fW=(e,t,n)=>{const r=new Map,a={platform:rW,...n},i={...a.platform,_c:r};return C9(e,t,{...a,platform:i})};var pW=typeof document<"u",hW=function(){},jh=pW?v.useLayoutEffect:hW;function kh(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(!kh(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)&&!kh(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Z$(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function WE(e,t){const n=Z$(e);return Math.round(t*n)/n}function gy(e){const t=v.useRef(e);return jh(()=>{t.current=e}),t}function mW(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);kh(x,r)||g(r);const[j,b]=v.useState(null),[y,S]=v.useState(null),C=v.useCallback(B=>{B!==P.current&&(P.current=B,b(B))},[]),N=v.useCallback(B=>{B!==O.current&&(O.current=B,S(B))},[]),E=i||j,_=o||y,P=v.useRef(null),O=v.useRef(null),T=v.useRef(h),R=d!=null,I=gy(d),D=gy(a),$=gy(f),H=v.useCallback(()=>{if(!P.current||!O.current)return;const B={placement:t,strategy:n,middleware:x};D.current&&(B.platform=D.current),fW(P.current,O.current,B).then(U=>{const Z={...U,isPositioned:$.current!==!1};F.current&&!kh(T.current,Z)&&(T.current=Z,Kc.flushSync(()=>{p(Z)}))})},[x,t,n,D,$]);jh(()=>{f===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,p(B=>({...B,isPositioned:!1})))},[f]);const F=v.useRef(!1);jh(()=>(F.current=!0,()=>{F.current=!1}),[]),jh(()=>{if(E&&(P.current=E),_&&(O.current=_),E&&_){if(I.current)return I.current(E,_,H);H()}},[E,_,H,I,R]);const q=v.useMemo(()=>({reference:P,floating:O,setReference:C,setFloating:N}),[C,N]),Q=v.useMemo(()=>({reference:E,floating:_}),[E,_]),J=v.useMemo(()=>{const B={position:n,left:0,top:0};if(!Q.floating)return B;const U=WE(Q.floating,h.x),Z=WE(Q.floating,h.y);return c?{...B,transform:"translate("+U+"px, "+Z+"px)",...Z$(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:H,refs:q,elements:Q,floatingStyles:J}),[h,H,q,Q,J])}const vW=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?qE({element:r.current,padding:a}).fn(n):{}:r?qE({element:r,padding:a}).fn(n):{}}}},gW=(e,t)=>({...iW(e),options:[e,t]}),xW=(e,t)=>({...oW(e),options:[e,t]}),yW=(e,t)=>({...dW(e),options:[e,t]}),bW=(e,t)=>({...lW(e),options:[e,t]}),wW=(e,t)=>({...cW(e),options:[e,t]}),jW=(e,t)=>({...uW(e),options:[e,t]}),SW=(e,t)=>({...vW(e),options:[e,t]});var NW="Arrow",eD=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return s.jsx(Ke.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"})})});eD.displayName=NW;var CW=eD;function ev(e){const[t,n]=v.useState(void 0);return Vn(()=>{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 sN="Popper",[tD,Gi]=lr(sN),[AW,nD]=tD(sN),rD=e=>{const{__scopePopper:t,children:n}=e,[r,a]=v.useState(null);return s.jsx(AW,{scope:t,anchor:r,onAnchorChange:a,children:n})};rD.displayName=sN;var aD="PopperAnchor",sD=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=nD(aD,n),o=v.useRef(null),c=vt(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(Ke.div,{...a,ref:c})});sD.displayName=aD;var iN="PopperContent",[_W,EW]=tD(iN),iD=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=nD(iN,n),[S,C]=v.useState(null),N=vt(t,le=>C(le)),[E,_]=v.useState(null),P=ev(E),O=P?.width??0,T=P?.height??0,R=r+(i!=="center"?"-"+i:""),I=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},D=Array.isArray(f)?f:[f],$=D.length>0,H={padding:I,boundary:D.filter(kW),altBoundary:$},{refs:F,floatingStyles:q,placement:Q,isPositioned:J,middlewareData:B}=mW({strategy:"fixed",placement:R,whileElementsMounted:(...le)=>sW(...le,{animationFrame:g==="always"}),elements:{reference:y.anchor},middleware:[gW({mainAxis:a+T,alignmentAxis:o}),d&&xW({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?yW():void 0,...H}),d&&bW({...H}),wW({...H,apply:({elements:le,rects:oe,availableWidth:ie,availableHeight:fe})=>{const{width:Ae,height:re}=oe.reference,Te=le.floating.style;Te.setProperty("--radix-popper-available-width",`${ie}px`),Te.setProperty("--radix-popper-available-height",`${fe}px`),Te.setProperty("--radix-popper-anchor-width",`${Ae}px`),Te.setProperty("--radix-popper-anchor-height",`${re}px`)}}),E&&SW({element:E,padding:c}),OW({arrowWidth:O,arrowHeight:T}),x&&jW({strategy:"referenceHidden",...H})]}),[U,Z]=cD(Q),z=On(j);Vn(()=>{J&&z?.()},[J,z]);const L=B.arrow?.x,ee=B.arrow?.y,se=B.arrow?.centerOffset!==0,[G,ue]=v.useState();return Vn(()=>{S&&ue(window.getComputedStyle(S).zIndex)},[S]),s.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:J?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[B.transformOrigin?.x,B.transformOrigin?.y].join(" "),...B.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(_W,{scope:n,placedSide:U,onArrowChange:_,arrowX:L,arrowY:ee,shouldHideArrow:se,children:s.jsx(Ke.div,{"data-side":U,"data-align":Z,...b,ref:N,style:{...b.style,animation:J?void 0:"none"}})})})});iD.displayName=iN;var oD="PopperArrow",PW={top:"bottom",right:"left",bottom:"top",left:"right"},lD=v.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=EW(oD,r),o=PW[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(CW,{...a,ref:n,style:{...a.style,display:"block"}})})});lD.displayName=oD;function kW(e){return e!==null}var OW=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]=cD(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 cD(e){const[t,n="center"]=e.split("-");return[t,n]}var tv=rD,xf=sD,nv=iD,rv=lD,TW=Symbol("radix.slottable");function RW(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=TW,t}var[av]=lr("Tooltip",[Gi]),sv=Gi(),uD="TooltipProvider",IW=700,Gj="tooltip.open",[MW,oN]=av(uD),dD=e=>{const{__scopeTooltip:t,delayDuration:n=IW,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(MW,{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})};dD.displayName=uD;var Sd="Tooltip",[$W,iv]=av(Sd),fD=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:i,disableHoverableContent:o,delayDuration:c}=e,d=oN(Sd,e.__scopeTooltip),f=sv(t),[h,p]=v.useState(null),x=Wn(),g=v.useRef(0),j=o??d.disableHoverableContent,b=c??d.delayDuration,y=v.useRef(!1),[S,C]=oa({prop:r,defaultProp:a??!1,onChange:O=>{O?(d.onOpen(),document.dispatchEvent(new CustomEvent(Gj))):d.onClose(),i?.(O)},caller:Sd}),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(tv,{...f,children:s.jsx($W,{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})})};fD.displayName=Sd;var Yj="TooltipTrigger",pD=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=iv(Yj,n),i=oN(Yj,n),o=sv(n),c=v.useRef(null),d=vt(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(xf,{asChild:!0,...o,children:s.jsx(Ke.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:d,onPointerMove:Re(e.onPointerMove,x=>{x.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),h.current=!0)}),onPointerLeave:Re(e.onPointerLeave,()=>{a.onTriggerLeave(),h.current=!1}),onPointerDown:Re(e.onPointerDown,()=>{a.open&&a.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Re(e.onFocus,()=>{f.current||a.onOpen()}),onBlur:Re(e.onBlur,a.onClose),onClick:Re(e.onClick,a.onClose)})})});pD.displayName=Yj;var DW="TooltipPortal",[Wge,LW]=av(DW,{forceMount:void 0}),vc="TooltipContent",hD=v.forwardRef((e,t)=>{const n=LW(vc,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,o=iv(vc,e.__scopeTooltip);return s.jsx(Hn,{present:r||o.open,children:o.disableHoverableContent?s.jsx(mD,{side:a,...i,ref:t}):s.jsx(FW,{side:a,...i,ref:t})})}),FW=v.forwardRef((e,t)=>{const n=iv(vc,e.__scopeTooltip),r=oN(vc,e.__scopeTooltip),a=v.useRef(null),i=vt(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=WW(S,y.getBoundingClientRect()),N=VW(S,C),E=HW(b.getBoundingClientRect()),_=GW([...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=!KW(S,o);C?x():N&&(x(),f())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[d,h,o,f,x]),s.jsx(mD,{...e,ref:i})}),[BW,zW]=av(Sd,{isInside:!1}),UW=RW("TooltipContent"),mD=v.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...c}=e,d=iv(vc,n),f=sv(n),{onClose:h}=d;return v.useEffect(()=>(document.addEventListener(Gj,h),()=>document.removeEventListener(Gj,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(Jo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:p=>p.preventDefault(),onDismiss:h,children:s.jsxs(nv,{"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(UW,{children:r}),s.jsx(BW,{scope:n,isInside:!0,children:s.jsx(y7,{id:d.contentId,role:"tooltip",children:a||r})})]})})});hD.displayName=vc;var vD="TooltipArrow",qW=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=sv(n);return zW(vD,n).isInside?null:s.jsx(rv,{...a,...r,ref:t})});qW.displayName=vD;function WW(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 VW(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 HW(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 KW(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 GW(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),YW(t)}function YW(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 XW=dD,QW=fD,JW=pD,gD=hD;const xD=XW,yD=QW,bD=JW,lN=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(gD,{ref:r,sideOffset:t,className:Ne("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}));lN.displayName=gD.displayName;var ov=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(){}},ZW={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},eV=class{#e=ZW;#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)}},Xj=new eV;function tV(e){setTimeout(e,0)}var lv=typeof window>"u"||"Deno"in globalThis;function Fa(){}function nV(e,t){return typeof e=="function"?e(t):e}function rV(e){return typeof e=="number"&&e>=0&&e!==1/0}function aV(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Qj(e,t){return typeof e=="function"?e(t):e}function sV(e,t){return typeof e=="function"?e(t):e}function VE(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:i,queryKey:o,stale:c}=e;if(o){if(r){if(t.queryHash!==cN(o,t.options))return!1}else if(!Cd(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 HE(e,t){const{exact:n,status:r,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Nd(t.options.mutationKey)!==Nd(i))return!1}else if(!Cd(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function cN(e,t){return(t?.queryKeyHashFn||Nd)(e)}function Nd(e){return JSON.stringify(e,(t,n)=>Jj(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function Cd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Cd(e[n],t[n])):!1}var iV=Object.prototype.hasOwnProperty;function wD(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=KE(e)&&KE(t);if(!r&&!(Jj(e)&&Jj(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:iV.call(e,p))&&f++;continue}if(x===null||g===null||typeof x!="object"||typeof g!="object"){d[p]=g;continue}const j=wD(x,g,n+1);d[p]=j,j===x&&f++}return i===c&&f===i?e:d}function KE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Jj(e){if(!GE(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!GE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function GE(e){return Object.prototype.toString.call(e)==="[object Object]"}function oV(e){return new Promise(t=>{Xj.setTimeout(t,e)})}function lV(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?wD(e,t):t}function cV(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function uV(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var uN=Symbol();function jD(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===uN?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function dV(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 fV=class extends ov{#e;#n;#t;constructor(){super(),this.#t=e=>{if(!lv&&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"}},SD=new fV;function pV(){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 hV=tV;function mV(){let e=[],t=0,n=c=>{c()},r=c=>{c()},a=hV;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 br=mV(),vV=class extends ov{#e=!0;#n;#t;constructor(){super(),this.#t=e=>{if(!lv&&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}},Oh=new vV;function gV(e){return Math.min(1e3*2**e,3e4)}function ND(e){return(e??"online")==="online"?Oh.isOnline():!0}var Zj=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function CD(e){let t=!1,n=0,r;const a=pV(),i=()=>a.status!=="pending",o=b=>{if(!i()){const y=new Zj(b);x(y),e.onCancel?.(y)}},c=()=>{t=!0},d=()=>{t=!1},f=()=>SD.isFocused()&&(e.networkMode==="always"||Oh.isOnline())&&e.canRun(),h=()=>ND(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??(lv?0:3),N=e.retryDelay??gV,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),oV(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 AD=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rV(this.gcTime)&&(this.#e=Xj.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(lv?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Xj.clearTimeout(this.#e),this.#e=void 0)}},xV=class extends AD{#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=XE(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=XE(this.options);t.data!==void 0&&(this.setState(YE(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#t.remove(this)}setData(e,t){const n=lV(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(Fa).catch(Fa):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>sV(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===uN||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Qj(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:!aV(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=jD(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=CD({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:c=>{c instanceof Zj&&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 Zj){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,...yV(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...YE(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),br.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#t.notify({query:this,type:"updated",action:e})})}};function yV(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ND(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function YE(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function XE(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 QE(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=>{dV(j,()=>t.signal,()=>h=!0)},x=jD(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?uV:cV;return{pages:_(j.pages,N,E),pageParams:_(j.pageParams,b,E)}};if(a&&i.length){const j=a==="backward",b=j?bV:JE,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:JE(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 JE(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 bV(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var wV=class extends AD{#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||jV(),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=CD({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),br.batch(()=>{this.#n.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function jV(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var SV=class extends ov{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 wV({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=Xp(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=Xp(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=Xp(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=Xp(e);return typeof t=="string"?this.#n.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){br.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=>HE(t,n))}findAll(e={}){return this.getAll().filter(t=>HE(e,t))}notify(e){br.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return br.batch(()=>Promise.all(e.map(t=>t.continue().catch(Fa))))}};function Xp(e){return e.options.scope?.id}var NV=class extends ov{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,a=t.queryHash??cN(r,t);let i=this.get(a);return i||(i=new xV({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(){br.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=>VE(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>VE(e,n)):t}notify(e){br.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){br.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){br.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},CV=class{#e;#n;#t;#a;#r;#i;#o;#s;constructor(e={}){this.#e=e.queryCache||new NV,this.#n=e.mutationCache||new SV,this.#t=e.defaultOptions||{},this.#a=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=SD.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Oh.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(Qj(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=nV(t,i);if(o!==void 0)return this.#e.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return br.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;br.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return br.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=br.batch(()=>this.#e.findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(Fa).catch(Fa)}invalidateQueries(e,t={}){return br.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=br.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(Fa)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Fa)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Qj(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Fa).catch(Fa)}fetchInfiniteQuery(e){return e.behavior=QE(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Fa).catch(Fa)}ensureInfiniteQueryData(e){return e.behavior=QE(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Oh.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(Nd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#a.values()],n={};return t.forEach(r=>{Cd(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Nd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Cd(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=cN(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===uN&&(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()}},AV=v.createContext(void 0),_V=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(AV.Provider,{value:e,children:t}));function Ad(){return Ad=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ad.apply(this,arguments)}var Di;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Di||(Di={}));const ZE="popstate";function EV(e){e===void 0&&(e={});function t(r,a){let{pathname:i,search:o,hash:c}=r.location;return e1("",{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 kV(t,n,null,e)}function Sn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function dN(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function PV(){return Math.random().toString(36).substr(2,8)}function eP(e,t){return{usr:e.state,key:e.key,idx:t}}function e1(e,t,n,r){return n===void 0&&(n=null),Ad({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Jc(t):t,{state:n,key:t&&t.key||r||PV()})}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 Jc(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 kV(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:i=!1}=r,o=a.history,c=Di.Pop,d=null,f=h();f==null&&(f=0,o.replaceState(Ad({},o.state,{idx:f}),""));function h(){return(o.state||{idx:null}).idx}function p(){c=Di.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=Di.Push;let C=e1(b.location,y,S);f=h()+1;let N=eP(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=Di.Replace;let C=e1(b.location,y,S);f=h();let N=eP(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"),Sn(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(ZE,p),d=y,()=>{a.removeEventListener(ZE,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 tP;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(tP||(tP={}));function OV(e,t,n){return n===void 0&&(n="/"),TV(e,t,n)}function TV(e,t,n,r){let a=typeof t=="string"?Jc(t):t,i=gc(a.pathname||"/",n);if(i==null)return null;let o=_D(e);RV(o);let c=null;for(let d=0;c==null&&d<o.length;++d){let f=WV(i);c=UV(o[d],f)}return c}function _D(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("/")&&(Sn(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=Fi([r,d.relativePath]),h=n.concat(d);i.children&&i.children.length>0&&(Sn(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),_D(i.children,t,h,f)),!(i.path==null&&!i.index)&&t.push({path:f,score:BV(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 ED(i.path))a(i,o,d)}),t}function ED(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=ED(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 RV(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:zV(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const IV=/^:[\w-]+$/,MV=3,$V=2,DV=1,LV=10,FV=-2,nP=e=>e==="*";function BV(e,t){let n=e.split("/"),r=n.length;return n.some(nP)&&(r+=FV),t&&(r+=$V),n.filter(a=>!nP(a)).reduce((a,i)=>a+(IV.test(i)?MV:i===""?DV:LV),r)}function zV(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 UV(e,t,n){let{routesMeta:r}=e,a={},i="/",o=[];for(let c=0;c<r.length;++c){let d=r[c],f=c===r.length-1,h=i==="/"?t:t.slice(i.length)||"/",p=en({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},h),x=d.route;if(!p)return null;Object.assign(a,p.params),o.push({params:a,pathname:Fi([i,p.pathname]),pathnameBase:YV(Fi([i,p.pathnameBase])),route:x}),p.pathnameBase!=="/"&&(i=Fi([i,p.pathnameBase]))}return o}function en(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=qV(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 qV(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),dN(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 WV(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return dN(!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 gc(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 VV=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,HV=e=>VV.test(e);function KV(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Jc(e):e,i;if(n)if(HV(n))i=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),dN(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?i=rP(n.substring(1),"/"):i=rP(n,t)}else i=t;return{pathname:i,search:XV(r),hash:QV(a)}}function rP(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 xy(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 GV(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function fN(e,t){let n=GV(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function pN(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=Jc(e):(a=Ad({},e),Sn(!a.pathname||!a.pathname.includes("?"),xy("?","pathname","search",a)),Sn(!a.pathname||!a.pathname.includes("#"),xy("#","pathname","hash",a)),Sn(!a.search||!a.search.includes("#"),xy("#","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=KV(a,c),f=o&&o!=="/"&&o.endsWith("/"),h=(i||o===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||h)&&(d.pathname+="/"),d}const Fi=e=>e.join("/").replace(/\/\/+/g,"/"),YV=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),XV=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,QV=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function JV(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const PD=["post","put","patch","delete"];new Set(PD);const ZV=["get",...PD];new Set(ZV);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)}const cv=v.createContext(null),kD=v.createContext(null),ri=v.createContext(null),uv=v.createContext(null),Ns=v.createContext({outlet:null,matches:[],isDataRoute:!1}),OD=v.createContext(null);function eH(e,t){let{relative:n}=t===void 0?{}:t;Zc()||Sn(!1);let{basename:r,navigator:a}=v.useContext(ri),{hash:i,pathname:o,search:c}=dv(e,{relative:n}),d=o;return r!=="/"&&(d=o==="/"?r:Fi([r,o])),a.createHref({pathname:d,search:c,hash:i})}function Zc(){return v.useContext(uv)!=null}function Cs(){return Zc()||Sn(!1),v.useContext(uv).location}function TD(e){v.useContext(ri).static||v.useLayoutEffect(e)}function _a(){let{isDataRoute:e}=v.useContext(Ns);return e?mH():tH()}function tH(){Zc()||Sn(!1);let e=v.useContext(cv),{basename:t,future:n,navigator:r}=v.useContext(ri),{matches:a}=v.useContext(Ns),{pathname:i}=Cs(),o=JSON.stringify(fN(a,n.v7_relativeSplatPath)),c=v.useRef(!1);return TD(()=>{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=pN(f,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Fi([t,p.pathname])),(h.replace?r.replace:r.push)(p,h.state,h)},[t,r,o,i,e])}const nH=v.createContext(null);function rH(e){let t=v.useContext(Ns).outlet;return t&&v.createElement(nH.Provider,{value:e},t)}function el(){let{matches:e}=v.useContext(Ns),t=e[e.length-1];return t?t.params:{}}function dv(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=v.useContext(ri),{matches:a}=v.useContext(Ns),{pathname:i}=Cs(),o=JSON.stringify(fN(a,r.v7_relativeSplatPath));return v.useMemo(()=>pN(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function aH(e,t){return sH(e,t)}function sH(e,t,n,r){Zc()||Sn(!1);let{navigator:a}=v.useContext(ri),{matches:i}=v.useContext(Ns),o=i[i.length-1],c=o?o.params:{};o&&o.pathname;let d=o?o.pathnameBase:"/";o&&o.route;let f=Cs(),h;if(t){var p;let y=typeof t=="string"?Jc(t):t;d==="/"||(p=y.pathname)!=null&&p.startsWith(d)||Sn(!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=OV(e,{pathname:g}),b=uH(j&&j.map(y=>Object.assign({},y,{params:Object.assign({},c,y.params),pathname:Fi([d,a.encodeLocation?a.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?d:Fi([d,a.encodeLocation?a.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),i,n,r);return t&&b?v.createElement(uv.Provider,{value:{location:_d({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:Di.Pop}},b):b}function iH(){let e=hH(),t=JV(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 oH=v.createElement(iH,null);class lH 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(Ns.Provider,{value:this.props.routeContext},v.createElement(OD.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function cH(e){let{routeContext:t,match:n,children:r}=e,a=v.useContext(cv);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(Ns.Provider,{value:t},r)}function uH(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||Sn(!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||oH,d&&(f<0&&x===0?(vH("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(cH,{match:p,routeContext:{outlet:h,matches:S,isDataRoute:n!=null},children:N})};return n&&(p.route.ErrorBoundary||p.route.errorElement||x===0)?v.createElement(lH,{location:n.location,revalidation:n.revalidation,component:b,error:g,children:C(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):C()},null)}var RD=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(RD||{}),ID=(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})(ID||{});function dH(e){let t=v.useContext(cv);return t||Sn(!1),t}function fH(e){let t=v.useContext(kD);return t||Sn(!1),t}function pH(e){let t=v.useContext(Ns);return t||Sn(!1),t}function MD(e){let t=pH(),n=t.matches[t.matches.length-1];return n.route.id||Sn(!1),n.route.id}function hH(){var e;let t=v.useContext(OD),n=fH(),r=MD();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function mH(){let{router:e}=dH(RD.UseNavigateStable),t=MD(ID.UseNavigateStable),n=v.useRef(!1);return TD(()=>{n.current=!0}),v.useCallback(function(a,i){i===void 0&&(i={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,_d({fromRouteId:t},i)))},[e,t])}const aP={};function vH(e,t,n){aP[e]||(aP[e]=!0)}function gH(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function $D(e){let{to:t,replace:n,state:r,relative:a}=e;Zc()||Sn(!1);let{future:i,static:o}=v.useContext(ri),{matches:c}=v.useContext(Ns),{pathname:d}=Cs(),f=_a(),h=pN(t,fN(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 sP(e){return rH(e.context)}function Zt(e){Sn(!1)}function xH(e){let{basename:t="/",children:n=null,location:r,navigationType:a=Di.Pop,navigator:i,static:o=!1,future:c}=e;Zc()&&Sn(!1);let d=t.replace(/^\/*/,"/"),f=v.useMemo(()=>({basename:d,navigator:i,static:o,future:_d({v7_relativeSplatPath:!1},c)}),[d,c,i,o]);typeof r=="string"&&(r=Jc(r));let{pathname:h="/",search:p="",hash:x="",state:g=null,key:j="default"}=r,b=v.useMemo(()=>{let y=gc(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(ri.Provider,{value:f},v.createElement(uv.Provider,{children:n,value:b}))}function yH(e){let{children:t,location:n}=e;return aH(t1(t),n)}new Promise(()=>{});function t1(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,t1(r.props.children,i));return}r.type!==Zt&&Sn(!1),!r.props.index||!r.props.children||Sn(!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=t1(r.props.children,i)),n.push(o)}),n}function Rh(){return Rh=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},Rh.apply(this,arguments)}function DD(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 bH(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function wH(e,t){return e.button===0&&(!t||t==="_self")&&!bH(e)}function n1(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 jH(e,t){let n=n1(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}const SH=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],NH=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],CH="6";try{window.__reactRouterVersion=CH}catch{}const AH=v.createContext({isTransitioning:!1}),_H="startTransition",iP=Vm[_H];function EH(e){let{basename:t,children:n,future:r,window:a}=e,i=v.useRef();i.current==null&&(i.current=EV({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&&iP?iP(()=>d(p)):d(p)},[d,f]);return v.useLayoutEffect(()=>o.listen(h),[o,h]),v.useEffect(()=>gH(r),[r]),v.createElement(xH,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:o,future:r})}const PH=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",kH=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,bt=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=DD(t,SH),{basename:g}=v.useContext(ri),j,b=!1;if(typeof f=="string"&&kH.test(f)&&(j=f,PH))try{let N=new URL(window.location.href),E=f.startsWith("//")?new URL(N.protocol+f):new URL(f),_=gc(E.pathname,g);E.origin===N.origin&&_!=null?f=_+E.search+E.hash:b=!0}catch{}let y=eH(f,{relative:a}),S=RH(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",Rh({},x,{href:j||y,onClick:b||i?r:C,ref:n,target:d}))}),OH=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=DD(t,NH),x=dv(d,{relative:p.relative}),g=Cs(),j=v.useContext(kD),{navigator:b,basename:y}=v.useContext(ri),S=j!=null&&IH(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=gc(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)==="/"),T={isActive:P,isPending:O,isTransitioning:S},R=P?r:void 0,I;typeof i=="function"?I=i(T):I=[i,P?"active":null,O?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let D=typeof c=="function"?c(T):c;return v.createElement(bt,Rh({},p,{"aria-current":R,className:I,ref:n,style:D,to:d,viewTransition:f}),typeof h=="function"?h(T):h)});var r1;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(r1||(r1={}));var oP;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(oP||(oP={}));function TH(e){let t=v.useContext(cv);return t||Sn(!1),t}function RH(e,t){let{target:n,replace:r,state:a,preventScrollReset:i,relative:o,viewTransition:c}=t===void 0?{}:t,d=_a(),f=Cs(),h=dv(e,{relative:o});return v.useCallback(p=>{if(wH(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 Yi(e){let t=v.useRef(n1(e)),n=v.useRef(!1),r=Cs(),a=v.useMemo(()=>jH(r.search,n.current?null:t.current),[r.search]),i=_a(),o=v.useCallback((c,d)=>{const f=n1(typeof c=="function"?c(a):c);n.current=!0,i("?"+f,d)},[i,a]);return[a,o]}function IH(e,t){t===void 0&&(t={});let n=v.useContext(AH);n==null&&Sn(!1);let{basename:r}=TH(r1.useViewTransitionState),a=dv(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=gc(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=gc(n.nextLocation.pathname,r)||n.nextLocation.pathname;return en(a.pathname,o)!=null||en(a.pathname,i)!=null}var MH=Symbol.for("react.lazy"),Ih=Vm[" use ".trim().toString()];function $H(e){return typeof e=="object"&&e!==null&&"then"in e}function LD(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===MH&&"_payload"in e&&$H(e._payload)}function fv(e){const t=DH(e),n=v.forwardRef((r,a)=>{let{children:i,...o}=r;LD(i)&&typeof Ih=="function"&&(i=Ih(i._payload));const c=v.Children.toArray(i),d=c.find(FH);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 Xi=fv("Slot");function DH(e){const t=v.forwardRef((n,r)=>{let{children:a,...i}=n;if(LD(a)&&typeof Ih=="function"&&(a=Ih(a._payload)),v.isValidElement(a)){const o=zH(a),c=BH(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Cr(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 LH=Symbol("radix.slottable");function FH(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===LH}function BH(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 zH(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 yy=768;function UH(){const[e,t]=v.useState(void 0);return v.useEffect(()=>{const n=window.matchMedia(`(max-width: ${yy-1}px)`),r=()=>{t(window.innerWidth<yy)};return n.addEventListener("change",r),t(window.innerWidth<yy),()=>n.removeEventListener("change",r)},[]),!!e}const hN=Zo("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"}}),ne=v.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},i)=>{const o=r?Xi:"button";return s.jsx(o,{className:Ne(hN({variant:t,size:n,className:e})),ref:i,...a})});ne.displayName="Button";const ft=v.forwardRef(({className:e,type:t,...n},r)=>s.jsx("input",{type:t,className:Ne("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}));ft.displayName="Input";var qH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],WH=qH.reduce((e,t)=>{const n=fv(`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}},{}),VH="Separator",lP="horizontal",HH=["horizontal","vertical"],FD=v.forwardRef((e,t)=>{const{decorative:n,orientation:r=lP,...a}=e,i=KH(r)?r:lP,c=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return s.jsx(WH.div,{"data-orientation":i,...c,...a,ref:t})});FD.displayName=VH;function KH(e){return HH.includes(e)}var BD=FD;const zD=v.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>s.jsx(BD,{ref:a,decorative:n,orientation:t,className:Ne("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));zD.displayName=BD.displayName;var by="focusScope.autoFocusOnMount",wy="focusScope.autoFocusOnUnmount",cP={bubbles:!1,cancelable:!0},GH="FocusScope",yf=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[c,d]=v.useState(null),f=On(a),h=On(i),p=v.useRef(null),x=vt(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:Ri(p.current,{select:!0})},y=function(N){if(g.paused||!c)return;const E=N.relatedTarget;E!==null&&(c.contains(E)||Ri(p.current,{select:!0}))},S=function(N){if(document.activeElement===document.body)for(const _ of N)_.removedNodes.length>0&&Ri(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){dP.add(g);const b=document.activeElement;if(!c.contains(b)){const S=new CustomEvent(by,cP);c.addEventListener(by,f),c.dispatchEvent(S),S.defaultPrevented||(YH(eK(UD(c)),{select:!0}),document.activeElement===b&&Ri(c))}return()=>{c.removeEventListener(by,f),setTimeout(()=>{const S=new CustomEvent(wy,cP);c.addEventListener(wy,h),c.dispatchEvent(S),S.defaultPrevented||Ri(b??document.body,{select:!0}),c.removeEventListener(wy,h),dP.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]=XH(C);N&&E?!b.shiftKey&&S===E?(b.preventDefault(),n&&Ri(N,{select:!0})):b.shiftKey&&S===N&&(b.preventDefault(),n&&Ri(E,{select:!0})):S===C&&b.preventDefault()}},[n,r,g.paused]);return s.jsx(Ke.div,{tabIndex:-1,...o,ref:x,onKeyDown:j})});yf.displayName=GH;function YH(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ri(r,{select:t}),document.activeElement!==n)return}function XH(e){const t=UD(e),n=uP(t,e),r=uP(t.reverse(),e);return[n,r]}function UD(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 uP(e,t){for(const n of e)if(!QH(n,{upTo:t}))return n}function QH(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 JH(e){return e instanceof HTMLInputElement&&"select"in e}function Ri(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&JH(e)&&t&&e.select()}}var dP=ZH();function ZH(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=fP(e,t),e.unshift(t)},remove(t){e=fP(e,t),e[0]?.resume()}}}function fP(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function eK(e){return e.filter(t=>t.tagName!=="A")}var jy=0;function pv(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??pP()),document.body.insertAdjacentElement("beforeend",e[1]??pP()),jy++,()=>{jy===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),jy--}},[])}function pP(){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 cs=function(){return cs=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},cs.apply(this,arguments)};function qD(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 tK(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 Sh="right-scroll-bar-position",Nh="width-before-scroll-bar",nK="with-scroll-bars-hidden",rK="--removed-body-scroll-bar-size";function Sy(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function aK(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 sK=typeof window<"u"?v.useLayoutEffect:v.useEffect,hP=new WeakMap;function iK(e,t){var n=aK(null,function(r){return e.forEach(function(a){return Sy(a,r)})});return sK(function(){var r=hP.get(n);if(r){var a=new Set(r),i=new Set(e),o=n.current;a.forEach(function(c){i.has(c)||Sy(c,null)}),i.forEach(function(c){a.has(c)||Sy(c,o)})}hP.set(n,e)},[e]),n}function oK(e){return e}function lK(e,t){t===void 0&&(t=oK);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 cK(e){e===void 0&&(e={});var t=lK(null);return t.options=cs({async:!0,ssr:!1},e),t}var WD=function(e){var t=e.sideCar,n=qD(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,cs({},n))};WD.isSideCarExport=!0;function uK(e,t){return e.useMedium(t),WD}var VD=cK(),Ny=function(){},hv=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:Ny,onWheelCapture:Ny,onTouchMoveCapture:Ny}),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=qD(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=x,P=iK([n,t]),O=cs(cs({},E),a);return v.createElement(v.Fragment,null,h&&v.createElement(_,{sideCar:VD,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),cs(cs({},O),{ref:P})):v.createElement(C,cs({},O,{className:d,ref:P}),c))});hv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};hv.classNames={fullWidth:Nh,zeroRight:Sh};var dK=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function fK(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=dK();return t&&e.setAttribute("nonce",t),e}function pK(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function hK(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var mK=function(){var e=0,t=null;return{add:function(n){e==0&&(t=fK())&&(pK(t,n),hK(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},vK=function(){var e=mK();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},HD=function(){var e=vK(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},gK={left:0,top:0,right:0,gap:0},Cy=function(e){return parseInt(e||"",10)||0},xK=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[Cy(n),Cy(r),Cy(a)]},yK=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return gK;var t=xK(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])}},bK=HD(),ic="data-scroll-locked",wK=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(nK,` {
11
- overflow: hidden `).concat(r,`;
12
- padding-right: `).concat(c,"px ").concat(r,`;
13
- }
14
- body[`).concat(ic,`] {
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(Sh,` {
28
- right: `).concat(c,"px ").concat(r,`;
29
- }
30
-
31
- .`).concat(Nh,` {
32
- margin-right: `).concat(c,"px ").concat(r,`;
33
- }
34
-
35
- .`).concat(Sh," .").concat(Sh,` {
36
- right: 0 `).concat(r,`;
37
- }
38
-
39
- .`).concat(Nh," .").concat(Nh,` {
40
- margin-right: 0 `).concat(r,`;
41
- }
42
-
43
- body[`).concat(ic,`] {
44
- `).concat(rK,": ").concat(c,`px;
45
- }
46
- `)},mP=function(){var e=parseInt(document.body.getAttribute(ic)||"0",10);return isFinite(e)?e:0},jK=function(){v.useEffect(function(){return document.body.setAttribute(ic,(mP()+1).toString()),function(){var e=mP()-1;e<=0?document.body.removeAttribute(ic):document.body.setAttribute(ic,e.toString())}},[])},SK=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;jK();var i=v.useMemo(function(){return yK(a)},[a]);return v.createElement(bK,{styles:wK(i,!t,a,n?"":"!important")})},a1=!1;if(typeof window<"u")try{var Qp=Object.defineProperty({},"passive",{get:function(){return a1=!0,!0}});window.addEventListener("test",Qp,Qp),window.removeEventListener("test",Qp,Qp)}catch{a1=!1}var Dl=a1?{passive:!1}:!1,NK=function(e){return e.tagName==="TEXTAREA"},KD=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!NK(e)&&n[t]==="visible")},CK=function(e){return KD(e,"overflowY")},AK=function(e){return KD(e,"overflowX")},vP=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=GD(e,r);if(a){var i=YD(e,r),o=i[1],c=i[2];if(o>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},_K=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},EK=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},GD=function(e,t){return e==="v"?CK(t):AK(t)},YD=function(e,t){return e==="v"?_K(t):EK(t)},PK=function(e,t){return e==="h"&&t==="rtl"?-1:1},kK=function(e,t,n,r,a){var i=PK(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=YD(e,c),j=g[0],b=g[1],y=g[2],S=b-y-i*j;(j||S)&&GD(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},Jp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},gP=function(e){return[e.deltaX,e.deltaY]},xP=function(e){return e&&"current"in e?e.current:e},OK=function(e,t){return e[0]===t[0]&&e[1]===t[1]},TK=function(e){return`
47
- .block-interactivity-`.concat(e,` {pointer-events: none;}
48
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
49
- `)},RK=0,Ll=[];function IK(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),a=v.useState(RK++)[0],i=v.useState(HD)[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=tK([e.lockRef.current],(e.shards||[]).map(xP),!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=Jp(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 T=window.getSelection(),R=T&&T.anchorNode,I=R?R===P||R.contains(P):!1;if(I)return!1;var D=vP(O,P);if(!D)return!0;if(D?_=O:(_=O==="v"?"h":"v",D=vP(O,P)),!D)return!1;if(!r.current&&"changedTouches"in b&&(N||E)&&(r.current=_),!_)return!0;var $=r.current||_;return kK($,y,b,$==="h"?N:E)},[]),d=v.useCallback(function(b){var y=b;if(!(!Ll.length||Ll[Ll.length-1]!==i)){var S="deltaY"in y?gP(y):Jp(y),C=t.current.filter(function(_){return _.name===y.type&&(_.target===y.target||y.target===_.shadowParent)&&OK(_.delta,S)})[0];if(C&&C.should){y.cancelable&&y.preventDefault();return}if(!C){var N=(o.current.shards||[]).map(xP).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:MK(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=Jp(b),r.current=void 0},[]),p=v.useCallback(function(b){f(b.type,gP(b),b.target,c(b,e.lockRef.current))},[]),x=v.useCallback(function(b){f(b.type,Jp(b),b.target,c(b,e.lockRef.current))},[]);v.useEffect(function(){return Ll.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:x}),document.addEventListener("wheel",d,Dl),document.addEventListener("touchmove",d,Dl),document.addEventListener("touchstart",h,Dl),function(){Ll=Ll.filter(function(b){return b!==i}),document.removeEventListener("wheel",d,Dl),document.removeEventListener("touchmove",d,Dl),document.removeEventListener("touchstart",h,Dl)}},[]);var g=e.removeScrollBar,j=e.inert;return v.createElement(v.Fragment,null,j?v.createElement(i,{styles:TK(a)}):null,g?v.createElement(SK,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function MK(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const $K=uK(VD,IK);var bf=v.forwardRef(function(e,t){return v.createElement(hv,cs({},e,{ref:t,sideCar:$K}))});bf.classNames=hv.classNames;var DK=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Fl=new WeakMap,Zp=new WeakMap,eh={},Ay=0,XD=function(e){return e&&(e.host||XD(e.parentNode))},LK=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=XD(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})},FK=function(e,t,n,r){var a=LK(t,Array.isArray(e)?e:[e]);eh[n]||(eh[n]=new WeakMap);var i=eh[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=(Fl.get(x)||0)+1,y=(i.get(x)||0)+1;Fl.set(x,b),i.set(x,y),o.push(x),b===1&&j&&Zp.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(),Ay++,function(){o.forEach(function(p){var x=Fl.get(p)-1,g=i.get(p)-1;Fl.set(p,x),i.set(p,g),x||(Zp.has(p)||p.removeAttribute(r),Zp.delete(p)),g||p.removeAttribute(n)}),Ay--,Ay||(Fl=new WeakMap,Fl=new WeakMap,Zp=new WeakMap,eh={})}},mv=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=DK(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),FK(r,a,n,"aria-hidden")):function(){return null}};function BK(e){const t=zK(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(qK);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 zK(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=VK(a),c=WK(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Cr(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 UK=Symbol("radix.slottable");function qK(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===UK}function WK(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 VK(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 vv="Dialog",[QD,JD]=lr(vv),[HK,Ka]=QD(vv),ZD=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]=oa({prop:r,defaultProp:a??!1,onChange:i,caller:vv});return s.jsx(HK,{scope:t,triggerRef:c,contentRef:d,contentId:Wn(),titleId:Wn(),descriptionId:Wn(),open:f,onOpenChange:h,onOpenToggle:v.useCallback(()=>h(p=>!p),[h]),modal:o,children:n})};ZD.displayName=vv;var e3="DialogTrigger",t3=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ka(e3,n),i=vt(t,a.triggerRef);return s.jsx(Ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":gN(a.open),...r,ref:i,onClick:Re(e.onClick,a.onOpenToggle)})});t3.displayName=e3;var mN="DialogPortal",[KK,n3]=QD(mN,{forceMount:void 0}),r3=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=Ka(mN,t);return s.jsx(KK,{scope:t,forceMount:n,children:v.Children.map(r,o=>s.jsx(Hn,{present:n||i.open,children:s.jsx(Gc,{asChild:!0,container:a,children:o})}))})};r3.displayName=mN;var Mh="DialogOverlay",a3=v.forwardRef((e,t)=>{const n=n3(Mh,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Ka(Mh,e.__scopeDialog);return i.modal?s.jsx(Hn,{present:r||i.open,children:s.jsx(YK,{...a,ref:t})}):null});a3.displayName=Mh;var GK=BK("DialogOverlay.RemoveScroll"),YK=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ka(Mh,n);return s.jsx(bf,{as:GK,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(Ke.div,{"data-state":gN(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),$o="DialogContent",s3=v.forwardRef((e,t)=>{const n=n3($o,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Ka($o,e.__scopeDialog);return s.jsx(Hn,{present:r||i.open,children:i.modal?s.jsx(XK,{...a,ref:t}):s.jsx(QK,{...a,ref:t})})});s3.displayName=$o;var XK=v.forwardRef((e,t)=>{const n=Ka($o,e.__scopeDialog),r=v.useRef(null),a=vt(t,n.contentRef,r);return v.useEffect(()=>{const i=r.current;if(i)return mv(i)},[]),s.jsx(i3,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0;(o.button===2||c)&&i.preventDefault()}),onFocusOutside:Re(e.onFocusOutside,i=>i.preventDefault())})}),QK=v.forwardRef((e,t)=>{const n=Ka($o,e.__scopeDialog),r=v.useRef(!1),a=v.useRef(!1);return s.jsx(i3,{...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()}})}),i3=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,c=Ka($o,n),d=v.useRef(null),f=vt(t,d);return pv(),s.jsxs(s.Fragment,{children:[s.jsx(yf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(Jo,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":gN(c.open),...o,ref:f,onDismiss:()=>c.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(ZK,{titleId:c.titleId}),s.jsx(tG,{contentRef:d,descriptionId:c.descriptionId})]})]})}),vN="DialogTitle",o3=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ka(vN,n);return s.jsx(Ke.h2,{id:a.titleId,...r,ref:t})});o3.displayName=vN;var l3="DialogDescription",c3=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ka(l3,n);return s.jsx(Ke.p,{id:a.descriptionId,...r,ref:t})});c3.displayName=l3;var u3="DialogClose",d3=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ka(u3,n);return s.jsx(Ke.button,{type:"button",...r,ref:t,onClick:Re(e.onClick,()=>a.onOpenChange(!1))})});d3.displayName=u3;function gN(e){return e?"open":"closed"}var f3="DialogTitleWarning",[JK,p3]=UU(f3,{contentName:$o,titleName:vN,docsSlug:"dialog"}),ZK=({titleId:e})=>{const t=p3(f3),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},eG="DialogDescriptionWarning",tG=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${p3(eG).contentName}}.`;return v.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},gv=ZD,nG=t3,xv=r3,eu=a3,tu=s3,wf=o3,jf=c3,yv=d3;const h3=gv,rG=xv,m3=v.forwardRef(({className:e,...t},n)=>s.jsx(eu,{className:Ne("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}));m3.displayName=eu.displayName;const aG=Zo("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"}}),xN=v.forwardRef(({side:e="right",className:t,children:n,...r},a)=>s.jsxs(rG,{children:[s.jsx(m3,{}),s.jsxs(tu,{ref:a,className:Ne(aG({side:e}),t),...r,children:[n,s.jsxs(yv,{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(ys,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));xN.displayName=tu.displayName;const v3=({className:e,...t})=>s.jsx("div",{className:Ne("flex flex-col space-y-2 text-center sm:text-left",e),...t});v3.displayName="SheetHeader";const g3=v.forwardRef(({className:e,...t},n)=>s.jsx(wf,{ref:n,className:Ne("text-lg font-semibold text-foreground",e),...t}));g3.displayName=wf.displayName;const sG=v.forwardRef(({className:e,...t},n)=>s.jsx(jf,{ref:n,className:Ne("text-sm text-muted-foreground",e),...t}));sG.displayName=jf.displayName;function yP({className:e,...t}){return s.jsx("div",{className:Ne("animate-pulse rounded-md bg-muted",e),...t})}const iG="sidebar:state",oG=3600*24*7,lG="16rem",cG="18rem",uG="3rem",dG="b",x3=v.createContext(null);function Sf(){const e=v.useContext(x3);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const y3=v.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:i,...o},c)=>{const d=UH(),[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=`${iG}=${N}; path=/; max-age=${oG}`},[n,g]),b=v.useCallback(()=>d?h(C=>!C):j(C=>!C),[d,j,h]);v.useEffect(()=>{const C=N=>{N.key===dG&&(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(x3.Provider,{value:S,children:s.jsx(xD,{delayDuration:0,children:s.jsx("div",{style:{"--sidebar-width":lG,"--sidebar-width-icon":uG,...a},className:Ne("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:c,...o,children:i})})})});y3.displayName="SidebarProvider";const b3=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}=Sf();return n==="none"?s.jsx("div",{className:Ne("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",r),ref:o,...i,children:a}):c?s.jsx(h3,{open:f,onOpenChange:h,...i,children:s.jsx(xN,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":cG},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:Ne("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:Ne("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})})]})});b3.displayName="Sidebar";const w3=v.forwardRef(({className:e,onClick:t,...n},r)=>{const{toggleSidebar:a}=Sf();return s.jsxs(ne,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:Ne("h-7 w-7",e),onClick:i=>{t?.(i),a()},...n,children:[s.jsx(G7,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});w3.displayName="SidebarTrigger";const fG=v.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=Sf();return s.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:Ne("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})});fG.displayName="SidebarRail";const pG=v.forwardRef(({className:e,...t},n)=>s.jsx("main",{ref:n,className:Ne("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}));pG.displayName="SidebarInset";const hG=v.forwardRef(({className:e,...t},n)=>s.jsx(ft,{ref:n,"data-sidebar":"input",className:Ne("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));hG.displayName="SidebarInput";const j3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"header",className:Ne("flex flex-col gap-2 p-2",e),...t}));j3.displayName="SidebarHeader";const S3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"footer",className:Ne("flex flex-col gap-2 p-2",e),...t}));S3.displayName="SidebarFooter";const s1=v.forwardRef(({className:e,...t},n)=>s.jsx(zD,{ref:n,"data-sidebar":"separator",className:Ne("mx-2 w-auto bg-sidebar-border",e),...t}));s1.displayName="SidebarSeparator";const N3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"content",className:Ne("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));N3.displayName="SidebarContent";const C3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"group",className:Ne("relative flex w-full min-w-0 flex-col p-2",e),...t}));C3.displayName="SidebarGroup";const A3=v.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const a=t?Xi:"div";return s.jsx(a,{ref:r,"data-sidebar":"group-label",className:Ne("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})});A3.displayName="SidebarGroupLabel";const mG=v.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const a=t?Xi:"button";return s.jsx(a,{ref:r,"data-sidebar":"group-action",className:Ne("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})});mG.displayName="SidebarGroupAction";const _3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"group-content",className:Ne("w-full text-sm",e),...t}));_3.displayName="SidebarGroupContent";const E3=v.forwardRef(({className:e,...t},n)=>s.jsx("ul",{ref:n,"data-sidebar":"menu",className:Ne("flex w-full min-w-0 flex-col gap-1",e),...t}));E3.displayName="SidebarMenu";const P3=v.forwardRef(({className:e,...t},n)=>s.jsx("li",{ref:n,"data-sidebar":"menu-item",className:Ne("group/menu-item relative",e),...t}));P3.displayName="SidebarMenuItem";const vG=Zo("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"}}),k3=v.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:a,className:i,...o},c)=>{const d=e?Xi:"button",{isMobile:f,state:h}=Sf(),p=s.jsx(d,{ref:c,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:Ne(vG({variant:n,size:r}),i),...o});return a?(typeof a=="string"&&(a={children:a}),s.jsxs(yD,{children:[s.jsx(bD,{asChild:!0,children:p}),s.jsx(lN,{side:"right",align:"center",hidden:h!=="collapsed"||f,...a})]})):p});k3.displayName="SidebarMenuButton";const gG=v.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},a)=>{const i=t?Xi:"button";return s.jsx(i,{ref:a,"data-sidebar":"menu-action",className:Ne("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})});gG.displayName="SidebarMenuAction";const xG=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:Ne("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}));xG.displayName="SidebarMenuBadge";const yG=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:Ne("flex h-8 items-center gap-2 rounded-md px-2",e),...n,children:[t&&s.jsx(yP,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),s.jsx(yP,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":a}})]})});yG.displayName="SidebarMenuSkeleton";const bG=v.forwardRef(({className:e,...t},n)=>s.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:Ne("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}));bG.displayName="SidebarMenuSub";const wG=v.forwardRef(({...e},t)=>s.jsx("li",{ref:t,...e}));wG.displayName="SidebarMenuSubItem";const jG=v.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...a},i)=>{const o=e?Xi:"a";return s.jsx(o,{ref:i,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:Ne("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})});jG.displayName="SidebarMenuSubButton";const O3=v.forwardRef(({className:e,activeClassName:t,pendingClassName:n,to:r,...a},i)=>s.jsx(OH,{ref:i,to:r,className:({isActive:o,isPending:c})=>Ne(e,o&&t,c&&n),...a}));O3.displayName="NavLink";function SG({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 NG=[{title:"Home",items:[{title:"Dashboard",url:"/",icon:A$}]},{title:"Lab",items:[{title:"MCP Evaluations",url:"/mcp-evaluations",icon:C$},{title:"Analyze MCP",url:"/tool-analysis",icon:_$}]},{title:"Libraries",items:[{title:"Test Cases",url:"/libraries/test-cases",icon:N$},{title:"Servers",url:"/libraries/servers",icon:S$},{title:"Agents",url:"/libraries/agents",icon:wa}]},{title:"Execution",items:[{title:"Run Evaluation",url:"/run",icon:ko},{title:"Evaluation Results",url:"/results",icon:wd},{title:"Compare Evaluations",url:"/compare",icon:GS},{title:"MCP Analysis Results",url:"/tool-analysis-results",icon:E$},{title:"Custom Reports",url:"/markdown-reports",icon:Xl}]},{title:"Workspace",items:[{title:"Settings",url:"/settings",icon:XS}]}];function CG(e={version:null}){const t=e.version??null,{state:n}=Sf(),r=n==="collapsed",a=Cs(),i=v.useMemo(()=>NG,[]);return s.jsxs(b3,{collapsible:"icon",children:[s.jsx(j3,{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(SG,{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(N3,{children:i.map((o,c)=>s.jsxs("div",{children:[c>0&&!r&&s.jsx(s1,{className:"my-1.5"}),s.jsxs(C3,{className:r?"px-2":"px-3 py-2",children:[!r&&s.jsx(A3,{className:"px-1 pb-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground/90",children:o.title}),s.jsx(_3,{children:s.jsx(E3,{children:o.items.map(d=>s.jsx(P3,{children:s.jsx(k3,{asChild:!0,isActive:d.url==="/"?a.pathname==="/":a.pathname.startsWith(d.url),tooltip:d.title,children:s.jsxs(O3,{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(S3,{className:r?"px-2 py-2":"px-3 py-3",children:[s.jsx(s1,{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(V7,{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 T3=v.forwardRef(({...e},t)=>s.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));T3.displayName="Breadcrumb";const R3=v.forwardRef(({className:e,...t},n)=>s.jsx("ol",{ref:n,className:Ne("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));R3.displayName="BreadcrumbList";const I3=v.forwardRef(({className:e,...t},n)=>s.jsx("li",{ref:n,className:Ne("inline-flex items-center gap-1.5",e),...t}));I3.displayName="BreadcrumbItem";const M3=v.forwardRef(({asChild:e,className:t,...n},r)=>{const a=e?Xi:"a";return s.jsx(a,{ref:r,className:Ne("transition-colors hover:text-foreground",t),...n})});M3.displayName="BreadcrumbLink";const $3=v.forwardRef(({className:e,...t},n)=>s.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:Ne("font-normal text-foreground",e),...t}));$3.displayName="BreadcrumbPage";const D3=({children:e,className:t,...n})=>s.jsx("li",{role:"presentation","aria-hidden":"true",className:Ne("[&>svg]:size-3.5",t),...n,children:e??s.jsx(j$,{})});D3.displayName="BreadcrumbSeparator";function qs(){return{input:0,output:0,total:0,hasInput:!1,hasOutput:!1,hasTotal:!1}}function Vl(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 Ws(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 AG(e){const t=qs();for(const n of e)Vl(t,n);return Ws(t)}function _G(e,t){return`${e}-${t+1}`}function Hl(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,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||_G("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,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 EG(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=Hl(t);return{servers:n.servers,agents:n.agents,scenarios:n.scenarios}}function bP(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",client_id:g.oauthClientId||"",client_secret:g.oauthClientSecret||void 0,redirect_url:g.oauthRedirectUrl||"http://localhost:6274/oauth/",scope:g.oauthScope||void 0}:void 0;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 PG(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",client_id:r.oauthClientId||"",client_secret:r.oauthClientSecret||void 0,redirect_url:r.oauthRedirectUrl||"http://localhost:6274/oauth/",scope:r.oauthScope||void 0}:void 0}})()])),n=Object.fromEntries(e.agents.map(r=>[r.id,{...r.name&&r.name!==r.id?{name:r.name}:{},provider:r.provider==="azure"?"azure_openai":r.provider==="anthropic"?"anthropic":"openai",model:r.model,temperature:r.temperature,max_tokens:r.maxTokens,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 kG(e,t){if(e)return`${e}::${t??""}`}function th(e){return e.type==="text"}function OG(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 TG(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(th);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:wP(x.input??{}),toolName:x.name,timestamp:o.ts});const g=h.get(x.id);if(!g)continue;const j=g.content.filter(th).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(th).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:wP(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(th).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 wP(e){try{return JSON.stringify(e)}catch{return String(e)}}function jP(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 _y(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 RG(e){const t=qs(),n=qs(),r=new Map;if(!e)return{assistant:null,tool:null,perTool:{}};for(const i of e.messages??[]){if(i.role!=="assistant")continue;jP(t,i.usage);const o=i.content.filter(h=>h.type==="tool_use");if(o.length===0)continue;jP(n,i.usage);const c=_y(i.usage?.input_tokens,o.length),d=_y(i.usage?.output_tokens,o.length),f=_y(i.usage?.total_tokens,o.length);for(let h=0;h<o.length;h+=1){const p=o[h].name,x=r.get(p)??qs(),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=Ws(o);c&&(a[i]=c)}return{assistant:Ws(t),tool:Ws(n),perTool:a}}function SP(e,t=[]){const n=new Map;for(const o of t){const c=kG(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=RG(C);return{runIndex:y.run_index,passed:y.pass,toolCalls:OG(y,C),assistantTokenUsage:N.assistant,toolTokenUsage:N.tool,toolTokenUsageByTool:N.perTool,finalAnswer:y.final_text,conversation:TG(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=qs(),p=qs(),x=new Map;for(const y of f){Vl(h,y.assistantTokenUsage),Vl(p,y.toolTokenUsage);for(const[S,C]of Object.entries(y.toolTokenUsageByTool??{})){const N=x.get(S)??qs();Vl(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=Ws(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:Ws(h),toolTokenUsage:Ws(p),toolTokenUsageByTool:g}}),a=qs(),i=qs();for(const o of r)Vl(a,o.assistantTokenUsage),Vl(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:Ws(a),toolTokenUsage:Ws(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 IG(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}const fd=IG();async function ut(e,t){const n=await fetch(`${fd}${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 MG(e,t){const n=await fetch(`${fd}${e}`,{...t,headers:{}});if(!n.ok){const r=await n.text();throw new Error(`Request failed (${n.status}): ${r}`)}return n.text()}const it={health:()=>ut("/api/health"),getSettings:()=>ut("/api/settings"),updateSettings:e=>ut("/api/settings",{method:"PUT",body:JSON.stringify(e)}),listConfigs:()=>ut("/api/evals"),createConfig:(e,t)=>ut("/api/evals",{method:"POST",body:JSON.stringify({fileName:e,config:t})}),updateConfig:(e,t,n)=>ut(`/api/evals/${e}`,{method:"PUT",body:JSON.stringify({config:t,fileName:n})}),deleteConfig:e=>ut(`/api/evals/${e}`,{method:"DELETE"}),listRuns:()=>ut("/api/runs"),listMarkdownReports:()=>ut("/api/markdown-reports").then(e=>e.items),getMarkdownReport:e=>ut(`/api/markdown-reports/content?path=${encodeURIComponent(e)}`),deleteMarkdownReport:e=>ut(`/api/markdown-reports?path=${encodeURIComponent(e)}`,{method:"DELETE"}).then(()=>{}),getRun:e=>ut(`/api/runs/${e}`),deleteRun:e=>ut(`/api/runs/${e}`,{method:"DELETE"}),updateRunNote:(e,t)=>ut(`/api/runs/${encodeURIComponent(e)}/note`,{method:"PATCH",body:JSON.stringify({runNote:t??""})}).then(()=>{}),getRunTrace:e=>ut(`/api/runs/${e}/trace`),listSnapshots:()=>ut("/api/snapshots"),createSnapshotFromRun:(e,t)=>ut("/api/snapshots",{method:"POST",body:JSON.stringify({runId:e,name:t})}),getSnapshot:e=>ut(`/api/snapshots/${e}`),compareSnapshot:(e,t)=>ut(`/api/snapshots/${e}/compare`,{method:"POST",body:JSON.stringify({runId:t})}),askResultAssistant:(e,t)=>ut(`/api/runs/${encodeURIComponent(e)}/assistant`,{method:"POST",body:JSON.stringify({messages:t})}),applyResultAssistantReport:e=>ut(`/api/runs/${encodeURIComponent(e.runId)}/assistant/apply-report`,{method:"POST",body:JSON.stringify({markdown:e.markdown,outputPath:e.outputPath,overwrite:e.overwrite})}),createResultAssistantSession:e=>ut("/api/result-assistant/sessions",{method:"POST",body:JSON.stringify({runId:e})}),getResultAssistantSession:e=>ut(`/api/result-assistant/sessions/${e}`),sendResultAssistantMessage:(e,t)=>ut(`/api/result-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t})}),approveResultAssistantToolCall:(e,t,n)=>ut(`/api/result-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify(n===void 0?{}:{argumentsOverride:n})}),denyResultAssistantToolCall:(e,t)=>ut(`/api/result-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),closeResultAssistantSession:e=>ut(`/api/result-assistant/sessions/${e}`,{method:"DELETE"}).then(()=>{}),generateSnapshotEvalBaseline:(e,t,n)=>ut("/api/snapshots/generate-eval",{method:"POST",body:JSON.stringify({runId:e,configId:t,name:n})}),updateSnapshotPolicy:(e,t)=>ut(`/api/evals/${e}/snapshot-policy`,{method:"POST",body:JSON.stringify(t)}),getLibraries:()=>ut("/api/libraries"),saveLibraries:e=>ut("/api/libraries",{method:"PUT",body:JSON.stringify(e)}),startRun:e=>ut("/api/runs",{method:"POST",body:JSON.stringify(e)}),listProviderModels:e=>ut(`/api/providers/models?provider=${encodeURIComponent(e)}`),createScenarioAssistantSession:e=>ut("/api/scenario-assistant/sessions",{method:"POST",body:JSON.stringify(e)}),getScenarioAssistantSession:e=>ut(`/api/scenario-assistant/sessions/${e}`),sendScenarioAssistantMessage:(e,t)=>ut(`/api/scenario-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t})}),approveScenarioAssistantToolCall:(e,t)=>ut(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify({})}),denyScenarioAssistantToolCall:(e,t)=>ut(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),approveAllScenarioAssistantToolCalls:e=>ut(`/api/scenario-assistant/sessions/${e}/tool-calls/approve-all`,{method:"POST",body:JSON.stringify({})}),closeScenarioAssistantSession:e=>ut(`/api/scenario-assistant/sessions/${e}`,{method:"DELETE"}),discoverToolsForAnalysis:e=>ut("/api/tool-analysis/discover-tools",{method:"POST",body:JSON.stringify(e)}),startToolAnalysis:e=>ut("/api/tool-analysis/jobs",{method:"POST",body:JSON.stringify(e)}),getToolAnalysisResult:e=>ut(`/api/tool-analysis/jobs/${e}/result`),stopToolAnalysis:e=>ut(`/api/tool-analysis/jobs/${e}/stop`,{method:"POST"}),subscribeToolAnalysisJob:(e,t)=>{const n=new EventSource(`${fd}/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:()=>ut("/api/tool-analysis-results").then(e=>e.items),getToolAnalysisSavedResult:e=>ut(`/api/tool-analysis-results/${e}`),deleteToolAnalysisSavedResult:e=>ut(`/api/tool-analysis-results/${e}`,{method:"DELETE"}).then(()=>{}),createOAuthDebuggerSession:e=>ut("/api/oauth-debugger/sessions",{method:"POST",body:JSON.stringify(e)}),getOAuthDebuggerSession:e=>ut(`/api/oauth-debugger/sessions/${e}`),startOAuthDebuggerSession:e=>ut(`/api/oauth-debugger/sessions/${e}/start`,{method:"POST",body:JSON.stringify({})}),subscribeOAuthDebuggerSession:(e,t)=>{const n=new EventSource(`${fd}/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)=>ut(`/api/oauth-debugger/sessions/${e}/manual-callback`,{method:"POST",body:JSON.stringify(t)}),stopOAuthDebuggerSession:e=>ut(`/api/oauth-debugger/sessions/${e}/stop`,{method:"POST",body:JSON.stringify({})}),exportOAuthDebuggerSession:(e,t)=>t==="json"?ut(`/api/oauth-debugger/sessions/${e}/export?format=json`):MG(`/api/oauth-debugger/sessions/${e}/export?format=${t}`),stopRun:e=>ut(`/api/runs/jobs/${e}/stop`,{method:"POST"}),getRunQueue:()=>ut("/api/runs/queue"),removeQueuedRun:e=>ut(`/api/runs/queue/${e}`,{method:"DELETE"}).then(()=>{}),subscribeRunJob:(e,t)=>{const n=new EventSource(`${fd}/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 $G(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 DG(e){return e||`config-${Date.now()}`}const LG={async listConfigs(){return(await it.listConfigs()).map(Hl)},async createConfig(e){const t=await it.createConfig($G(e),bP(e));return Hl(t)},async updateConfig(e){const t=await it.updateConfig(e.id,bP(e),DG(e.name));return Hl(t)},async deleteConfig(e){await it.deleteConfig(e)},async listResults(){const t=(await it.listRuns()).map(async n=>{const[{results:r},a]=await Promise.all([it.getRun(n.runId),it.getRunTrace(n.runId)]);return SP(r,a.records)});return Promise.all(t)},async getResult(e){try{const[{results:t},n]=await Promise.all([it.getRun(e),it.getRunTrace(e)]);return SP(t,n.records)}catch{return}},async deleteResult(e){await it.deleteRun(e)},async updateRunNote(e,t){await it.updateRunNote(e,t)},async listMarkdownReports(){return it.listMarkdownReports()},async getMarkdownReport(e){return it.getMarkdownReport(e)},async deleteMarkdownReport(e){await it.deleteMarkdownReport(e)},async startRun(e){return it.startRun(e)},async stopRun(e){await it.stopRun(e)},async getRunQueue(){return it.getRunQueue()},async removeQueuedRun(e){await it.removeQueuedRun(e)},subscribeRunJob(e,t){return it.subscribeRunJob(e,t)},async listSnapshots(){return it.listSnapshots()},async createSnapshotFromRun(e,t){return it.createSnapshotFromRun(e,t)},async getSnapshot(e){try{return await it.getSnapshot(e)}catch{return}},async compareSnapshot(e,t){return it.compareSnapshot(e,t)},async askResultAssistant(e,t){return it.askResultAssistant(e,t)},async applyResultAssistantReport(e){return it.applyResultAssistantReport(e)},async createResultAssistantSession(e){return it.createResultAssistantSession(e)},async getResultAssistantSession(e){return it.getResultAssistantSession(e)},async sendResultAssistantMessage(e,t){return it.sendResultAssistantMessage(e,t)},async approveResultAssistantToolCall(e,t,n){return it.approveResultAssistantToolCall(e,t,n)},async denyResultAssistantToolCall(e,t){return it.denyResultAssistantToolCall(e,t)},async closeResultAssistantSession(e){await it.closeResultAssistantSession(e)},async generateSnapshotEvalBaseline(e,t,n){const r=await it.generateSnapshotEvalBaseline(e,t,n);return{snapshot:r.snapshot,config:Hl(r.config)}},async updateSnapshotPolicy(e,t){const n=await it.updateSnapshotPolicy(e,t);return Hl(n)},async getLibraries(){const e=await it.getLibraries();return EG(e)},async saveLibraries(e){await it.saveLibraries(PG(e))},async listProviderModels(e){return it.listProviderModels(e)},async getWorkspaceSettings(){return it.getSettings()},async updateWorkspaceSettings(e){return it.updateSettings(e)},async createScenarioAssistantSession(e){return it.createScenarioAssistantSession(e)},async getScenarioAssistantSession(e){return it.getScenarioAssistantSession(e)},async sendScenarioAssistantMessage(e,t){return it.sendScenarioAssistantMessage(e,t)},async approveScenarioAssistantToolCall(e,t){return it.approveScenarioAssistantToolCall(e,t)},async denyScenarioAssistantToolCall(e,t){return it.denyScenarioAssistantToolCall(e,t)},async approveAllScenarioAssistantToolCalls(e){return it.approveAllScenarioAssistantToolCalls(e)},async closeScenarioAssistantSession(e){await it.closeScenarioAssistantSession(e)},async discoverToolsForAnalysis(e){return it.discoverToolsForAnalysis(e)},async startToolAnalysis(e){return it.startToolAnalysis(e)},subscribeToolAnalysisJob(e,t){return it.subscribeToolAnalysisJob(e,t)},async getToolAnalysisResult(e){return it.getToolAnalysisResult(e)},async stopToolAnalysis(e){return it.stopToolAnalysis(e)},async listToolAnalysisResults(){return it.listToolAnalysisResults()},async getToolAnalysisSavedResult(e){return it.getToolAnalysisSavedResult(e)},async deleteToolAnalysisSavedResult(e){await it.deleteToolAnalysisSavedResult(e)},async createOAuthDebuggerSession(e){return it.createOAuthDebuggerSession(e)},async getOAuthDebuggerSession(e){return it.getOAuthDebuggerSession(e)},async startOAuthDebuggerSession(e){return it.startOAuthDebuggerSession(e)},subscribeOAuthDebuggerSession(e,t){return it.subscribeOAuthDebuggerSession(e,t)},async submitOAuthDebuggerManualCallback(e,t){return it.submitOAuthDebuggerManualCallback(e,t)},async stopOAuthDebuggerSession(e){return it.stopOAuthDebuggerSession(e)},async exportOAuthDebuggerSession(e,t){return it.exportOAuthDebuggerSession(e,t)}},L3=v.createContext(null);function FG({children:e}){const t="workspace",[n,r]=v.useState("checking"),[a,i]=v.useState(null);v.useEffect(()=>{r("checking"),it.health().then(c=>{r("connected"),i(typeof c?.version=="string"?c.version:null)}).catch(()=>{r("disconnected"),i(null)})},[t]);const o=v.useMemo(()=>LG,[]);return s.jsx(L3.Provider,{value:{mode:t,connection:n,version:a,source:o},children:e})}function Tn(){const e=v.useContext(L3);if(!e)throw new Error("useDataSource must be used within DataSourceProvider");return e}const BG=e=>{if(e==="/")return[{label:"Dashboard"}];const t=[{label:"Dashboard",to:"/"}];if(en("/mcp-evaluations/:id",e))return t.push({label:"MCP Evaluations",to:"/mcp-evaluations"},{label:"MCP Evaluation"}),t;if(en("/mcp-evaluations",e))return t.push({label:"MCP Evaluations"}),t;if(en("/settings",e))return t.push({label:"Settings"}),t;if(en("/tool-analysis",e))return t.push({label:"Analyze MCP Tools"}),t;if(en("/tool-analysis-results/:id",e)){const n=en("/tool-analysis-results/:id",e);return t.push({label:"Tool Analysis Results",to:"/tool-analysis-results"},{label:n?.params.id??"Report"}),t}if(en("/tool-analysis-results",e))return t.push({label:"Tool Analysis Results"}),t;if(en("/markdown-reports/view",e))return t.push({label:"Markdown Reports",to:"/markdown-reports"},{label:"View Report"}),t;if(en("/markdown-reports",e))return t.push({label:"Markdown Reports"}),t;if(en("/oauth-debugger",e))return t.push({label:"OAuth Debugger"}),t;if(en("/results/:id",e))return t.push({label:"Evaluation Results",to:"/results"},{label:"Result"}),t;if(en("/results",e))return t.push({label:"Evaluation Results"}),t;if(en("/run",e))return t.push({label:"Run Evaluation"}),t;if(en("/libraries/servers/:serverId",e)){const n=en("/libraries/servers/:serverId",e),r=n?.params.serverId?decodeURIComponent(n.params.serverId):"Server";return t.push({label:"Libraries",to:"/libraries/servers"},{label:"Servers",to:"/libraries/servers"},{label:r==="new"?"New Server":r}),t}if(en("/libraries/servers",e))return t.push({label:"Libraries",to:"/libraries/servers"},{label:"Servers"}),t;if(en("/libraries/agents/:agentName",e)){const n=en("/libraries/agents/:agentName",e),r=n?.params.agentName?decodeURIComponent(n.params.agentName):"Agent";return t.push({label:"Libraries",to:"/libraries/agents"},{label:"Agents",to:"/libraries/agents"},{label:r==="new"?"New Agent":r}),t}if(en("/libraries/agents",e))return t.push({label:"Libraries",to:"/libraries/agents"},{label:"Agents"}),t;if(en("/libraries/test-cases/:testCaseId",e)){const n=en("/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 en("/libraries/test-cases",e)?(t.push({label:"Libraries",to:"/libraries/test-cases"},{label:"Test Cases"}),t):en("/compare",e)?(t.push({label:"Compare Evaluations"}),t):(en("/compare/results",e)&&t.push({label:"Compare Evaluations",to:"/compare"},{label:"Full Result Compare"}),t)};function zG(){const e=Cs(),t=new URLSearchParams(e.search).get("embed")==="1",n=BG(e.pathname),{connection:r,version:a}=Tn();return t?s.jsx("main",{className:"min-h-screen overflow-auto bg-background p-4",children:s.jsx(sP,{})}):s.jsx(y3,{children:s.jsxs("div",{className:"flex min-h-screen w-full",children:[s.jsx(CG,{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(w3,{}),s.jsx(T3,{children:s.jsx(R3,{children:n.map((i,o)=>{const c=o===n.length-1;return s.jsxs(v.Fragment,{children:[s.jsx(I3,{children:i.to&&!c?s.jsx(M3,{asChild:!0,children:s.jsx(bt,{to:i.to,children:i.label})}):s.jsx($3,{children:i.label})}),!c&&s.jsx(D3,{})]},`${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(sP,{})})]})]})})}const F3=v.createContext(null);function UG({children:e}){const{source:t}=Tn(),[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(F3.Provider,{value:{configs:n,loading:a,getConfig:c,addConfig:d,updateConfig:f,deleteConfig:h,cloneConfig:p,reload:o},children:e})}function Nf(){const e=v.useContext(F3);if(!e)throw new Error("useConfigs must be used within ConfigProvider");return e}const B3=v.createContext(null);function qG({children:e}){const{source:t}=Tn(),[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(B3.Provider,{value:d,children:e})}function Ga(){const e=v.useContext(B3);if(!e)throw new Error("useLibraries must be used within LibraryProvider");return e}const Ue=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Ne("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Ue.displayName="Card";const St=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Ne("flex flex-col space-y-1.5 p-6",e),...t}));St.displayName="CardHeader";const Nt=v.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:Ne("text-2xl font-semibold leading-none tracking-tight",e),...t}));Nt.displayName="CardTitle";const hs=v.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:Ne("text-sm text-muted-foreground",e),...t}));hs.displayName="CardDescription";const qe=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Ne("p-6 pt-0",e),...t}));qe.displayName="CardContent";const WG=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Ne("flex items-center p-6 pt-0",e),...t}));WG.displayName="CardFooter";const $r=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:n,className:Ne("w-full caption-bottom text-sm",e),...t})}));$r.displayName="Table";const Dr=v.forwardRef(({className:e,...t},n)=>s.jsx("thead",{ref:n,className:Ne("[&_tr]:border-b",e),...t}));Dr.displayName="TableHeader";const Lr=v.forwardRef(({className:e,...t},n)=>s.jsx("tbody",{ref:n,className:Ne("[&_tr:last-child]:border-0",e),...t}));Lr.displayName="TableBody";const VG=v.forwardRef(({className:e,...t},n)=>s.jsx("tfoot",{ref:n,className:Ne("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));VG.displayName="TableFooter";const $t=v.forwardRef(({className:e,...t},n)=>s.jsx("tr",{ref:n,className:Ne("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));$t.displayName="TableRow";const tt=v.forwardRef(({className:e,...t},n)=>s.jsx("th",{ref:n,className:Ne("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));tt.displayName="TableHead";const ze=v.forwardRef(({className:e,...t},n)=>s.jsx("td",{ref:n,className:Ne("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));ze.displayName="TableCell";const HG=v.forwardRef(({className:e,...t},n)=>s.jsx("caption",{ref:n,className:Ne("mt-4 text-sm text-muted-foreground",e),...t}));HG.displayName="TableCaption";function os({title:e,value:t,subtitle:n,icon:r,trend:a}){return s.jsx(Ue,{children:s.jsx(qe,{className:"p-4",children:s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:e}),s.jsx("p",{className:"text-2xl font-bold",children:t}),n&&s.jsxs("p",{className:`text-xs ${a==="up"?"text-success":a==="down"?"text-destructive":"text-muted-foreground"}`,children:[a==="up"&&"↑ ",a==="down"&&"↓ ",n]})]}),s.jsx("div",{className:"rounded-lg bg-primary/10 p-2",children:s.jsx(r,{className:"h-4 w-4 text-primary"})})]})})})}const KG=Zo("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?Xi:"div";return s.jsx(a,{className:Ne(KG({variant:t}),e),...r})}function Vs({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 Ey,NP;function Br(){if(NP)return Ey;NP=1;var e=Array.isArray;return Ey=e,Ey}var Py,CP;function z3(){if(CP)return Py;CP=1;var e=typeof Wp=="object"&&Wp&&Wp.Object===Object&&Wp;return Py=e,Py}var ky,AP;function As(){if(AP)return ky;AP=1;var e=z3(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return ky=n,ky}var Oy,_P;function Cf(){if(_P)return Oy;_P=1;var e=As(),t=e.Symbol;return Oy=t,Oy}var Ty,EP;function GG(){if(EP)return Ty;EP=1;var e=Cf(),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 Ty=i,Ty}var Ry,PP;function YG(){if(PP)return Ry;PP=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return Ry=n,Ry}var Iy,kP;function ai(){if(kP)return Iy;kP=1;var e=Cf(),t=GG(),n=YG(),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 Iy=o,Iy}var My,OP;function si(){if(OP)return My;OP=1;function e(t){return t!=null&&typeof t=="object"}return My=e,My}var $y,TP;function nu(){if(TP)return $y;TP=1;var e=ai(),t=si(),n="[object Symbol]";function r(a){return typeof a=="symbol"||t(a)&&e(a)==n}return $y=r,$y}var Dy,RP;function yN(){if(RP)return Dy;RP=1;var e=Br(),t=nu(),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 Dy=a,Dy}var Ly,IP;function Qi(){if(IP)return Ly;IP=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return Ly=e,Ly}var Fy,MP;function bN(){if(MP)return Fy;MP=1;var e=ai(),t=Qi(),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 Fy=o,Fy}var By,$P;function XG(){if($P)return By;$P=1;var e=As(),t=e["__core-js_shared__"];return By=t,By}var zy,DP;function QG(){if(DP)return zy;DP=1;var e=XG(),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 zy=n,zy}var Uy,LP;function U3(){if(LP)return Uy;LP=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 Uy=n,Uy}var qy,FP;function JG(){if(FP)return qy;FP=1;var e=bN(),t=QG(),n=Qi(),r=U3(),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 qy=p,qy}var Wy,BP;function ZG(){if(BP)return Wy;BP=1;function e(t,n){return t?.[n]}return Wy=e,Wy}var Vy,zP;function tl(){if(zP)return Vy;zP=1;var e=JG(),t=ZG();function n(r,a){var i=t(r,a);return e(i)?i:void 0}return Vy=n,Vy}var Hy,UP;function bv(){if(UP)return Hy;UP=1;var e=tl(),t=e(Object,"create");return Hy=t,Hy}var Ky,qP;function eY(){if(qP)return Ky;qP=1;var e=bv();function t(){this.__data__=e?e(null):{},this.size=0}return Ky=t,Ky}var Gy,WP;function tY(){if(WP)return Gy;WP=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return Gy=e,Gy}var Yy,VP;function nY(){if(VP)return Yy;VP=1;var e=bv(),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 Yy=a,Yy}var Xy,HP;function rY(){if(HP)return Xy;HP=1;var e=bv(),t=Object.prototype,n=t.hasOwnProperty;function r(a){var i=this.__data__;return e?i[a]!==void 0:n.call(i,a)}return Xy=r,Xy}var Qy,KP;function aY(){if(KP)return Qy;KP=1;var e=bv(),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 Qy=n,Qy}var Jy,GP;function sY(){if(GP)return Jy;GP=1;var e=eY(),t=tY(),n=nY(),r=rY(),a=aY();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,Jy=i,Jy}var Zy,YP;function iY(){if(YP)return Zy;YP=1;function e(){this.__data__=[],this.size=0}return Zy=e,Zy}var eb,XP;function wN(){if(XP)return eb;XP=1;function e(t,n){return t===n||t!==t&&n!==n}return eb=e,eb}var tb,QP;function wv(){if(QP)return tb;QP=1;var e=wN();function t(n,r){for(var a=n.length;a--;)if(e(n[a][0],r))return a;return-1}return tb=t,tb}var nb,JP;function oY(){if(JP)return nb;JP=1;var e=wv(),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 nb=r,nb}var rb,ZP;function lY(){if(ZP)return rb;ZP=1;var e=wv();function t(n){var r=this.__data__,a=e(r,n);return a<0?void 0:r[a][1]}return rb=t,rb}var ab,ek;function cY(){if(ek)return ab;ek=1;var e=wv();function t(n){return e(this.__data__,n)>-1}return ab=t,ab}var sb,tk;function uY(){if(tk)return sb;tk=1;var e=wv();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 sb=t,sb}var ib,nk;function jv(){if(nk)return ib;nk=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,ib=i,ib}var ob,rk;function jN(){if(rk)return ob;rk=1;var e=tl(),t=As(),n=e(t,"Map");return ob=n,ob}var lb,ak;function dY(){if(ak)return lb;ak=1;var e=sY(),t=jv(),n=jN();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return lb=r,lb}var cb,sk;function fY(){if(sk)return cb;sk=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return cb=e,cb}var ub,ik;function Sv(){if(ik)return ub;ik=1;var e=fY();function t(n,r){var a=n.__data__;return e(r)?a[typeof r=="string"?"string":"hash"]:a.map}return ub=t,ub}var db,ok;function pY(){if(ok)return db;ok=1;var e=Sv();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return db=t,db}var fb,lk;function hY(){if(lk)return fb;lk=1;var e=Sv();function t(n){return e(this,n).get(n)}return fb=t,fb}var pb,ck;function mY(){if(ck)return pb;ck=1;var e=Sv();function t(n){return e(this,n).has(n)}return pb=t,pb}var hb,uk;function vY(){if(uk)return hb;uk=1;var e=Sv();function t(n,r){var a=e(this,n),i=a.size;return a.set(n,r),this.size+=a.size==i?0:1,this}return hb=t,hb}var mb,dk;function SN(){if(dk)return mb;dk=1;var e=dY(),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,mb=i,mb}var vb,fk;function q3(){if(fk)return vb;fk=1;var e=SN(),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,vb=n,vb}var gb,pk;function gY(){if(pk)return gb;pk=1;var e=q3(),t=500;function n(r){var a=e(r,function(o){return i.size===t&&i.clear(),o}),i=a.cache;return a}return gb=n,gb}var xb,hk;function xY(){if(hk)return xb;hk=1;var e=gY(),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 xb=r,xb}var yb,mk;function NN(){if(mk)return yb;mk=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 yb=e,yb}var bb,vk;function yY(){if(vk)return bb;vk=1;var e=Cf(),t=NN(),n=Br(),r=nu(),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 bb=o,bb}var wb,gk;function W3(){if(gk)return wb;gk=1;var e=yY();function t(n){return n==null?"":e(n)}return wb=t,wb}var jb,xk;function V3(){if(xk)return jb;xk=1;var e=Br(),t=yN(),n=xY(),r=W3();function a(i,o){return e(i)?i:t(i,o)?[i]:n(r(i))}return jb=a,jb}var Sb,yk;function Nv(){if(yk)return Sb;yk=1;var e=nu();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Sb=t,Sb}var Nb,bk;function CN(){if(bk)return Nb;bk=1;var e=V3(),t=Nv();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 Nb=n,Nb}var Cb,wk;function H3(){if(wk)return Cb;wk=1;var e=CN();function t(n,r,a){var i=n==null?void 0:e(n,r);return i===void 0?a:i}return Cb=t,Cb}var bY=H3();const sa=Yt(bY);var Ab,jk;function wY(){if(jk)return Ab;jk=1;function e(t){return t==null}return Ab=e,Ab}var jY=wY();const At=Yt(jY);var _b,Sk;function SY(){if(Sk)return _b;Sk=1;var e=ai(),t=Br(),n=si(),r="[object String]";function a(i){return typeof i=="string"||!t(i)&&n(i)&&e(i)==r}return _b=a,_b}var NY=SY();const Do=Yt(NY);var CY=bN();const Ct=Yt(CY);var AY=Qi();const ru=Yt(AY);var Eb={exports:{}},Kt={};var Nk;function _Y(){if(Nk)return Kt;Nk=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 Kt.ContextConsumer=o,Kt.ContextProvider=i,Kt.Element=e,Kt.ForwardRef=d,Kt.Fragment=n,Kt.Lazy=x,Kt.Memo=p,Kt.Portal=t,Kt.Profiler=a,Kt.StrictMode=r,Kt.Suspense=f,Kt.SuspenseList=h,Kt.isAsyncMode=function(){return!1},Kt.isConcurrentMode=function(){return!1},Kt.isContextConsumer=function(y){return b(y)===o},Kt.isContextProvider=function(y){return b(y)===i},Kt.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===e},Kt.isForwardRef=function(y){return b(y)===d},Kt.isFragment=function(y){return b(y)===n},Kt.isLazy=function(y){return b(y)===x},Kt.isMemo=function(y){return b(y)===p},Kt.isPortal=function(y){return b(y)===t},Kt.isProfiler=function(y){return b(y)===a},Kt.isStrictMode=function(y){return b(y)===r},Kt.isSuspense=function(y){return b(y)===f},Kt.isSuspenseList=function(y){return b(y)===h},Kt.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)},Kt.typeOf=b,Kt}var Ck;function EY(){return Ck||(Ck=1,Eb.exports=_Y()),Eb.exports}var PY=EY(),Pb,Ak;function K3(){if(Ak)return Pb;Ak=1;var e=ai(),t=si(),n="[object Number]";function r(a){return typeof a=="number"||t(a)&&e(a)==n}return Pb=r,Pb}var kb,_k;function kY(){if(_k)return kb;_k=1;var e=K3();function t(n){return e(n)&&n!=+n}return kb=t,kb}var OY=kY();const Af=Yt(OY);var TY=K3();const RY=Yt(TY);var wr=function(t){return t===0?0:t>0?1:-1},Ao=function(t){return Do(t)&&t.indexOf("%")===t.length-1},We=function(t){return RY(t)&&!Af(t)},IY=function(t){return At(t)},qn=function(t){return We(t)||Do(t)},MY=0,au=function(t){var n=++MY;return"".concat(t||"").concat(n)},jr=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(!We(t)&&!Do(t))return r;var i;if(Ao(t)){var o=t.indexOf("%");i=n*parseFloat(t.slice(0,o))/100}else i=+t;return Af(i)&&(i=r),a&&i>n&&(i=n),i},Kl=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},$Y=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},ea=function(t,n){return We(t)&&We(n)?function(r){return t+r*(n-t)}:function(){return n}};function $h(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):sa(r,t))===n})}var DY=function(t,n){return We(t)&&We(n)?t-n:Do(t)&&Do(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function oc(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 i1(e){"@babel/helpers - typeof";return i1=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},i1(e)}var LY=["viewBox","children"],FY=["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"],Ek=["points","pathLength"],Ob={svg:LY,polygon:Ek,polyline:Ek},AN=["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"],Dh=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(v.isValidElement(t)&&(r=t.props),!ru(r))return null;var a={};return Object.keys(r).forEach(function(i){AN.includes(i)&&(a[i]=n||function(o){return r[i](r,o)})}),a},BY=function(t,n,r){return function(a){return t(n,r,a),null}},Lo=function(t,n,r){if(!ru(t)||i1(t)!=="object")return null;var a=null;return Object.keys(t).forEach(function(i){var o=t[i];AN.includes(i)&&typeof o=="function"&&(a||(a={}),a[i]=BY(o,n,r))}),a},zY=["children"],UY=["children"];function Pk(e,t){if(e==null)return{};var n=qY(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 qY(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 o1(e){"@babel/helpers - typeof";return o1=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},o1(e)}var kk={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"},Gs=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},Ok=null,Tb=null,_N=function e(t){if(t===Ok&&Array.isArray(Tb))return Tb;var n=[];return v.Children.forEach(t,function(r){At(r)||(PY.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),Tb=n,Ok=t,n};function ia(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(a){return Gs(a)}):r=[Gs(t)],_N(e).forEach(function(a){var i=sa(a,"type.displayName")||sa(a,"type.name");r.indexOf(i)!==-1&&n.push(a)}),n}function Jr(e,t){var n=ia(e,t);return n&&n[0]}var Tk=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,a=n.height;return!(!We(r)||r<=0||!We(a)||a<=0)},WY=["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"],VY=function(t){return t&&t.type&&Do(t.type)&&WY.indexOf(t.type)>=0},HY=function(t){return t&&o1(t)==="object"&&"clipDot"in t},KY=function(t,n,r,a){var i,o=(i=Ob?.[a])!==null&&i!==void 0?i:[];return n.startsWith("data-")||!Ct(t)&&(a&&o.includes(n)||FY.includes(n))||r&&AN.includes(n)},gt=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(v.isValidElement(t)&&(a=t.props),!ru(a))return null;var i={};return Object.keys(a).forEach(function(o){var c;KY((c=a)===null||c===void 0?void 0:c[o],o,n,r)&&(i[o]=a[o])}),i},l1=function e(t,n){if(t===n)return!0;var r=v.Children.count(t);if(r!==v.Children.count(n))return!1;if(r===0)return!0;if(r===1)return Rk(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(!Rk(i,o))return!1}return!0},Rk=function(t,n){if(At(t)&&At(n))return!0;if(!At(t)&&!At(n)){var r=t.props||{},a=r.children,i=Pk(r,zY),o=n.props||{},c=o.children,d=Pk(o,UY);return a&&c?oc(i,d)&&l1(a,c):!a&&!c?oc(i,d):!1}return!1},Ik=function(t,n){var r=[],a={};return _N(t).forEach(function(i,o){if(VY(i))r.push(i);else if(i){var c=Gs(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},GY=function(t){var n=t&&t.type;return n&&kk[n]?kk[n]:null},YY=function(t,n){return _N(n).indexOf(t)},XY=["children","width","height","viewBox","className","style","title","desc"];function c1(){return c1=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},c1.apply(this,arguments)}function QY(e,t){if(e==null)return{};var n=JY(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 JY(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){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=QY(e,XY),h=a||{width:n,height:r,x:0,y:0},p=_t("recharts-surface",i);return W.createElement("svg",c1({},gt(f,!0,"svg"),{className:p,width:n,height:r,style:o,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),W.createElement("title",null,c),W.createElement("desc",null,d),t)}var ZY=["children","className"];function d1(){return d1=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},d1.apply(this,arguments)}function eX(e,t){if(e==null)return{};var n=tX(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 tX(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 qt=W.forwardRef(function(e,t){var n=e.children,r=e.className,a=eX(e,ZY),i=_t("recharts-layer",r);return W.createElement("g",d1({className:i},gt(a,!0),{ref:t}),n)}),Ys=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]},Rb,Mk;function nX(){if(Mk)return Rb;Mk=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 Rb=e,Rb}var Ib,$k;function rX(){if($k)return Ib;$k=1;var e=nX();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 Ib=t,Ib}var Mb,Dk;function G3(){if(Dk)return Mb;Dk=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 Mb=d,Mb}var $b,Lk;function aX(){if(Lk)return $b;Lk=1;function e(t){return t.split("")}return $b=e,$b}var Db,Fk;function sX(){if(Fk)return Db;Fk=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 Db=E,Db}var Lb,Bk;function iX(){if(Bk)return Lb;Bk=1;var e=aX(),t=G3(),n=sX();function r(a){return t(a)?n(a):e(a)}return Lb=r,Lb}var Fb,zk;function oX(){if(zk)return Fb;zk=1;var e=rX(),t=G3(),n=iX(),r=W3();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 Fb=a,Fb}var Bb,Uk;function lX(){if(Uk)return Bb;Uk=1;var e=oX(),t=e("toUpperCase");return Bb=t,Bb}var cX=lX();const Cv=Yt(cX);function sn(e){return function(){return e}}const Y3=Math.cos,Lh=Math.sin,Ya=Math.sqrt,Fh=Math.PI,Av=2*Fh,f1=Math.PI,p1=2*f1,So=1e-6,uX=p1-So;function X3(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function dX(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return X3;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 fX{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?X3:dX(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>So)if(!(Math.abs(p*d-f*h)>So)||!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((f1-Math.acos((b+x-y)/(2*S*C)))/2),E=N/C,_=N/S;Math.abs(E-1)>So&&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)>So||Math.abs(this._y1-h)>So)&&this._append`L${f},${h}`,r&&(x<0&&(x=x%p1+p1),x>uX?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>So&&this._append`A${r},${r},0,${+(x>=f1)},${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 EN(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 fX(t)}function PN(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Q3(e){this._context=e}Q3.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 _v(e){return new Q3(e)}function J3(e){return e[0]}function Z3(e){return e[1]}function e5(e,t){var n=sn(!0),r=null,a=_v,i=null,o=EN(c);e=typeof e=="function"?e:e===void 0?J3:sn(e),t=typeof t=="function"?t:t===void 0?Z3:sn(t);function c(d){var f,h=(d=PN(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:sn(+d),c):e},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:sn(+d),c):t},c.defined=function(d){return arguments.length?(n=typeof d=="function"?d:sn(!!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 nh(e,t,n){var r=null,a=sn(!0),i=null,o=_v,c=null,d=EN(f);e=typeof e=="function"?e:e===void 0?J3:sn(+e),t=typeof t=="function"?t:sn(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?Z3:sn(+n);function f(p){var x,g,j,b=(p=PN(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 e5().defined(a).curve(o).context(i)}return f.x=function(p){return arguments.length?(e=typeof p=="function"?p:sn(+p),r=null,f):e},f.x0=function(p){return arguments.length?(e=typeof p=="function"?p:sn(+p),f):e},f.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:sn(+p),f):r},f.y=function(p){return arguments.length?(t=typeof p=="function"?p:sn(+p),n=null,f):t},f.y0=function(p){return arguments.length?(t=typeof p=="function"?p:sn(+p),f):t},f.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:sn(+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:sn(!!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 t5{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 pX(e){return new t5(e,!0)}function hX(e){return new t5(e,!1)}const kN={draw(e,t){const n=Ya(t/Fh);e.moveTo(n,0),e.arc(0,0,n,0,Av)}},mX={draw(e,t){const n=Ya(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()}},n5=Ya(1/3),vX=n5*2,gX={draw(e,t){const n=Ya(t/vX),r=n*n5;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},xX={draw(e,t){const n=Ya(t),r=-n/2;e.rect(r,r,n,n)}},yX=.8908130915292852,r5=Lh(Fh/10)/Lh(7*Fh/10),bX=Lh(Av/10)*r5,wX=-Y3(Av/10)*r5,jX={draw(e,t){const n=Ya(t*yX),r=bX*n,a=wX*n;e.moveTo(0,-n),e.lineTo(r,a);for(let i=1;i<5;++i){const o=Av*i/5,c=Y3(o),d=Lh(o);e.lineTo(d*n,-c*n),e.lineTo(c*r-d*a,d*r+c*a)}e.closePath()}},zb=Ya(3),SX={draw(e,t){const n=-Ya(t/(zb*3));e.moveTo(0,n*2),e.lineTo(-zb*n,-n),e.lineTo(zb*n,-n),e.closePath()}},va=-.5,ga=Ya(3)/2,h1=1/Ya(12),NX=(h1/2+1)*3,CX={draw(e,t){const n=Ya(t/NX),r=n/2,a=n*h1,i=r,o=n*h1+n,c=-i,d=o;e.moveTo(r,a),e.lineTo(i,o),e.lineTo(c,d),e.lineTo(va*r-ga*a,ga*r+va*a),e.lineTo(va*i-ga*o,ga*i+va*o),e.lineTo(va*c-ga*d,ga*c+va*d),e.lineTo(va*r+ga*a,va*a-ga*r),e.lineTo(va*i+ga*o,va*o-ga*i),e.lineTo(va*c+ga*d,va*d-ga*c),e.closePath()}};function AX(e,t){let n=null,r=EN(a);e=typeof e=="function"?e:sn(e||kN),t=typeof t=="function"?t:sn(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:sn(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:sn(+i),a):t},a.context=function(i){return arguments.length?(n=i??null,a):n},a}function Bh(){}function zh(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 a5(e){this._context=e}a5.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:zh(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:zh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function _X(e){return new a5(e)}function s5(e){this._context=e}s5.prototype={areaStart:Bh,areaEnd:Bh,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:zh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function EX(e){return new s5(e)}function i5(e){this._context=e}i5.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:zh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function PX(e){return new i5(e)}function o5(e){this._context=e}o5.prototype={areaStart:Bh,areaEnd:Bh,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 kX(e){return new o5(e)}function qk(e){return e<0?-1:1}function Wk(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(qk(i)+qk(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(c))||0}function Vk(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Ub(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 Uh(e){this._context=e}Uh.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:Ub(this,this._t0,Vk(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,Ub(this,Vk(this,n=Wk(this,e,t)),n);break;default:Ub(this,this._t0,n=Wk(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function l5(e){this._context=new c5(e)}(l5.prototype=Object.create(Uh.prototype)).point=function(e,t){Uh.prototype.point.call(this,t,e)};function c5(e){this._context=e}c5.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 OX(e){return new Uh(e)}function TX(e){return new l5(e)}function u5(e){this._context=e}u5.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=Hk(e),a=Hk(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 Hk(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 RX(e){return new u5(e)}function Ev(e,t){this._context=e,this._t=t}Ev.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 IX(e){return new Ev(e,.5)}function MX(e){return new Ev(e,0)}function $X(e){return new Ev(e,1)}function xc(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 m1(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function DX(e,t){return e[t]}function LX(e){const t=[];return t.key=e,t}function FX(){var e=sn([]),t=m1,n=xc,r=DX;function a(i){var o=Array.from(e.apply(this,arguments),LX),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=PN(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:sn(Array.from(i)),a):e},a.value=function(i){return arguments.length?(r=typeof i=="function"?i:sn(+i),a):r},a.order=function(i){return arguments.length?(t=i==null?m1:typeof i=="function"?i:sn(Array.from(i)),a):t},a.offset=function(i){return arguments.length?(n=i??xc,a):n},a}function BX(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}xc(e,t)}}function zX(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}xc(e,t)}}function UX(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,xc(e,t)}}function Ed(e){"@babel/helpers - typeof";return Ed=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},Ed(e)}var qX=["type","size","sizeType"];function v1(){return v1=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},v1.apply(this,arguments)}function Kk(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 Gk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Kk(Object(n),!0).forEach(function(r){WX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WX(e,t,n){return t=VX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VX(e){var t=HX(e,"string");return Ed(t)=="symbol"?t:t+""}function HX(e,t){if(Ed(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ed(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function KX(e,t){if(e==null)return{};var n=GX(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 GX(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 d5={symbolCircle:kN,symbolCross:mX,symbolDiamond:gX,symbolSquare:xX,symbolStar:jX,symbolTriangle:SX,symbolWye:CX},YX=Math.PI/180,XX=function(t){var n="symbol".concat(Cv(t));return d5[n]||kN},QX=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*YX;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}},JX=function(t,n){d5["symbol".concat(Cv(t))]=n},ON=function(t){var n=t.type,r=n===void 0?"circle":n,a=t.size,i=a===void 0?64:a,o=t.sizeType,c=o===void 0?"area":o,d=KX(t,qX),f=Gk(Gk({},d),{},{type:r,size:i,sizeType:c}),h=function(){var y=XX(r),S=AX().type(y).size(QX(i,c,r));return S()},p=f.className,x=f.cx,g=f.cy,j=gt(f,!0);return x===+x&&g===+g&&i===+i?W.createElement("path",v1({},j,{className:_t("recharts-symbols",p),transform:"translate(".concat(x,", ").concat(g,")"),d:h()})):null};ON.registerSymbol=JX;function yc(e){"@babel/helpers - typeof";return yc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yc(e)}function g1(){return g1=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},g1.apply(this,arguments)}function Yk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ZX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Yk(Object(n),!0).forEach(function(r){Pd(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tQ(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,p5(r.key),r)}}function nQ(e,t,n){return t&&tQ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function rQ(e,t,n){return t=qh(t),aQ(e,f5()?Reflect.construct(t,n||[],qh(e).constructor):t.apply(e,n))}function aQ(e,t){if(t&&(yc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sQ(e)}function sQ(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 qh(e){return qh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},qh(e)}function iQ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x1(e,t)}function x1(e,t){return x1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},x1(e,t)}function Pd(e,t,n){return t=p5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p5(e){var t=oQ(e,"string");return yc(t)=="symbol"?t:t+""}function oQ(e,t){if(yc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(yc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var xa=32,TN=(function(e){function t(){return eQ(this,t),rQ(this,t,arguments)}return iQ(t,e),nQ(t,[{key:"renderIcon",value:function(r){var a=this.props.inactiveColor,i=xa/2,o=xa/6,c=xa/3,d=r.inactive?a:r.color;if(r.type==="plainline")return W.createElement("line",{strokeWidth:4,fill:"none",stroke:d,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:i,x2:xa,y2:i,className:"recharts-legend-icon"});if(r.type==="line")return W.createElement("path",{strokeWidth:4,fill:"none",stroke:d,d:"M0,".concat(i,"h").concat(c,`
57
- A`).concat(o,",").concat(o,",0,1,1,").concat(2*c,",").concat(i,`
58
- H`).concat(xa,"M").concat(2*c,",").concat(i,`
59
- A`).concat(o,",").concat(o,",0,1,1,").concat(c,",").concat(i),className:"recharts-legend-icon"});if(r.type==="rect")return W.createElement("path",{stroke:"none",fill:d,d:"M0,".concat(xa/8,"h").concat(xa,"v").concat(xa*3/4,"h").concat(-xa,"z"),className:"recharts-legend-icon"});if(W.isValidElement(r.legendIcon)){var f=ZX({},r);return delete f.legendIcon,W.cloneElement(r.legendIcon,f)}return W.createElement(ON,{fill:d,cx:i,cy:i,size:xa,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:xa,height:xa},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=_t(Pd(Pd({"recharts-legend-item":!0},"legend-item-".concat(j),!0),"inactive",g.inactive));if(g.type==="none")return null;var S=Ct(g.value)?null:g.value;Ys(!Ct(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 W.createElement("li",g1({className:y,style:p,key:"legend-item-".concat(j)},Lo(r.props,g,j)),W.createElement(u1,{width:o,height:o,viewBox:h,style:x},r.renderIcon(g)),W.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 W.createElement("ul",{className:"recharts-default-legend",style:c},this.renderItems())}}])})(v.PureComponent);Pd(TN,"displayName","Legend");Pd(TN,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var qb,Xk;function lQ(){if(Xk)return qb;Xk=1;var e=jv();function t(){this.__data__=new e,this.size=0}return qb=t,qb}var Wb,Qk;function cQ(){if(Qk)return Wb;Qk=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return Wb=e,Wb}var Vb,Jk;function uQ(){if(Jk)return Vb;Jk=1;function e(t){return this.__data__.get(t)}return Vb=e,Vb}var Hb,Zk;function dQ(){if(Zk)return Hb;Zk=1;function e(t){return this.__data__.has(t)}return Hb=e,Hb}var Kb,eO;function fQ(){if(eO)return Kb;eO=1;var e=jv(),t=jN(),n=SN(),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 Kb=a,Kb}var Gb,tO;function h5(){if(tO)return Gb;tO=1;var e=jv(),t=lQ(),n=cQ(),r=uQ(),a=dQ(),i=fQ();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,Gb=o,Gb}var Yb,nO;function pQ(){if(nO)return Yb;nO=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return Yb=t,Yb}var Xb,rO;function hQ(){if(rO)return Xb;rO=1;function e(t){return this.__data__.has(t)}return Xb=e,Xb}var Qb,aO;function m5(){if(aO)return Qb;aO=1;var e=SN(),t=pQ(),n=hQ();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,Qb=r,Qb}var Jb,sO;function v5(){if(sO)return Jb;sO=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 Jb=e,Jb}var Zb,iO;function g5(){if(iO)return Zb;iO=1;function e(t,n){return t.has(n)}return Zb=e,Zb}var e0,oO;function x5(){if(oO)return e0;oO=1;var e=m5(),t=v5(),n=g5(),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,T){if(!n(N,T)&&(E===O||h(E,O,d,f,p)))return N.push(T)})){C=!1;break}}else if(!(E===_||h(E,_,d,f,p))){C=!1;break}}return p.delete(o),p.delete(c),C}return e0=i,e0}var t0,lO;function mQ(){if(lO)return t0;lO=1;var e=As(),t=e.Uint8Array;return t0=t,t0}var n0,cO;function vQ(){if(cO)return n0;cO=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(a,i){r[++n]=[i,a]}),r}return n0=e,n0}var r0,uO;function RN(){if(uO)return r0;uO=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(a){r[++n]=a}),r}return r0=e,r0}var a0,dO;function gQ(){if(dO)return a0;dO=1;var e=Cf(),t=mQ(),n=wN(),r=x5(),a=vQ(),i=RN(),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,T,R,I,D,$){switch(T){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 H=a;case j:var F=R&o;if(H||(H=i),P.size!=O.size&&!F)return!1;var q=$.get(P);if(q)return q==O;R|=c,$.set(P,O);var Q=r(H(P),H(O),R,I,D,$);return $.delete(P),Q;case y:if(E)return E.call(P)==E.call(O)}return!1}return a0=_,a0}var s0,fO;function y5(){if(fO)return s0;fO=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 s0=e,s0}var i0,pO;function xQ(){if(pO)return i0;pO=1;var e=y5(),t=Br();function n(r,a,i){var o=a(r);return t(r)?o:e(o,i(r))}return i0=n,i0}var o0,hO;function yQ(){if(hO)return o0;hO=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 o0=e,o0}var l0,mO;function bQ(){if(mO)return l0;mO=1;function e(){return[]}return l0=e,l0}var c0,vO;function wQ(){if(vO)return c0;vO=1;var e=yQ(),t=bQ(),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 c0=i,c0}var u0,gO;function jQ(){if(gO)return u0;gO=1;function e(t,n){for(var r=-1,a=Array(t);++r<t;)a[r]=n(r);return a}return u0=e,u0}var d0,xO;function SQ(){if(xO)return d0;xO=1;var e=ai(),t=si(),n="[object Arguments]";function r(a){return t(a)&&e(a)==n}return d0=r,d0}var f0,yO;function IN(){if(yO)return f0;yO=1;var e=SQ(),t=si(),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 f0=i,f0}var id={exports:{}},p0,bO;function NQ(){if(bO)return p0;bO=1;function e(){return!1}return p0=e,p0}id.exports;var wO;function b5(){return wO||(wO=1,(function(e,t){var n=As(),r=NQ(),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})(id,id.exports)),id.exports}var h0,jO;function MN(){if(jO)return h0;jO=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 h0=n,h0}var m0,SO;function $N(){if(SO)return m0;SO=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return m0=t,m0}var v0,NO;function CQ(){if(NO)return v0;NO=1;var e=ai(),t=$N(),n=si(),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]",T="[object Uint8ClampedArray]",R="[object Uint16Array]",I="[object Uint32Array]",D={};D[C]=D[N]=D[E]=D[_]=D[P]=D[O]=D[T]=D[R]=D[I]=!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 $(H){return n(H)&&t(H.length)&&!!D[e(H)]}return v0=$,v0}var g0,CO;function w5(){if(CO)return g0;CO=1;function e(t){return function(n){return t(n)}}return g0=e,g0}var od={exports:{}};od.exports;var AO;function AQ(){return AO||(AO=1,(function(e,t){var n=z3(),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})(od,od.exports)),od.exports}var x0,_O;function j5(){if(_O)return x0;_O=1;var e=CQ(),t=w5(),n=AQ(),r=n&&n.isTypedArray,a=r?t(r):e;return x0=a,x0}var y0,EO;function _Q(){if(EO)return y0;EO=1;var e=jQ(),t=IN(),n=Br(),r=b5(),a=MN(),i=j5(),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 y0=d,y0}var b0,PO;function EQ(){if(PO)return b0;PO=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,a=typeof r=="function"&&r.prototype||e;return n===a}return b0=t,b0}var w0,kO;function S5(){if(kO)return w0;kO=1;function e(t,n){return function(r){return t(n(r))}}return w0=e,w0}var j0,OO;function PQ(){if(OO)return j0;OO=1;var e=S5(),t=e(Object.keys,Object);return j0=t,j0}var S0,TO;function kQ(){if(TO)return S0;TO=1;var e=EQ(),t=PQ(),n=Object.prototype,r=n.hasOwnProperty;function a(i){if(!e(i))return t(i);var o=[];for(var c in Object(i))r.call(i,c)&&c!="constructor"&&o.push(c);return o}return S0=a,S0}var N0,RO;function _f(){if(RO)return N0;RO=1;var e=bN(),t=$N();function n(r){return r!=null&&t(r.length)&&!e(r)}return N0=n,N0}var C0,IO;function Pv(){if(IO)return C0;IO=1;var e=_Q(),t=kQ(),n=_f();function r(a){return n(a)?e(a):t(a)}return C0=r,C0}var A0,MO;function OQ(){if(MO)return A0;MO=1;var e=xQ(),t=wQ(),n=Pv();function r(a){return e(a,n,t)}return A0=r,A0}var _0,$O;function TQ(){if($O)return _0;$O=1;var e=OQ(),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 T=p?d(O,P,S,o,i,h):d(P,O,S,i,o,h);if(!(T===void 0?P===O||f(P,O,c,d,h):T)){E=!1;break}_||(_=S=="constructor")}if(E&&!_){var R=i.constructor,I=o.constructor;R!=I&&"constructor"in i&&"constructor"in o&&!(typeof R=="function"&&R instanceof R&&typeof I=="function"&&I instanceof I)&&(E=!1)}return h.delete(i),h.delete(o),E}return _0=a,_0}var E0,DO;function RQ(){if(DO)return E0;DO=1;var e=tl(),t=As(),n=e(t,"DataView");return E0=n,E0}var P0,LO;function IQ(){if(LO)return P0;LO=1;var e=tl(),t=As(),n=e(t,"Promise");return P0=n,P0}var k0,FO;function N5(){if(FO)return k0;FO=1;var e=tl(),t=As(),n=e(t,"Set");return k0=n,k0}var O0,BO;function MQ(){if(BO)return O0;BO=1;var e=tl(),t=As(),n=e(t,"WeakMap");return O0=n,O0}var T0,zO;function $Q(){if(zO)return T0;zO=1;var e=RQ(),t=jN(),n=IQ(),r=N5(),a=MQ(),i=ai(),o=U3(),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}),T0=C,T0}var R0,UO;function DQ(){if(UO)return R0;UO=1;var e=h5(),t=x5(),n=gQ(),r=TQ(),a=$Q(),i=Br(),o=b5(),c=j5(),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),T=P?h:a(y);O=O==f?p:O,T=T==f?p:T;var R=O==p,I=T==p,D=O==T;if(D&&o(b)){if(!o(y))return!1;_=!0,R=!1}if(D&&!R)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 $=R&&g.call(b,"__wrapped__"),H=I&&g.call(y,"__wrapped__");if($||H){var F=$?b.value():b,q=H?y.value():y;return E||(E=new e),N(F,q,S,C,E)}}return D?(E||(E=new e),r(b,y,S,C,N,E)):!1}return R0=j,R0}var I0,qO;function DN(){if(qO)return I0;qO=1;var e=DQ(),t=si();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 I0=n,I0}var M0,WO;function LQ(){if(WO)return M0;WO=1;var e=h5(),t=DN(),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 M0=a,M0}var $0,VO;function C5(){if(VO)return $0;VO=1;var e=Qi();function t(n){return n===n&&!e(n)}return $0=t,$0}var D0,HO;function FQ(){if(HO)return D0;HO=1;var e=C5(),t=Pv();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 D0=n,D0}var L0,KO;function A5(){if(KO)return L0;KO=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return L0=e,L0}var F0,GO;function BQ(){if(GO)return F0;GO=1;var e=LQ(),t=FQ(),n=A5();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 F0=r,F0}var B0,YO;function zQ(){if(YO)return B0;YO=1;function e(t,n){return t!=null&&n in Object(t)}return B0=e,B0}var z0,XO;function UQ(){if(XO)return z0;XO=1;var e=V3(),t=IN(),n=Br(),r=MN(),a=$N(),i=Nv();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 z0=o,z0}var U0,QO;function qQ(){if(QO)return U0;QO=1;var e=zQ(),t=UQ();function n(r,a){return r!=null&&t(r,a,e)}return U0=n,U0}var q0,JO;function WQ(){if(JO)return q0;JO=1;var e=DN(),t=H3(),n=qQ(),r=yN(),a=C5(),i=A5(),o=Nv(),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 q0=f,q0}var W0,ZO;function su(){if(ZO)return W0;ZO=1;function e(t){return t}return W0=e,W0}var V0,eT;function VQ(){if(eT)return V0;eT=1;function e(t){return function(n){return n?.[t]}}return V0=e,V0}var H0,tT;function HQ(){if(tT)return H0;tT=1;var e=CN();function t(n){return function(r){return e(r,n)}}return H0=t,H0}var K0,nT;function KQ(){if(nT)return K0;nT=1;var e=VQ(),t=HQ(),n=yN(),r=Nv();function a(i){return n(i)?e(r(i)):t(i)}return K0=a,K0}var G0,rT;function _s(){if(rT)return G0;rT=1;var e=BQ(),t=WQ(),n=su(),r=Br(),a=KQ();function i(o){return typeof o=="function"?o:o==null?n:typeof o=="object"?r(o)?t(o[0],o[1]):e(o):a(o)}return G0=i,G0}var Y0,aT;function _5(){if(aT)return Y0;aT=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 Y0=e,Y0}var X0,sT;function GQ(){if(sT)return X0;sT=1;function e(t){return t!==t}return X0=e,X0}var Q0,iT;function YQ(){if(iT)return Q0;iT=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 Q0=e,Q0}var J0,oT;function XQ(){if(oT)return J0;oT=1;var e=_5(),t=GQ(),n=YQ();function r(a,i,o){return i===i?n(a,i,o):e(a,t,o)}return J0=r,J0}var Z0,lT;function QQ(){if(lT)return Z0;lT=1;var e=XQ();function t(n,r){var a=n==null?0:n.length;return!!a&&e(n,r,0)>-1}return Z0=t,Z0}var ew,cT;function JQ(){if(cT)return ew;cT=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 ew=e,ew}var tw,uT;function ZQ(){if(uT)return tw;uT=1;function e(){}return tw=e,tw}var nw,dT;function eJ(){if(dT)return nw;dT=1;var e=N5(),t=ZQ(),n=RN(),r=1/0,a=e&&1/n(new e([,-0]))[1]==r?function(i){return new e(i)}:t;return nw=a,nw}var rw,fT;function tJ(){if(fT)return rw;fT=1;var e=m5(),t=QQ(),n=JQ(),r=g5(),a=eJ(),i=RN(),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 rw=c,rw}var aw,pT;function nJ(){if(pT)return aw;pT=1;var e=_s(),t=tJ();function n(r,a){return r&&r.length?t(r,e(a,2)):[]}return aw=n,aw}var rJ=nJ();const hT=Yt(rJ);function E5(e,t,n){return t===!0?hT(e,n):Ct(t)?hT(e,t):e}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)}var aJ=["ref"];function mT(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 Bs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mT(Object(n),!0).forEach(function(r){kv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vT(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,k5(r.key),r)}}function iJ(e,t,n){return t&&vT(e.prototype,t),n&&vT(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function oJ(e,t,n){return t=Wh(t),lJ(e,P5()?Reflect.construct(t,n||[],Wh(e).constructor):t.apply(e,n))}function lJ(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 cJ(e)}function cJ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(P5=function(){return!!e})()}function Wh(e){return Wh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Wh(e)}function uJ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&y1(e,t)}function y1(e,t){return y1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},y1(e,t)}function kv(e,t,n){return t=k5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k5(e){var t=dJ(e,"string");return bc(t)=="symbol"?t:t+""}function dJ(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 fJ(e,t){if(e==null)return{};var n=pJ(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 pJ(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 hJ(e){return e.value}function mJ(e,t){if(W.isValidElement(e))return W.cloneElement(e,t);if(typeof e=="function")return W.createElement(e,t);t.ref;var n=fJ(t,aJ);return W.createElement(TN,n)}var gT=1,Oo=(function(e){function t(){var n;sJ(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=oJ(this,t,[].concat(a)),kv(n,"lastBoundingBox",{width:-1,height:-1}),n}return uJ(t,e),iJ(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)>gT||Math.abs(a.height-this.lastBoundingBox.height)>gT)&&(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?Bs({},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 Bs(Bs({},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=Bs(Bs({position:"absolute",width:o||"auto",height:c||"auto"},this.getDefaultPosition(d)),d);return W.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(g){r.wrapperNode=g}},mJ(i,Bs(Bs({},this.props),{},{payload:E5(h,f,hJ)})))}}],[{key:"getWithHeight",value:function(r,a){var i=Bs(Bs({},this.defaultProps),r.props),o=i.layout;return o==="vertical"&&We(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||a}:null}}])})(v.PureComponent);kv(Oo,"displayName","Legend");kv(Oo,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var sw,xT;function vJ(){if(xT)return sw;xT=1;var e=Cf(),t=IN(),n=Br(),r=e?e.isConcatSpreadable:void 0;function a(i){return n(i)||t(i)||!!(r&&i&&i[r])}return sw=a,sw}var iw,yT;function O5(){if(yT)return iw;yT=1;var e=y5(),t=vJ();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 iw=n,iw}var ow,bT;function gJ(){if(bT)return ow;bT=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 ow=e,ow}var lw,wT;function xJ(){if(wT)return lw;wT=1;var e=gJ(),t=e();return lw=t,lw}var cw,jT;function T5(){if(jT)return cw;jT=1;var e=xJ(),t=Pv();function n(r,a){return r&&e(r,a,t)}return cw=n,cw}var uw,ST;function yJ(){if(ST)return uw;ST=1;var e=_f();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 uw=t,uw}var dw,NT;function LN(){if(NT)return dw;NT=1;var e=T5(),t=yJ(),n=t(e);return dw=n,dw}var fw,CT;function R5(){if(CT)return fw;CT=1;var e=LN(),t=_f();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 fw=n,fw}var pw,AT;function bJ(){if(AT)return pw;AT=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return pw=e,pw}var hw,_T;function wJ(){if(_T)return hw;_T=1;var e=nu();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 hw=t,hw}var mw,ET;function jJ(){if(ET)return mw;ET=1;var e=wJ();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 mw=t,mw}var vw,PT;function SJ(){if(PT)return vw;PT=1;var e=NN(),t=CN(),n=_s(),r=R5(),a=bJ(),i=w5(),o=jJ(),c=su(),d=Br();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 vw=f,vw}var gw,kT;function NJ(){if(kT)return gw;kT=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 gw=e,gw}var xw,OT;function CJ(){if(OT)return xw;OT=1;var e=NJ(),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 xw=n,xw}var yw,TT;function AJ(){if(TT)return yw;TT=1;function e(t){return function(){return t}}return yw=e,yw}var bw,RT;function I5(){if(RT)return bw;RT=1;var e=tl(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return bw=t,bw}var ww,IT;function _J(){if(IT)return ww;IT=1;var e=AJ(),t=I5(),n=su(),r=t?function(a,i){return t(a,"toString",{configurable:!0,enumerable:!1,value:e(i),writable:!0})}:n;return ww=r,ww}var jw,MT;function EJ(){if(MT)return jw;MT=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 jw=r,jw}var Sw,$T;function PJ(){if($T)return Sw;$T=1;var e=_J(),t=EJ(),n=t(e);return Sw=n,Sw}var Nw,DT;function kJ(){if(DT)return Nw;DT=1;var e=su(),t=CJ(),n=PJ();function r(a,i){return n(t(a,i,e),a+"")}return Nw=r,Nw}var Cw,LT;function Ov(){if(LT)return Cw;LT=1;var e=wN(),t=_f(),n=MN(),r=Qi();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 Cw=a,Cw}var Aw,FT;function OJ(){if(FT)return Aw;FT=1;var e=O5(),t=SJ(),n=kJ(),r=Ov(),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 Aw=a,Aw}var TJ=OJ();const FN=Yt(TJ);function kd(e){"@babel/helpers - typeof";return kd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kd(e)}function 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 RJ(e,t){return DJ(e)||$J(e,t)||MJ(e,t)||IJ()}function IJ(){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 MJ(e,t){if(e){if(typeof e=="string")return BT(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 BT(e,t)}}function BT(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 $J(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 DJ(e){if(Array.isArray(e))return e}function zT(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 _w(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zT(Object(n),!0).forEach(function(r){LJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LJ(e,t,n){return t=FJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FJ(e){var t=BJ(e,"string");return kd(t)=="symbol"?t:t+""}function BJ(e,t){if(kd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(kd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zJ(e){return Array.isArray(e)&&qn(e[0])&&qn(e[1])?e.join(" ~ "):e}var UJ=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 $={padding:0,margin:0},H=(x?FN(h,x):h).map(function(F,q){if(F.type==="none")return null;var Q=_w({display:"block",paddingTop:4,paddingBottom:4,color:F.color||"#000"},c),J=F.formatter||p||zJ,B=F.value,U=F.name,Z=B,z=U;if(J&&Z!=null&&z!=null){var L=J(B,U,F,q,h);if(Array.isArray(L)){var ee=RJ(L,2);Z=ee[0],z=ee[1]}else Z=L}return W.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(q),style:Q},qn(z)?W.createElement("span",{className:"recharts-tooltip-item-name"},z):null,qn(z)?W.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,W.createElement("span",{className:"recharts-tooltip-item-value"},Z),W.createElement("span",{className:"recharts-tooltip-item-unit"},F.unit||""))});return W.createElement("ul",{className:"recharts-tooltip-item-list",style:$},H)}return null},E=_w({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),_=_w({margin:0},f),P=!At(b),O=P?b:"",T=_t("recharts-default-tooltip",g),R=_t("recharts-tooltip-label",j);P&&y&&h!==void 0&&h!==null&&(O=y(b,h));var I=C?{role:"status","aria-live":"assertive"}:{};return W.createElement("div",b1({className:T,style:E},I),W.createElement("p",{className:R,style:_},W.isValidElement(O)?O:"".concat(O)),N())};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 rh(e,t,n){return t=qJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qJ(e){var t=WJ(e,"string");return Od(t)=="symbol"?t:t+""}function WJ(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)}var Yu="recharts-tooltip-wrapper",VJ={visibility:"hidden"};function HJ(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return _t(Yu,rh(rh(rh(rh({},"".concat(Yu,"-right"),We(n)&&t&&We(t.x)&&n>=t.x),"".concat(Yu,"-left"),We(n)&&t&&We(t.x)&&n<t.x),"".concat(Yu,"-bottom"),We(r)&&t&&We(t.y)&&r>=t.y),"".concat(Yu,"-top"),We(r)&&t&&We(t.y)&&r<t.y))}function UT(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&&We(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 KJ(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function GJ(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=UT({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:o.width,viewBox:d,viewBoxDimension:d.width}),p=UT({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:o.height,viewBox:d,viewBoxDimension:d.height}),f=KJ({translateX:h,translateY:p,useTranslate3d:c})):f=VJ,{cssProperties:f,cssClasses:HJ({translateX:h,translateY:p,coordinate:n})}}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)}function qT(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 WT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qT(Object(n),!0).forEach(function(r){j1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function YJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function XJ(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,$5(r.key),r)}}function QJ(e,t,n){return t&&XJ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function JJ(e,t,n){return t=Vh(t),ZJ(e,M5()?Reflect.construct(t,n||[],Vh(e).constructor):t.apply(e,n))}function ZJ(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 eZ(e)}function eZ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function M5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(M5=function(){return!!e})()}function Vh(e){return Vh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Vh(e)}function tZ(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 j1(e,t,n){return t=$5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $5(e){var t=nZ(e,"string");return wc(t)=="symbol"?t:t+""}function nZ(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)}var VT=1,rZ=(function(e){function t(){var n;YJ(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=JJ(this,t,[].concat(a)),j1(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),j1(n,"handleKeyDown",function(o){if(o.key==="Escape"){var c,d,f,h;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(c=(d=n.props.coordinate)===null||d===void 0?void 0:d.x)!==null&&c!==void 0?c:0,y:(f=(h=n.props.coordinate)===null||h===void 0?void 0:h.y)!==null&&f!==void 0?f:0}})}}),n}return tZ(t,e),QJ(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>VT||Math.abs(r.height-this.state.lastBoundingBox.height)>VT)&&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=GJ({allowEscapeViewBox:o,coordinate:h,offsetTopLeft:g,position:j,reverseDirection:b,tooltipBox:this.state.lastBoundingBox,useTranslate3d:y,viewBox:S}),E=N.cssClasses,_=N.cssProperties,P=WT(WT({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 W.createElement("div",{tabIndex:-1,className:E,style:P,ref:function(T){r.wrapperNode=T}},f)}}])})(v.PureComponent),aZ=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},nl={isSsr:aZ()};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 HT(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 KT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HT(Object(n),!0).forEach(function(r){BN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iZ(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,L5(r.key),r)}}function oZ(e,t,n){return t&&iZ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function lZ(e,t,n){return t=Hh(t),cZ(e,D5()?Reflect.construct(t,n||[],Hh(e).constructor):t.apply(e,n))}function cZ(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 uZ(e)}function uZ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function D5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(D5=function(){return!!e})()}function Hh(e){return Hh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Hh(e)}function dZ(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&&S1(e,t)}function S1(e,t){return S1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},S1(e,t)}function BN(e,t,n){return t=L5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L5(e){var t=fZ(e,"string");return jc(t)=="symbol"?t:t+""}function fZ(e,t){if(jc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(jc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function pZ(e){return e.dataKey}function hZ(e,t){return W.isValidElement(e)?W.cloneElement(e,t):typeof e=="function"?W.createElement(e,t):W.createElement(UJ,t)}var Mr=(function(e){function t(){return sZ(this,t),lZ(this,t,arguments)}return dZ(t,e),oZ(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&&(_=E5(j.filter(function(O){return O.value!=null&&(O.hide!==!0||r.props.includeHidden)}),b,pZ));var P=_.length>0;return W.createElement(rZ,{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},hZ(f,KT(KT({},this.props),{},{payload:_})))}}])})(v.PureComponent);BN(Mr,"displayName","Tooltip");BN(Mr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!nl.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 Ew,GT;function mZ(){if(GT)return Ew;GT=1;var e=As(),t=function(){return e.Date.now()};return Ew=t,Ew}var Pw,YT;function vZ(){if(YT)return Pw;YT=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return Pw=t,Pw}var kw,XT;function gZ(){if(XT)return kw;XT=1;var e=vZ(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return kw=n,kw}var Ow,QT;function F5(){if(QT)return Ow;QT=1;var e=gZ(),t=Qi(),n=nu(),r=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,c=parseInt;function d(f){if(typeof f=="number")return f;if(n(f))return r;if(t(f)){var h=typeof f.valueOf=="function"?f.valueOf():f;f=t(h)?h+"":h}if(typeof f!="string")return f===0?f:+f;f=e(f);var p=i.test(f);return p||o.test(f)?c(f.slice(2),p?2:8):a.test(f)?r:+f}return Ow=d,Ow}var Tw,JT;function xZ(){if(JT)return Tw;JT=1;var e=Qi(),t=mZ(),n=F5(),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(H){var F=h,q=p;return h=p=void 0,y=H,g=c.apply(q,F),g}function _(H){return y=H,j=setTimeout(T,d),S?E(H):g}function P(H){var F=H-b,q=H-y,Q=d-F;return C?i(Q,x-q):Q}function O(H){var F=H-b,q=H-y;return b===void 0||F>=d||F<0||C&&q>=x}function T(){var H=t();if(O(H))return R(H);j=setTimeout(T,P(H))}function R(H){return j=void 0,N&&h?E(H):(h=p=void 0,g)}function I(){j!==void 0&&clearTimeout(j),y=0,h=b=p=j=void 0}function D(){return j===void 0?g:R(t())}function $(){var H=t(),F=O(H);if(h=arguments,p=this,b=H,F){if(j===void 0)return _(b);if(C)return clearTimeout(j),j=setTimeout(T,d),E(b)}return j===void 0&&(j=setTimeout(T,d)),g}return $.cancel=I,$.flush=D,$}return Tw=o,Tw}var Rw,ZT;function yZ(){if(ZT)return Rw;ZT=1;var e=xZ(),t=Qi(),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 Rw=r,Rw}var bZ=yZ();const B5=Yt(bZ);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 eR(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 ah(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eR(Object(n),!0).forEach(function(r){wZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wZ(e,t,n){return t=jZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jZ(e){var t=SZ(e,"string");return Td(t)=="symbol"?t:t+""}function SZ(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 NZ(e,t){return EZ(e)||_Z(e,t)||AZ(e,t)||CZ()}function CZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
61
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function AZ(e,t){if(e){if(typeof e=="string")return tR(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 tR(e,t)}}function tR(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 _Z(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 EZ(e){if(Array.isArray(e))return e}var Kh=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}),T=NZ(O,2),R=T[0],I=T[1],D=v.useCallback(function(H,F){I(function(q){var Q=Math.round(H),J=Math.round(F);return q.containerWidth===Q&&q.containerHeight===J?q:{containerWidth:Q,containerHeight:J}})},[]);v.useEffect(function(){var H=function(U){var Z,z=U[0].contentRect,L=z.width,ee=z.height;D(L,ee),(Z=P.current)===null||Z===void 0||Z.call(P,L,ee)};b>0&&(H=B5(H,b,{trailing:!0,leading:!1}));var F=new ResizeObserver(H),q=_.current.getBoundingClientRect(),Q=q.width,J=q.height;return D(Q,J),F.observe(_.current),function(){F.disconnect()}},[D,b]);var $=v.useMemo(function(){var H=R.containerWidth,F=R.containerHeight;if(H<0||F<0)return null;Ys(Ao(o)||Ao(d),`The width(%s) and height(%s) are both fixed numbers,
62
- maybe you don't need to use a ResponsiveContainer.`,o,d),Ys(!n||n>0,"The aspect(%s) must be greater than zero.",n);var q=Ao(o)?H:o,Q=Ao(d)?F:d;n&&n>0&&(q?Q=q/n:Q&&(q=Q*n),x&&Q>x&&(Q=x)),Ys(q>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.`,q,Q,o,d,h,p,n);var J=!Array.isArray(g)&&Gs(g.type).endsWith("Chart");return W.Children.map(g,function(B){return W.isValidElement(B)?v.cloneElement(B,ah({width:q,height:Q},J?{style:ah({height:"100%",width:"100%",maxHeight:Q,maxWidth:q},B.props.style)}:{})):B})},[n,g,d,x,p,h,R,o]);return W.createElement("div",{id:y?"".concat(y):void 0,className:_t("recharts-responsive-container",S),style:ah(ah({},E),{},{width:o,height:d,minWidth:h,minHeight:p,maxHeight:x}),ref:_},$)}),Tv=function(t){return null};Tv.displayName="Cell";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 nR(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 N1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nR(Object(n),!0).forEach(function(r){PZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function PZ(e,t,n){return t=kZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kZ(e){var t=OZ(e,"string");return Rd(t)=="symbol"?t:t+""}function OZ(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 Bl={widthCache:{},cacheCount:0},TZ=2e3,RZ={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},rR="recharts_measurement_span";function IZ(e){var t=N1({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var pd=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||nl.isSsr)return{width:0,height:0};var r=IZ(n),a=JSON.stringify({text:t,copyStyle:r});if(Bl.widthCache[a])return Bl.widthCache[a];try{var i=document.getElementById(rR);i||(i=document.createElement("span"),i.setAttribute("id",rR),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=N1(N1({},RZ),r);Object.assign(i.style,o),i.textContent="".concat(t);var c=i.getBoundingClientRect(),d={width:c.width,height:c.height};return Bl.widthCache[a]=d,++Bl.cacheCount>TZ&&(Bl.cacheCount=0,Bl.widthCache={}),d}catch{return{width:0,height:0}}},MZ=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};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 Gh(e,t){return FZ(e)||LZ(e,t)||DZ(e,t)||$Z()}function $Z(){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 DZ(e,t){if(e){if(typeof e=="string")return aR(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 aR(e,t)}}function aR(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 LZ(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 FZ(e){if(Array.isArray(e))return e}function BZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sR(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,UZ(r.key),r)}}function zZ(e,t,n){return t&&sR(e.prototype,t),n&&sR(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function UZ(e){var t=qZ(e,"string");return Id(t)=="symbol"?t:t+""}function qZ(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 String(e)}var iR=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,oR=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,WZ=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,VZ=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,z5={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},HZ=Object.keys(z5),Ql="NaN";function KZ(e,t){return e*z5[t]}var sh=(function(){function e(t,n){BZ(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!WZ.test(n)&&(this.num=NaN,this.unit=""),HZ.includes(n)&&(this.num=KZ(t,n),this.unit="px")}return zZ(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=VZ.exec(n))!==null&&r!==void 0?r:[],i=Gh(a,3),o=i[1],c=i[2];return new e(parseFloat(o),c??"")}}])})();function U5(e){if(e.includes(Ql))return Ql;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=iR.exec(t))!==null&&n!==void 0?n:[],a=Gh(r,4),i=a[1],o=a[2],c=a[3],d=sh.parse(i??""),f=sh.parse(c??""),h=o==="*"?d.multiply(f):d.divide(f);if(h.isNaN())return Ql;t=t.replace(iR,h.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var p,x=(p=oR.exec(t))!==null&&p!==void 0?p:[],g=Gh(x,4),j=g[1],b=g[2],y=g[3],S=sh.parse(j??""),C=sh.parse(y??""),N=b==="+"?S.add(C):S.subtract(C);if(N.isNaN())return Ql;t=t.replace(oR,N.toString())}return t}var lR=/\(([^()]*)\)/;function GZ(e){for(var t=e;t.includes("(");){var n=lR.exec(t),r=Gh(n,2),a=r[1];t=t.replace(lR,U5(a))}return t}function YZ(e){var t=e.replace(/\s+/g,"");return t=GZ(t),t=U5(t),t}function XZ(e){try{return YZ(e)}catch{return Ql}}function Iw(e){var t=XZ(e.slice(5,-1));return t===Ql?"":t}var QZ=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],JZ=["dx","dy","angle","className","breakAll"];function C1(){return C1=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},C1.apply(this,arguments)}function cR(e,t){if(e==null)return{};var n=ZZ(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 ZZ(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 uR(e,t){return ree(e)||nee(e,t)||tee(e,t)||eee()}function eee(){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 tee(e,t){if(e){if(typeof e=="string")return dR(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 dR(e,t)}}function dR(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 nee(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 ree(e){if(Array.isArray(e))return e}var q5=/[ \f\n\r\t\v\u2028\u2029]+/,W5=function(t){var n=t.children,r=t.breakAll,a=t.style;try{var i=[];At(n)||(r?i=n.toString().split(""):i=n.toString().split(q5));var o=i.map(function(d){return{word:d,width:pd(d,a).width}}),c=r?0:pd(" ",a).width;return{wordsWithComputedWidth:o,spaceWidth:c}}catch{return null}},aee=function(t,n,r,a,i){var o=t.maxLines,c=t.children,d=t.style,f=t.breakAll,h=We(o),p=c,x=function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return q.reduce(function(Q,J){var B=J.word,U=J.width,Z=Q[Q.length-1];if(Z&&(a==null||i||Z.width+U+r<Number(a)))Z.words.push(B),Z.width+=U+r;else{var z={words:[B],width:U};Q.push(z)}return Q},[])},g=x(n),j=function(q){return q.reduce(function(Q,J){return Q.width>J.width?Q:J})};if(!h)return g;for(var b="…",y=function(q){var Q=p.slice(0,q),J=W5({breakAll:f,style:d,children:Q+b}).wordsWithComputedWidth,B=x(J),U=B.length>o||j(B).width>Number(a);return[U,B]},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),T=uR(O,2),R=T[0],I=T[1],D=y(_),$=uR(D,1),H=$[0];if(!R&&!H&&(S=_+1),R&&H&&(C=_-1),!R&&H){E=I;break}N++}return E||g},fR=function(t){var n=At(t)?[]:t.toString().split(q5);return[{words:n}]},see=function(t){var n=t.width,r=t.scaleToFit,a=t.children,i=t.style,o=t.breakAll,c=t.maxLines;if((n||r)&&!nl.isSsr){var d,f,h=W5({breakAll:o,children:a,style:i});if(h){var p=h.wordsWithComputedWidth,x=h.spaceWidth;d=p,f=x}else return fR(a);return aee({breakAll:o,children:a,maxLines:c,style:i},d,f,n,r)}return fR(a)},pR="#808080",Fo=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?pR:y,C=cR(t,QZ),N=v.useMemo(function(){return see({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,T=C.breakAll,R=cR(C,JZ);if(!qn(r)||!qn(i))return null;var I=r+(We(E)?E:0),D=i+(We(_)?_:0),$;switch(b){case"start":$=Iw("calc(".concat(f,")"));break;case"middle":$=Iw("calc(".concat((N.length-1)/2," * -").concat(c," + (").concat(f," / 2))"));break;default:$=Iw("calc(".concat(N.length-1," * -").concat(c,")"));break}var H=[];if(p){var F=N[0].width,q=C.width;H.push("scale(".concat((We(q)?q/F:1)/F,")"))}return P&&H.push("rotate(".concat(P,", ").concat(I,", ").concat(D,")")),H.length&&(R.transform=H.join(" ")),W.createElement("text",C1({},gt(R,!0),{x:I,y:D,className:_t("recharts-text",O),textAnchor:g,fill:S.includes("url")?pR:S}),N.map(function(Q,J){var B=Q.words.join(T?"":" ");return W.createElement("tspan",{x:I,dy:J===0?$:c,key:"".concat(B,"-").concat(J)},B)}))};function Bi(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function iee(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function zN(e){let t,n,r;e.length!==2?(t=Bi,n=(c,d)=>Bi(e(c),d),r=(c,d)=>e(c)-d):(t=e===Bi||e===iee?e:oee,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 oee(){return 0}function V5(e){return e===null?NaN:+e}function*lee(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const cee=zN(Bi),Ef=cee.right;zN(V5).center;class hR extends Map{constructor(t,n=fee){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(mR(this,t))}has(t){return super.has(mR(this,t))}set(t,n){return super.set(uee(this,t),n)}delete(t){return super.delete(dee(this,t))}}function mR({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function uee({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function dee({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function fee(e){return e!==null&&typeof e=="object"?e.valueOf():e}function pee(e=Bi){if(e===Bi)return H5;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 H5(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const hee=Math.sqrt(50),mee=Math.sqrt(10),vee=Math.sqrt(2);function Yh(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>=hee?10:i>=mee?5:i>=vee?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?Yh(e,t,n*2):[c,d,f]}function A1(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?Yh(t,e,n):Yh(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 _1(e,t,n){return t=+t,e=+e,n=+n,Yh(e,t,n)[2]}function E1(e,t,n){t=+t,e=+e,n=+n;const r=t<e,a=r?_1(t,e,n):_1(e,t,n);return(r?-1:1)*(a<0?1/-a:a)}function vR(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function gR(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function K5(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?H5:pee(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));K5(e,t,g,j,a)}const i=e[t];let o=n,c=r;for(Xu(e,n,t),a(e[r],i)>0&&Xu(e,n,r);o<c;){for(Xu(e,o,c),++o,--c;a(e[o],i)<0;)++o;for(;a(e[c],i)>0;)--c}a(e[n],i)===0?Xu(e,n,c):(++c,Xu(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function Xu(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function gee(e,t,n){if(e=Float64Array.from(lee(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return gR(e);if(t>=1)return vR(e);var r,a=(r-1)*t,i=Math.floor(a),o=vR(K5(e,i).subarray(0,i+1)),c=gR(e.subarray(i+1));return o+(c-o)*(a-i)}}function xee(e,t,n=V5){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 yee(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 Ea(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function ii(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 P1=Symbol("implicit");function UN(){var e=new hR,t=[],n=[],r=P1;function a(i){let o=e.get(i);if(o===void 0){if(r!==P1)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 hR;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 UN(t,n).unknown(r)},Ea.apply(a,arguments),a}function Md(){var e=UN().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=yee(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 Md(t(),[r,a]).round(c).paddingInner(d).paddingOuter(f).align(h)},Ea.apply(p(),arguments)}function G5(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return G5(t())},e}function hd(){return G5(Md.apply(null,arguments).paddingInner(1))}function qN(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Y5(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Pf(){}var $d=.7,Xh=1/$d,lc="\\s*([+-]?\\d+)\\s*",Dd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ms="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",bee=/^#([0-9a-f]{3,8})$/,wee=new RegExp(`^rgb\\(${lc},${lc},${lc}\\)$`),jee=new RegExp(`^rgb\\(${ms},${ms},${ms}\\)$`),See=new RegExp(`^rgba\\(${lc},${lc},${lc},${Dd}\\)$`),Nee=new RegExp(`^rgba\\(${ms},${ms},${ms},${Dd}\\)$`),Cee=new RegExp(`^hsl\\(${Dd},${ms},${ms}\\)$`),Aee=new RegExp(`^hsla\\(${Dd},${ms},${ms},${Dd}\\)$`),xR={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};qN(Pf,Ld,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:yR,formatHex:yR,formatHex8:_ee,formatHsl:Eee,formatRgb:bR,toString:bR});function yR(){return this.rgb().formatHex()}function _ee(){return this.rgb().formatHex8()}function Eee(){return X5(this).formatHsl()}function bR(){return this.rgb().formatRgb()}function Ld(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=bee.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?wR(t):n===3?new Fr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ih(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ih(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=wee.exec(e))?new Fr(t[1],t[2],t[3],1):(t=jee.exec(e))?new Fr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=See.exec(e))?ih(t[1],t[2],t[3],t[4]):(t=Nee.exec(e))?ih(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Cee.exec(e))?NR(t[1],t[2]/100,t[3]/100,1):(t=Aee.exec(e))?NR(t[1],t[2]/100,t[3]/100,t[4]):xR.hasOwnProperty(e)?wR(xR[e]):e==="transparent"?new Fr(NaN,NaN,NaN,0):null}function wR(e){return new Fr(e>>16&255,e>>8&255,e&255,1)}function ih(e,t,n,r){return r<=0&&(e=t=n=NaN),new Fr(e,t,n,r)}function Pee(e){return e instanceof Pf||(e=Ld(e)),e?(e=e.rgb(),new Fr(e.r,e.g,e.b,e.opacity)):new Fr}function k1(e,t,n,r){return arguments.length===1?Pee(e):new Fr(e,t,n,r??1)}function Fr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}qN(Fr,k1,Y5(Pf,{brighter(e){return e=e==null?Xh:Math.pow(Xh,e),new Fr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?$d:Math.pow($d,e),new Fr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Fr(To(this.r),To(this.g),To(this.b),Qh(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:jR,formatHex:jR,formatHex8:kee,formatRgb:SR,toString:SR}));function jR(){return`#${_o(this.r)}${_o(this.g)}${_o(this.b)}`}function kee(){return`#${_o(this.r)}${_o(this.g)}${_o(this.b)}${_o((isNaN(this.opacity)?1:this.opacity)*255)}`}function SR(){const e=Qh(this.opacity);return`${e===1?"rgb(":"rgba("}${To(this.r)}, ${To(this.g)}, ${To(this.b)}${e===1?")":`, ${e})`}`}function Qh(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 _o(e){return e=To(e),(e<16?"0":"")+e.toString(16)}function NR(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ua(e,t,n,r)}function X5(e){if(e instanceof Ua)return new Ua(e.h,e.s,e.l,e.opacity);if(e instanceof Pf||(e=Ld(e)),!e)return new Ua;if(e instanceof Ua)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 Ua(o,c,d,e.opacity)}function Oee(e,t,n,r){return arguments.length===1?X5(e):new Ua(e,t,n,r??1)}function Ua(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}qN(Ua,Oee,Y5(Pf,{brighter(e){return e=e==null?Xh:Math.pow(Xh,e),new Ua(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?$d:Math.pow($d,e),new Ua(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 Fr(Mw(e>=240?e-240:e+120,a,r),Mw(e,a,r),Mw(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Ua(CR(this.h),oh(this.s),oh(this.l),Qh(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=Qh(this.opacity);return`${e===1?"hsl(":"hsla("}${CR(this.h)}, ${oh(this.s)*100}%, ${oh(this.l)*100}%${e===1?")":`, ${e})`}`}}));function CR(e){return e=(e||0)%360,e<0?e+360:e}function oh(e){return Math.max(0,Math.min(1,e||0))}function Mw(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 WN=e=>()=>e;function Tee(e,t){return function(n){return e+n*t}}function Ree(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 Iee(e){return(e=+e)==1?Q5:function(t,n){return n-t?Ree(t,n,e):WN(isNaN(t)?n:t)}}function Q5(e,t){var n=t-e;return n?Tee(e,n):WN(isNaN(e)?t:e)}const AR=(function e(t){var n=Iee(t);function r(a,i){var o=n((a=k1(a)).r,(i=k1(i)).r),c=n(a.g,i.g),d=n(a.b,i.b),f=Q5(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 Mee(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 $ee(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Dee(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]=iu(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 Lee(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Jh(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Fee(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]=iu(e[a],t[a]):r[a]=t[a];return function(i){for(a in n)r[a]=n[a](i);return r}}var O1=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,$w=new RegExp(O1.source,"g");function Bee(e){return function(){return e}}function zee(e){return function(t){return e(t)+""}}function Uee(e,t){var n=O1.lastIndex=$w.lastIndex=0,r,a,i,o=-1,c=[],d=[];for(e=e+"",t=t+"";(r=O1.exec(e))&&(a=$w.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:Jh(r,a)})),n=$w.lastIndex;return n<t.length&&(i=t.slice(n),c[o]?c[o]+=i:c[++o]=i),c.length<2?d[0]?zee(d[0].x):Bee(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 iu(e,t){var n=typeof t,r;return t==null||n==="boolean"?WN(t):(n==="number"?Jh:n==="string"?(r=Ld(t))?(t=r,AR):Uee:t instanceof Ld?AR:t instanceof Date?Lee:$ee(t)?Mee:Array.isArray(t)?Dee:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Fee:Jh)(e,t)}function VN(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function qee(e,t){t===void 0&&(t=e,e=iu);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 Wee(e){return function(){return e}}function Zh(e){return+e}var _R=[0,1];function Sr(e){return e}function T1(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Wee(isNaN(t)?NaN:.5)}function Vee(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Hee(e,t,n){var r=e[0],a=e[1],i=t[0],o=t[1];return a<r?(r=T1(a,r),i=n(o,i)):(r=T1(r,a),i=n(i,o)),function(c){return i(r(c))}}function Kee(e,t,n){var r=Math.min(e.length,t.length)-1,a=new Array(r),i=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)a[o]=T1(e[o],e[o+1]),i[o]=n(t[o],t[o+1]);return function(c){var d=Ef(e,c,1,r)-1;return i[d](a[d](c))}}function kf(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Rv(){var e=_R,t=_R,n=iu,r,a,i,o=Sr,c,d,f;function h(){var x=Math.min(e.length,t.length);return o!==Sr&&(o=Vee(e[0],e[x-1])),c=x>2?Kee:Hee,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),Jh)))(x)))},p.domain=function(x){return arguments.length?(e=Array.from(x,Zh),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=VN,h()},p.clamp=function(x){return arguments.length?(o=x?!0:Sr,h()):o!==Sr},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 HN(){return Rv()(Sr,Sr)}function Gee(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function em(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Sc(e){return e=em(Math.abs(e)),e?e[1]:NaN}function Yee(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 Xee(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Qee=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Fd(e){if(!(t=Qee.exec(e)))throw new Error("invalid format: "+e);var t;return new KN({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]})}Fd.prototype=KN.prototype;function KN(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+""}KN.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 Jee(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 tm;function Zee(e,t){var n=em(e,t);if(!n)return tm=void 0,e.toPrecision(t);var r=n[0],a=n[1],i=a-(tm=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")+em(e,Math.max(0,t+i-1))[0]}function ER(e,t){var n=em(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 PR={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Gee,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)=>ER(e*100,t),r:ER,s:Zee,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function kR(e){return e}var OR=Array.prototype.map,TR=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ete(e){var t=e.grouping===void 0||e.thousands===void 0?kR:Yee(OR.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?kR:Xee(OR.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=Fd(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"):PR[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():""),T=(y==="$"?r:/[%p]/.test(P)?o:"")+(x&&x.suffix!==void 0?x.suffix:""),R=PR[P],I=/[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($){var H=O,F=T,q,Q,J;if(P==="c")F=R($)+F,$="";else{$=+$;var B=$<0||1/$<0;if($=isNaN($)?d:R(Math.abs($),E),_&&($=Jee($)),B&&+$==0&&b!=="+"&&(B=!1),H=(B?b==="("?b:c:b==="-"||b==="("?"":b)+H,F=(P==="s"&&!isNaN($)&&tm!==void 0?TR[8+tm/3]:"")+F+(B&&b==="("?")":""),I){for(q=-1,Q=$.length;++q<Q;)if(J=$.charCodeAt(q),48>J||J>57){F=(J===46?a+$.slice(q+1):$.slice(q))+F,$=$.slice(0,q);break}}}N&&!S&&($=t($,1/0));var U=H.length+$.length+F.length,Z=U<C?new Array(C-U+1).join(g):"";switch(N&&S&&($=t(Z+$,Z.length?C-F.length:1/0),Z=""),j){case"<":$=H+$+F+Z;break;case"=":$=H+Z+$+F;break;case"^":$=Z.slice(0,U=Z.length>>1)+H+$+F+Z.slice(U);break;default:$=Z+H+$+F;break}return i($)}return D.toString=function(){return p+""},D}function h(p,x){var g=Math.max(-8,Math.min(8,Math.floor(Sc(x)/3)))*3,j=Math.pow(10,-g),b=f((p=Fd(p),p.type="f",p),{suffix:TR[8+g/3]});return function(y){return b(j*y)}}return{format:f,formatPrefix:h}}var lh,GN,J5;tte({thousands:",",grouping:[3],currency:["$",""]});function tte(e){return lh=ete(e),GN=lh.format,J5=lh.formatPrefix,lh}function nte(e){return Math.max(0,-Sc(Math.abs(e)))}function rte(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Sc(t)/3)))*3-Sc(Math.abs(e)))}function ate(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Sc(t)-Sc(e))+1}function Z5(e,t,n,r){var a=E1(e,t,n),i;switch(r=Fd(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(i=rte(a,o))&&(r.precision=i),J5(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=ate(a,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=nte(a))&&(r.precision=i-(r.type==="%")*2);break}}return GN(r)}function Ji(e){var t=e.domain;return e.ticks=function(n){var r=t();return A1(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var a=t();return Z5(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=_1(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 nm(){var e=HN();return e.copy=function(){return kf(e,nm())},Ea.apply(e,arguments),Ji(e)}function eL(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,Zh),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return eL(e).unknown(t)},e=arguments.length?Array.from(e,Zh):[0,1],Ji(n)}function tL(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 RR(e){return Math.log(e)}function IR(e){return Math.exp(e)}function ste(e){return-Math.log(-e)}function ite(e){return-Math.exp(-e)}function ote(e){return isFinite(e)?+("1e"+e):e<0?0:e}function lte(e){return e===10?ote:e===Math.E?Math.exp:t=>Math.pow(e,t)}function cte(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function MR(e){return(t,n)=>-e(-t,n)}function YN(e){const t=e(RR,IR),n=t.domain;let r=10,a,i;function o(){return a=cte(r),i=lte(r),n()[0]<0?(a=MR(a),i=MR(i),e(ste,ite)):e(RR,IR),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=A1(f,h,y))}else S=A1(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=Fd(d)).precision==null&&(d.trim=!0),d=GN(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(tL(n(),{floor:c=>i(Math.floor(a(c))),ceil:c=>i(Math.ceil(a(c)))})),t}function nL(){const e=YN(Rv()).domain([1,10]);return e.copy=()=>kf(e,nL()).base(e.base()),Ea.apply(e,arguments),e}function $R(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function DR(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function XN(e){var t=1,n=e($R(t),DR(t));return n.constant=function(r){return arguments.length?e($R(t=+r),DR(t)):t},Ji(n)}function rL(){var e=XN(Rv());return e.copy=function(){return kf(e,rL()).constant(e.constant())},Ea.apply(e,arguments)}function LR(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function ute(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function dte(e){return e<0?-e*e:e*e}function QN(e){var t=e(Sr,Sr),n=1;function r(){return n===1?e(Sr,Sr):n===.5?e(ute,dte):e(LR(n),LR(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,r()):n},Ji(t)}function JN(){var e=QN(Rv());return e.copy=function(){return kf(e,JN()).exponent(e.exponent())},Ea.apply(e,arguments),e}function fte(){return JN.apply(null,arguments).exponent(.5)}function FR(e){return Math.sign(e)*e*e}function pte(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function aL(){var e=HN(),t=[0,1],n=!1,r;function a(i){var o=pte(e(i));return isNaN(o)?r:n?Math.round(o):o}return a.invert=function(i){return e.invert(FR(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,Zh)).map(FR)),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 aL(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Ea.apply(a,arguments),Ji(a)}function sL(){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]=xee(e,o/c);return i}function i(o){return o==null||isNaN(o=+o)?r:t[Ef(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(Bi),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 sL().domain(e).range(t).unknown(r)},Ea.apply(i,arguments)}function iL(){var e=0,t=1,n=1,r=[.5],a=[0,1],i;function o(d){return d!=null&&d<=d?a[Ef(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 iL().domain([e,t]).range(a).unknown(i)},Ea.apply(Ji(o),arguments)}function oL(){var e=[.5],t=[0,1],n,r=1;function a(i){return i!=null&&i<=i?t[Ef(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 oL().domain(e).range(t).unknown(n)},Ea.apply(a,arguments)}const Dw=new Date,Lw=new Date;function Kn(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=>Kn(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)=>(Dw.setTime(+i),Lw.setTime(+o),e(Dw),e(Lw),Math.floor(n(Dw,Lw))),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 rm=Kn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);rm.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Kn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):rm);rm.range;const Hs=1e3,ja=Hs*60,Ks=ja*60,ei=Ks*24,ZN=ei*7,BR=ei*30,Fw=ei*365,Eo=Kn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Hs)},(e,t)=>(t-e)/Hs,e=>e.getUTCSeconds());Eo.range;const eC=Kn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Hs)},(e,t)=>{e.setTime(+e+t*ja)},(e,t)=>(t-e)/ja,e=>e.getMinutes());eC.range;const tC=Kn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ja)},(e,t)=>(t-e)/ja,e=>e.getUTCMinutes());tC.range;const nC=Kn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Hs-e.getMinutes()*ja)},(e,t)=>{e.setTime(+e+t*Ks)},(e,t)=>(t-e)/Ks,e=>e.getHours());nC.range;const rC=Kn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ks)},(e,t)=>(t-e)/Ks,e=>e.getUTCHours());rC.range;const Of=Kn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ja)/ei,e=>e.getDate()-1);Of.range;const Iv=Kn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ei,e=>e.getUTCDate()-1);Iv.range;const lL=Kn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ei,e=>Math.floor(e/ei));lL.range;function rl(e){return Kn(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())*ja)/ZN)}const Mv=rl(0),am=rl(1),hte=rl(2),mte=rl(3),Nc=rl(4),vte=rl(5),gte=rl(6);Mv.range;am.range;hte.range;mte.range;Nc.range;vte.range;gte.range;function al(e){return Kn(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)/ZN)}const $v=al(0),sm=al(1),xte=al(2),yte=al(3),Cc=al(4),bte=al(5),wte=al(6);$v.range;sm.range;xte.range;yte.range;Cc.range;bte.range;wte.range;const aC=Kn(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());aC.range;const sC=Kn(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());sC.range;const ti=Kn(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());ti.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Kn(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)});ti.range;const ni=Kn(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());ni.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Kn(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)});ni.range;function cL(e,t,n,r,a,i){const o=[[Eo,1,Hs],[Eo,5,5*Hs],[Eo,15,15*Hs],[Eo,30,30*Hs],[i,1,ja],[i,5,5*ja],[i,15,15*ja],[i,30,30*ja],[a,1,Ks],[a,3,3*Ks],[a,6,6*Ks],[a,12,12*Ks],[r,1,ei],[r,2,2*ei],[n,1,ZN],[t,1,BR],[t,3,3*BR],[e,1,Fw]];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=zN(([,,y])=>y).right(o,x);if(g===o.length)return e.every(E1(f/Fw,h/Fw,p));if(g===0)return rm.every(Math.max(E1(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[jte,Ste]=cL(ni,sC,$v,lL,rC,tC),[Nte,Cte]=cL(ti,aC,Mv,Of,nC,eC);function Bw(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 zw(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 Qu(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Ate(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=Ju(a),h=Zu(a),p=Ju(i),x=Zu(i),g=Ju(o),j=Zu(o),b=Ju(c),y=Zu(c),S=Ju(d),C=Zu(d),N={a:J,A:B,b:U,B:Z,c:null,d:HR,e:HR,f:Yte,g:sne,G:one,H:Hte,I:Kte,j:Gte,L:uL,m:Xte,M:Qte,p:z,q:L,Q:YR,s:XR,S:Jte,u:Zte,U:ene,V:tne,w:nne,W:rne,x:null,X:null,y:ane,Y:ine,Z:lne,"%":GR},E={a:ee,A:se,b:G,B:ue,c:null,d:KR,e:KR,f:fne,g:jne,G:Nne,H:cne,I:une,j:dne,L:fL,m:pne,M:hne,p:le,q:oe,Q:YR,s:XR,S:mne,u:vne,U:gne,V:xne,w:yne,W:bne,x:null,X:null,y:wne,Y:Sne,Z:Cne,"%":GR},_={a:I,A:D,b:$,B:H,c:F,d:WR,e:WR,f:Ute,g:qR,G:UR,H:VR,I:VR,j:Lte,L:zte,m:Dte,M:Fte,p:R,q:$te,Q:Wte,s:Vte,S:Bte,u:Ote,U:Tte,V:Rte,w:kte,W:Ite,x:q,X:Q,y:qR,Y:UR,Z:Mte,"%":qte};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(ie,fe){return function(Ae){var re=[],Te=-1,_e=0,Ge=ie.length,je,Me,Y;for(Ae instanceof Date||(Ae=new Date(+Ae));++Te<Ge;)ie.charCodeAt(Te)===37&&(re.push(ie.slice(_e,Te)),(Me=zR[je=ie.charAt(++Te)])!=null?je=ie.charAt(++Te):Me=je==="e"?" ":"0",(Y=fe[je])&&(je=Y(Ae,Me)),re.push(je),_e=Te+1);return re.push(ie.slice(_e,Te)),re.join("")}}function O(ie,fe){return function(Ae){var re=Qu(1900,void 0,1),Te=T(re,ie,Ae+="",0),_e,Ge;if(Te!=Ae.length)return null;if("Q"in re)return new Date(re.Q);if("s"in re)return new Date(re.s*1e3+("L"in re?re.L:0));if(fe&&!("Z"in re)&&(re.Z=0),"p"in re&&(re.H=re.H%12+re.p*12),re.m===void 0&&(re.m="q"in re?re.q:0),"V"in re){if(re.V<1||re.V>53)return null;"w"in re||(re.w=1),"Z"in re?(_e=zw(Qu(re.y,0,1)),Ge=_e.getUTCDay(),_e=Ge>4||Ge===0?sm.ceil(_e):sm(_e),_e=Iv.offset(_e,(re.V-1)*7),re.y=_e.getUTCFullYear(),re.m=_e.getUTCMonth(),re.d=_e.getUTCDate()+(re.w+6)%7):(_e=Bw(Qu(re.y,0,1)),Ge=_e.getDay(),_e=Ge>4||Ge===0?am.ceil(_e):am(_e),_e=Of.offset(_e,(re.V-1)*7),re.y=_e.getFullYear(),re.m=_e.getMonth(),re.d=_e.getDate()+(re.w+6)%7)}else("W"in re||"U"in re)&&("w"in re||(re.w="u"in re?re.u%7:"W"in re?1:0),Ge="Z"in re?zw(Qu(re.y,0,1)).getUTCDay():Bw(Qu(re.y,0,1)).getDay(),re.m=0,re.d="W"in re?(re.w+6)%7+re.W*7-(Ge+5)%7:re.w+re.U*7-(Ge+6)%7);return"Z"in re?(re.H+=re.Z/100|0,re.M+=re.Z%100,zw(re)):Bw(re)}}function T(ie,fe,Ae,re){for(var Te=0,_e=fe.length,Ge=Ae.length,je,Me;Te<_e;){if(re>=Ge)return-1;if(je=fe.charCodeAt(Te++),je===37){if(je=fe.charAt(Te++),Me=_[je in zR?fe.charAt(Te++):je],!Me||(re=Me(ie,Ae,re))<0)return-1}else if(je!=Ae.charCodeAt(re++))return-1}return re}function R(ie,fe,Ae){var re=f.exec(fe.slice(Ae));return re?(ie.p=h.get(re[0].toLowerCase()),Ae+re[0].length):-1}function I(ie,fe,Ae){var re=g.exec(fe.slice(Ae));return re?(ie.w=j.get(re[0].toLowerCase()),Ae+re[0].length):-1}function D(ie,fe,Ae){var re=p.exec(fe.slice(Ae));return re?(ie.w=x.get(re[0].toLowerCase()),Ae+re[0].length):-1}function $(ie,fe,Ae){var re=S.exec(fe.slice(Ae));return re?(ie.m=C.get(re[0].toLowerCase()),Ae+re[0].length):-1}function H(ie,fe,Ae){var re=b.exec(fe.slice(Ae));return re?(ie.m=y.get(re[0].toLowerCase()),Ae+re[0].length):-1}function F(ie,fe,Ae){return T(ie,t,fe,Ae)}function q(ie,fe,Ae){return T(ie,n,fe,Ae)}function Q(ie,fe,Ae){return T(ie,r,fe,Ae)}function J(ie){return o[ie.getDay()]}function B(ie){return i[ie.getDay()]}function U(ie){return d[ie.getMonth()]}function Z(ie){return c[ie.getMonth()]}function z(ie){return a[+(ie.getHours()>=12)]}function L(ie){return 1+~~(ie.getMonth()/3)}function ee(ie){return o[ie.getUTCDay()]}function se(ie){return i[ie.getUTCDay()]}function G(ie){return d[ie.getUTCMonth()]}function ue(ie){return c[ie.getUTCMonth()]}function le(ie){return a[+(ie.getUTCHours()>=12)]}function oe(ie){return 1+~~(ie.getUTCMonth()/3)}return{format:function(ie){var fe=P(ie+="",N);return fe.toString=function(){return ie},fe},parse:function(ie){var fe=O(ie+="",!1);return fe.toString=function(){return ie},fe},utcFormat:function(ie){var fe=P(ie+="",E);return fe.toString=function(){return ie},fe},utcParse:function(ie){var fe=O(ie+="",!0);return fe.toString=function(){return ie},fe}}}var zR={"-":"",_:" ",0:"0"},nr=/^\s*\d+/,_te=/^%/,Ete=/[\\^$*+?|[\]().{}]/g;function Wt(e,t,n){var r=e<0?"-":"",a=(r?-e:e)+"",i=a.length;return r+(i<n?new Array(n-i+1).join(t)+a:a)}function Pte(e){return e.replace(Ete,"\\$&")}function Ju(e){return new RegExp("^(?:"+e.map(Pte).join("|")+")","i")}function Zu(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function kte(e,t,n){var r=nr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Ote(e,t,n){var r=nr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Tte(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Rte(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Ite(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function UR(e,t,n){var r=nr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function qR(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Mte(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 $te(e,t,n){var r=nr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Dte(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function WR(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Lte(e,t,n){var r=nr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function VR(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Fte(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Bte(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function zte(e,t,n){var r=nr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Ute(e,t,n){var r=nr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function qte(e,t,n){var r=_te.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Wte(e,t,n){var r=nr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Vte(e,t,n){var r=nr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function HR(e,t){return Wt(e.getDate(),t,2)}function Hte(e,t){return Wt(e.getHours(),t,2)}function Kte(e,t){return Wt(e.getHours()%12||12,t,2)}function Gte(e,t){return Wt(1+Of.count(ti(e),e),t,3)}function uL(e,t){return Wt(e.getMilliseconds(),t,3)}function Yte(e,t){return uL(e,t)+"000"}function Xte(e,t){return Wt(e.getMonth()+1,t,2)}function Qte(e,t){return Wt(e.getMinutes(),t,2)}function Jte(e,t){return Wt(e.getSeconds(),t,2)}function Zte(e){var t=e.getDay();return t===0?7:t}function ene(e,t){return Wt(Mv.count(ti(e)-1,e),t,2)}function dL(e){var t=e.getDay();return t>=4||t===0?Nc(e):Nc.ceil(e)}function tne(e,t){return e=dL(e),Wt(Nc.count(ti(e),e)+(ti(e).getDay()===4),t,2)}function nne(e){return e.getDay()}function rne(e,t){return Wt(am.count(ti(e)-1,e),t,2)}function ane(e,t){return Wt(e.getFullYear()%100,t,2)}function sne(e,t){return e=dL(e),Wt(e.getFullYear()%100,t,2)}function ine(e,t){return Wt(e.getFullYear()%1e4,t,4)}function one(e,t){var n=e.getDay();return e=n>=4||n===0?Nc(e):Nc.ceil(e),Wt(e.getFullYear()%1e4,t,4)}function lne(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Wt(t/60|0,"0",2)+Wt(t%60,"0",2)}function KR(e,t){return Wt(e.getUTCDate(),t,2)}function cne(e,t){return Wt(e.getUTCHours(),t,2)}function une(e,t){return Wt(e.getUTCHours()%12||12,t,2)}function dne(e,t){return Wt(1+Iv.count(ni(e),e),t,3)}function fL(e,t){return Wt(e.getUTCMilliseconds(),t,3)}function fne(e,t){return fL(e,t)+"000"}function pne(e,t){return Wt(e.getUTCMonth()+1,t,2)}function hne(e,t){return Wt(e.getUTCMinutes(),t,2)}function mne(e,t){return Wt(e.getUTCSeconds(),t,2)}function vne(e){var t=e.getUTCDay();return t===0?7:t}function gne(e,t){return Wt($v.count(ni(e)-1,e),t,2)}function pL(e){var t=e.getUTCDay();return t>=4||t===0?Cc(e):Cc.ceil(e)}function xne(e,t){return e=pL(e),Wt(Cc.count(ni(e),e)+(ni(e).getUTCDay()===4),t,2)}function yne(e){return e.getUTCDay()}function bne(e,t){return Wt(sm.count(ni(e)-1,e),t,2)}function wne(e,t){return Wt(e.getUTCFullYear()%100,t,2)}function jne(e,t){return e=pL(e),Wt(e.getUTCFullYear()%100,t,2)}function Sne(e,t){return Wt(e.getUTCFullYear()%1e4,t,4)}function Nne(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Cc(e):Cc.ceil(e),Wt(e.getUTCFullYear()%1e4,t,4)}function Cne(){return"+0000"}function GR(){return"%"}function YR(e){return+e}function XR(e){return Math.floor(+e/1e3)}var zl,hL,mL;Ane({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 Ane(e){return zl=Ate(e),hL=zl.format,zl.parse,mL=zl.utcFormat,zl.utcParse,zl}function _ne(e){return new Date(e)}function Ene(e){return e instanceof Date?+e:+new Date(+e)}function iC(e,t,n,r,a,i,o,c,d,f){var h=HN(),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,Ene)):x().map(_ne)},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(tL(O,P)):h},h.copy=function(){return kf(h,iC(e,t,n,r,a,i,o,c,d,f))},h}function Pne(){return Ea.apply(iC(Nte,Cte,ti,aC,Mv,Of,nC,eC,Eo,hL).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function kne(){return Ea.apply(iC(jte,Ste,ni,sC,$v,Iv,rC,tC,Eo,mL).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Dv(){var e=0,t=1,n,r,a,i,o=Sr,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(iu),f.rangeRound=h(VN),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 Zi(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function vL(){var e=Ji(Dv()(Sr));return e.copy=function(){return Zi(e,vL())},ii.apply(e,arguments)}function gL(){var e=YN(Dv()).domain([1,10]);return e.copy=function(){return Zi(e,gL()).base(e.base())},ii.apply(e,arguments)}function xL(){var e=XN(Dv());return e.copy=function(){return Zi(e,xL()).constant(e.constant())},ii.apply(e,arguments)}function oC(){var e=QN(Dv());return e.copy=function(){return Zi(e,oC()).exponent(e.exponent())},ii.apply(e,arguments)}function One(){return oC.apply(null,arguments).exponent(.5)}function yL(){var e=[],t=Sr;function n(r){if(r!=null&&!isNaN(r=+r))return t((Ef(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(Bi),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)=>gee(e,i/r))},n.copy=function(){return yL(t).domain(e)},ii.apply(n,arguments)}function Lv(){var e=0,t=.5,n=1,r=1,a,i,o,c,d,f=Sr,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=qee(b,[S,C,N]),g):[f(0),f(.5),f(1)]}}return g.range=j(iu),g.rangeRound=j(VN),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 bL(){var e=Ji(Lv()(Sr));return e.copy=function(){return Zi(e,bL())},ii.apply(e,arguments)}function wL(){var e=YN(Lv()).domain([.1,1,10]);return e.copy=function(){return Zi(e,wL()).base(e.base())},ii.apply(e,arguments)}function jL(){var e=XN(Lv());return e.copy=function(){return Zi(e,jL()).constant(e.constant())},ii.apply(e,arguments)}function lC(){var e=QN(Lv());return e.copy=function(){return Zi(e,lC()).exponent(e.exponent())},ii.apply(e,arguments)}function Tne(){return lC.apply(null,arguments).exponent(.5)}const QR=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Md,scaleDiverging:bL,scaleDivergingLog:wL,scaleDivergingPow:lC,scaleDivergingSqrt:Tne,scaleDivergingSymlog:jL,scaleIdentity:eL,scaleImplicit:P1,scaleLinear:nm,scaleLog:nL,scaleOrdinal:UN,scalePoint:hd,scalePow:JN,scaleQuantile:sL,scaleQuantize:iL,scaleRadial:aL,scaleSequential:vL,scaleSequentialLog:gL,scaleSequentialPow:oC,scaleSequentialQuantile:yL,scaleSequentialSqrt:One,scaleSequentialSymlog:xL,scaleSqrt:fte,scaleSymlog:rL,scaleThreshold:oL,scaleTime:Pne,scaleUtc:kne,tickFormat:Z5},Symbol.toStringTag,{value:"Module"}));var Uw,JR;function Fv(){if(JR)return Uw;JR=1;var e=nu();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 Uw=t,Uw}var qw,ZR;function SL(){if(ZR)return qw;ZR=1;function e(t,n){return t>n}return qw=e,qw}var Ww,e2;function Rne(){if(e2)return Ww;e2=1;var e=Fv(),t=SL(),n=su();function r(a){return a&&a.length?e(a,n,t):void 0}return Ww=r,Ww}var Ine=Rne();const Bv=Yt(Ine);var Vw,t2;function NL(){if(t2)return Vw;t2=1;function e(t,n){return t<n}return Vw=e,Vw}var Hw,n2;function Mne(){if(n2)return Hw;n2=1;var e=Fv(),t=NL(),n=su();function r(a){return a&&a.length?e(a,n,t):void 0}return Hw=r,Hw}var $ne=Mne();const zv=Yt($ne);var Kw,r2;function Dne(){if(r2)return Kw;r2=1;var e=NN(),t=_s(),n=R5(),r=Br();function a(i,o){var c=r(i)?e:n;return c(i,t(o,3))}return Kw=a,Kw}var Gw,a2;function Lne(){if(a2)return Gw;a2=1;var e=O5(),t=Dne();function n(r,a){return e(t(r,a),1)}return Gw=n,Gw}var Fne=Lne();const Bne=Yt(Fne);var Yw,s2;function zne(){if(s2)return Yw;s2=1;var e=DN();function t(n,r){return e(n,r)}return Yw=t,Yw}var Une=zne();const Tf=Yt(Une);var ou=1e9,qne={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},uC,gn=!0,Aa="[DecimalError] ",Ro=Aa+"Invalid argument: ",cC=Aa+"Exponent out of range: ",lu=Math.floor,No=Math.pow,Wne=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ta,er=1e7,pn=7,CL=9007199254740991,im=lu(CL/pn),Ze={};Ze.absoluteValue=Ze.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Ze.comparedTo=Ze.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};Ze.decimalPlaces=Ze.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*pn;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Ze.dividedBy=Ze.div=function(e){return Xs(this,new this.constructor(e))};Ze.dividedToIntegerBy=Ze.idiv=function(e){var t=this,n=t.constructor;return tn(Xs(t,new n(e),0,1),n.precision)};Ze.equals=Ze.eq=function(e){return!this.cmp(e)};Ze.exponent=function(){return Mn(this)};Ze.greaterThan=Ze.gt=function(e){return this.cmp(e)>0};Ze.greaterThanOrEqualTo=Ze.gte=function(e){return this.cmp(e)>=0};Ze.isInteger=Ze.isint=function(){return this.e>this.d.length-2};Ze.isNegative=Ze.isneg=function(){return this.s<0};Ze.isPositive=Ze.ispos=function(){return this.s>0};Ze.isZero=function(){return this.s===0};Ze.lessThan=Ze.lt=function(e){return this.cmp(e)<0};Ze.lessThanOrEqualTo=Ze.lte=function(e){return this.cmp(e)<1};Ze.logarithm=Ze.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(ta))throw Error(Aa+"NaN");if(n.s<1)throw Error(Aa+(n.s?"NaN":"-Infinity"));return n.eq(ta)?new r(0):(gn=!1,t=Xs(Bd(n,i),Bd(e,i),i),gn=!0,tn(t,a))};Ze.minus=Ze.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?EL(t,e):AL(t,(e.s=-e.s,e))};Ze.modulo=Ze.mod=function(e){var t,n=this,r=n.constructor,a=r.precision;if(e=new r(e),!e.s)throw Error(Aa+"NaN");return n.s?(gn=!1,t=Xs(n,e,0,1).times(e),gn=!0,n.minus(t)):tn(new r(n),a)};Ze.naturalExponential=Ze.exp=function(){return _L(this)};Ze.naturalLogarithm=Ze.ln=function(){return Bd(this)};Ze.negated=Ze.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Ze.plus=Ze.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?AL(t,e):EL(t,(e.s=-e.s,e))};Ze.precision=Ze.sd=function(e){var t,n,r,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ro+e);if(t=Mn(a)+1,r=a.d.length-1,n=r*pn+1,r=a.d[r],r){for(;r%10==0;r/=10)n--;for(r=a.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Ze.squareRoot=Ze.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(Aa+"NaN")}for(e=Mn(c),gn=!1,a=Math.sqrt(+c),a==0||a==1/0?(t=ds(c.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=lu((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(Xs(c,i,o+2)).times(.5),ds(i.d).slice(0,o)===(t=ds(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),a==o&&t=="4999"){if(tn(i,n+1,0),i.times(i).eq(c)){r=i;break}}else if(t!="9999")break;o+=4}return gn=!0,tn(r,n)};Ze.times=Ze.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%er|0,t=c/er|0;i[a]=(i[a]+t)%er|0}for(;!i[--o];)i.pop();return t?++n:i.shift(),e.d=i,e.e=n,gn?tn(e,p.precision):e};Ze.toDecimalPlaces=Ze.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(ws(e,0,ou),t===void 0?t=r.rounding:ws(t,0,8),tn(n,e+Mn(n)+1,t))};Ze.toExponential=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=Bo(r,!0):(ws(e,0,ou),t===void 0?t=a.rounding:ws(t,0,8),r=tn(new a(r),e+1,t),n=Bo(r,!0,e+1)),n};Ze.toFixed=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?Bo(a):(ws(e,0,ou),t===void 0?t=i.rounding:ws(t,0,8),r=tn(new i(a),e+Mn(a)+1,t),n=Bo(r.abs(),!1,e+Mn(r)+1),a.isneg()&&!a.isZero()?"-"+n:n)};Ze.toInteger=Ze.toint=function(){var e=this,t=e.constructor;return tn(new t(e),Mn(e)+1,t.rounding)};Ze.toNumber=function(){return+this};Ze.toPower=Ze.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(ta);if(c=new d(c),!c.s){if(e.s<1)throw Error(Aa+"Infinity");return c}if(c.eq(ta))return c;if(r=d.precision,e.eq(ta))return tn(c,r);if(t=e.e,n=e.d.length-1,o=t>=n,i=c.s,o){if((n=h<0?-h:h)<=CL){for(a=new d(ta),t=Math.ceil(r/pn+4),gn=!1;n%2&&(a=a.times(c),o2(a.d,t)),n=lu(n/2),n!==0;)c=c.times(c),o2(c.d,t);return gn=!0,e.s<0?new d(ta).div(a):tn(a,r)}}else if(i<0)throw Error(Aa+"NaN");return i=i<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,gn=!1,a=e.times(Bd(c,r+f)),gn=!0,a=_L(a),a.s=i,a};Ze.toPrecision=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?(n=Mn(a),r=Bo(a,n<=i.toExpNeg||n>=i.toExpPos)):(ws(e,1,ou),t===void 0?t=i.rounding:ws(t,0,8),a=tn(new i(a),e,t),n=Mn(a),r=Bo(a,e<=n||n<=i.toExpNeg,e)),r};Ze.toSignificantDigits=Ze.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(ws(e,1,ou),t===void 0?t=r.rounding:ws(t,0,8)),tn(new r(n),e,t)};Ze.toString=Ze.valueOf=Ze.val=Ze.toJSON=Ze[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Mn(e),n=e.constructor;return Bo(e,t<=n.toExpNeg||t>=n.toExpPos)};function AL(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)),gn?tn(t,p):t;if(d=e.d,f=t.d,o=e.e,a=t.e,d=d.slice(),i=o-a,i){for(i<0?(r=d,i=-i,c=f.length):(r=f,a=o,c=d.length),o=Math.ceil(p/pn),c=o>c?o+1:c+1,i>c&&(i=c,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(c=d.length,i=f.length,c-i<0&&(i=c,r=f,f=d,d=r),n=0;i;)n=(d[--i]=d[i]+f[i]+n)/er|0,d[i]%=er;for(n&&(d.unshift(n),++a),c=d.length;d[--c]==0;)d.pop();return t.d=d,t.e=a,gn?tn(t,p):t}function ws(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Ro+e)}function ds(e){var t,n,r,a=e.length-1,i="",o=e[0];if(a>0){for(i+=o,t=1;t<a;t++)r=e[t]+"",n=pn-r.length,n&&(i+=Ii(n)),i+=r;o=e[t],r=o+"",n=pn-r.length,n&&(i+=Ii(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var Xs=(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%er|0,o=i/er|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*er+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,T,R=r.constructor,I=r.s==a.s?1:-1,D=r.d,$=a.d;if(!r.s)return new R(r);if(!a.s)throw Error(Aa+"Division by zero");for(d=r.e-a.e,O=$.length,_=D.length,g=new R(I),j=g.d=[],f=0;$[f]==(D[f]||0);)++f;if($[f]>(D[f]||0)&&--d,i==null?C=i=R.precision:o?C=i+(Mn(r)-Mn(a))+1:C=i,C<0)return new R(0);if(C=C/pn+2|0,f=0,O==1)for(h=0,$=$[0],C++;(f<_||h)&&C--;f++)N=h*er+(D[f]||0),j[f]=N/$|0,h=N%$|0;else{for(h=er/($[0]+1)|0,h>1&&($=e($,h),D=e(D,h),O=$.length,_=D.length),E=O,b=D.slice(0,O),y=b.length;y<O;)b[y++]=0;T=$.slice(),T.unshift(0),P=$[0],$[1]>=er/2&&++P;do h=0,c=t($,b,O,y),c<0?(S=b[0],O!=y&&(S=S*er+(b[1]||0)),h=S/P|0,h>1?(h>=er&&(h=er-1),p=e($,h),x=p.length,y=b.length,c=t(p,b,x,y),c==1&&(h--,n(p,O<x?T:$,x))):(h==0&&(c=h=1),p=$.slice()),x=p.length,x<y&&p.unshift(0),n(b,p,y),c==-1&&(y=b.length,c=t($,b,O,y),c<1&&(h++,n(b,O<y?T:$,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,tn(g,o?i+Mn(g)+1:i)}})();function _L(e,t){var n,r,a,i,o,c,d=0,f=0,h=e.constructor,p=h.precision;if(Mn(e)>16)throw Error(cC+Mn(e));if(!e.s)return new h(ta);for(gn=!1,c=p,o=new h(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(r=Math.log(No(2,f))/Math.LN10*2+5|0,c+=r,n=a=i=new h(ta),h.precision=c;;){if(a=tn(a.times(e),c),n=n.times(++d),o=i.plus(Xs(a,n,c)),ds(o.d).slice(0,c)===ds(i.d).slice(0,c)){for(;f--;)i=tn(i.times(i),c);return h.precision=p,t==null?(gn=!0,tn(i,p)):i}i=o}}function Mn(e){for(var t=e.e*pn,n=e.d[0];n>=10;n/=10)t++;return t}function Xw(e,t,n){if(t>e.LN10.sd())throw gn=!0,n&&(e.precision=n),Error(Aa+"LN10 precision limit exceeded");return tn(new e(e.LN10),t)}function Ii(e){for(var t="";e--;)t+="0";return t}function Bd(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(Aa+(g.s?"NaN":"-Infinity"));if(g.eq(ta))return new b(0);if(t==null?(gn=!1,f=y):f=t,g.eq(10))return t==null&&(gn=!0),Xw(b,f);if(f+=x,b.precision=f,n=ds(j),r=n.charAt(0),i=Mn(g),Math.abs(i)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=ds(g.d),r=n.charAt(0),p++;i=Mn(g),r>1?(g=new b("0."+n),i++):g=new b(r+"."+n.slice(1))}else return d=Xw(b,f+2,y).times(i+""),g=Bd(new b(r+"."+n.slice(1)),f-x).plus(d),b.precision=y,t==null?(gn=!0,tn(g,y)):g;for(c=o=g=Xs(g.minus(ta),g.plus(ta),f),h=tn(g.times(g),f),a=3;;){if(o=tn(o.times(h),f),d=c.plus(Xs(o,new b(a),f)),ds(d.d).slice(0,f)===ds(c.d).slice(0,f))return c=c.times(2),i!==0&&(c=c.plus(Xw(b,f+2,y).times(i+""))),c=Xs(c,new b(p),f),b.precision=y,t==null?(gn=!0,tn(c,y)):c;c=d,a+=2}}function i2(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=lu(n/pn),e.d=[],r=(n+1)%pn,n<0&&(r+=pn),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=pn;r<a;)e.d.push(+t.slice(r,r+=pn));t=t.slice(r),r=pn-t.length}else r-=a;for(;r--;)t+="0";if(e.d.push(+t),gn&&(e.e>im||e.e<-im))throw Error(cC+n)}else e.s=0,e.e=0,e.d=[0];return e}function tn(e,t,n){var r,a,i,o,c,d,f,h,p=e.d;for(o=1,i=p[0];i>=10;i/=10)o++;if(r=t-o,r<0)r+=pn,a=t,f=p[h=0];else{if(h=Math.ceil((r+1)/pn),i=p.length,h>=i)return e;for(f=i=p[h],o=1;i>=10;i/=10)o++;r%=pn,a=r-pn+o}if(n!==void 0&&(i=No(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/No(10,o-a):0:p[h-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return d?(i=Mn(e),p.length=1,t=t-i-1,p[0]=No(10,(pn-t%pn)%pn),e.e=lu(-t/pn)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(r==0?(p.length=h,i=1,h--):(p.length=h+1,i=No(10,pn-r),p[h]=a>0?(f/No(10,o-a)%No(10,a)|0)*i:0),d)for(;;)if(h==0){(p[0]+=i)==er&&(p[0]=1,++e.e);break}else{if(p[h]+=i,p[h]!=er)break;p[h--]=0,i=1}for(r=p.length;p[--r]===0;)p.pop();if(gn&&(e.e>im||e.e<-im))throw Error(cC+Mn(e));return e}function EL(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),gn?tn(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/pn),c)+2,o>a&&(o=a,n.length=1),n.reverse(),a=o;a--;)n.push(0);n.reverse()}else{for(a=d.length,c=p.length,h=a<c,h&&(c=a),a=0;a<c;a++)if(d[a]!=p[a]){h=d[a]<p[a];break}o=0}for(h&&(n=d,d=p,p=n,t.s=-t.s),c=d.length,a=p.length-c;a>0;--a)d[c++]=0;for(a=p.length;a>o;){if(d[--a]<p[a]){for(i=a;i&&d[--i]===0;)d[i]=er-1;--d[i],d[a]+=er}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,gn?tn(t,g):t):new x(0)}function Bo(e,t,n){var r,a=Mn(e),i=ds(e.d),o=i.length;return t?(n&&(r=n-o)>0?i=i.charAt(0)+"."+i.slice(1)+Ii(r):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+Ii(-a-1)+i,n&&(r=n-o)>0&&(i+=Ii(r))):a>=o?(i+=Ii(a+1-o),n&&(r=n-a-1)>0&&(i=i+"."+Ii(r))):((r=a+1)<o&&(i=i.slice(0,r)+"."+i.slice(r)),n&&(r=n-o)>0&&(a+1===o&&(i+="."),i+=Ii(r))),e.s<0?"-"+i:i}function o2(e,t){if(e.length>t)return e.length=t,!0}function PL(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(Ro+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 i2(o,i.toString())}else if(typeof i!="string")throw Error(Ro+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,Wne.test(i))i2(o,i);else throw Error(Ro+i)}if(a.prototype=Ze,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=PL,a.config=a.set=Vne,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 Vne(e){if(!e||typeof e!="object")throw Error(Aa+"Object expected");var t,n,r,a=["precision",1,ou,"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(lu(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(Ro+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Ro+n+": "+r);return this}var uC=PL(qne);ta=new uC(1);const Jt=uC;function Hne(e){return Xne(e)||Yne(e)||Gne(e)||Kne()}function Kne(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
68
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gne(e,t){if(e){if(typeof e=="string")return R1(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 R1(e,t)}}function Yne(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Xne(e){if(Array.isArray(e))return R1(e)}function R1(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 Qne=function(t){return t},kL={},OL=function(t){return t===kL},l2=function(t){return function n(){return arguments.length===0||arguments.length===1&&OL(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},Jne=function e(t,n){return t===1?n:l2(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!==kL}).length;return o>=t?n.apply(void 0,a):e(t-o,l2(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 OL(p)?d.shift():p});return n.apply(void 0,Hne(h).concat(d))}))})},Uv=function(t){return Jne(t.length,t)},I1=function(t,n){for(var r=[],a=t;a<n;++a)r[a-t]=a;return r},Zne=Uv(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),ere=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return Qne;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))}},M1=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},TL=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 tre(e){var t;return e===0?t=1:t=Math.floor(new Jt(e).abs().log(10).toNumber())+1,t}function nre(e,t,n){for(var r=new Jt(e),a=0,i=[];r.lt(t)&&a<1e5;)i.push(r.toNumber()),r=r.add(n),a++;return i}var rre=Uv(function(e,t,n){var r=+e,a=+t;return r+n*(a-r)}),are=Uv(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),sre=Uv(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const qv={rangeStep:nre,getDigitCount:tre,interpolateNumber:rre,uninterpolateNumber:are,uninterpolateTruncation:sre};function $1(e){return lre(e)||ore(e)||RL(e)||ire()}function ire(){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 ore(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function lre(e){if(Array.isArray(e))return D1(e)}function zd(e,t){return dre(e)||ure(e,t)||RL(e,t)||cre()}function cre(){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 RL(e,t){if(e){if(typeof e=="string")return D1(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 D1(e,t)}}function D1(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 ure(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 dre(e){if(Array.isArray(e))return e}function IL(e){var t=zd(e,2),n=t[0],r=t[1],a=n,i=r;return n>r&&(a=r,i=n),[a,i]}function ML(e,t,n){if(e.lte(0))return new Jt(0);var r=qv.getDigitCount(e.toNumber()),a=new Jt(10).pow(r),i=e.div(a),o=r!==1?.05:.1,c=new Jt(Math.ceil(i.div(o).toNumber())).add(n).mul(o),d=c.mul(a);return t?d:new Jt(Math.ceil(d))}function fre(e,t,n){var r=1,a=new Jt(e);if(!a.isint()&&n){var i=Math.abs(e);i<1?(r=new Jt(10).pow(qv.getDigitCount(e)-1),a=new Jt(Math.floor(a.div(r).toNumber())).mul(r)):i>1&&(a=new Jt(Math.floor(e)))}else e===0?a=new Jt(Math.floor((t-1)/2)):n||(a=new Jt(Math.floor(e)));var o=Math.floor((t-1)/2),c=ere(Zne(function(d){return a.add(new Jt(d-o).mul(r)).toNumber()}),I1);return c(0,t)}function $L(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 Jt(0),tickMin:new Jt(0),tickMax:new Jt(0)};var i=ML(new Jt(t).sub(e).div(n-1),r,a),o;e<=0&&t>=0?o=new Jt(0):(o=new Jt(e).add(t).div(2),o=o.sub(new Jt(o).mod(i)));var c=Math.ceil(o.sub(e).div(i).toNumber()),d=Math.ceil(new Jt(t).sub(o).div(i).toNumber()),f=c+d+1;return f>n?$L(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 Jt(c).mul(i)),tickMax:o.add(new Jt(d).mul(i))})}function pre(e){var t=zd(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=IL([n,r]),d=zd(c,2),f=d[0],h=d[1];if(f===-1/0||h===1/0){var p=h===1/0?[f].concat($1(I1(0,a-1).map(function(){return 1/0}))):[].concat($1(I1(0,a-1).map(function(){return-1/0})),[h]);return n>r?M1(p):p}if(f===h)return fre(f,a,i);var x=$L(f,h,o,i),g=x.step,j=x.tickMin,b=x.tickMax,y=qv.rangeStep(j,b.add(new Jt(.1).mul(g)),g);return n>r?M1(y):y}function hre(e,t){var n=zd(e,2),r=n[0],a=n[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=IL([r,a]),c=zd(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=ML(new Jt(f).sub(d).div(h-1),i,0),x=[].concat($1(qv.rangeStep(new Jt(d),new Jt(f).sub(new Jt(.99).mul(p)),p)),[f]);return r>a?M1(x):x}var mre=TL(pre),vre=TL(hre),gre="Invariant failed";function zo(e,t){throw new Error(gre)}var xre=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Ac(e){"@babel/helpers - typeof";return Ac=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ac(e)}function om(){return om=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},om.apply(this,arguments)}function yre(e,t){return Sre(e)||jre(e,t)||wre(e,t)||bre()}function bre(){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 wre(e,t){if(e){if(typeof e=="string")return c2(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 c2(e,t)}}function c2(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 jre(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 Sre(e){if(Array.isArray(e))return e}function Nre(e,t){if(e==null)return{};var n=Cre(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Cre(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Are(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _re(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,FL(r.key),r)}}function Ere(e,t,n){return t&&_re(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pre(e,t,n){return t=lm(t),kre(e,DL()?Reflect.construct(t,n||[],lm(e).constructor):t.apply(e,n))}function kre(e,t){if(t&&(Ac(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ore(e)}function Ore(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function DL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(DL=function(){return!!e})()}function lm(e){return lm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},lm(e)}function Tre(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&&L1(e,t)}function L1(e,t){return L1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},L1(e,t)}function LL(e,t,n){return t=FL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FL(e){var t=Rre(e,"string");return Ac(t)=="symbol"?t:t+""}function Rre(e,t){if(Ac(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ac(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Rf=(function(e){function t(){return Are(this,t),Pre(this,t,arguments)}return Tre(t,e),Ere(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=Nre(r,xre),g=gt(x,!1);this.props.direction==="x"&&h.type!=="number"&&zo();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 T=yre(E,2);P=T[0],O=T[1]}else P=O=E;if(i==="vertical"){var R=h.scale,I=C+a,D=I+o,$=I-o,H=R(N-P),F=R(N+O);_.push({x1:F,y1:D,x2:F,y2:$}),_.push({x1:H,y1:I,x2:F,y2:I}),_.push({x1:H,y1:D,x2:H,y2:$})}else if(i==="horizontal"){var q=p.scale,Q=S+a,J=Q-o,B=Q+o,U=q(N-P),Z=q(N+O);_.push({x1:J,y1:Z,x2:B,y2:Z}),_.push({x1:Q,y1:U,x2:Q,y2:Z}),_.push({x1:J,y1:U,x2:B,y2:U})}return W.createElement(qt,om({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 W.createElement("line",om({},z,{key:"line-".concat(z.x1,"-").concat(z.x2,"-").concat(z.y1,"-").concat(z.y2)}))}))});return W.createElement(qt,{className:"recharts-errorBars"},j)}}])})(W.Component);LL(Rf,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});LL(Rf,"displayName","ErrorBar");function Ud(e){"@babel/helpers - typeof";return Ud=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},Ud(e)}function u2(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 go(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?u2(Object(n),!0).forEach(function(r){Ire(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ire(e,t,n){return t=Mre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mre(e){var t=$re(e,"string");return Ud(t)=="symbol"?t:t+""}function $re(e,t){if(Ud(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ud(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var BL=function(t){var n=t.children,r=t.formattedGraphicalItems,a=t.legendWidth,i=t.legendContent,o=Jr(n,Oo);if(!o)return null;var c=Oo.defaultProps,d=c!==void 0?go(go({},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?go(go({},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:dC(p),value:b||j,payload:g}}),go(go(go({},d),Oo.getWithHeight(o,a)),{},{payload:f,item:o})};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 d2(e){return Bre(e)||Fre(e)||Lre(e)||Dre()}function Dre(){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 Lre(e,t){if(e){if(typeof e=="string")return F1(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 F1(e,t)}}function Fre(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Bre(e){if(Array.isArray(e))return F1(e)}function F1(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 f2(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 An(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?f2(Object(n),!0).forEach(function(r){cc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cc(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)}function Un(e,t,n){return At(e)||At(t)?n:qn(t)?sa(e,t,n):Ct(t)?t(e):n}function md(e,t,n,r){var a=Bne(e,function(c){return Un(c,t)});if(n==="number"){var i=a.filter(function(c){return We(c)||parseFloat(c)});return i.length?[zv(i),Bv(i)]:[1/0,-1/0]}var o=r?a.filter(function(c){return!At(c)}):a;return o.map(function(c){return qn(c)||c instanceof Date?c:""})}var qre=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(wr(p-h)!==wr(x-p)){var j=[];if(wr(x-p)===wr(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},dC=function(t){var n,r=t,a=r.type.displayName,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?An(An({},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},Wre=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 Gs(O.type).indexOf("Bar")>=0});if(S&&S.length){var C=S[0].type.defaultProps,N=C!==void 0?An(An({},C),S[0].props):S[0].props,E=N.barSize,_=N[y];o[_]||(o[_]=[]);var P=At(E)?n:E;o[_].push({item:S[0],stackList:S.slice(1),barSize:At(P)?void 0:jr(P,r,0)})}}return o},Vre=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=jr(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(d2(E),[P]);return y=O[O.length-1].position,_.stackList&&_.stackList.length&&_.stackList.forEach(function(T){O.push({item:T,position:y})}),O},p)}else{var S=jr(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(d2(E),[{item:_.item,position:{offset:S+(C+f)*P+(C-N)/2,size:N}}]);return _.stackList&&_.stackList.length&&_.stackList.forEach(function(T){O.push({item:T,position:O[O.length-1].position})}),O},p)}return h},Hre=function(t,n,r,a){var i=r.children,o=r.width,c=r.margin,d=o-(c.left||0)-(c.right||0),f=BL({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"&&We(t[g]))return An(An({},t),{},cc({},g,t[g]+(p||0)));if((b==="horizontal"||b==="vertical"&&g==="center")&&j!=="middle"&&We(t[j]))return An(An({},t),{},cc({},j,t[j]+(x||0)))}return t},Kre=function(t,n,r){return At(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},zL=function(t,n,r,a,i){var o=n.props.children,c=ia(o,Rf).filter(function(f){return Kre(a,i,f.props.direction)});if(c&&c.length){var d=c.map(function(f){return f.props.dataKey});return t.reduce(function(f,h){var p=Un(h,r);if(At(p))return f;var x=Array.isArray(p)?[zv(p),Bv(p)]:[p,p],g=d.reduce(function(j,b){var y=Un(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},Gre=function(t,n,r,a,i){var o=n.map(function(c){return zL(t,c,r,i,a)}).filter(function(c){return!At(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},UL=function(t,n,r,a,i){var o=n.map(function(d){var f=d.props.dataKey;return r==="number"&&f&&zL(t,d,f,a)||md(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},[])},qL=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},Po=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?wr(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!Af(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}})},Qw=new WeakMap,ch=function(t,n){if(typeof n!="function")return t;Qw.has(t)||Qw.set(t,new WeakMap);var r=Qw.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},WL=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:Md(),realScaleType:"band"}:o==="radial"&&c==="angleAxis"?{scale:nm(),realScaleType:"linear"}:i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:hd(),realScaleType:"point"}:i==="category"?{scale:Md(),realScaleType:"band"}:{scale:nm(),realScaleType:"linear"};if(Do(a)){var d="scale".concat(Cv(a));return{scale:(QR[d]||hd)(),realScaleType:QR[d]?d:"point"}}return Ct(a)?{scale:a}:{scale:hd(),realScaleType:"point"}},p2=1e-4,VL=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])-p2,o=Math.max(a[0],a[1])+p2,c=t(n[0]),d=t(n[r-1]);(c<i||c>o||d<i||d>o)&&t.domain([n[0],n[r-1]])}},Yre=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},Xre=function(t,n){if(!n||n.length!==2||!We(n[0])||!We(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(!We(t[0])||t[0]<r)&&(i[0]=r),(!We(t[1])||t[1]>a)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]<r&&(i[1]=r),i},Qre=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=Af(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])}},Jre=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=Af(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)}},Zre={sign:Qre,expand:BX,none:xc,silhouette:zX,wiggle:UX,positive:Jre},eae=function(t,n,r){var a=n.map(function(c){return c.props.dataKey}),i=Zre[r],o=FX().keys(a).value(function(c,d){return+Un(c,d,0)}).order(m1).offset(i);return o(t)},tae=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?An(An({},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(qn(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[au("_stackId_")]={numericAxisId:r,cateAxisId:a,items:[x]};return An(An({},p),{},cc({},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 An(An({},b),{},cc({},y,{numericAxisId:r,cateAxisId:a,items:S.items,stackedData:eae(t,S.items,i)}))},j)}return An(An({},p),{},cc({},x,g))},h)},HL=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=mre(f,i,c);return t.domain([zv(h),Bv(h)]),{niceTicks:h}}if(i&&a==="number"){var p=t.domain(),x=vre(p,i,c);return{niceTicks:x}}return null};function h2(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&&!At(a[t.dataKey])){var c=$h(n,"value",a[t.dataKey]);if(c)return c.coordinate+r/2}return n[i]?n[i].coordinate+r/2:null}var d=Un(a,At(o)?t.dataKey:o);return At(d)?null:t.scale(d)}var m2=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=Un(o,n.dataKey,n.domain[c]);return At(d)?null:n.scale(d)-i/2+a},nae=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]},rae=function(t,n){var r,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?An(An({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(qn(i)){var o=n[i];if(o){var c=o.items.indexOf(t);return c>=0?o.stackedData[c]:null}}return null},aae=function(t){return t.reduce(function(n,r){return[zv(r.concat([n[0]]).filter(We)),Bv(r.concat([n[1]]).filter(We))]},[1/0,-1/0])},KL=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=aae(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})},v2=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,g2=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,B1=function(t,n,r){if(Ct(t))return t(n,r);if(!Array.isArray(t))return n;var a=[];if(We(t[0]))a[0]=r?t[0]:Math.min(t[0],n[0]);else if(v2.test(t[0])){var i=+v2.exec(t[0])[1];a[0]=n[0]-i}else Ct(t[0])?a[0]=t[0](n[0]):a[0]=n[0];if(We(t[1]))a[1]=r?t[1]:Math.max(t[1],n[1]);else if(g2.test(t[1])){var o=+g2.exec(t[1])[1];a[1]=n[1]+o}else Ct(t[1])?a[1]=t[1](n[1]):a[1]=n[1];return a},cm=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=FN(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},x2=function(t,n,r){return!t||!t.length||Tf(t,sa(r,"type.defaultProps.domain"))?n:t},GL=function(t,n){var r=t.type.defaultProps?An(An({},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 An(An({},gt(t,!1)),{},{dataKey:a,unit:o,formatter:c,name:i||a,color:dC(t),value:Un(n,a),type:d,payload:n,chartType:f,hide:h})};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 y2(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 zs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?y2(Object(n),!0).forEach(function(r){YL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function YL(e,t,n){return t=sae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sae(e){var t=iae(e,"string");return Wd(t)=="symbol"?t:t+""}function iae(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 oae(e,t){return dae(e)||uae(e,t)||cae(e,t)||lae()}function lae(){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 cae(e,t){if(e){if(typeof e=="string")return b2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b2(e,t)}}function b2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function uae(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 dae(e){if(Array.isArray(e))return e}var um=Math.PI/180,fae=function(t){return t*180/Math.PI},on=function(t,n,r,a){return{x:t+Math.cos(-um*a)*r,y:n+Math.sin(-um*a)*r}},XL=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},pae=function(t,n,r,a,i){var o=t.width,c=t.height,d=t.startAngle,f=t.endAngle,h=jr(t.cx,o,o/2),p=jr(t.cy,c,c/2),x=XL(o,c,r),g=jr(t.innerRadius,x,0),j=jr(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(At(C.range))a==="angleAxis"?_=[d,f]:a==="radiusAxis"&&(_=[g,j]),E&&(_=[_[1],_[0]]);else{_=C.range;var P=_,O=oae(P,2);d=O[0],f=O[1]}var T=WL(C,i),R=T.realScaleType,I=T.scale;I.domain(N).range(_),VL(I);var D=HL(I,zs(zs({},C),{},{realScaleType:R})),$=zs(zs(zs({},C),D),{},{range:_,radius:j,realScaleType:R,scale:I,cx:h,cy:p,innerRadius:g,outerRadius:j,startAngle:d,endAngle:f});return zs(zs({},y),{},YL({},S,$))},{})},hae=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))},mae=function(t,n){var r=t.x,a=t.y,i=n.cx,o=n.cy,c=hae({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:fae(f),angleInRadian:f}},vae=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}},gae=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},w2=function(t,n){var r=t.x,a=t.y,i=mae({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=vae(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?zs(zs({},n),{},{radius:o,angle:gae(g,n)}):null},QL=function(t){return!v.isValidElement(t)&&!Ct(t)&&typeof t!="boolean"?t.className:""};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)}var xae=["offset"];function yae(e){return Sae(e)||jae(e)||wae(e)||bae()}function bae(){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 wae(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 jae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Sae(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 Nae(e,t){if(e==null)return{};var n=Cae(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Cae(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function j2(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 zn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?j2(Object(n),!0).forEach(function(r){Aae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Aae(e,t,n){return t=_ae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _ae(e){var t=Eae(e,"string");return Vd(t)=="symbol"?t:t+""}function Eae(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 Hd(){return Hd=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},Hd.apply(this,arguments)}var Pae=function(t){var n=t.value,r=t.formatter,a=At(t.children)?n:t.children;return Ct(r)?r(a):a},kae=function(t,n){var r=wr(n-t),a=Math.min(Math.abs(n-t),360);return r*a},Oae=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=kae(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 _=on(f,h,y,N),P=on(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),T=At(t.id)?au("recharts-radial-line-"):t.id;return W.createElement("text",Hd({},r,{dominantBaseline:"central",className:_t("recharts-radial-bar-label",c)}),W.createElement("defs",null,W.createElement("path",{id:T,d:O})),W.createElement("textPath",{xlinkHref:"#".concat(T)},n))},Tae=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=on(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=on(o,c,y,x),C=S.x,N=S.y;return{x:C,y:N,textAnchor:"middle",verticalAnchor:"middle"}},Rae=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 zn(zn({},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 zn(zn({},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 zn(zn({},_),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 zn(zn({},P),r?{width:Math.max(r.x+r.width-P.x,0),height:h}:{})}var O=r?{width:f,height:h}:{};return i==="insideLeft"?zn({x:c+y,y:d+h/2,textAnchor:C,verticalAnchor:"middle"},O):i==="insideRight"?zn({x:c+f-y,y:d+h/2,textAnchor:S,verticalAnchor:"middle"},O):i==="insideTop"?zn({x:c+f/2,y:d+x,textAnchor:"middle",verticalAnchor:j},O):i==="insideBottom"?zn({x:c+f/2,y:d+h-x,textAnchor:"middle",verticalAnchor:g},O):i==="insideTopLeft"?zn({x:c+y,y:d+x,textAnchor:C,verticalAnchor:j},O):i==="insideTopRight"?zn({x:c+f-y,y:d+x,textAnchor:S,verticalAnchor:j},O):i==="insideBottomLeft"?zn({x:c+y,y:d+h-x,textAnchor:C,verticalAnchor:g},O):i==="insideBottomRight"?zn({x:c+f-y,y:d+h-x,textAnchor:S,verticalAnchor:g},O):ru(i)&&(We(i.x)||Ao(i.x))&&(We(i.y)||Ao(i.y))?zn({x:c+jr(i.x,f),y:d+jr(i.y,h),textAnchor:"end",verticalAnchor:"end"},O):zn({x:c+f/2,y:d+h/2,textAnchor:"middle",verticalAnchor:"middle"},O)},Iae=function(t){return"cx"in t&&We(t.cx)};function tr(e){var t=e.offset,n=t===void 0?5:t,r=Nae(e,xae),a=zn({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||At(c)&&At(d)&&!v.isValidElement(f)&&!Ct(f))return null;if(v.isValidElement(f))return v.cloneElement(f,a);var g;if(Ct(f)){if(g=v.createElement(f,a),v.isValidElement(g))return g}else g=Pae(a);var j=Iae(i),b=gt(a,!0);if(j&&(o==="insideStart"||o==="insideEnd"||o==="end"))return Oae(a,g,b);var y=j?Tae(a):Rae(a);return W.createElement(Fo,Hd({className:_t("recharts-label",p)},b,y,{breakAll:x}),g)}tr.displayName="Label";var JL=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(We(b)&&We(y)){if(We(p)&&We(x))return{x:p,y:x,width:b,height:y};if(We(g)&&We(j))return{x:g,y:j,width:b,height:y}}return We(p)&&We(x)?{x:p,y:x,width:0,height:0}:We(n)&&We(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:{}},Mae=function(t,n){return t?t===!0?W.createElement(tr,{key:"label-implicit",viewBox:n}):qn(t)?W.createElement(tr,{key:"label-implicit",viewBox:n,value:t}):v.isValidElement(t)?t.type===tr?v.cloneElement(t,{key:"label-implicit",viewBox:n}):W.createElement(tr,{key:"label-implicit",content:t,viewBox:n}):Ct(t)?W.createElement(tr,{key:"label-implicit",content:t,viewBox:n}):ru(t)?W.createElement(tr,Hd({viewBox:n},t,{key:"label-implicit"})):null:null},$ae=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=JL(t),o=ia(a,tr).map(function(d,f){return v.cloneElement(d,{viewBox:n||i,key:"label-".concat(f)})});if(!r)return o;var c=Mae(t.label,n||i);return[c].concat(yae(o))};tr.parseViewBox=JL;tr.renderCallByParent=$ae;var Jw,S2;function Dae(){if(S2)return Jw;S2=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return Jw=e,Jw}var Lae=Dae();const Fae=Yt(Lae);function Kd(e){"@babel/helpers - typeof";return Kd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kd(e)}var Bae=["valueAccessor"],zae=["data","dataKey","clockWise","id","textBreakAll"];function Uae(e){return Hae(e)||Vae(e)||Wae(e)||qae()}function qae(){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 Wae(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 Vae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Hae(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 dm(){return dm=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},dm.apply(this,arguments)}function N2(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 C2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?N2(Object(n),!0).forEach(function(r){Kae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kae(e,t,n){return t=Gae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gae(e){var t=Yae(e,"string");return Kd(t)=="symbol"?t:t+""}function Yae(e,t){if(Kd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Kd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function A2(e,t){if(e==null)return{};var n=Xae(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 Xae(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 Qae=function(t){return Array.isArray(t.value)?Fae(t.value):t.value};function Qs(e){var t=e.valueAccessor,n=t===void 0?Qae:t,r=A2(e,Bae),a=r.data,i=r.dataKey,o=r.clockWise,c=r.id,d=r.textBreakAll,f=A2(r,zae);return!a||!a.length?null:W.createElement(qt,{className:"recharts-label-list"},a.map(function(h,p){var x=At(i)?n(h,p):Un(h&&h.payload,i),g=At(c)?{}:{id:"".concat(c,"-").concat(p)};return W.createElement(tr,dm({},gt(h,!0),f,g,{parentViewBox:h.parentViewBox,value:x,textBreakAll:d,viewBox:tr.parseViewBox(At(o)?h:C2(C2({},h),{},{clockWise:o})),key:"label-".concat(p),index:p}))}))}Qs.displayName="LabelList";function Jae(e,t){return e?e===!0?W.createElement(Qs,{key:"labelList-implicit",data:t}):W.isValidElement(e)||Ct(e)?W.createElement(Qs,{key:"labelList-implicit",data:t,content:e}):ru(e)?W.createElement(Qs,dm({data:t},e,{key:"labelList-implicit"})):null:null}function Zae(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=ia(r,Qs).map(function(o,c){return v.cloneElement(o,{data:t,key:"labelList-".concat(c)})});if(!n)return a;var i=Jae(e.label,t);return[i].concat(Uae(a))}Qs.renderCallByParent=Zae;function Gd(e){"@babel/helpers - typeof";return Gd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gd(e)}function q1(){return q1=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},q1.apply(this,arguments)}function _2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function E2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_2(Object(n),!0).forEach(function(r){ese(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ese(e,t,n){return t=tse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tse(e){var t=nse(e,"string");return Gd(t)=="symbol"?t:t+""}function nse(e,t){if(Gd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Gd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var rse=function(t,n){var r=wr(n-t),a=Math.min(Math.abs(n-t),359.999);return r*a},uh=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)/um,x=f?i:i+o*p,g=on(n,r,h,x),j=on(n,r,a,x),b=f?i-o*p:i,y=on(n,r,h*Math.cos(p*um),b);return{center:g,circleTangency:j,lineTangency:y,theta:p}},ZL=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.startAngle,c=t.endAngle,d=rse(o,c),f=o+d,h=on(n,r,i,o),p=on(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=on(n,r,a,o),j=on(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},ase=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=wr(h-f),x=uh({cx:n,cy:r,radius:i,angle:f,sign:p,cornerRadius:o,cornerIsExternal:d}),g=x.circleTangency,j=x.lineTangency,b=x.theta,y=uh({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
- `):ZL({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=uh({cx:n,cy:r,radius:a,angle:f,sign:p,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),O=P.circleTangency,T=P.lineTangency,R=P.theta,I=uh({cx:n,cy:r,radius:a,angle:h,sign:-p,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),D=I.circleTangency,$=I.lineTangency,H=I.theta,F=d?Math.abs(f-h):Math.abs(f-h)-R-H;if(F<0&&o===0)return"".concat(_,"L").concat(n,",").concat(r,"Z");_+="L".concat($.x,",").concat($.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(+(F>180),",").concat(+(p>0),",").concat(O.x,",").concat(O.y,`
94
- A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(T.x,",").concat(T.y,"Z")}else _+="L".concat(n,",").concat(r,"Z");return _},sse={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},e4=function(t){var n=E2(E2({},sse),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=_t("recharts-sector",x),j=o-i,b=jr(c,j,0,!0),y;return b>0&&Math.abs(h-p)<360?y=ase({cx:r,cy:a,innerRadius:i,outerRadius:o,cornerRadius:Math.min(b,j/2),forceCornerRadius:d,cornerIsExternal:f,startAngle:h,endAngle:p}):y=ZL({cx:r,cy:a,innerRadius:i,outerRadius:o,startAngle:h,endAngle:p}),W.createElement("path",q1({},gt(n,!0),{className:g,d:y,role:"img"}))};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 W1(){return W1=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},W1.apply(this,arguments)}function P2(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 k2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?P2(Object(n),!0).forEach(function(r){ise(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P2(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 O2={curveBasisClosed:EX,curveBasisOpen:PX,curveBasis:_X,curveBumpX:pX,curveBumpY:hX,curveLinearClosed:kX,curveLinear:_v,curveMonotoneX:OX,curveMonotoneY:TX,curveNatural:RX,curveStep:IX,curveStepAfter:$X,curveStepBefore:MX},dh=function(t){return t.x===+t.x&&t.y===+t.y},ed=function(t){return t.x},td=function(t){return t.y},cse=function(t,n){if(Ct(t))return t;var r="curve".concat(Cv(t));return(r==="curveMonotone"||r==="curveBump")&&n?O2["".concat(r).concat(n==="vertical"?"Y":"X")]:O2[r]||_v},use=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=cse(r,c),p=f?i.filter(function(b){return dh(b)}):i,x;if(Array.isArray(o)){var g=f?o.filter(function(b){return dh(b)}):o,j=p.map(function(b,y){return k2(k2({},b),{},{base:g[y]})});return c==="vertical"?x=nh().y(td).x1(ed).x0(function(b){return b.base.x}):x=nh().x(ed).y1(td).y0(function(b){return b.base.y}),x.defined(dh).curve(h),x(j)}return c==="vertical"&&We(o)?x=nh().y(td).x1(ed).x0(o):We(o)?x=nh().x(ed).y1(td).y0(o):x=e5().x(ed).y(td),x.defined(dh).curve(h),x(p)},fm=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?use(t):a;return v.createElement("path",W1({},gt(t,!1),Dh(t),{className:_t("recharts-curve",n),d:o,ref:i}))},Zw={exports:{}},ej,T2;function dse(){if(T2)return ej;T2=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ej=e,ej}var tj,R2;function fse(){if(R2)return tj;R2=1;var e=dse();function t(){}function n(){}return n.resetWarningCache=t,tj=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},tj}var I2;function pse(){return I2||(I2=1,Zw.exports=fse()()),Zw.exports}var hse=pse();const Gt=Yt(hse),{getOwnPropertyNames:mse,getOwnPropertySymbols:vse}=Object,{hasOwnProperty:gse}=Object.prototype;function nj(e,t){return function(r,a,i){return e(r,a,i)&&t(r,a,i)}}function fh(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 xse(e){return e?.[Symbol.toStringTag]}function M2(e){return mse(e).concat(vse(e))}const yse=Object.hasOwn||((e,t)=>gse.call(e,t));function sl(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const bse="__v",wse="__o",jse="_owner",{getOwnPropertyDescriptor:$2,keys:D2}=Object;function Sse(e,t){return e.byteLength===t.byteLength&&pm(new Uint8Array(e),new Uint8Array(t))}function Nse(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function Cse(e,t){return e.byteLength===t.byteLength&&pm(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Ase(e,t){return sl(e.getTime(),t.getTime())}function _se(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Ese(e,t){return e===t}function L2(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 Pse=sl;function kse(e,t,n){const r=D2(e);let a=r.length;if(D2(t).length!==a)return!1;for(;a-- >0;)if(!t4(e,t,n,r[a]))return!1;return!0}function nd(e,t,n){const r=M2(e);let a=r.length;if(M2(t).length!==a)return!1;let i,o,c;for(;a-- >0;)if(i=r[a],!t4(e,t,n,i)||(o=$2(e,i),c=$2(t,i),(o||c)&&(!o||!c||o.configurable!==c.configurable||o.enumerable!==c.enumerable||o.writable!==c.writable)))return!1;return!0}function Ose(e,t){return sl(e.valueOf(),t.valueOf())}function Tse(e,t){return e.source===t.source&&e.flags===t.flags}function F2(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 pm(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 Rse(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 t4(e,t,n,r){return(r===jse||r===wse||r===bse)&&(e.$$typeof||t.$$typeof)?!0:yse(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const Ise="[object ArrayBuffer]",Mse="[object Arguments]",$se="[object Boolean]",Dse="[object DataView]",Lse="[object Date]",Fse="[object Error]",Bse="[object Map]",zse="[object Number]",Use="[object Object]",qse="[object RegExp]",Wse="[object Set]",Vse="[object String]",Hse={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},Kse="[object URL]",Gse=Object.prototype.toString;function Yse({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 _=Gse.call(y);if(_===Lse)return r(y,S,C);if(_===qse)return h(y,S,C);if(_===Bse)return o(y,S,C);if(_===Wse)return p(y,S,C);if(_===Use)return typeof y.then!="function"&&typeof S.then!="function"&&d(y,S,C);if(_===Kse)return g(y,S,C);if(_===Fse)return a(y,S,C);if(_===Mse)return d(y,S,C);if(Hse[_])return x(y,S,C);if(_===Ise)return e(y,S,C);if(_===Dse)return n(y,S,C);if(_===$se||_===zse||_===Vse)return f(y,S,C);if(j){let P=j[_];if(!P){const O=xse(y);O&&(P=j[O])}if(P)return P(y,S,C)}return!1}}function Xse({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:Sse,areArraysEqual:n?nd:Nse,areDataViewsEqual:Cse,areDatesEqual:Ase,areErrorsEqual:_se,areFunctionsEqual:Ese,areMapsEqual:n?nj(L2,nd):L2,areNumbersEqual:Pse,areObjectsEqual:n?nd:kse,arePrimitiveWrappersEqual:Ose,areRegExpsEqual:Tse,areSetsEqual:n?nj(F2,nd):F2,areTypedArraysEqual:n?nj(pm,nd):pm,areUrlsEqual:Rse,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const a=fh(r.areArraysEqual),i=fh(r.areMapsEqual),o=fh(r.areObjectsEqual),c=fh(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:c})}return r}function Qse(e){return function(t,n,r,a,i,o,c){return e(t,n,c)}}function Jse({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 Zse=eo();eo({strict:!0});eo({circular:!0});eo({circular:!0,strict:!0});eo({createInternalComparator:()=>sl});eo({strict:!0,createInternalComparator:()=>sl});eo({circular:!0,createInternalComparator:()=>sl});eo({circular:!0,createInternalComparator:()=>sl,strict:!0});function eo(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:a=!1}=e,i=Xse(e),o=Yse(i),c=n?n(o):Qse(o);return Jse({circular:t,comparator:o,createState:r,equals:c,strict:a})}function eie(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function B2(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):eie(a)};requestAnimationFrame(r)}function V1(e){"@babel/helpers - typeof";return V1=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},V1(e)}function tie(e){return sie(e)||aie(e)||rie(e)||nie()}function nie(){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 rie(e,t){if(e){if(typeof e=="string")return z2(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 z2(e,t)}}function z2(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 aie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function sie(e){if(Array.isArray(e))return e}function iie(){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=tie(o),d=c[0],f=c.slice(1);if(typeof d=="number"){B2(a.bind(null,f),d);return}a(d),B2(a.bind(null,f));return}V1(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 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 U2(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 q2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?U2(Object(n),!0).forEach(function(r){n4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function n4(e,t,n){return t=oie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oie(e){var t=lie(e,"string");return Xd(t)==="symbol"?t:String(t)}function lie(e,t){if(Xd(e)!=="object"||e===null)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 cie=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,a){return r.filter(function(i){return a.includes(i)})})},uie=function(t){return t},die=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},vd=function(t,n){return Object.keys(n).reduce(function(r,a){return q2(q2({},r),{},n4({},a,t(a,n[a])))},{})},W2=function(t,n,r){return t.map(function(a){return"".concat(die(a)," ").concat(n,"ms ").concat(r)}).join(",")};function fie(e,t){return mie(e)||hie(e,t)||r4(e,t)||pie()}function pie(){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 hie(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function mie(e){if(Array.isArray(e))return e}function vie(e){return yie(e)||xie(e)||r4(e)||gie()}function gie(){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 r4(e,t){if(e){if(typeof e=="string")return H1(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 H1(e,t)}}function xie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function yie(e){if(Array.isArray(e))return H1(e)}function H1(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 hm=1e-4,a4=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},s4=function(t,n){return t.map(function(r,a){return r*Math.pow(n,a)}).reduce(function(r,a){return r+a})},V2=function(t,n){return function(r){var a=a4(t,n);return s4(a,r)}},bie=function(t,n){return function(r){var a=a4(t,n),i=[].concat(vie(a.map(function(o,c){return o*c}).slice(1)),[0]);return s4(i,r)}},H2=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=fie(f,4);a=h[0],i=h[1],o=h[2],c=h[3]}}}var p=V2(a,o),x=V2(i,c),g=bie(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)<hm||P<hm)return x(N);N=j(N-_/P)}return x(N)};return b.isStepper=!1,b},wie=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)<hm&&Math.abs(b)<hm?[p,0]:[y,b]};return d.isStepper=!0,d.dt=c,d},jie=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 H2(a);case"spring":return wie();default:if(a.split("(")[0]==="cubic-bezier")return H2(a)}return typeof a=="function"?a: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 K2(e){return Cie(e)||Nie(e)||i4(e)||Sie()}function Sie(){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 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 G1(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 ir(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){K1(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 K1(e,t,n){return t=Aie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Aie(e){var t=_ie(e,"string");return Qd(t)==="symbol"?t:String(t)}function _ie(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)}function Eie(e,t){return Oie(e)||kie(e,t)||i4(e,t)||Pie()}function Pie(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
99
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i4(e,t){if(e){if(typeof e=="string")return G1(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 G1(e,t)}}function G1(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 kie(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 Oie(e){if(Array.isArray(e))return e}var mm=function(t,n,r){return t+(n-t)*r},Y1=function(t){var n=t.from,r=t.to;return n!==r},Tie=function e(t,n,r){var a=vd(function(i,o){if(Y1(o)){var c=t(o.from,o.to,o.velocity),d=Eie(c,2),f=d[0],h=d[1];return ir(ir({},o),{},{from:f,velocity:h})}return o},n);return r<1?vd(function(i,o){return Y1(o)?ir(ir({},o),{},{velocity:mm(o.velocity,a[i].velocity,r),from:mm(o.from,a[i].from,r)}):o},n):e(t,a,r-1)};const Rie=(function(e,t,n,r,a){var i=cie(e,t),o=i.reduce(function(y,S){return ir(ir({},y),{},K1({},S,[e[S],t[S]]))},{}),c=i.reduce(function(y,S){return ir(ir({},y),{},K1({},S,{from:e[S],velocity:0,to:t[S]}))},{}),d=-1,f,h,p=function(){return null},x=function(){return vd(function(S,C){return C.from},c)},g=function(){return!Object.values(c).filter(Y1).length},j=function(S){f||(f=S);var C=S-f,N=C/n.dt;c=Tie(n,c,N),a(ir(ir(ir({},e),t),x())),f=S,g()||(d=requestAnimationFrame(p))},b=function(S){h||(h=S);var C=(S-h)/r,N=vd(function(_,P){return mm.apply(void 0,K2(P).concat([n(C)]))},o);if(a(ir(ir(ir({},e),t),N)),C<1)d=requestAnimationFrame(p);else{var E=vd(function(_,P){return mm.apply(void 0,K2(P).concat([n(1)]))},o);a(ir(ir(ir({},e),t),E))}};return p=n.isStepper?j:b,function(){return requestAnimationFrame(p),function(){cancelAnimationFrame(d)}}});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)}var Iie=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function Mie(e,t){if(e==null)return{};var n=$ie(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 $ie(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 rj(e){return Bie(e)||Fie(e)||Lie(e)||Die()}function Die(){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 Lie(e,t){if(e){if(typeof e=="string")return X1(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 X1(e,t)}}function Fie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Bie(e){if(Array.isArray(e))return X1(e)}function X1(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 Y2(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 Da(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Y2(Object(n),!0).forEach(function(r){ld(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ld(e,t,n){return t=o4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Uie(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,o4(r.key),r)}}function qie(e,t,n){return t&&Uie(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function o4(e){var t=Wie(e,"string");return _c(t)==="symbol"?t:String(t)}function Wie(e,t){if(_c(e)!=="object"||e===null)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(t==="string"?String:Number)(e)}function Vie(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Q1(e,t)}function Q1(e,t){return Q1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Q1(e,t)}function Hie(e){var t=Kie();return function(){var r=vm(e),a;if(t){var i=vm(this).constructor;a=Reflect.construct(r,arguments,i)}else a=r.apply(this,arguments);return J1(this,a)}}function J1(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 Z1(e)}function Z1(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Kie(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function vm(e){return vm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},vm(e)}var js=(function(e){Vie(n,e);var t=Hie(n);function n(r,a){var i;zie(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(Z1(i)),i.changeStyle=i.changeStyle.bind(Z1(i)),!c||g<=0)return i.state={style:{}},typeof x=="function"&&(i.state={style:h}),J1(i);if(p&&p.length)i.state={style:p[0].style};else if(f){if(typeof x=="function")return i.state={style:f},J1(i);i.state={style:d?ld({},d,f):f}}else i.state={style:{}};return i}return qie(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?ld({},d,h):h};this.state&&x&&(d&&x[d]!==h||!d&&x!==h)&&this.setState(g);return}if(!(Zse(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?ld({},d,b):b};(d&&x[d]!==b||!d&&x!==b)&&this.setState(y)}this.runAnimation(Da(Da({},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=Rie(o,c,jie(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,T=S>0?o[S-1]:y,R=P||Object.keys(_);if(typeof E=="function"||E==="spring")return[].concat(rj(b),[i.runJSAnimation.bind(i,{from:T.style,to:_,duration:C,easing:E}),C]);var I=W2(R,C,E),D=Da(Da(Da({},T.style),_),{},{transition:I});return[].concat(rj(b),[D,C,O]).filter(uie)};return this.manager.start([d].concat(rj(o.reduce(g,[h,Math.max(x,c)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=iie());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?ld({},c,d):d,y=W2(Object.keys(b),o,f);j.start([h,i,Da(Da({},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=Mie(a,Iie),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,Da(Da({},d),{},{style:Da(Da({},y),h),className:S}));return C};return f===1?p(v.Children.only(i)):W.createElement("div",null,v.Children.map(i,function(x){return p(x)}))}}]),n})(v.PureComponent);js.displayName="Animate";js.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};js.propTypes={from:Gt.oneOfType([Gt.object,Gt.string]),to:Gt.oneOfType([Gt.object,Gt.string]),attributeName:Gt.string,duration:Gt.number,begin:Gt.number,easing:Gt.oneOfType([Gt.string,Gt.func]),steps:Gt.arrayOf(Gt.shape({duration:Gt.number.isRequired,style:Gt.object.isRequired,easing:Gt.oneOfType([Gt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Gt.func]),properties:Gt.arrayOf("string"),onAnimationEnd:Gt.func})),children:Gt.oneOfType([Gt.node,Gt.func]),isActive:Gt.bool,canBegin:Gt.bool,onAnimationEnd:Gt.func,shouldReAnimate:Gt.bool,onAnimationStart:Gt.func,onAnimationReStart:Gt.func};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 gm(){return gm=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},gm.apply(this,arguments)}function Gie(e,t){return Jie(e)||Qie(e,t)||Xie(e,t)||Yie()}function Yie(){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 Xie(e,t){if(e){if(typeof e=="string")return X2(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 X2(e,t)}}function X2(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 Qie(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 Jie(e){if(Array.isArray(e))return e}function Q2(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 J2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Q2(Object(n),!0).forEach(function(r){Zie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Zie(e,t,n){return t=eoe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eoe(e){var t=toe(e,"string");return Jd(t)=="symbol"?t:t+""}function toe(e,t){if(Jd(e)!="object"||!e)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)}var Z2=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},noe=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},roe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},fC=function(t){var n=J2(J2({},roe),t),r=v.useRef(),a=v.useState(-1),i=Gie(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=_t("recharts-rectangle",g);return C?W.createElement(js,{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,T=E.y;return W.createElement(js,{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},W.createElement("path",gm({},gt(n,!0),{className:N,d:Z2(O,T,_,P,x),ref:r})))}):W.createElement("path",gm({},gt(n,!0),{className:N,d:Z2(d,f,h,p,x)}))},aoe=["points","className","baseLinePoints","connectNulls"];function Jl(){return Jl=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},Jl.apply(this,arguments)}function soe(e,t){if(e==null)return{};var n=ioe(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 ioe(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 eI(e){return uoe(e)||coe(e)||loe(e)||ooe()}function ooe(){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 loe(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 coe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function uoe(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}var tI=function(t){return t&&t.x===+t.x&&t.y===+t.y},doe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){tI(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),tI(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},gd=function(t,n){var r=doe(t);n&&(r=[r.reduce(function(i,o){return[].concat(eI(i),eI(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},foe=function(t,n,r){var a=gd(t,r);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(gd(n.reverse(),r).slice(1))},poe=function(t){var n=t.points,r=t.className,a=t.baseLinePoints,i=t.connectNulls,o=soe(t,aoe);if(!n||!n.length)return null;var c=_t("recharts-polygon",r);if(a&&a.length){var d=o.stroke&&o.stroke!=="none",f=foe(n,a,i);return W.createElement("g",{className:c},W.createElement("path",Jl({},gt(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:f})),d?W.createElement("path",Jl({},gt(o,!0),{fill:"none",d:gd(n,i)})):null,d?W.createElement("path",Jl({},gt(o,!0),{fill:"none",d:gd(a,i)})):null)}var h=gd(n,i);return W.createElement("path",Jl({},gt(o,!0),{fill:h.slice(-1)==="Z"?o.fill:"none",className:c,d:h}))};function tS(){return tS=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},tS.apply(this,arguments)}var Wv=function(t){var n=t.cx,r=t.cy,a=t.r,i=t.className,o=_t("recharts-dot",i);return n===+n&&r===+r&&a===+a?v.createElement("circle",tS({},gt(t,!1),Dh(t),{className:o,cx:n,cy:r,r:a})):null};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)}var hoe=["x","y","top","left","width","height","className"];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)}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 moe(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){voe(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 voe(e,t,n){return t=goe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function goe(e){var t=xoe(e,"string");return Zd(t)=="symbol"?t:t+""}function xoe(e,t){if(Zd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Zd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yoe(e,t){if(e==null)return{};var n=boe(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 boe(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 woe=function(t,n,r,a,i,o){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(o,",").concat(n,"h").concat(r)},joe=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=yoe(t,hoe),y=moe({x:r,y:i,top:c,left:f,width:p,height:g},b);return!We(r)||!We(i)||!We(p)||!We(g)||!We(c)||!We(f)?null:W.createElement("path",nS({},gt(y,!0),{className:_t("recharts-cross",j),d:woe(r,i,p,g,c,f)}))},aj,rI;function Soe(){if(rI)return aj;rI=1;var e=Fv(),t=SL(),n=_s();function r(a,i){return a&&a.length?e(a,n(i,2),t):void 0}return aj=r,aj}var Noe=Soe();const Coe=Yt(Noe);var sj,aI;function Aoe(){if(aI)return sj;aI=1;var e=Fv(),t=_s(),n=NL();function r(a,i){return a&&a.length?e(a,t(i,2),n):void 0}return sj=r,sj}var _oe=Aoe();const Eoe=Yt(_oe);var Poe=["cx","cy","angle","ticks","axisLine"],koe=["ticks","tick","angle","tickFormatter","stroke"];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)}function xd(){return xd=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},xd.apply(this,arguments)}function sI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function xo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sI(Object(n),!0).forEach(function(r){Vv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function iI(e,t){if(e==null)return{};var n=Ooe(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 Ooe(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 Toe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oI(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 Roe(e,t,n){return t&&oI(e.prototype,t),n&&oI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ioe(e,t,n){return t=xm(t),Moe(e,l4()?Reflect.construct(t,n||[],xm(e).constructor):t.apply(e,n))}function Moe(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 $oe(e)}function $oe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(l4=function(){return!!e})()}function xm(e){return xm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},xm(e)}function Doe(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&&rS(e,t)}function rS(e,t){return rS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},rS(e,t)}function Vv(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=Loe(e,"string");return Ec(t)=="symbol"?t:t+""}function Loe(e,t){if(Ec(e)!="object"||!e)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)}var Hv=(function(e){function t(){return Toe(this,t),Ioe(this,t,arguments)}return Doe(t,e),Roe(t,[{key:"getTickValueCoord",value:function(r){var a=r.coordinate,i=this.props,o=i.angle,c=i.cx,d=i.cy;return on(c,d,a,o)}},{key:"getTickTextAnchor",value:function(){var r=this.props.orientation,a;switch(r){case"left":a="end";break;case"right":a="start";break;default:a="middle";break}return a}},{key:"getViewBox",value:function(){var r=this.props,a=r.cx,i=r.cy,o=r.angle,c=r.ticks,d=Coe(c,function(h){return h.coordinate||0}),f=Eoe(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=iI(r,Poe),h=c.reduce(function(j,b){return[Math.min(j[0],b.coordinate),Math.max(j[1],b.coordinate)]},[1/0,-1/0]),p=on(a,i,h[0],o),x=on(a,i,h[1],o),g=xo(xo(xo({},gt(f,!1)),{},{fill:"none"},gt(d,!1)),{},{x1:p.x,y1:p.y,x2:x.x,y2:x.y});return W.createElement("line",xd({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=iI(a,koe),p=this.getTickTextAnchor(),x=gt(h,!1),g=gt(o,!1),j=i.map(function(b,y){var S=r.getTickValueCoord(b),C=xo(xo(xo(xo({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 W.createElement(qt,xd({className:_t("recharts-polar-radius-axis-tick",QL(o)),key:"tick-".concat(b.coordinate)},Lo(r.props,b,y)),t.renderTickItem(o,C,d?d(b.value,y):b.value))});return W.createElement(qt,{className:"recharts-polar-radius-axis-ticks"},j)}},{key:"render",value:function(){var r=this.props,a=r.ticks,i=r.axisLine,o=r.tick;return!a||!a.length?null:W.createElement(qt,{className:_t("recharts-polar-radius-axis",this.props.className)},i&&this.renderAxisLine(),o&&this.renderTicks(),tr.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,a,i){var o;return W.isValidElement(r)?o=W.cloneElement(r,a):Ct(r)?o=r(a):o=W.createElement(Fo,xd({},a,{className:"recharts-polar-radius-axis-tick-value"}),i),o}}])})(v.PureComponent);Vv(Hv,"displayName","PolarRadiusAxis");Vv(Hv,"axisType","radiusAxis");Vv(Hv,"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 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 Co(){return Co=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},Co.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 yo(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){Kv(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 Foe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,d4(r.key),r)}}function Boe(e,t,n){return t&&cI(e.prototype,t),n&&cI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function zoe(e,t,n){return t=ym(t),Uoe(e,u4()?Reflect.construct(t,n||[],ym(e).constructor):t.apply(e,n))}function Uoe(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 qoe(e)}function qoe(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 ym(e){return ym=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ym(e)}function Woe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&aS(e,t)}function aS(e,t){return aS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},aS(e,t)}function Kv(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 d4(e){var t=Voe(e,"string");return Pc(t)=="symbol"?t:t+""}function Voe(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 Hoe=Math.PI/180,uI=1e-5,Gv=(function(e){function t(){return Foe(this,t),zoe(this,t,arguments)}return Woe(t,e),Boe(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=on(i,o,c,r.coordinate),x=on(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*Hoe),o;return i>uI?o=a==="outer"?"start":"end":i<-uI?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=yo(yo({},gt(this.props,!1)),{},{fill:"none"},gt(c,!1));if(d==="circle")return W.createElement(Wv,Co({className:"recharts-polar-angle-axis-line"},f,{cx:a,cy:i,r:o}));var h=this.props.ticks,p=h.map(function(x){return on(a,i,o,x.coordinate)});return W.createElement(poe,Co({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=gt(this.props,!1),p=gt(o,!1),x=yo(yo({},h),{},{fill:"none"},gt(c,!1)),g=i.map(function(j,b){var y=r.getTickLineCoord(j),S=r.getTickTextAnchor(j),C=yo(yo(yo({textAnchor:S},h),{},{stroke:"none",fill:f},p),{},{index:b,payload:j,x:y.x2,y:y.y2});return W.createElement(qt,Co({className:_t("recharts-polar-angle-axis-tick",QL(o)),key:"tick-".concat(j.coordinate)},Lo(r.props,j,b)),c&&W.createElement("line",Co({className:"recharts-polar-angle-axis-tick-line"},x,y)),o&&t.renderTickItem(o,C,d?d(j.value,b):j.value))});return W.createElement(qt,{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:W.createElement(qt,{className:_t("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,a,i){var o;return W.isValidElement(r)?o=W.cloneElement(r,a):Ct(r)?o=r(a):o=W.createElement(Fo,Co({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])})(v.PureComponent);Kv(Gv,"displayName","PolarAngleAxis");Kv(Gv,"axisType","angleAxis");Kv(Gv,"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 ij,dI;function Koe(){if(dI)return ij;dI=1;var e=S5(),t=e(Object.getPrototypeOf,Object);return ij=t,ij}var oj,fI;function Goe(){if(fI)return oj;fI=1;var e=ai(),t=Koe(),n=si(),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 oj=f,oj}var Yoe=Goe();const Xoe=Yt(Yoe);var lj,pI;function Qoe(){if(pI)return lj;pI=1;var e=ai(),t=si(),n="[object Boolean]";function r(a){return a===!0||a===!1||t(a)&&e(a)==n}return lj=r,lj}var Joe=Qoe();const Zoe=Yt(Joe);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)}function bm(){return bm=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},bm.apply(this,arguments)}function ele(e,t){return ale(e)||rle(e,t)||nle(e,t)||tle()}function tle(){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 nle(e,t){if(e){if(typeof e=="string")return hI(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 hI(e,t)}}function hI(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 rle(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 ale(e){if(Array.isArray(e))return e}function mI(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 vI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mI(Object(n),!0).forEach(function(r){sle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sle(e,t,n){return t=ile(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ile(e){var t=ole(e,"string");return ef(t)=="symbol"?t:t+""}function ole(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)}var gI=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},lle={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},cle=function(t){var n=vI(vI({},lle),t),r=v.useRef(),a=v.useState(-1),i=ele(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=_t("recharts-trapezoid",g);return S?W.createElement(js,{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,T=N.y;return W.createElement(js,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:b,easing:j},W.createElement("path",bm({},gt(n,!0),{className:C,d:gI(O,T,E,_,P),ref:r})))}):W.createElement("g",null,W.createElement("path",bm({},gt(n,!0),{className:C,d:gI(d,f,h,p,x)})))},ule=["option","shapeType","propTransformer","activeClassName","isActive"];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 dle(e,t){if(e==null)return{};var n=fle(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 fle(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 xI(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 wm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xI(Object(n),!0).forEach(function(r){ple(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ple(e,t,n){return t=hle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hle(e){var t=mle(e,"string");return tf(t)=="symbol"?t:t+""}function mle(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)}function vle(e,t){return wm(wm({},t),e)}function gle(e,t){return e==="symbols"}function yI(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return W.createElement(fC,n);case"trapezoid":return W.createElement(cle,n);case"sector":return W.createElement(e4,n);case"symbols":if(gle(t))return W.createElement(ON,n);break;default:return null}}function xle(e){return v.isValidElement(e)?e.props:e}function f4(e){var t=e.option,n=e.shapeType,r=e.propTransformer,a=r===void 0?vle:r,i=e.activeClassName,o=i===void 0?"recharts-active-shape":i,c=e.isActive,d=dle(e,ule),f;if(v.isValidElement(t))f=v.cloneElement(t,wm(wm({},d),xle(t)));else if(Ct(t))f=t(d);else if(Xoe(t)&&!Zoe(t)){var h=a(t,d);f=W.createElement(yI,{shapeType:n,elementProps:h})}else{var p=d;f=W.createElement(yI,{shapeType:n,elementProps:p})}return c?W.createElement(qt,{className:o},f):f}function Yv(e,t){return t!=null&&"trapezoids"in e.props}function Xv(e,t){return t!=null&&"sectors"in e.props}function nf(e,t){return t!=null&&"points"in e.props}function yle(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 ble(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function wle(e,t){var n=e.x===t.x,r=e.y===t.y,a=e.z===t.z;return n&&r&&a}function jle(e,t){var n;return Yv(e,t)?n=yle:Xv(e,t)?n=ble:nf(e,t)&&(n=wle),n}function Sle(e,t){var n;return Yv(e,t)?n="trapezoids":Xv(e,t)?n="sectors":nf(e,t)&&(n="points"),n}function Nle(e,t){if(Yv(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(Xv(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 nf(e,t)?t.payload:{}}function Cle(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,a=Sle(n,t),i=Nle(n,t),o=r.filter(function(d,f){var h=Tf(i,d),p=n.props[a].filter(function(j){var b=jle(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 Ch;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 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 bI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function an(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bI(Object(n),!0).forEach(function(r){ba(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ale(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,h4(r.key),r)}}function _le(e,t,n){return t&&wI(e.prototype,t),n&&wI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ele(e,t,n){return t=jm(t),Ple(e,p4()?Reflect.construct(t,n||[],jm(e).constructor):t.apply(e,n))}function Ple(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 kle(e)}function kle(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(p4=function(){return!!e})()}function jm(e){return jm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},jm(e)}function Ole(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&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 ba(e,t,n){return t=h4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h4(e){var t=Tle(e,"string");return kc(t)=="symbol"?t:t+""}function Tle(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 String(e)}var oi=(function(e){function t(n){var r;return Ale(this,t),r=Ele(this,t,[n]),ba(r,"pieRef",null),ba(r,"sectorRefs",[]),ba(r,"id",au("recharts-pie-")),ba(r,"handleAnimationEnd",function(){var a=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),Ct(a)&&a()}),ba(r,"handleAnimationStart",function(){var a=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),Ct(a)&&a()}),r.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},r}return Ole(t,e),_le(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=gt(this.props,!1),p=gt(o,!1),x=gt(c,!1),g=o&&o.offsetRadius||20,j=r.map(function(b,y){var S=(b.startAngle+b.endAngle)/2,C=on(b.cx,b.cy,b.outerRadius+g,S),N=an(an(an(an({},h),b),{},{stroke:"none"},p),{},{index:y,textAnchor:t.getTextAnchor(C.x,b.cx)},C),E=an(an(an(an({},h),b),{},{fill:"none",stroke:b.fill},x),{},{index:y,points:[on(b.cx,b.cy,b.outerRadius,S),C]}),_=d;return At(d)&&At(f)?_="value":At(d)&&(_=f),W.createElement(qt,{key:"label-".concat(b.startAngle,"-").concat(b.endAngle,"-").concat(b.midAngle,"-").concat(y)},c&&t.renderLabelLineItem(c,E,"line"),t.renderLabelItem(o,N,Un(b,_)))});return W.createElement(qt,{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=an(an({},f),{},{stroke:c?f.fill:f.stroke,tabIndex:-1});return W.createElement(qt,Zl({ref:function(y){y&&!a.sectorRefs.includes(y)&&a.sectorRefs.push(y)},tabIndex:-1,className:"recharts-pie-sector"},Lo(a.props,f,h),{key:"sector-".concat(f?.startAngle,"-").concat(f?.endAngle,"-").concat(f.midAngle,"-").concat(h)}),W.createElement(f4,Zl({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 W.createElement(js,{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?sa(N,"paddingAngle",0):0;if(_){var O=ea(_.endAngle-_.startAngle,N.endAngle-N.startAngle),T=an(an({},N),{},{startAngle:C+P,endAngle:C+O(b)+P});y.push(T),C=T.endAngle}else{var R=N.endAngle,I=N.startAngle,D=ea(0,R-I),$=D(b),H=an(an({},N),{},{startAngle:C+P,endAngle:C+$+P});y.push(H),C=H.endAngle}}),W.createElement(qt,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||!We(f)||!We(h)||!We(p)||!We(x))return null;var b=_t("recharts-pie",c);return W.createElement(qt,{tabIndex:this.props.rootTabIndex,className:b,ref:function(S){r.pieRef=S}},this.renderSectors(),d&&this.renderLabels(o),tr.renderCallByParent(this.props,null,!1),(!g||j)&&Qs.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return a.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:r.sectors!==a.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,a){return r>a?"start":r<a?"end":"middle"}},{key:"renderLabelLineItem",value:function(r,a,i){if(W.isValidElement(r))return W.cloneElement(r,a);if(Ct(r))return r(a);var o=_t("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return W.createElement(fm,Zl({},a,{key:i,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(r,a,i){if(W.isValidElement(r))return W.cloneElement(r,a);var o=i;if(Ct(r)&&(o=r(a),W.isValidElement(o)))return o;var c=_t("recharts-pie-label-text",typeof r!="boolean"&&!Ct(r)?r.className:"");return W.createElement(Fo,Zl({},a,{alignmentBaseline:"middle",className:c}),o)}}])})(v.PureComponent);Ch=oi;ba(oi,"displayName","Pie");ba(oi,"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:!nl.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});ba(oi,"parseDeltaAngle",function(e,t){var n=wr(t-e),r=Math.min(Math.abs(t-e),360);return n*r});ba(oi,"getRealPieData",function(e){var t=e.data,n=e.children,r=gt(e,!1),a=ia(n,Tv);return t&&t.length?t.map(function(i,o){return an(an(an({payload:i},r),i),a&&a[o]&&a[o].props)}):a&&a.length?a.map(function(i){return an(an({},r),i.props)}):[]});ba(oi,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,a=t.width,i=t.height,o=XL(a,i),c=r+jr(e.cx,a,a/2),d=n+jr(e.cy,i,i/2),f=jr(e.innerRadius,o,0),h=jr(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}});ba(oi,"getComposedData",function(e){var t=e.item,n=e.offset,r=t.type.defaultProps!==void 0?an(an({},t.type.defaultProps),t.props):t.props,a=Ch.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=Ch.parseCoordinateOfPie(r,n),b=Ch.parseDeltaAngle(o,c),y=Math.abs(b),S=f;At(f)&&At(p)?(Ys(!1,`Use "dataKey" to specify the value of pie,
114
- the props "valueKey" will be deprecated in 1.1.0`),S="value"):At(f)&&(Ys(!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(T){return Un(T,S,0)!==0}).length,N=(y>=360?C:C-1)*d,E=y-C*g-N,_=a.reduce(function(T,R){var I=Un(R,S,0);return T+(We(I)?I:0)},0),P;if(_>0){var O;P=a.map(function(T,R){var I=Un(T,S,0),D=Un(T,h,R),$=(We(I)?I:0)/_,H;R?H=O.endAngle+wr(b)*d*(I!==0?1:0):H=o;var F=H+wr(b)*((I!==0?g:0)+$*E),q=(H+F)/2,Q=(j.innerRadius+j.outerRadius)/2,J=[{name:D,value:I,payload:T,dataKey:S,type:x}],B=on(j.cx,j.cy,Q,q);return O=an(an(an({percent:$,cornerRadius:i,name:D,tooltipPayload:J,midAngle:q,middleRadius:Q,tooltipPosition:B},T),j),{},{value:Un(T,S),startAngle:H,endAngle:F,payload:T,paddingAngle:wr(b)*d}),O})}return an(an({},j),{},{sectors:P,data:a})});var cj,jI;function Rle(){if(jI)return cj;jI=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 cj=n,cj}var uj,SI;function m4(){if(SI)return uj;SI=1;var e=F5(),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 uj=r,uj}var dj,NI;function Ile(){if(NI)return dj;NI=1;var e=Rle(),t=Ov(),n=m4();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 dj=r,dj}var fj,CI;function Mle(){if(CI)return fj;CI=1;var e=Ile(),t=e();return fj=t,fj}var $le=Mle();const Sm=Yt($le);function rf(e){"@babel/helpers - typeof";return rf=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},rf(e)}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 _I(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){v4(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 v4(e,t,n){return t=Dle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dle(e){var t=Lle(e,"string");return rf(t)=="symbol"?t:t+""}function Lle(e,t){if(rf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(rf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Fle=["Webkit","Moz","O","ms"],Ble=function(t,n){var r=t.replace(/(\w)/,function(i){return i.toUpperCase()}),a=Fle.reduce(function(i,o){return _I(_I({},i),{},v4({},o+r,n))},{});return a[t]=n,a};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 Nm(){return Nm=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},Nm.apply(this,arguments)}function EI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function pj(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){Qr(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 zle(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,x4(r.key),r)}}function Ule(e,t,n){return t&&PI(e.prototype,t),n&&PI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function qle(e,t,n){return t=Cm(t),Wle(e,g4()?Reflect.construct(t,n||[],Cm(e).constructor):t.apply(e,n))}function Wle(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 Vle(e)}function Vle(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(g4=function(){return!!e})()}function Cm(e){return Cm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Cm(e)}function Hle(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 Qr(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=Kle(e,"string");return Oc(t)=="symbol"?t:t+""}function Kle(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 Gle=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=hd().domain(Sm(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}},kI=function(t){return t.changedTouches&&!!t.changedTouches.length},Tc=(function(e){function t(n){var r;return zle(this,t),r=qle(this,t,[n]),Qr(r,"handleDrag",function(a){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(a):r.state.isSlideMoving&&r.handleSlideDrag(a)}),Qr(r,"handleTouchMove",function(a){a.changedTouches!=null&&a.changedTouches.length>0&&r.handleDrag(a.changedTouches[0])}),Qr(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()}),Qr(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Qr(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Qr(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Qr(r,"handleSlideDragStart",function(a){var i=kI(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 Hle(t,e),Ule(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=Un(i[r],c,r);return Ct(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=kI(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 T=y.length-1;return o==="startX"&&(c>d?E%b===0:_%b===0)||c<d&&_===T||o==="endX"&&(c>d?_%b===0:E%b===0)||c>d&&_===T};this.setState(Qr(Qr({},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(Qr({},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 W.createElement("rect",{stroke:f,fill:d,x:a,y:i,width:o,height:c})}},{key:"renderPanorama",value:function(){var r=this.props,a=r.x,i=r.y,o=r.width,c=r.height,d=r.data,f=r.children,h=r.padding,p=v.Children.only(f);return p?W.cloneElement(p,{x:a,y:i,width:o,height:c,margin:h,compact:!0,data:d}):null}},{key:"renderTravellerLayer",value:function(r,a){var i,o,c=this,d=this.props,f=d.y,h=d.travellerWidth,p=d.height,x=d.traveller,g=d.ariaLabel,j=d.data,b=d.startIndex,y=d.endIndex,S=Math.max(r,this.props.x),C=pj(pj({},gt(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 W.createElement(qt,{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 W.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:d,fillOpacity:.2,x:h,y:o,width:p,height:c})}},{key:"renderText",value:function(){var r=this.props,a=r.startIndex,i=r.endIndex,o=r.y,c=r.height,d=r.travellerWidth,f=r.stroke,h=this.state,p=h.startX,x=h.endX,g=5,j={pointerEvents:"none",fill:f};return W.createElement(qt,{className:"recharts-brush-texts"},W.createElement(Fo,Nm({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,x)-g,y:o+c/2},j),this.getTextOfTick(a)),W.createElement(Fo,Nm({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||!We(c)||!We(d)||!We(f)||!We(h)||f<=0||h<=0)return null;var N=_t("recharts-brush",i),E=W.Children.count(o)===1,_=Ble("userSelect","none");return W.createElement(qt,{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 W.createElement(W.Fragment,null,W.createElement("rect",{x:a,y:i,width:o,height:c,fill:d,stroke:"none"}),W.createElement("line",{x1:a+1,y1:f,x2:a+o-1,y2:f,fill:"none",stroke:"#fff"}),W.createElement("line",{x1:a+1,y1:f+2,x2:a+o-1,y2:f+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,a){var i;return W.isValidElement(r)?i=W.cloneElement(r,a):Ct(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 pj({prevData:i,prevTravellerWidth:d,prevUpdateId:f,prevX:c,prevWidth:o},i&&i.length?Gle({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);Qr(Tc,"displayName","Brush");Qr(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 hj,OI;function Yle(){if(OI)return hj;OI=1;var e=LN();function t(n,r){var a;return e(n,function(i,o,c){return a=r(i,o,c),!a}),!!a}return hj=t,hj}var mj,TI;function Xle(){if(TI)return mj;TI=1;var e=v5(),t=_s(),n=Yle(),r=Br(),a=Ov();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 mj=i,mj}var Qle=Xle();const Jle=Yt(Qle);var vs=function(t,n){var r=t.alwaysShow,a=t.ifOverflow;return r&&(a="extendDomain"),a===n},vj,RI;function Zle(){if(RI)return vj;RI=1;var e=I5();function t(n,r,a){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):n[r]=a}return vj=t,vj}var gj,II;function ece(){if(II)return gj;II=1;var e=Zle(),t=T5(),n=_s();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 gj=r,gj}var tce=ece();const nce=Yt(tce);var xj,MI;function rce(){if(MI)return xj;MI=1;function e(t,n){for(var r=-1,a=t==null?0:t.length;++r<a;)if(!n(t[r],r,t))return!1;return!0}return xj=e,xj}var yj,$I;function ace(){if($I)return yj;$I=1;var e=LN();function t(n,r){var a=!0;return e(n,function(i,o,c){return a=!!r(i,o,c),a}),a}return yj=t,yj}var bj,DI;function sce(){if(DI)return bj;DI=1;var e=rce(),t=ace(),n=_s(),r=Br(),a=Ov();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 bj=i,bj}var ice=sce();const oce=Yt(ice);var lce=["x","y"];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 oS(){return oS=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},oS.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 rd(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){cce(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 cce(e,t,n){return t=uce(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uce(e){var t=dce(e,"string");return af(t)=="symbol"?t:t+""}function dce(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)}function fce(e,t){if(e==null)return{};var n=pce(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 pce(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 hce(e,t){var n=e.x,r=e.y,a=fce(e,lce),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 rd(rd(rd(rd(rd({},t),a),o?{x:o}:{}),d?{y:d}:{}),{},{height:h,width:x,name:t.name,radius:t.radius})}function FI(e){return W.createElement(f4,oS({shapeType:"rectangle",propTransformer:hce,activeClassName:"recharts-active-bar"},e))}var mce=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=We(r)||IY(r);return i?t(r,a):(i||zo(),n)}},vce=["value","background"],y4;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 gce(e,t){if(e==null)return{};var n=xce(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 xce(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 Am(){return Am=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},Am.apply(this,arguments)}function BI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function In(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BI(Object(n),!0).forEach(function(r){Li(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,w4(r.key),r)}}function bce(e,t,n){return t&&zI(e.prototype,t),n&&zI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function wce(e,t,n){return t=_m(t),jce(e,b4()?Reflect.construct(t,n||[],_m(e).constructor):t.apply(e,n))}function jce(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 Sce(e)}function Sce(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 _m(e){return _m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_m(e)}function Nce(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 Li(e,t,n){return t=w4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w4(e){var t=Cce(e,"string");return Rc(t)=="symbol"?t:t+""}function Cce(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 il=(function(e){function t(){var n;yce(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=wce(this,t,[].concat(a)),Li(n,"state",{isAnimationFinished:!1}),Li(n,"id",au("recharts-bar-")),Li(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),Li(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return Nce(t,e),bce(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=gt(this.props,!1);return r&&r.map(function(p,x){var g=x===d,j=g?f:o,b=In(In(In({},h),p),{},{isActive:g,option:j,index:x,dataKey:c,onAnimationStart:a.handleAnimationStart,onAnimationEnd:a.handleAnimationEnd});return W.createElement(qt,Am({className:"recharts-bar-rectangle"},Lo(a.props,p,x),{key:"rectangle-".concat(p?.x,"-").concat(p?.y,"-").concat(p?.value,"-").concat(x)}),W.createElement(FI,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 W.createElement(js,{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=ea(C.x,y.x),E=ea(C.y,y.y),_=ea(C.width,y.width),P=ea(C.height,y.height);return In(In({},y),{},{x:N(j),y:E(j),width:_(j),height:P(j)})}if(o==="horizontal"){var O=ea(0,y.height),T=O(j);return In(In({},y),{},{y:y.y+y.height-T,height:T})}var R=ea(0,y.width),I=R(j);return In(In({},y),{},{width:I})});return W.createElement(qt,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=gt(this.props.background,!1);return i.map(function(f,h){f.value;var p=f.background,x=gce(f,vce);if(!p)return null;var g=In(In(In(In(In({},x),{},{fill:"#eee"},p),d),Lo(r.props,f,h)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:h,className:"recharts-bar-background-rectangle"});return W.createElement(FI,Am({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=ia(h,Rf);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:Un(y,S)}},j={clipPath:r?"url(#clipPath-".concat(a,")"):null};return W.createElement(qt,j,p.map(function(b){return W.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=_t("recharts-bar",o),C=c&&c.allowDataOverflow,N=d&&d.allowDataOverflow,E=C||N,_=At(b)?this.id:b;return W.createElement(qt,{className:S},C||N?W.createElement("defs",null,W.createElement("clipPath",{id:"clipPath-".concat(_)},W.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,W.createElement(qt,{className:"recharts-bar-rectangles",clipPath:E?"url(#clipPath-".concat(_,")"):null},j?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(E,_),(!g||y)&&Qs.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);y4=il;Li(il,"displayName","Bar");Li(il,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!nl.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Li(il,"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=Yre(r,n);if(!g)return null;var j=t.layout,b=n.type.defaultProps,y=b!==void 0?In(In({},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=nae({numericAxis:E}),O=ia(C,Tv),T=p.map(function(R,I){var D,$,H,F,q,Q;f?D=Xre(f[h+I],_):(D=Un(R,S),Array.isArray(D)||(D=[P,D]));var J=mce(N,y4.defaultProps.minPointSize)(D[1],I);if(j==="horizontal"){var B,U=[o.scale(D[0]),o.scale(D[1])],Z=U[0],z=U[1];$=m2({axis:i,ticks:c,bandSize:a,offset:g.offset,entry:R,index:I}),H=(B=z??Z)!==null&&B!==void 0?B:void 0,F=g.size;var L=Z-z;if(q=Number.isNaN(L)?0:L,Q={x:$,y:o.y,width:F,height:o.height},Math.abs(J)>0&&Math.abs(q)<Math.abs(J)){var ee=wr(q||J)*(Math.abs(J)-Math.abs(q));H-=ee,q+=ee}}else{var se=[i.scale(D[0]),i.scale(D[1])],G=se[0],ue=se[1];if($=G,H=m2({axis:o,ticks:d,bandSize:a,offset:g.offset,entry:R,index:I}),F=ue-G,q=g.size,Q={x:i.x,y:H,width:i.width,height:q},Math.abs(J)>0&&Math.abs(F)<Math.abs(J)){var le=wr(F||J)*(Math.abs(J)-Math.abs(F));F+=le}}return In(In(In({},R),{},{x:$,y:H,width:F,height:q,value:f?D:D[1],payload:R,background:Q},O&&O[I]&&O[I].props),{},{tooltipPayload:[GL(n,R)],tooltipPosition:{x:$+F/2,y:H+q/2}})});return In({data:T,layout:j},x)});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 Ace(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UI(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 _ce(e,t,n){return t&&UI(e.prototype,t),n&&UI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function qI(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 Ba(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qI(Object(n),!0).forEach(function(r){Qv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qv(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=Ece(e,"string");return sf(t)=="symbol"?t:t+""}function Ece(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)}var S4=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=!!Jr(f,il);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,T,R,I,D;if(b.type==="number"&&(b.padding==="gap"||b.padding==="no-gap")){var $=S[1]-S[0],H=1/0,F=b.categoricalDomain.sort(DY);if(F.forEach(function(se,G){G>0&&(H=Math.min((se||0)-(F[G-1]||0),H))}),Number.isFinite(H)){var q=H/$,Q=b.layout==="vertical"?r.height:r.width;if(b.padding==="gap"&&(O=q*Q/2),b.padding==="no-gap"){var J=jr(t.barCategoryGap,q*Q),B=q*Q/2;O=B-J-(B-J)/Q*J}}}a==="xAxis"?T=[r.left+(N.left||0)+(O||0),r.left+r.width-(N.right||0)-(O||0)]:a==="yAxis"?T=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)]:T=b.range,_&&(T=[T[1],T[0]]);var U=WL(b,i,x),Z=U.scale,z=U.realScaleType;Z.domain(S).range(T),VL(Z);var L=HL(Z,Ba(Ba({},b),{},{realScaleType:z}));a==="xAxis"?(D=y==="top"&&!E||y==="bottom"&&E,R=r.left,I=p[P]-D*b.height):a==="yAxis"&&(D=y==="left"&&!E||y==="right"&&E,R=p[P]-D*b.width,I=r.top);var ee=Ba(Ba(Ba({},b),L),{},{realScaleType:z,x:R,y:I,scale:Z,width:a==="xAxis"?r.width:b.width,height:a==="yAxis"?r.height:b.height});return ee.bandSize=cm(ee,L),!b.hide&&a==="xAxis"?p[P]+=(D?-1:1)*ee.height:b.hide||(p[P]+=(D?-1:1)*ee.width),Ba(Ba({},g),{},Qv({},j,ee))},{})},N4=function(t,n){var r=t.x,a=t.y,i=n.x,o=n.y;return{x:Math.min(r,i),y:Math.min(a,o),width:Math.abs(i-r),height:Math.abs(o-a)}},Pce=function(t){var n=t.x1,r=t.y1,a=t.x2,i=t.y2;return N4({x:n,y:r},{x:a,y:i})},C4=(function(){function e(t){Ace(this,e),this.scale=t}return _ce(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)}}])})();Qv(C4,"EPS",1e-4);var pC=function(t){var n=Object.keys(t).reduce(function(r,a){return Ba(Ba({},r),{},Qv({},a,C4.create(t[a])))},{});return Ba(Ba({},n),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,c=i.position;return nce(a,function(d,f){return n[f].apply(d,{bandAware:o,position:c})})},isInRange:function(a){return oce(a,function(i,o){return n[o].isInRange(i)})}})};function kce(e){return(e%180+180)%180}var Oce=function(t){var n=t.width,r=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=kce(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)},wj,WI;function Tce(){if(WI)return wj;WI=1;var e=_s(),t=_f(),n=Pv();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 wj=r,wj}var jj,VI;function Rce(){if(VI)return jj;VI=1;var e=m4();function t(n){var r=e(n),a=r%1;return r===r?a?r-a:r:0}return jj=t,jj}var Sj,HI;function Ice(){if(HI)return Sj;HI=1;var e=_5(),t=_s(),n=Rce(),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 Sj=a,Sj}var Nj,KI;function Mce(){if(KI)return Nj;KI=1;var e=Tce(),t=Ice(),n=e(t);return Nj=n,Nj}Mce();var $ce=q3();const Dce=Yt($ce);var Lce=Dce(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("")}),A4=v.createContext(void 0),_4=v.createContext(void 0),E4=v.createContext(void 0),Fce=v.createContext({}),P4=v.createContext(void 0),k4=v.createContext(0),O4=v.createContext(0),GI=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=Lce(i);return W.createElement(A4.Provider,{value:r},W.createElement(_4.Provider,{value:a},W.createElement(Fce.Provider,{value:i},W.createElement(E4.Provider,{value:h},W.createElement(P4.Provider,{value:o},W.createElement(k4.Provider,{value:f},W.createElement(O4.Provider,{value:d},c)))))))},Bce=function(){return v.useContext(P4)},T4=function(t){var n=v.useContext(A4);n==null&&zo();var r=n[t];return r==null&&zo(),r},R4=function(t){var n=v.useContext(_4);n==null&&zo();var r=n[t];return r==null&&zo(),r},zce=function(){var t=v.useContext(E4);return t},I4=function(){return v.useContext(O4)},M4=function(){return v.useContext(k4)};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 Uce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qce(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,D4(r.key),r)}}function Wce(e,t,n){return t&&qce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Vce(e,t,n){return t=Em(t),Hce(e,$4()?Reflect.construct(t,n||[],Em(e).constructor):t.apply(e,n))}function Hce(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 Kce(e)}function Kce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($4=function(){return!!e})()}function Em(e){return Em=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Em(e)}function Gce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&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 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 XI(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){hC(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 hC(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 D4(e){var t=Yce(e,"string");return Ic(t)=="symbol"?t:t+""}function Yce(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)}function Xce(e,t){return eue(e)||Zce(e,t)||Jce(e,t)||Qce()}function Qce(){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 Jce(e,t){if(e){if(typeof e=="string")return QI(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 QI(e,t)}}function QI(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 Zce(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 eue(e){if(Array.isArray(e))return 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)}var tue=function(t,n){var r;return W.isValidElement(t)?r=W.cloneElement(t,n):Ct(t)?r=t(n):r=W.createElement("line",uS({},n,{className:"recharts-reference-line-line"})),r},nue=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(vs(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(vs(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 vs(f,"discard")&&Jle(_,function(P){return!t.isInRange(P)})?null:_}return null};function rue(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=Bce(),h=T4(a),p=R4(i),x=zce();if(!f||!x)return null;Ys(d===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var g=pC({x:h.scale,y:p.scale}),j=qn(t),b=qn(n),y=r&&r.length===2,S=nue(g,j,b,y,x,e.position,h.orientation,p.orientation,e);if(!S)return null;var C=Xce(S,2),N=C[0],E=N.x,_=N.y,P=C[1],O=P.x,T=P.y,R=vs(e,"hidden")?"url(#".concat(f,")"):void 0,I=XI(XI({clipPath:R},gt(e,!0)),{},{x1:E,y1:_,x2:O,y2:T});return W.createElement(qt,{className:_t("recharts-reference-line",c)},tue(o,I),tr.renderCallByParent(e,Pce({x1:E,y1:_,x2:O,y2:T})))}var mC=(function(e){function t(){return Uce(this,t),Vce(this,t,arguments)}return Gce(t,e),Wce(t,[{key:"render",value:function(){return W.createElement(rue,this.props)}}])})(W.Component);hC(mC,"displayName","ReferenceLine");hC(mC,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function dS(){return dS=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},dS.apply(this,arguments)}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 JI(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 ZI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JI(Object(n),!0).forEach(function(r){Jv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sue(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,F4(r.key),r)}}function iue(e,t,n){return t&&sue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function oue(e,t,n){return t=Pm(t),lue(e,L4()?Reflect.construct(t,n||[],Pm(e).constructor):t.apply(e,n))}function lue(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 cue(e)}function cue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function L4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(L4=function(){return!!e})()}function Pm(e){return Pm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Pm(e)}function uue(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 Jv(e,t,n){return t=F4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F4(e){var t=due(e,"string");return Mc(t)=="symbol"?t:t+""}function due(e,t){if(Mc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Mc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var fue=function(t){var n=t.x,r=t.y,a=t.xAxis,i=t.yAxis,o=pC({x:a.scale,y:i.scale}),c=o.apply({x:n,y:r},{bandAware:!0});return vs(t,"discard")&&!o.isInRange(c)?null:c},Zv=(function(e){function t(){return aue(this,t),oue(this,t,arguments)}return uue(t,e),iue(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=qn(a),h=qn(i);if(Ys(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!f||!h)return null;var p=fue(this.props);if(!p)return null;var x=p.x,g=p.y,j=this.props,b=j.shape,y=j.className,S=vs(this.props,"hidden")?"url(#".concat(d,")"):void 0,C=ZI(ZI({clipPath:S},gt(this.props,!0)),{},{cx:x,cy:g});return W.createElement(qt,{className:_t("recharts-reference-dot",y)},t.renderDot(b,C),tr.renderCallByParent(this.props,{x:x-o,y:g-o,width:2*o,height:2*o}))}}])})(W.Component);Jv(Zv,"displayName","ReferenceDot");Jv(Zv,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Jv(Zv,"renderDot",function(e,t){var n;return W.isValidElement(e)?n=W.cloneElement(e,t):Ct(e)?n=e(t):n=W.createElement(Wv,dS({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});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)}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 eM(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 tM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eM(Object(n),!0).forEach(function(r){eg(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hue(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 mue(e,t,n){return t&&hue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function vue(e,t,n){return t=km(t),gue(e,B4()?Reflect.construct(t,n||[],km(e).constructor):t.apply(e,n))}function gue(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 xue(e)}function xue(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 km(e){return km=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},km(e)}function yue(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&&hS(e,t)}function hS(e,t){return hS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},hS(e,t)}function eg(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=bue(e,"string");return $c(t)=="symbol"?t:t+""}function bue(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 wue=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=pC({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 vs(i,"discard")&&(!x.isInRange(g)||!x.isInRange(j))?null:N4(g,j)},tg=(function(e){function t(){return pue(this,t),vue(this,t,arguments)}return yue(t,e),mue(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;Ys(f===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=qn(a),x=qn(i),g=qn(o),j=qn(c),b=this.props.shape;if(!p&&!x&&!g&&!j&&!b)return null;var y=wue(p,x,g,j,this.props);if(!y&&!b)return null;var S=vs(this.props,"hidden")?"url(#".concat(h,")"):void 0;return W.createElement(qt,{className:_t("recharts-reference-area",d)},t.renderRect(b,tM(tM({clipPath:S},gt(this.props,!0)),y)),tr.renderCallByParent(this.props,y))}}])})(W.Component);eg(tg,"displayName","ReferenceArea");eg(tg,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});eg(tg,"renderRect",function(e,t){var n;return W.isValidElement(e)?n=W.cloneElement(e,t):Ct(e)?n=e(t):n=W.createElement(fC,pS({},t,{className:"recharts-reference-area-rect"})),n});function U4(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 jue(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Oce(r,n)}function Sue(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 Om(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 Nue(e,t){return U4(e,t+1)}function Cue(e,t,n,r,a){for(var i=(r||[]).slice(),o=t.start,c=t.end,d=0,f=1,h=o,p=function(){var j=r?.[d];if(j===void 0)return{v:U4(r,f)};var b=d,y,S=function(){return y===void 0&&(y=n(j,b)),y},C=j.coordinate,N=d===0||Om(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 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 nM(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 gr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nM(Object(n),!0).forEach(function(r){Aue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Aue(e,t,n){return t=_ue(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _ue(e){var t=Eue(e,"string");return of(t)=="symbol"?t:t+""}function Eue(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)}function Pue(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=gr(gr({},g),{},{tickCoord:y>0?g.coordinate-y*e:g.coordinate})}else i[x]=g=gr(gr({},g),{},{tickCoord:g.coordinate});var S=Om(e,g.tickCoord,b,c,d);S&&(d=g.tickCoord-e*(b()/2+a),i[x]=gr(gr({},g),{},{isShow:!0}))},h=o-1;h>=0;h--)f(h);return i}function kue(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=gr(gr({},h),{},{tickCoord:x>0?h.coordinate-x*e:h.coordinate});var g=Om(e,h.tickCoord,function(){return p},d,f);g&&(f=h.tickCoord-e*(p/2+a),o[c-1]=gr(gr({},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=gr(gr({},N),{},{tickCoord:P<0?N.coordinate-P*e:N.coordinate})}else o[C]=N=gr(gr({},N),{},{tickCoord:N.coordinate});var O=Om(e,N.tickCoord,_,d,f);O&&(d=N.tickCoord+e*(_()/2+a),o[C]=gr(gr({},N),{},{isShow:!0}))},y=0;y<j;y++)b(y);return o}function Oue(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(We(d)||nl.isSsr)return Nue(a,typeof d=="number"&&We(d)?d:0);var x=[],g=c==="top"||c==="bottom"?"width":"height",j=h&&g==="width"?pd(h,{fontSize:t,letterSpacing:n}):{width:0,height:0},b=function(N,E){var _=Ct(f)?f(N.value,E):N.value;return g==="width"?jue(pd(_,{fontSize:t,letterSpacing:n}),j,p):pd(_,{fontSize:t,letterSpacing:n})[g]},y=a.length>=2?wr(a[1].coordinate-a[0].coordinate):1,S=Sue(i,y,g);return d==="equidistantPreserveStart"?Cue(y,S,b,a,o):(d==="preserveStart"||d==="preserveStartEnd"?x=kue(y,S,b,a,o,d==="preserveStartEnd"):x=Pue(y,S,b,a,o),x.filter(function(C){return C.isShow}))}var Tue=["viewBox"],Rue=["viewBox"],Iue=["ticks"];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 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 rM(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 Bn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rM(Object(n),!0).forEach(function(r){vC(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cj(e,t){if(e==null)return{};var n=Mue(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 Mue(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 $ue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aM(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,W4(r.key),r)}}function Due(e,t,n){return t&&aM(e.prototype,t),n&&aM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Lue(e,t,n){return t=Tm(t),Fue(e,q4()?Reflect.construct(t,n||[],Tm(e).constructor):t.apply(e,n))}function Fue(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 Bue(e)}function Bue(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 Tm(e){return Tm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Tm(e)}function zue(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 vC(e,t,n){return t=W4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W4(e){var t=Uue(e,"string");return Dc(t)=="symbol"?t:t+""}function Uue(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 ng=(function(e){function t(n){var r;return $ue(this,t),r=Lue(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return zue(t,e),Due(t,[{key:"shouldComponentUpdate",value:function(r,a){var i=r.viewBox,o=Cj(r,Tue),c=this.props,d=c.viewBox,f=Cj(c,Rue);return!oc(i,d)||!oc(o,f)||!oc(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,_=We(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=Bn(Bn(Bn({},gt(this.props,!1)),gt(h,!1)),{},{fill:"none"});if(d==="top"||d==="bottom"){var x=+(d==="top"&&!f||d==="bottom"&&f);p=Bn(Bn({},p),{},{x1:a,y1:i+x*c,x2:a+o,y2:i+x*c})}else{var g=+(d==="left"&&!f||d==="right"&&f);p=Bn(Bn({},p),{},{x1:a+g*o,y1:i,x2:a+g*o,y2:i+c})}return W.createElement("line",ec({},p,{className:_t("recharts-cartesian-axis-line",sa(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=Oue(Bn(Bn({},this.props),{},{ticks:r}),a,i),j=this.getTickTextAnchor(),b=this.getTickVerticalAnchor(),y=gt(this.props,!1),S=gt(h,!1),C=Bn(Bn({},y),{},{fill:"none"},gt(d,!1)),N=g.map(function(E,_){var P=o.getTickLineCoord(E),O=P.line,T=P.tick,R=Bn(Bn(Bn(Bn({textAnchor:j,verticalAnchor:b},y),{},{stroke:"none",fill:f},S),T),{},{index:_,payload:E,visibleTicksCount:g.length,tickFormatter:p});return W.createElement(qt,ec({className:"recharts-cartesian-axis-tick",key:"tick-".concat(E.value,"-").concat(E.coordinate,"-").concat(E.tickCoord)},Lo(o.props,E,_)),d&&W.createElement("line",ec({},C,O,{className:_t("recharts-cartesian-axis-tick-line",sa(d,"className"))})),h&&t.renderTickItem(h,R,"".concat(Ct(p)?p(E.value,_):E.value).concat(x||"")))});return W.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=Cj(p,Iue),j=x;return Ct(d)&&(j=x&&x.length>0?d(this.props):d(g)),o<=0||c<=0||!j||!j.length?null:W.createElement(qt,{className:_t("recharts-cartesian-axis",f),ref:function(y){r.layerReference=y}},i&&this.renderAxisLine(),this.renderTicks(j,this.state.fontSize,this.state.letterSpacing),tr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,a,i){var o,c=_t(a.className,"recharts-cartesian-axis-tick-value");return W.isValidElement(r)?o=W.cloneElement(r,Bn(Bn({},a),{},{className:c})):Ct(r)?o=r(Bn(Bn({},a),{},{className:c})):o=W.createElement(Fo,ec({},a,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])})(v.Component);vC(ng,"displayName","CartesianAxis");vC(ng,"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 que=["type","layout","connectNulls","ref"],Wue=["key"];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 sM(e,t){if(e==null)return{};var n=Vue(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 Vue(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 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 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 Xr(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){za(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 Ul(e){return Yue(e)||Gue(e)||Kue(e)||Hue()}function Hue(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
117
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kue(e,t){if(e){if(typeof e=="string")return vS(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 vS(e,t)}}function Gue(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Yue(e){if(Array.isArray(e))return vS(e)}function vS(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 Xue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oM(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,H4(r.key),r)}}function Que(e,t,n){return t&&oM(e.prototype,t),n&&oM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Jue(e,t,n){return t=Rm(t),Zue(e,V4()?Reflect.construct(t,n||[],Rm(e).constructor):t.apply(e,n))}function Zue(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 ede(e)}function ede(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function V4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(V4=function(){return!!e})()}function Rm(e){return Rm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Rm(e)}function tde(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 za(e,t,n){return t=H4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H4(e){var t=nde(e,"string");return Lc(t)=="symbol"?t:t+""}function nde(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 Uo=(function(e){function t(){var n;Xue(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=Jue(this,t,[].concat(a)),za(n,"state",{isAnimationFinished:!0,totalLength:0}),za(n,"generateSimpleStrokeDasharray",function(o,c){return"".concat(c,"px ").concat(o-c,"px")}),za(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(Ul(d.slice(0,j)),[p-b]);break}var y=g.length%2===0?[0,x]:[x];return[].concat(Ul(t.repeat(d,h)),Ul(g),y).map(function(S){return"".concat(S,"px")}).join(", ")}),za(n,"id",au("recharts-line-")),za(n,"pathRef",function(o){n.mainCurve=o}),za(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),za(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return tde(t,e),Que(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=ia(h,Rf);if(!p)return null;var x=function(b,y){return{x:b.x,y:b.y,value:b.value,errorVal:Un(b.payload,y)}},g={clipPath:r?"url(#clipPath-".concat(a,")"):null};return W.createElement(qt,g,p.map(function(j){return W.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=gt(this.props,!1),x=gt(d,!0),g=f.map(function(b,y){var S=Xr(Xr(Xr({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 W.createElement(qt,yd({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=sM(c,que),x=Xr(Xr(Xr({},gt(p,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:a?"url(#clipPath-".concat(i,")"):null,points:r},o),{},{type:d,layout:f,connectNulls:h});return W.createElement(fm,yd({},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 W.createElement(js,{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($,H){var F=Math.floor(H*P);if(C[F]){var q=C[F],Q=ea(q.x,$.x),J=ea(q.y,$.y);return Xr(Xr({},$),{},{x:Q(_),y:J(_)})}if(j){var B=ea(b*2,$.x),U=ea(y/2,$.y);return Xr(Xr({},$),{},{x:B(_),y:U(_)})}return Xr(Xr({},$),{},{x:$.x,y:$.y})});return i.renderCurveStatically(O,r,a)}var T=ea(0,N),R=T(_),I;if(d){var D="".concat(d).split(/[,\s]+/gim).map(function($){return parseFloat($)});I=i.getStrokeDasharray(R,N,D)}else I=i.generateSimpleStrokeDasharray(N,R);return i.renderCurveStatically(c,r,a,{strokeDasharray:I})})}},{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=_t("recharts-line",d),E=f&&f.allowDataOverflow,_=h&&h.allowDataOverflow,P=E||_,O=At(y)?this.id:y,T=(r=gt(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},R=T.r,I=R===void 0?3:R,D=T.strokeWidth,$=D===void 0?2:D,H=HY(o)?o:{},F=H.clipDot,q=F===void 0?!0:F,Q=I*2+$;return W.createElement(qt,{className:N},E||_?W.createElement("defs",null,W.createElement("clipPath",{id:"clipPath-".concat(O)},W.createElement("rect",{x:E?x:x-g/2,y:_?p:p-j/2,width:E?g:g*2,height:_?j:j*2})),!q&&W.createElement("clipPath",{id:"clipPath-dots-".concat(O)},W.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,q,O),(!b||S)&&Qs.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(Ul(r),[0]):r,o=[],c=0;c<a;++c)o=[].concat(Ul(o),Ul(i));return o}},{key:"renderDotItem",value:function(r,a){var i;if(W.isValidElement(r))i=W.cloneElement(r,a);else if(Ct(r))i=r(a);else{var o=a.key,c=sM(a,Wue),d=_t("recharts-line-dot",typeof r!="boolean"?r.className:"");i=W.createElement(Wv,yd({key:o},c,{className:d}))}return i}}])})(v.PureComponent);za(Uo,"displayName","Line");za(Uo,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!nl.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});za(Uo,"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=Un(x,o);return h==="horizontal"?{x:h2({axis:n,ticks:a,bandSize:c,entry:x,index:g}),y:At(j)?null:r.scale(j),value:j,payload:x}:{x:At(j)?null:n.scale(j),y:h2({axis:r,ticks:i,bandSize:c,entry:x,index:g}),value:j,payload:x}});return Xr({points:p,layout:h},f)});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 rde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ade(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Y4(r.key),r)}}function sde(e,t,n){return t&&ade(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ide(e,t,n){return t=Im(t),ode(e,K4()?Reflect.construct(t,n||[],Im(e).constructor):t.apply(e,n))}function ode(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 lde(e)}function lde(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 Im(e){return Im=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Im(e)}function cde(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 G4(e,t,n){return t=Y4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y4(e){var t=ude(e,"string");return Fc(t)=="symbol"?t:t+""}function ude(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)}function yS(){return yS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yS.apply(this,arguments)}function dde(e){var t=e.xAxisId,n=I4(),r=M4(),a=T4(t);return a==null?null:v.createElement(ng,yS({},a,{className:_t("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return Po(o,!0)}}))}var Vi=(function(e){function t(){return rde(this,t),ide(this,t,arguments)}return cde(t,e),sde(t,[{key:"render",value:function(){return v.createElement(dde,this.props)}}])})(v.Component);G4(Vi,"displayName","XAxis");G4(Vi,"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 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 fde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pde(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,J4(r.key),r)}}function hde(e,t,n){return t&&pde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function mde(e,t,n){return t=Mm(t),vde(e,X4()?Reflect.construct(t,n||[],Mm(e).constructor):t.apply(e,n))}function vde(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 gde(e)}function gde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function X4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(X4=function(){return!!e})()}function Mm(e){return Mm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Mm(e)}function xde(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 Q4(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=yde(e,"string");return Bc(t)=="symbol"?t:t+""}function yde(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 wS(){return wS=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},wS.apply(this,arguments)}var bde=function(t){var n=t.yAxisId,r=I4(),a=M4(),i=R4(n);return i==null?null:v.createElement(ng,wS({},i,{className:_t("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:a},ticksGenerator:function(c){return Po(c,!0)}}))},Hi=(function(e){function t(){return fde(this,t),mde(this,t,arguments)}return xde(t,e),hde(t,[{key:"render",value:function(){return v.createElement(bde,this.props)}}])})(v.Component);Q4(Hi,"displayName","YAxis");Q4(Hi,"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 lM(e){return Nde(e)||Sde(e)||jde(e)||wde()}function wde(){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 jde(e,t){if(e){if(typeof e=="string")return jS(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 jS(e,t)}}function Sde(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Nde(e){if(Array.isArray(e))return jS(e)}function jS(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 SS=function(t,n,r,a,i){var o=ia(t,mC),c=ia(t,Zv),d=[].concat(lM(o),lM(c)),f=ia(t,tg),h="".concat(a,"Id"),p=a[0],x=n;if(d.length&&(x=d.reduce(function(b,y){if(y.props[h]===r&&vs(y.props,"extendDomain")&&We(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&&vs(y.props,"extendDomain")&&We(y.props[g])&&We(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 We(y)?[Math.min(b[0],y),Math.max(b[1],y)]:b},x)),x},Aj={exports:{}},cM;function Cde(){return cM||(cM=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})(Aj)),Aj.exports}var Ade=Cde();const _de=Yt(Ade);var _j=new _de,Ej="recharts.syncMouseEvents";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 Ede(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pde(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Z4(r.key),r)}}function kde(e,t,n){return t&&Pde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pj(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=Ode(e,"string");return lf(t)=="symbol"?t:t+""}function Ode(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 String(e)}var Tde=(function(){function e(){Ede(this,e),Pj(this,"activeIndex",0),Pj(this,"coordinateList",[]),Pj(this,"layout","horizontal")}return kde(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 Rde(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e?.[0],a=e?.[1];if(r&&a&&We(r)&&We(a))return!0}return!1}function Ide(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 eF(e){var t=e.cx,n=e.cy,r=e.radius,a=e.startAngle,i=e.endAngle,o=on(t,n,r,a),c=on(t,n,r,i);return{points:[o,c],cx:t,cy:n,radius:r,startAngle:a,endAngle:i}}function Mde(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=on(c,d,f,p),g=on(c,d,h,p);r=x.x,a=x.y,i=g.x,o=g.y}else return eF(t);return[{x:r,y:a},{x:i,y:o}]}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 uM(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 ph(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uM(Object(n),!0).forEach(function(r){$de(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $de(e,t,n){return t=Dde(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dde(e){var t=Lde(e,"string");return cf(t)=="symbol"?t:t+""}function Lde(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(t==="string"?String:Number)(e)}function Fde(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=fm;if(x==="ScatterChart")j=o,b=joe;else if(x==="BarChart")j=Ide(p,o,d,h),b=fC;else if(p==="radial"){var y=eF(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=e4}else j={points:Mde(p,o,d)},b=fm;var P=ph(ph(ph(ph({stroke:"#ccc",pointerEvents:"none"},d),j),gt(g,!1)),{},{payload:c,payloadIndex:f,className:_t("recharts-tooltip-cursor",g.className)});return v.isValidElement(g)?v.cloneElement(g,P):v.createElement(b,P)}var Bde=["item"],zde=["children","className","width","height","style","compact","title","desc"];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 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 dM(e,t){return Wde(e)||qde(e,t)||nF(e,t)||Ude()}function Ude(){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 qde(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 Wde(e){if(Array.isArray(e))return e}function fM(e,t){if(e==null)return{};var n=Vde(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 Vde(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 Hde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Kde(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,rF(r.key),r)}}function Gde(e,t,n){return t&&Kde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Yde(e,t,n){return t=$m(t),Xde(e,tF()?Reflect.construct(t,n||[],$m(e).constructor):t.apply(e,n))}function Xde(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 Qde(e)}function Qde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tF=function(){return!!e})()}function $m(e){return $m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},$m(e)}function Jde(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&&NS(e,t)}function NS(e,t){return NS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},NS(e,t)}function Uc(e){return tfe(e)||efe(e)||nF(e)||Zde()}function Zde(){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 nF(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 efe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function tfe(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}function pM(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 Se(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pM(Object(n),!0).forEach(function(r){xt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xt(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=nfe(e,"string");return zc(t)=="symbol"?t:t+""}function nfe(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(t==="string"?String:Number)(e)}var rfe={xAxis:["bottom","top"],yAxis:["left","right"]},afe={width:"100%",height:"100%"},aF={x:0,y:0};function hh(e){return e}var sfe=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},ife=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 Se(Se(Se({},a),on(a.cx,a.cy,c,o)),{},{angle:o,radius:c})}var d=i.coordinate,f=a.angle;return Se(Se(Se({},a),on(a.cx,a.cy,d,f)),{},{angle:f,radius:d})}return aF},rg=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(Uc(c),Uc(f)):c},[]);return o.length>0?o:t&&t.length&&We(a)&&We(i)?t.slice(a,i+1):[]};function sF(e){return e==="number"?[0,"auto"]:void 0}var AS=function(t,n,r,a){var i=t.graphicalItems,o=t.tooltipAxis,c=rg(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=$h(g,o.dataKey,a)}else x=p&&p[r]||c[r];return x?[].concat(Uc(d),[GL(f,x)]):d},[])},hM=function(t,n,r,a){var i=a||{x:t.chartX,y:t.chartY},o=sfe(i,r),c=t.orderedTooltipTicks,d=t.tooltipAxis,f=t.tooltipTicks,h=qre(o,c,f,d);if(h>=0&&f){var p=f[h]&&f[h].value,x=AS(t,n,h,p),g=ife(r,c,h,i);return{activeTooltipIndex:h,activeLabel:p,activePayload:x,activeCoordinate:g}}return null},ofe=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=qL(h,i);return r.reduce(function(j,b){var y,S=b.type.defaultProps!==void 0?Se(Se({},b.type.defaultProps),b.props):b.props,C=S.type,N=S.dataKey,E=S.allowDataOverflow,_=S.allowDuplicatedCategory,P=S.scale,O=S.ticks,T=S.includeHidden,R=S[o];if(j[R])return j;var I=rg(t.data,{graphicalItems:a.filter(function(L){var ee,se=o in L.props?L.props[o]:(ee=L.type.defaultProps)===null||ee===void 0?void 0:ee[o];return se===R}),dataStartIndex:d,dataEndIndex:f}),D=I.length,$,H,F;Rde(S.domain,E,C)&&($=B1(S.domain,null,E),g&&(C==="number"||P!=="auto")&&(F=md(I,N,"category")));var q=sF(C);if(!$||$.length===0){var Q,J=(Q=S.domain)!==null&&Q!==void 0?Q:q;if(N){if($=md(I,N,C),C==="category"&&g){var B=$Y($);_&&B?(H=$,$=Sm(0,D)):_||($=x2(J,$,b).reduce(function(L,ee){return L.indexOf(ee)>=0?L:[].concat(Uc(L),[ee])},[]))}else if(C==="category")_?$=$.filter(function(L){return L!==""&&!At(L)}):$=x2(J,$,b).reduce(function(L,ee){return L.indexOf(ee)>=0||ee===""||At(ee)?L:[].concat(Uc(L),[ee])},[]);else if(C==="number"){var U=Gre(I,a.filter(function(L){var ee,se,G=o in L.props?L.props[o]:(ee=L.type.defaultProps)===null||ee===void 0?void 0:ee[o],ue="hide"in L.props?L.props.hide:(se=L.type.defaultProps)===null||se===void 0?void 0:se.hide;return G===R&&(T||!ue)}),N,i,h);U&&($=U)}g&&(C==="number"||P!=="auto")&&(F=md(I,N,"category"))}else g?$=Sm(0,D):c&&c[R]&&c[R].hasStack&&C==="number"?$=x==="expand"?[0,1]:KL(c[R].stackGroups,d,f):$=UL(I,a.filter(function(L){var ee=o in L.props?L.props[o]:L.type.defaultProps[o],se="hide"in L.props?L.props.hide:L.type.defaultProps.hide;return ee===R&&(T||!se)}),C,h,!0);if(C==="number")$=SS(p,$,R,i,O),J&&($=B1(J,$,E));else if(C==="category"&&J){var Z=J,z=$.every(function(L){return Z.indexOf(L)>=0});z&&($=Z)}}return Se(Se({},j),{},xt({},R,Se(Se({},S),{},{axisType:i,domain:$,categoricalDomain:F,duplicateDomain:H,originalDomain:(y=S.domain)!==null&&y!==void 0?y:q,isCategorical:g,layout:h})))},{})},lfe=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=rg(t.data,{graphicalItems:r,dataStartIndex:d,dataEndIndex:f}),g=x.length,j=qL(h,i),b=-1;return r.reduce(function(y,S){var C=S.type.defaultProps!==void 0?Se(Se({},S.type.defaultProps),S.props):S.props,N=C[o],E=sF("number");if(!y[N]){b++;var _;return j?_=Sm(0,g):c&&c[N]&&c[N].hasStack?(_=KL(c[N].stackGroups,d,f),_=SS(p,_,N,i)):(_=B1(E,UL(x,r.filter(function(P){var O,T,R=o in P.props?P.props[o]:(O=P.type.defaultProps)===null||O===void 0?void 0:O[o],I="hide"in P.props?P.props.hide:(T=P.type.defaultProps)===null||T===void 0?void 0:T.hide;return R===N&&!I}),"number",h),a.defaultProps.allowDataOverflow),_=SS(p,_,N,i)),Se(Se({},y),{},xt({},N,Se(Se({axisType:i},a.defaultProps),{},{hide:!0,orientation:sa(rfe,"".concat(i,".").concat(b%2),null),domain:_,originalDomain:E,isCategorical:j,layout:h})))}return y},{})},cfe=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=ia(h,i),g={};return x&&x.length?g=ofe(t,{axes:x,graphicalItems:o,axisType:a,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f}):o&&o.length&&(g=lfe(t,{Axis:i,graphicalItems:o,axisType:a,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f})),g},ufe=function(t){var n=Kl(t),r=Po(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:FN(r,function(a){return a.coordinate}),tooltipAxis:n,tooltipAxisBandSize:cm(n,r)}},mM=function(t){var n=t.children,r=t.defaultShowTooltip,a=Jr(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}},dfe=function(t){return!t||!t.length?!1:t.some(function(n){var r=Gs(n&&n.type);return r&&r.indexOf("Bar")>=0})},vM=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"}},ffe=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=Jr(p,Tc),j=Jr(p,Oo),b=Object.keys(d).reduce(function(_,P){var O=d[P],T=O.orientation;return!O.mirror&&!O.hide?Se(Se({},_),{},xt({},T,_[T]+O.width)):_},{left:x.left||0,right:x.right||0}),y=Object.keys(o).reduce(function(_,P){var O=o[P],T=O.orientation;return!O.mirror&&!O.hide?Se(Se({},_),{},xt({},T,sa(_,"".concat(T))+O.height)):_},{top:x.top||0,bottom:x.bottom||0}),S=Se(Se({},y),b),C=S.bottom;g&&(S.bottom+=g.props.height||Tc.defaultProps.height),j&&n&&(S=Hre(S,a,r,n));var N=f-S.left-S.right,E=h-S.top-S.bottom;return Se(Se({brushBottom:C},S),{},{width:Math.max(N,0),height:Math.max(E,0)})},pfe=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},gC=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,T=C.dataEndIndex,R=S.barSize,I=S.layout,D=S.barGap,$=S.barCategoryGap,H=S.maxBarSize,F=vM(I),q=F.numericAxisName,Q=F.cateAxisName,J=dfe(N),B=[];return N.forEach(function(U,Z){var z=rg(S.data,{graphicalItems:[U],dataStartIndex:O,dataEndIndex:T}),L=U.type.defaultProps!==void 0?Se(Se({},U.type.defaultProps),U.props):U.props,ee=L.dataKey,se=L.maxBarSize,G=L["".concat(q,"Id")],ue=L["".concat(Q,"Id")],le={},oe=d.reduce(function(Pe,Ye){var wt=C["".concat(Ye.axisType,"Map")],It=L["".concat(Ye.axisType,"Id")];wt&&wt[It]||Ye.axisType==="zAxis"||zo();var ve=wt[It];return Se(Se({},Pe),{},xt(xt({},Ye.axisType,ve),"".concat(Ye.axisType,"Ticks"),Po(ve)))},le),ie=oe[Q],fe=oe["".concat(Q,"Ticks")],Ae=E&&E[G]&&E[G].hasStack&&rae(U,E[G].stackGroups),re=Gs(U.type).indexOf("Bar")>=0,Te=cm(ie,fe),_e=[],Ge=J&&Wre({barSize:R,stackGroups:E,totalSize:pfe(oe,Q)});if(re){var je,Me,Y=At(se)?H:se,ye=(je=(Me=cm(ie,fe,!0))!==null&&Me!==void 0?Me:Y)!==null&&je!==void 0?je:0;_e=Vre({barGap:D,barCategoryGap:$,bandSize:ye!==Te?ye:Te,sizeList:Ge[ue],maxBarSize:Y}),ye!==Te&&(_e=_e.map(function(Pe){return Se(Se({},Pe),{},{position:Se(Se({},Pe.position),{},{offset:Pe.position.offset-ye/2})})}))}var de=U&&U.type&&U.type.getComposedData;de&&B.push({props:Se(Se({},de(Se(Se({},oe),{},{displayedData:z,props:S,dataKey:ee,item:U,bandSize:Te,barPosition:_e,offset:_,stackedData:Ae,layout:I,dataStartIndex:O,dataEndIndex:T}))),{},xt(xt(xt({key:U.key||"item-".concat(Z)},q,oe[q]),Q,oe[Q]),"animationId",P)),childIndex:YY(U,S.children),item:U})}),B},g=function(S,C){var N=S.props,E=S.dataStartIndex,_=S.dataEndIndex,P=S.updateId;if(!Tk({props:N}))return null;var O=N.children,T=N.layout,R=N.stackOffset,I=N.data,D=N.reverseStackOrder,$=vM(T),H=$.numericAxisName,F=$.cateAxisName,q=ia(O,r),Q=tae(I,q,"".concat(H,"Id"),"".concat(F,"Id"),R,D),J=d.reduce(function(L,ee){var se="".concat(ee.axisType,"Map");return Se(Se({},L),{},xt({},se,cfe(N,Se(Se({},ee),{},{graphicalItems:q,stackGroups:ee.axisType===H&&Q,dataStartIndex:E,dataEndIndex:_}))))},{}),B=ffe(Se(Se({},J),{},{props:N,graphicalItems:q}),C?.legendBBox);Object.keys(J).forEach(function(L){J[L]=h(N,J[L],B,L.replace("Map",""),n)});var U=J["".concat(F,"Map")],Z=ufe(U),z=x(N,Se(Se({},J),{},{dataStartIndex:E,dataEndIndex:_,updateId:P,graphicalItems:q,stackGroups:Q,offset:B}));return Se(Se({formattedGraphicalItems:z,graphicalItems:q,offset:B,stackGroups:Q},Z),J)},j=(function(y){function S(C){var N,E,_;return Hde(this,S),_=Yde(this,S,[C]),xt(_,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),xt(_,"accessibilityManager",new Tde),xt(_,"handleLegendBBoxUpdate",function(P){if(P){var O=_.state,T=O.dataStartIndex,R=O.dataEndIndex,I=O.updateId;_.setState(Se({legendBBox:P},g({props:_.props,dataStartIndex:T,dataEndIndex:R,updateId:I},Se(Se({},_.state),{},{legendBBox:P}))))}}),xt(_,"handleReceiveSyncEvent",function(P,O,T){if(_.props.syncId===P){if(T===_.eventEmitterSymbol&&typeof _.props.syncMethod!="function")return;_.applySyncEvent(O)}}),xt(_,"handleBrushChange",function(P){var O=P.startIndex,T=P.endIndex;if(O!==_.state.dataStartIndex||T!==_.state.dataEndIndex){var R=_.state.updateId;_.setState(function(){return Se({dataStartIndex:O,dataEndIndex:T},g({props:_.props,dataStartIndex:O,dataEndIndex:T,updateId:R},_.state))}),_.triggerSyncEvent({dataStartIndex:O,dataEndIndex:T})}}),xt(_,"handleMouseEnter",function(P){var O=_.getMouseInfo(P);if(O){var T=Se(Se({},O),{},{isTooltipActive:!0});_.setState(T),_.triggerSyncEvent(T);var R=_.props.onMouseEnter;Ct(R)&&R(T,P)}}),xt(_,"triggeredAfterMouseMove",function(P){var O=_.getMouseInfo(P),T=O?Se(Se({},O),{},{isTooltipActive:!0}):{isTooltipActive:!1};_.setState(T),_.triggerSyncEvent(T);var R=_.props.onMouseMove;Ct(R)&&R(T,P)}),xt(_,"handleItemMouseEnter",function(P){_.setState(function(){return{isTooltipActive:!0,activeItem:P,activePayload:P.tooltipPayload,activeCoordinate:P.tooltipPosition||{x:P.cx,y:P.cy}}})}),xt(_,"handleItemMouseLeave",function(){_.setState(function(){return{isTooltipActive:!1}})}),xt(_,"handleMouseMove",function(P){P.persist(),_.throttleTriggeredAfterMouseMove(P)}),xt(_,"handleMouseLeave",function(P){_.throttleTriggeredAfterMouseMove.cancel();var O={isTooltipActive:!1};_.setState(O),_.triggerSyncEvent(O);var T=_.props.onMouseLeave;Ct(T)&&T(O,P)}),xt(_,"handleOuterEvent",function(P){var O=GY(P),T=sa(_.props,"".concat(O));if(O&&Ct(T)){var R,I;/.*touch.*/i.test(O)?I=_.getMouseInfo(P.changedTouches[0]):I=_.getMouseInfo(P),T((R=I)!==null&&R!==void 0?R:{},P)}}),xt(_,"handleClick",function(P){var O=_.getMouseInfo(P);if(O){var T=Se(Se({},O),{},{isTooltipActive:!0});_.setState(T),_.triggerSyncEvent(T);var R=_.props.onClick;Ct(R)&&R(T,P)}}),xt(_,"handleMouseDown",function(P){var O=_.props.onMouseDown;if(Ct(O)){var T=_.getMouseInfo(P);O(T,P)}}),xt(_,"handleMouseUp",function(P){var O=_.props.onMouseUp;if(Ct(O)){var T=_.getMouseInfo(P);O(T,P)}}),xt(_,"handleTouchMove",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&_.throttleTriggeredAfterMouseMove(P.changedTouches[0])}),xt(_,"handleTouchStart",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&_.handleMouseDown(P.changedTouches[0])}),xt(_,"handleTouchEnd",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&_.handleMouseUp(P.changedTouches[0])}),xt(_,"handleDoubleClick",function(P){var O=_.props.onDoubleClick;if(Ct(O)){var T=_.getMouseInfo(P);O(T,P)}}),xt(_,"handleContextMenu",function(P){var O=_.props.onContextMenu;if(Ct(O)){var T=_.getMouseInfo(P);O(T,P)}}),xt(_,"triggerSyncEvent",function(P){_.props.syncId!==void 0&&_j.emit(Ej,_.props.syncId,P,_.eventEmitterSymbol)}),xt(_,"applySyncEvent",function(P){var O=_.props,T=O.layout,R=O.syncMethod,I=_.state.updateId,D=P.dataStartIndex,$=P.dataEndIndex;if(P.dataStartIndex!==void 0||P.dataEndIndex!==void 0)_.setState(Se({dataStartIndex:D,dataEndIndex:$},g({props:_.props,dataStartIndex:D,dataEndIndex:$,updateId:I},_.state)));else if(P.activeTooltipIndex!==void 0){var H=P.chartX,F=P.chartY,q=P.activeTooltipIndex,Q=_.state,J=Q.offset,B=Q.tooltipTicks;if(!J)return;if(typeof R=="function")q=R(B,P);else if(R==="value"){q=-1;for(var U=0;U<B.length;U++)if(B[U].value===P.activeLabel){q=U;break}}var Z=Se(Se({},J),{},{x:J.left,y:J.top}),z=Math.min(H,Z.x+Z.width),L=Math.min(F,Z.y+Z.height),ee=B[q]&&B[q].value,se=AS(_.state,_.props.data,q),G=B[q]?{x:T==="horizontal"?B[q].coordinate:z,y:T==="horizontal"?L:B[q].coordinate}:aF;_.setState(Se(Se({},P),{},{activeLabel:ee,activeCoordinate:G,activePayload:se,activeTooltipIndex:q}))}else _.setState(P)}),xt(_,"renderCursor",function(P){var O,T=_.state,R=T.isTooltipActive,I=T.activeCoordinate,D=T.activePayload,$=T.offset,H=T.activeTooltipIndex,F=T.tooltipAxisBandSize,q=_.getTooltipEventType(),Q=(O=P.props.active)!==null&&O!==void 0?O:R,J=_.props.layout,B=P.key||"_recharts-cursor";return W.createElement(Fde,{key:B,activeCoordinate:I,activePayload:D,activeTooltipIndex:H,chartName:n,element:P,isActive:Q,layout:J,offset:$,tooltipAxisBandSize:F,tooltipEventType:q})}),xt(_,"renderPolarAxis",function(P,O,T){var R=sa(P,"type.axisType"),I=sa(_.state,"".concat(R,"Map")),D=P.type.defaultProps,$=D!==void 0?Se(Se({},D),P.props):P.props,H=I&&I[$["".concat(R,"Id")]];return v.cloneElement(P,Se(Se({},H),{},{className:_t(R,H.className),key:P.key||"".concat(O,"-").concat(T),ticks:Po(H,!0)}))}),xt(_,"renderPolarGrid",function(P){var O=P.props,T=O.radialLines,R=O.polarAngles,I=O.polarRadius,D=_.state,$=D.radiusAxisMap,H=D.angleAxisMap,F=Kl($),q=Kl(H),Q=q.cx,J=q.cy,B=q.innerRadius,U=q.outerRadius;return v.cloneElement(P,{polarAngles:Array.isArray(R)?R:Po(q,!0).map(function(Z){return Z.coordinate}),polarRadius:Array.isArray(I)?I:Po(F,!0).map(function(Z){return Z.coordinate}),cx:Q,cy:J,innerRadius:B,outerRadius:U,key:P.key||"polar-grid",radialLines:T})}),xt(_,"renderLegend",function(){var P=_.state.formattedGraphicalItems,O=_.props,T=O.children,R=O.width,I=O.height,D=_.props.margin||{},$=R-(D.left||0)-(D.right||0),H=BL({children:T,formattedGraphicalItems:P,legendWidth:$,legendContent:f});if(!H)return null;var F=H.item,q=fM(H,Bde);return v.cloneElement(F,Se(Se({},q),{},{chartWidth:R,chartHeight:I,margin:D,onBBoxUpdate:_.handleLegendBBoxUpdate}))}),xt(_,"renderTooltip",function(){var P,O=_.props,T=O.children,R=O.accessibilityLayer,I=Jr(T,Mr);if(!I)return null;var D=_.state,$=D.isTooltipActive,H=D.activeCoordinate,F=D.activePayload,q=D.activeLabel,Q=D.offset,J=(P=I.props.active)!==null&&P!==void 0?P:$;return v.cloneElement(I,{viewBox:Se(Se({},Q),{},{x:Q.left,y:Q.top}),active:J,label:q,payload:J?F:[],coordinate:H,accessibilityLayer:R})}),xt(_,"renderBrush",function(P){var O=_.props,T=O.margin,R=O.data,I=_.state,D=I.offset,$=I.dataStartIndex,H=I.dataEndIndex,F=I.updateId;return v.cloneElement(P,{key:P.key||"_recharts-brush",onChange:ch(_.handleBrushChange,P.props.onChange),data:R,x:We(P.props.x)?P.props.x:D.left,y:We(P.props.y)?P.props.y:D.top+D.height+D.brushBottom-(T.bottom||0),width:We(P.props.width)?P.props.width:D.width,startIndex:$,endIndex:H,updateId:"brush-".concat(F)})}),xt(_,"renderReferenceElement",function(P,O,T){if(!P)return null;var R=_,I=R.clipPathId,D=_.state,$=D.xAxisMap,H=D.yAxisMap,F=D.offset,q=P.type.defaultProps||{},Q=P.props,J=Q.xAxisId,B=J===void 0?q.xAxisId:J,U=Q.yAxisId,Z=U===void 0?q.yAxisId:U;return v.cloneElement(P,{key:P.key||"".concat(O,"-").concat(T),xAxis:$[B],yAxis:H[Z],viewBox:{x:F.left,y:F.top,width:F.width,height:F.height},clipPathId:I})}),xt(_,"renderActivePoints",function(P){var O=P.item,T=P.activePoint,R=P.basePoint,I=P.childIndex,D=P.isRange,$=[],H=O.props.key,F=O.item.type.defaultProps!==void 0?Se(Se({},O.item.type.defaultProps),O.item.props):O.item.props,q=F.activeDot,Q=F.dataKey,J=Se(Se({index:I,dataKey:Q,cx:T.x,cy:T.y,r:4,fill:dC(O.item),strokeWidth:2,stroke:"#fff",payload:T.payload,value:T.value},gt(q,!1)),Dh(q));return $.push(S.renderActiveDot(q,J,"".concat(H,"-activePoint-").concat(I))),R?$.push(S.renderActiveDot(q,Se(Se({},J),{},{cx:R.x,cy:R.y}),"".concat(H,"-basePoint-").concat(I))):D&&$.push(null),$}),xt(_,"renderGraphicChild",function(P,O,T){var R=_.filterFormatItem(P,O,T);if(!R)return null;var I=_.getTooltipEventType(),D=_.state,$=D.isTooltipActive,H=D.tooltipAxis,F=D.activeTooltipIndex,q=D.activeLabel,Q=_.props.children,J=Jr(Q,Mr),B=R.props,U=B.points,Z=B.isRange,z=B.baseLine,L=R.item.type.defaultProps!==void 0?Se(Se({},R.item.type.defaultProps),R.item.props):R.item.props,ee=L.activeDot,se=L.hide,G=L.activeBar,ue=L.activeShape,le=!!(!se&&$&&J&&(ee||G||ue)),oe={};I!=="axis"&&J&&J.props.trigger==="click"?oe={onClick:ch(_.handleItemMouseEnter,P.props.onClick)}:I!=="axis"&&(oe={onMouseLeave:ch(_.handleItemMouseLeave,P.props.onMouseLeave),onMouseEnter:ch(_.handleItemMouseEnter,P.props.onMouseEnter)});var ie=v.cloneElement(P,Se(Se({},R.props),oe));function fe(Ye){return typeof H.dataKey=="function"?H.dataKey(Ye.payload):null}if(le)if(F>=0){var Ae,re;if(H.dataKey&&!H.allowDuplicatedCategory){var Te=typeof H.dataKey=="function"?fe:"payload.".concat(H.dataKey.toString());Ae=$h(U,Te,q),re=Z&&z&&$h(z,Te,q)}else Ae=U?.[F],re=Z&&z&&z[F];if(ue||G){var _e=P.props.activeIndex!==void 0?P.props.activeIndex:F;return[v.cloneElement(P,Se(Se(Se({},R.props),oe),{},{activeIndex:_e})),null,null]}if(!At(Ae))return[ie].concat(Uc(_.renderActivePoints({item:R,activePoint:Ae,basePoint:re,childIndex:F,isRange:Z})))}else{var Ge,je=(Ge=_.getItemByXY(_.state.activeCoordinate))!==null&&Ge!==void 0?Ge:{graphicalItem:ie},Me=je.graphicalItem,Y=Me.item,ye=Y===void 0?P:Y,de=Me.childIndex,Pe=Se(Se(Se({},R.props),oe),{},{activeIndex:de});return[v.cloneElement(ye,Pe),null,null]}return Z?[ie,null,null]:[ie,null]}),xt(_,"renderCustomized",function(P,O,T){return v.cloneElement(P,Se(Se({key:"recharts-customized-".concat(T)},_.props),_.state))}),xt(_,"renderMap",{CartesianGrid:{handler:hh,once:!0},ReferenceArea:{handler:_.renderReferenceElement},ReferenceLine:{handler:hh},ReferenceDot:{handler:_.renderReferenceElement},XAxis:{handler:hh},YAxis:{handler:hh},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:au("recharts"),"-clip"),_.throttleTriggeredAfterMouseMove=B5(_.triggeredAfterMouseMove,(E=C.throttleDelay)!==null&&E!==void 0?E:1e3/60),_.state={},_}return Jde(S,y),Gde(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,T=Jr(E,Mr);if(T){var R=T.props.defaultIndex;if(!(typeof R!="number"||R<0||R>this.state.tooltipTicks.length-1)){var I=this.state.tooltipTicks[R]&&this.state.tooltipTicks[R].value,D=AS(this.state,_,R,I),$=this.state.tooltipTicks[R].coordinate,H=(this.state.offset.top+P)/2,F=O==="horizontal",q=F?{x:$,y:H}:{y:$,x:H},Q=this.state.formattedGraphicalItems.find(function(B){var U=B.item;return U.type.name==="Scatter"});Q&&(q=Se(Se({},q),Q.props.points[R].tooltipPosition),D=Q.props.points[R].tooltipPayload);var J={activeTooltipIndex:R,isTooltipActive:!0,activeLabel:I,activePayload:D,activeCoordinate:q};this.setState(J),this.renderCursor(T),this.accessibilityManager.setIndex(R)}}}},{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){l1([Jr(N.children,Mr)],[Jr(this.props.children,Mr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var N=Jr(this.props.children,Mr);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=MZ(_),O={chartX:Math.round(N.pageX-P.left),chartY:Math.round(N.pageY-P.top)},T=_.width/E.offsetWidth||1,R=this.inRange(O.chartX,O.chartY,T);if(!R)return null;var I=this.state,D=I.xAxisMap,$=I.yAxisMap,H=this.getTooltipEventType(),F=hM(this.state,this.props.data,this.props.layout,R);if(H!=="axis"&&D&&$){var q=Kl(D).scale,Q=Kl($).scale,J=q&&q.invert?q.invert(O.chartX):null,B=Q&&Q.invert?Q.invert(O.chartY):null;return Se(Se({},O),{},{xValue:J,yValue:B},F)}return F?Se(Se({},O),F):null}},{key:"inRange",value:function(N,E){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,P=this.props.layout,O=N/_,T=E/_;if(P==="horizontal"||P==="vertical"){var R=this.state.offset,I=O>=R.left&&O<=R.left+R.width&&T>=R.top&&T<=R.top+R.height;return I?{x:O,y:T}:null}var D=this.state,$=D.angleAxisMap,H=D.radiusAxisMap;if($&&H){var F=Kl($);return w2({x:O,y:T},F)}return null}},{key:"parseEventsOfWrapper",value:function(){var N=this.props.children,E=this.getTooltipEventType(),_=Jr(N,Mr),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=Dh(this.props,this.handleOuterEvent);return Se(Se({},O),P)}},{key:"addListener",value:function(){_j.on(Ej,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){_j.removeListener(Ej,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(N,E,_){for(var P=this.state.formattedGraphicalItems,O=0,T=P.length;O<T;O++){var R=P[O];if(R.item===N||R.props.key===N.key||E===Gs(R.item.type)&&_===R.childIndex)return R}return null}},{key:"renderClipPath",value:function(){var N=this.clipPathId,E=this.state.offset,_=E.left,P=E.top,O=E.height,T=E.width;return W.createElement("defs",null,W.createElement("clipPath",{id:N},W.createElement("rect",{x:_,y:P,height:O,width:T})))}},{key:"getXScales",value:function(){var N=this.state.xAxisMap;return N?Object.entries(N).reduce(function(E,_){var P=dM(_,2),O=P[0],T=P[1];return Se(Se({},E),{},xt({},O,T.scale))},{}):null}},{key:"getYScales",value:function(){var N=this.state.yAxisMap;return N?Object.entries(N).reduce(function(E,_){var P=dM(_,2),O=P[0],T=P[1];return Se(Se({},E),{},xt({},O,T.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,T=_.length;O<T;O++){var R=_[O],I=R.props,D=R.item,$=D.type.defaultProps!==void 0?Se(Se({},D.type.defaultProps),D.props):D.props,H=Gs(D.type);if(H==="Bar"){var F=(I.data||[]).find(function(B){return noe(N,B)});if(F)return{graphicalItem:R,payload:F}}else if(H==="RadialBar"){var q=(I.data||[]).find(function(B){return w2(N,B)});if(q)return{graphicalItem:R,payload:q}}else if(Yv(R,P)||Xv(R,P)||nf(R,P)){var Q=Cle({graphicalItem:R,activeTooltipItem:P,itemData:$.data}),J=$.activeIndex===void 0?Q:$.activeIndex;return{graphicalItem:Se(Se({},R),{},{childIndex:J}),payload:nf(R,P)?$.data[Q]:R.props.data[Q]}}}return null}},{key:"render",value:function(){var N=this;if(!Tk(this))return null;var E=this.props,_=E.children,P=E.className,O=E.width,T=E.height,R=E.style,I=E.compact,D=E.title,$=E.desc,H=fM(E,zde),F=gt(H,!1);if(I)return W.createElement(GI,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},W.createElement(u1,tc({},F,{width:O,height:T,title:D,desc:$}),this.renderClipPath(),Ik(_,this.renderMap)));if(this.props.accessibilityLayer){var q,Q;F.tabIndex=(q=this.props.tabIndex)!==null&&q!==void 0?q:0,F.role=(Q=this.props.role)!==null&&Q!==void 0?Q:"application",F.onKeyDown=function(B){N.accessibilityManager.keyboardEvent(B)},F.onFocus=function(){N.accessibilityManager.focus()}}var J=this.parseEventsOfWrapper();return W.createElement(GI,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},W.createElement("div",tc({className:_t("recharts-wrapper",P),style:Se({position:"relative",cursor:"default",width:O,height:T},R)},J,{ref:function(U){N.container=U}}),W.createElement(u1,tc({},F,{width:O,height:T,title:D,desc:$,style:afe}),this.renderClipPath(),Ik(_,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(v.Component);xt(j,"displayName",n),xt(j,"defaultProps",Se({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},p)),xt(j,"getDerivedStateFromProps",function(y,S){var C=y.dataKey,N=y.data,E=y.children,_=y.width,P=y.height,O=y.layout,T=y.stackOffset,R=y.margin,I=S.dataStartIndex,D=S.dataEndIndex;if(S.updateId===void 0){var $=mM(y);return Se(Se(Se({},$),{},{updateId:0},g(Se(Se({props:y},$),{},{updateId:0}),S)),{},{prevDataKey:C,prevData:N,prevWidth:_,prevHeight:P,prevLayout:O,prevStackOffset:T,prevMargin:R,prevChildren:E})}if(C!==S.prevDataKey||N!==S.prevData||_!==S.prevWidth||P!==S.prevHeight||O!==S.prevLayout||T!==S.prevStackOffset||!oc(R,S.prevMargin)){var H=mM(y),F={chartX:S.chartX,chartY:S.chartY,isTooltipActive:S.isTooltipActive},q=Se(Se({},hM(S,N,O)),{},{updateId:S.updateId+1}),Q=Se(Se(Se({},H),F),q);return Se(Se(Se({},Q),g(Se({props:y},Q),S)),{},{prevDataKey:C,prevData:N,prevWidth:_,prevHeight:P,prevLayout:O,prevStackOffset:T,prevMargin:R,prevChildren:E})}if(!l1(E,S.prevChildren)){var J,B,U,Z,z=Jr(E,Tc),L=z&&(J=(B=z.props)===null||B===void 0?void 0:B.startIndex)!==null&&J!==void 0?J:I,ee=z&&(U=(Z=z.props)===null||Z===void 0?void 0:Z.endIndex)!==null&&U!==void 0?U:D,se=L!==I||ee!==D,G=!At(N),ue=G&&!se?S.updateId:S.updateId+1;return Se(Se({updateId:ue},g(Se(Se({props:y},S),{},{updateId:ue,dataStartIndex:L,dataEndIndex:ee}),S)),{},{prevChildren:E,dataStartIndex:L,dataEndIndex:ee})}return null}),xt(j,"renderActiveDot",function(y,S,C){var N;return v.isValidElement(y)?N=v.cloneElement(y,S):Ct(y)?N=y(S):N=W.createElement(Wv,S),W.createElement(qt,{className:"recharts-active-dot",key:C},N)});var b=v.forwardRef(function(S,C){return W.createElement(j,tc({},S,{ref:C}))});return b.displayName=j.displayName,b},_S=gC({chartName:"LineChart",GraphicalChild:Uo,axisComponents:[{axisType:"xAxis",AxisComp:Vi},{axisType:"yAxis",AxisComp:Hi}],formatAxisMap:S4}),hfe=gC({chartName:"BarChart",GraphicalChild:il,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Vi},{axisType:"yAxis",AxisComp:Hi}],formatAxisMap:S4}),mfe=gC({chartName:"PieChart",GraphicalChild:oi,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Gv},{axisType:"radiusAxis",AxisComp:Hv}],formatAxisMap:pae,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const vfe=()=>{const{configs:e}=Nf(),{source:t}=Tn(),[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(A$,{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(ne,{asChild:!0,children:s.jsxs(bt,{to:"/mcp-evaluations/new",children:[s.jsx(XS,{className:"mr-2 h-4 w-4"}),"New MCP Evaluation"]})}),s.jsx(ne,{variant:"outline",asChild:!0,children:s.jsxs(bt,{to:"/run",children:[s.jsx(ko,{className:"mr-2 h-4 w-4"}),"Run Evaluation"]})}),s.jsx(ne,{variant:"outline",asChild:!0,children:s.jsxs(bt,{to:"/results",children:[s.jsx(wd,{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(os,{title:"MCP Evaluations",value:f,icon:Uj,subtitle:`${f} active`}),s.jsx(os,{title:"Total Runs",value:h,icon:w$,subtitle:"Last 30 days"}),s.jsx(os,{title:"Pass Rate",value:`${Math.round(p*100)}%`,icon:wd,subtitle:"+5% from last week",trend:"up"}),s.jsx(os,{title:"Avg Latency",value:`${x}ms`,icon:O$,subtitle:"-120ms from last week",trend:"up"})]}),s.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Pass Rate Trend"})}),s.jsx(qe,{children:s.jsx(Kh,{width:"100%",height:200,children:s.jsxs(_S,{data:j,children:[s.jsx(Vi,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(Hi,{domain:[0,100],tick:{fontSize:11},tickLine:!1,axisLine:!1,tickFormatter:y=>`${y}%`}),s.jsx(Mr,{formatter:y=>[`${y}%`,"Pass Rate"]}),s.jsx(Uo,{type:"monotone",dataKey:"passRate",stroke:"hsl(38, 92%, 50%)",strokeWidth:2,dot:{r:3,fill:"hsl(38, 92%, 50%)"}})]})})})]}),s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Recent Tool Latency (ms)"})}),s.jsx(qe,{children:s.jsx(Kh,{width:"100%",height:200,children:s.jsxs(_S,{data:j,children:[s.jsx(Vi,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(Hi,{tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(Mr,{formatter:y=>[`${y}ms`,"Latency"]}),s.jsx(Uo,{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(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Recent Runs"})}),s.jsx(qe,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs($t,{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(fs,{className:"h-3.5 w-3.5"}):s.jsx(Dt,{className:"h-3.5 w-3.5"}):s.jsx(nc,{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(fs,{className:"h-3.5 w-3.5"}):s.jsx(Dt,{className:"h-3.5 w-3.5"}):s.jsx(nc,{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(fs,{className:"h-3.5 w-3.5"}):s.jsx(Dt,{className:"h-3.5 w-3.5"}):s.jsx(nc,{className:"h-3.5 w-3.5 text-muted-foreground"})]})})]})}),s.jsx(Lr,{children:g.map(y=>s.jsxs($t,{className:"cursor-pointer",children:[s.jsx(ze,{children:s.jsx(bt,{to:`/results/${y.id}`,className:"font-mono text-xs text-primary hover:underline",children:y.id})}),s.jsx(ze,{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(ze,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(vf,{className:"h-3 w-3"}),new Date(y.timestamp).toLocaleString()]})}),s.jsx(ze,{children:s.jsx(Vs,{rate:y.overallPassRate})}),s.jsx(ze,{className:"text-right font-mono text-sm",children:y.totalScenarios})]},y.id))})]})})]})})]})};function xC({value:e,onValueChange:t,placeholder:n="Search...",className:r,inputClassName:a,clearAriaLabel:i="Clear search"}){return s.jsxs("div",{className:Ne("relative",r),children:[s.jsx(ft,{value:e,onChange:o=>t(o.target.value),placeholder:n,className:Ne("h-9 w-[240px] pr-8",a)}),e&&s.jsx(ne,{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(ys,{className:"h-4 w-4"})})]})}var gfe=v.createContext(void 0);function cu(e){const t=v.useContext(gfe);return e||t||"ltr"}var kj="rovingFocusGroup.onEntryFocus",xfe={bubbles:!1,cancelable:!0},If="RovingFocusGroup",[ES,iF,yfe]=hf(If),[bfe,ag]=lr(If,[yfe]),[wfe,jfe]=bfe(If),oF=v.forwardRef((e,t)=>s.jsx(ES.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(ES.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(Sfe,{...e,ref:t})})}));oF.displayName=If;var Sfe=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=vt(t,x),j=cu(i),[b,y]=oa({prop:o,defaultProp:c??null,onChange:d,caller:If}),[S,C]=v.useState(!1),N=On(f),E=iF(n),_=v.useRef(!1),[P,O]=v.useState(0);return v.useEffect(()=>{const T=x.current;if(T)return T.addEventListener(kj,N),()=>T.removeEventListener(kj,N)},[N]),s.jsx(wfe,{scope:n,orientation:r,dir:j,loop:a,currentTabStopId:b,onItemFocus:v.useCallback(T=>y(T),[y]),onItemShiftTab:v.useCallback(()=>C(!0),[]),onFocusableItemAdd:v.useCallback(()=>O(T=>T+1),[]),onFocusableItemRemove:v.useCallback(()=>O(T=>T-1),[]),children:s.jsx(Ke.div,{tabIndex:S||P===0?-1:0,"data-orientation":r,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:Re(e.onMouseDown,()=>{_.current=!0}),onFocus:Re(e.onFocus,T=>{const R=!_.current;if(T.target===T.currentTarget&&R&&!S){const I=new CustomEvent(kj,xfe);if(T.currentTarget.dispatchEvent(I),!I.defaultPrevented){const D=E().filter(Q=>Q.focusable),$=D.find(Q=>Q.active),H=D.find(Q=>Q.id===b),q=[$,H,...D].filter(Boolean).map(Q=>Q.ref.current);uF(q,h)}}_.current=!1}),onBlur:Re(e.onBlur,()=>C(!1))})})}),lF="RovingFocusGroupItem",cF=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:i,children:o,...c}=e,d=Wn(),f=i||d,h=jfe(lF,n),p=h.currentTabStopId===f,x=iF(n),{onFocusableItemAdd:g,onFocusableItemRemove:j,currentTabStopId:b}=h;return v.useEffect(()=>{if(r)return g(),()=>j()},[r,g,j]),s.jsx(ES.ItemSlot,{scope:n,id:f,focusable:r,active:a,children:s.jsx(Ke.span,{tabIndex:p?0:-1,"data-orientation":h.orientation,...c,ref:t,onMouseDown:Re(e.onMouseDown,y=>{r?h.onItemFocus(f):y.preventDefault()}),onFocus:Re(e.onFocus,()=>h.onItemFocus(f)),onKeyDown:Re(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){h.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const S=Afe(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?_fe(N,E+1):N.slice(E+1)}setTimeout(()=>uF(N))}}),children:typeof o=="function"?o({isCurrentTabStop:p,hasTabStop:b!=null}):o})})});cF.displayName=lF;var Nfe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Cfe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Afe(e,t,n){const r=Cfe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Nfe[r]}function uF(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function _fe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var dF=oF,fF=cF;function Efe(e){const t=Pfe(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(Ofe);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function Pfe(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=Rfe(a),c=Tfe(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Cr(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 kfe=Symbol("radix.slottable");function Ofe(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kfe}function Tfe(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 Rfe(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 PS=["Enter"," "],Ife=["ArrowDown","PageUp","Home"],pF=["ArrowUp","PageDown","End"],Mfe=[...Ife,...pF],$fe={ltr:[...PS,"ArrowRight"],rtl:[...PS,"ArrowLeft"]},Dfe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Mf="Menu",[uf,Lfe,Ffe]=hf(Mf),[ol,hF]=lr(Mf,[Ffe,Gi,ag]),sg=Gi(),mF=ag(),[Bfe,ll]=ol(Mf),[zfe,$f]=ol(Mf),vF=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:i,modal:o=!0}=e,c=sg(t),[d,f]=v.useState(null),h=v.useRef(!1),p=On(i),x=cu(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(tv,{...c,children:s.jsx(Bfe,{scope:t,open:n,onOpenChange:p,content:d,onContentChange:f,children:s.jsx(zfe,{scope:t,onClose:v.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:h,dir:x,modal:o,children:r})})})};vF.displayName=Mf;var Ufe="MenuAnchor",yC=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=sg(n);return s.jsx(xf,{...a,...r,ref:t})});yC.displayName=Ufe;var bC="MenuPortal",[qfe,gF]=ol(bC,{forceMount:void 0}),xF=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,i=ll(bC,t);return s.jsx(qfe,{scope:t,forceMount:n,children:s.jsx(Hn,{present:n||i.open,children:s.jsx(Gc,{asChild:!0,container:a,children:r})})})};xF.displayName=bC;var Sa="MenuContent",[Wfe,wC]=ol(Sa),yF=v.forwardRef((e,t)=>{const n=gF(Sa,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=ll(Sa,e.__scopeMenu),o=$f(Sa,e.__scopeMenu);return s.jsx(uf.Provider,{scope:e.__scopeMenu,children:s.jsx(Hn,{present:r||i.open,children:s.jsx(uf.Slot,{scope:e.__scopeMenu,children:o.modal?s.jsx(Vfe,{...a,ref:t}):s.jsx(Hfe,{...a,ref:t})})})})}),Vfe=v.forwardRef((e,t)=>{const n=ll(Sa,e.__scopeMenu),r=v.useRef(null),a=vt(t,r);return v.useEffect(()=>{const i=r.current;if(i)return mv(i)},[]),s.jsx(jC,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Re(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Hfe=v.forwardRef((e,t)=>{const n=ll(Sa,e.__scopeMenu);return s.jsx(jC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Kfe=Efe("MenuContent.ScrollLock"),jC=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=ll(Sa,n),S=$f(Sa,n),C=sg(n),N=mF(n),E=Lfe(n),[_,P]=v.useState(null),O=v.useRef(null),T=vt(t,O,y.onContentChange),R=v.useRef(0),I=v.useRef(""),D=v.useRef(0),$=v.useRef(null),H=v.useRef("right"),F=v.useRef(0),q=j?bf:v.Fragment,Q=j?{as:Kfe,allowPinchZoom:!0}:void 0,J=U=>{const Z=I.current+U,z=E().filter(le=>!le.disabled),L=document.activeElement,ee=z.find(le=>le.ref.current===L)?.textValue,se=z.map(le=>le.textValue),G=spe(se,Z,ee),ue=z.find(le=>le.textValue===G)?.ref.current;(function le(oe){I.current=oe,window.clearTimeout(R.current),oe!==""&&(R.current=window.setTimeout(()=>le(""),1e3))})(Z),ue&&setTimeout(()=>ue.focus())};v.useEffect(()=>()=>window.clearTimeout(R.current),[]),pv();const B=v.useCallback(U=>H.current===$.current?.side&&ope(U,$.current?.area),[]);return s.jsx(Wfe,{scope:n,searchRef:I,onItemEnter:v.useCallback(U=>{B(U)&&U.preventDefault()},[B]),onItemLeave:v.useCallback(U=>{B(U)||(O.current?.focus(),P(null))},[B]),onTriggerLeave:v.useCallback(U=>{B(U)&&U.preventDefault()},[B]),pointerGraceTimerRef:D,onPointerGraceIntentChange:v.useCallback(U=>{$.current=U},[]),children:s.jsx(q,{...Q,children:s.jsx(yf,{asChild:!0,trapped:a,onMountAutoFocus:Re(i,U=>{U.preventDefault(),O.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:s.jsx(Jo,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:x,onDismiss:g,children:s.jsx(dF,{asChild:!0,...N,dir:S.dir,orientation:"vertical",loop:r,currentTabStopId:_,onCurrentTabStopIdChange:P,onEntryFocus:Re(d,U=>{S.isUsingKeyboardRef.current||U.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(nv,{role:"menu","aria-orientation":"vertical","data-state":MF(y.open),"data-radix-menu-content":"",dir:S.dir,...C,...b,ref:T,style:{outline:"none",...b.style},onKeyDown:Re(b.onKeyDown,U=>{const z=U.target.closest("[data-radix-menu-content]")===U.currentTarget,L=U.ctrlKey||U.altKey||U.metaKey,ee=U.key.length===1;z&&(U.key==="Tab"&&U.preventDefault(),!L&&ee&&J(U.key));const se=O.current;if(U.target!==se||!Mfe.includes(U.key))return;U.preventDefault();const ue=E().filter(le=>!le.disabled).map(le=>le.ref.current);pF.includes(U.key)&&ue.reverse(),rpe(ue)}),onBlur:Re(e.onBlur,U=>{U.currentTarget.contains(U.target)||(window.clearTimeout(R.current),I.current="")}),onPointerMove:Re(e.onPointerMove,df(U=>{const Z=U.target,z=F.current!==U.clientX;if(U.currentTarget.contains(Z)&&z){const L=U.clientX>F.current?"right":"left";H.current=L,F.current=U.clientX}}))})})})})})})});yF.displayName=Sa;var Gfe="MenuGroup",SC=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(Ke.div,{role:"group",...r,ref:t})});SC.displayName=Gfe;var Yfe="MenuLabel",bF=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(Ke.div,{...r,ref:t})});bF.displayName=Yfe;var Dm="MenuItem",gM="menu.itemSelect",ig=v.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...a}=e,i=v.useRef(null),o=$f(Dm,e.__scopeMenu),c=wC(Dm,e.__scopeMenu),d=vt(t,i),f=v.useRef(!1),h=()=>{const p=i.current;if(!n&&p){const x=new CustomEvent(gM,{bubbles:!0,cancelable:!0});p.addEventListener(gM,g=>r?.(g),{once:!0}),WS(p,x),x.defaultPrevented?f.current=!1:o.onClose()}};return s.jsx(wF,{...a,ref:d,disabled:n,onClick:Re(e.onClick,h),onPointerDown:p=>{e.onPointerDown?.(p),f.current=!0},onPointerUp:Re(e.onPointerUp,p=>{f.current||p.currentTarget?.click()}),onKeyDown:Re(e.onKeyDown,p=>{const x=c.searchRef.current!=="";n||x&&p.key===" "||PS.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});ig.displayName=Dm;var wF=v.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:a,...i}=e,o=wC(Dm,n),c=mF(n),d=v.useRef(null),f=vt(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(uf.ItemSlot,{scope:n,disabled:r,textValue:a??x,children:s.jsx(fF,{asChild:!0,...c,focusable:!r,children:s.jsx(Ke.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:f,onPointerMove:Re(e.onPointerMove,df(j=>{r?o.onItemLeave(j):(o.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Re(e.onPointerLeave,df(j=>o.onItemLeave(j))),onFocus:Re(e.onFocus,()=>p(!0)),onBlur:Re(e.onBlur,()=>p(!1))})})})}),Xfe="MenuCheckboxItem",jF=v.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...a}=e;return s.jsx(_F,{scope:e.__scopeMenu,checked:n,children:s.jsx(ig,{role:"menuitemcheckbox","aria-checked":Lm(n)?"mixed":n,...a,ref:t,"data-state":CC(n),onSelect:Re(a.onSelect,()=>r?.(Lm(n)?!0:!n),{checkForDefaultPrevented:!1})})})});jF.displayName=Xfe;var SF="MenuRadioGroup",[Qfe,Jfe]=ol(SF,{value:void 0,onValueChange:()=>{}}),NF=v.forwardRef((e,t)=>{const{value:n,onValueChange:r,...a}=e,i=On(r);return s.jsx(Qfe,{scope:e.__scopeMenu,value:n,onValueChange:i,children:s.jsx(SC,{...a,ref:t})})});NF.displayName=SF;var CF="MenuRadioItem",AF=v.forwardRef((e,t)=>{const{value:n,...r}=e,a=Jfe(CF,e.__scopeMenu),i=n===a.value;return s.jsx(_F,{scope:e.__scopeMenu,checked:i,children:s.jsx(ig,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":CC(i),onSelect:Re(r.onSelect,()=>a.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});AF.displayName=CF;var NC="MenuItemIndicator",[_F,Zfe]=ol(NC,{checked:!1}),EF=v.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...a}=e,i=Zfe(NC,n);return s.jsx(Hn,{present:r||Lm(i.checked)||i.checked===!0,children:s.jsx(Ke.span,{...a,ref:t,"data-state":CC(i.checked)})})});EF.displayName=NC;var epe="MenuSeparator",PF=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(Ke.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});PF.displayName=epe;var tpe="MenuArrow",kF=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=sg(n);return s.jsx(rv,{...a,...r,ref:t})});kF.displayName=tpe;var npe="MenuSub",[Vge,OF]=ol(npe),cd="MenuSubTrigger",TF=v.forwardRef((e,t)=>{const n=ll(cd,e.__scopeMenu),r=$f(cd,e.__scopeMenu),a=OF(cd,e.__scopeMenu),i=wC(cd,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(yC,{asChild:!0,...f,children:s.jsx(wF,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":MF(n.open),...e,ref:Cr(t,a.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Re(e.onPointerMove,df(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:Re(e.onPointerLeave,df(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:Re(e.onKeyDown,p=>{const x=i.searchRef.current!=="";e.disabled||x&&p.key===" "||$fe[r.dir].includes(p.key)&&(n.onOpenChange(!0),n.content?.focus(),p.preventDefault())})})})});TF.displayName=cd;var RF="MenuSubContent",IF=v.forwardRef((e,t)=>{const n=gF(Sa,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=ll(Sa,e.__scopeMenu),o=$f(Sa,e.__scopeMenu),c=OF(RF,e.__scopeMenu),d=v.useRef(null),f=vt(t,d);return s.jsx(uf.Provider,{scope:e.__scopeMenu,children:s.jsx(Hn,{present:r||i.open,children:s.jsx(uf.Slot,{scope:e.__scopeMenu,children:s.jsx(jC,{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:Re(e.onFocusOutside,h=>{h.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Re(e.onEscapeKeyDown,h=>{o.onClose(),h.preventDefault()}),onKeyDown:Re(e.onKeyDown,h=>{const p=h.currentTarget.contains(h.target),x=Dfe[o.dir].includes(h.key);p&&x&&(i.onOpenChange(!1),c.trigger?.focus(),h.preventDefault())})})})})})});IF.displayName=RF;function MF(e){return e?"open":"closed"}function Lm(e){return e==="indeterminate"}function CC(e){return Lm(e)?"indeterminate":e?"checked":"unchecked"}function rpe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ape(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function spe(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=ape(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 ipe(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 ope(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return ipe(n,t)}function df(e){return t=>t.pointerType==="mouse"?e(t):void 0}var lpe=vF,cpe=yC,upe=xF,dpe=yF,fpe=SC,ppe=bF,hpe=ig,mpe=jF,vpe=NF,gpe=AF,xpe=EF,ype=PF,bpe=kF,wpe=TF,jpe=IF,og="DropdownMenu",[Spe]=lr(og,[hF]),Ar=hF(),[Npe,$F]=Spe(og),DF=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:i,onOpenChange:o,modal:c=!0}=e,d=Ar(t),f=v.useRef(null),[h,p]=oa({prop:a,defaultProp:i??!1,onChange:o,caller:og});return s.jsx(Npe,{scope:t,triggerId:Wn(),triggerRef:f,contentId:Wn(),open:h,onOpenChange:p,onOpenToggle:v.useCallback(()=>p(x=>!x),[p]),modal:c,children:s.jsx(lpe,{...d,open:h,onOpenChange:p,dir:r,modal:c,children:n})})};DF.displayName=og;var LF="DropdownMenuTrigger",FF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...a}=e,i=$F(LF,n),o=Ar(n);return s.jsx(cpe,{asChild:!0,...o,children:s.jsx(Ke.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:Cr(t,i.triggerRef),onPointerDown:Re(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(i.onOpenToggle(),i.open||c.preventDefault())}),onKeyDown:Re(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&i.onOpenToggle(),c.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});FF.displayName=LF;var Cpe="DropdownMenuPortal",BF=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Ar(t);return s.jsx(upe,{...r,...n})};BF.displayName=Cpe;var zF="DropdownMenuContent",UF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=$F(zF,n),i=Ar(n),o=v.useRef(!1);return s.jsx(dpe,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...r,ref:t,onCloseAutoFocus:Re(e.onCloseAutoFocus,c=>{o.current||a.triggerRef.current?.focus(),o.current=!1,c.preventDefault()}),onInteractOutside:Re(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)"}})});UF.displayName=zF;var Ape="DropdownMenuGroup",_pe=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(fpe,{...a,...r,ref:t})});_pe.displayName=Ape;var Epe="DropdownMenuLabel",qF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(ppe,{...a,...r,ref:t})});qF.displayName=Epe;var Ppe="DropdownMenuItem",WF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(hpe,{...a,...r,ref:t})});WF.displayName=Ppe;var kpe="DropdownMenuCheckboxItem",VF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(mpe,{...a,...r,ref:t})});VF.displayName=kpe;var Ope="DropdownMenuRadioGroup",Tpe=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(vpe,{...a,...r,ref:t})});Tpe.displayName=Ope;var Rpe="DropdownMenuRadioItem",HF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(gpe,{...a,...r,ref:t})});HF.displayName=Rpe;var Ipe="DropdownMenuItemIndicator",KF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(xpe,{...a,...r,ref:t})});KF.displayName=Ipe;var Mpe="DropdownMenuSeparator",GF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(ype,{...a,...r,ref:t})});GF.displayName=Mpe;var $pe="DropdownMenuArrow",Dpe=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(bpe,{...a,...r,ref:t})});Dpe.displayName=$pe;var Lpe="DropdownMenuSubTrigger",YF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(wpe,{...a,...r,ref:t})});YF.displayName=Lpe;var Fpe="DropdownMenuSubContent",XF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(jpe,{...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)"}})});XF.displayName=Fpe;var Bpe=DF,zpe=FF,Upe=BF,QF=UF,JF=qF,ZF=WF,eB=VF,tB=HF,nB=KF,rB=GF,aB=YF,sB=XF;const uu=Bpe,du=zpe,qpe=v.forwardRef(({className:e,inset:t,children:n,...r},a)=>s.jsxs(aB,{ref:a,className:Ne("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(j$,{className:"ml-auto h-4 w-4"})]}));qpe.displayName=aB.displayName;const Wpe=v.forwardRef(({className:e,...t},n)=>s.jsx(sB,{ref:n,className:Ne("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}));Wpe.displayName=sB.displayName;const cl=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(Upe,{children:s.jsx(QF,{ref:r,sideOffset:t,className:Ne("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})}));cl.displayName=QF.displayName;const Nr=v.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(ZF,{ref:r,className:Ne("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}));Nr.displayName=ZF.displayName;const Vpe=v.forwardRef(({className:e,children:t,checked:n,...r},a)=>s.jsxs(eB,{ref:a,className:Ne("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(nB,{children:s.jsx(hc,{className:"h-4 w-4"})})}),t]}));Vpe.displayName=eB.displayName;const Hpe=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(tB,{ref:r,className:Ne("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(nB,{children:s.jsx(q7,{className:"h-2 w-2 fill-current"})})}),t]}));Hpe.displayName=tB.displayName;const AC=v.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(JF,{ref:r,className:Ne("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));AC.displayName=JF.displayName;const _C=v.forwardRef(({className:e,...t},n)=>s.jsx(rB,{ref:n,className:Ne("-mx-1 my-1 h-px bg-muted",e),...t}));_C.displayName=rB.displayName;const ql=e=>e.configName?.trim()||e.name,Kpe=()=>{const{configs:e,deleteConfig:t,cloneConfig:n,loading:r,reload:a}=Nf(),i=_a(),[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(_),Oe({title:"Deleted",description:`"${P}" has been removed.`})},b=async _=>{const P=await n(_);Oe({title:"Cloned",description:`Created "${ql(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(_=>[ql(_),_.id,_.description??"",_.loadError??""].join(" ").toLowerCase().includes(x)),[e,x]),N=v.useMemo(()=>[...C].sort((P,O)=>{let T=0;return o==="name"&&(T=ql(P).localeCompare(ql(O))),o==="scenarios"&&(T=S(P)-S(O)),o==="agents"&&(T=y(P)-y(O)),o==="updatedAt"&&(T=new Date(P.updatedAt).getTime()-new Date(O.updatedAt).getTime()),d==="asc"?T:-T}),[C,o,d]),E=_=>o!==_?s.jsx(nc,{className:"h-3.5 w-3.5 text-muted-foreground"}):d==="asc"?s.jsx(fs,{className:"h-3.5 w-3.5"}):s.jsx(Dt,{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(C$,{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(xC,{value:h,onValueChange:p,placeholder:"Search evaluations..."}),s.jsxs(ne,{variant:"outline",size:"sm",onClick:()=>{a()},children:[s.jsx(Na,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(ne,{variant:"outline",size:"sm",children:[s.jsx(X7,{className:"mr-2 h-4 w-4"}),"Import YAML"]}),s.jsx(ne,{size:"sm",asChild:!0,children:s.jsxs(bt,{to:"/mcp-evaluations/new",children:[s.jsx(xs,{className:"mr-2 h-4 w-4"}),"Create New"]})})]})]}),s.jsx(Ue,{children:s.jsx(qe,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs($t,{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(Lr,{children:[N.map(_=>s.jsxs($t,{children:[s.jsx(ze,{children:s.jsxs("div",{children:[s.jsx(bt,{to:`/mcp-evaluations/${_.id}`,className:"font-medium text-sm hover:text-primary",children:ql(_)}),_.loadError&&s.jsxs(Qe,{variant:"destructive",className:"ml-2 align-middle text-[10px]",children:[s.jsx(wh,{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(ze,{className:"text-right font-mono text-sm",children:S(_)}),s.jsx(ze,{className:"text-right font-mono text-sm",children:y(_)}),s.jsx(ze,{className:"text-right text-xs text-muted-foreground",children:new Date(_.updatedAt).toLocaleDateString()}),s.jsx(ze,{children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsx(ne,{size:"sm",variant:"outline",asChild:!0,children:s.jsxs(bt,{to:`/run?configId=${encodeURIComponent(_.id)}`,children:[s.jsx(ko,{className:"h-3.5 w-3.5"}),"Run"]})}),s.jsxs(uu,{children:[s.jsx(du,{asChild:!0,children:s.jsx(ne,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Gm,{className:"h-4 w-4"})})}),s.jsxs(cl,{align:"end",children:[s.jsxs(Nr,{onClick:()=>i(`/mcp-evaluations/${_.id}`),children:[s.jsx(Ym,{className:"mr-2 h-3.5 w-3.5"}),"Edit"]}),s.jsxs(Nr,{onClick:()=>{b(_.id)},children:[s.jsx(Ui,{className:"mr-2 h-3.5 w-3.5"}),"Clone"]}),s.jsxs(Nr,{className:"text-destructive",onClick:()=>{j(_.id,ql(_))},children:[s.jsx(Ca,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]})]})})]},_.id)),!r&&e.length===0&&s.jsx($t,{children:s.jsx(ze,{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($t,{children:s.jsx(ze,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"No MCP evaluations match this filter."})}),r&&s.jsx($t,{children:s.jsx(ze,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"Loading MCP evaluations..."})})]})]})})})]})};var Gpe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ype=Gpe.reduce((e,t)=>{const n=fv(`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}},{}),Xpe="Label",iB=v.forwardRef((e,t)=>s.jsx(Ype.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));iB.displayName=Xpe;var oB=iB;const Qpe=Zo("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Be=v.forwardRef(({className:e,...t},n)=>s.jsx(oB,{ref:n,className:Ne(Qpe(),e),...t}));Be.displayName=oB.displayName;const Wa=v.forwardRef(({className:e,...t},n)=>s.jsx("textarea",{className:Ne("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}));Wa.displayName="Textarea";function lg(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 cg="Switch",[Jpe]=lr(cg),[Zpe,ehe]=Jpe(cg),lB=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=vt(t,N=>g(N)),b=v.useRef(!1),y=x?h||!!x.closest("form"):!0,[S,C]=oa({prop:a,defaultProp:i??!1,onChange:f,caller:cg});return s.jsxs(Zpe,{scope:n,checked:S,disabled:c,children:[s.jsx(Ke.button,{type:"button",role:"switch","aria-checked":S,"aria-required":o,"data-state":fB(S),"data-disabled":c?"":void 0,disabled:c,value:d,...p,ref:j,onClick:Re(e.onClick,N=>{C(E=>!E),y&&(b.current=N.isPropagationStopped(),b.current||N.stopPropagation())})}),y&&s.jsx(dB,{control:x,bubbles:!b.current,name:r,value:d,checked:S,required:o,disabled:c,form:h,style:{transform:"translateX(-100%)"}})]})});lB.displayName=cg;var cB="SwitchThumb",uB=v.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,a=ehe(cB,n);return s.jsx(Ke.span,{"data-state":fB(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});uB.displayName=cB;var the="SwitchBubbleInput",dB=v.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...a},i)=>{const o=v.useRef(null),c=vt(o,i),d=lg(n),f=ev(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}})});dB.displayName=the;function fB(e){return e?"checked":"unchecked"}var pB=lB,nhe=uB;const Fm=v.forwardRef(({className:e,...t},n)=>s.jsx(pB,{className:Ne("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(nhe,{className:Ne("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")})}));Fm.displayName=pB.displayName;var ug="Tabs",[rhe]=lr(ug,[ag]),hB=ag(),[ahe,EC]=rhe(ug),mB=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:o="horizontal",dir:c,activationMode:d="automatic",...f}=e,h=cu(c),[p,x]=oa({prop:r,onChange:a,defaultProp:i??"",caller:ug});return s.jsx(ahe,{scope:n,baseId:Wn(),value:p,onValueChange:x,orientation:o,dir:h,activationMode:d,children:s.jsx(Ke.div,{dir:h,"data-orientation":o,...f,ref:t})})});mB.displayName=ug;var vB="TabsList",gB=v.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,i=EC(vB,n),o=hB(n);return s.jsx(dF,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:r,children:s.jsx(Ke.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});gB.displayName=vB;var xB="TabsTrigger",yB=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,o=EC(xB,n),c=hB(n),d=jB(o.baseId,r),f=SB(o.baseId,r),h=r===o.value;return s.jsx(fF,{asChild:!0,...c,focusable:!a,active:h,children:s.jsx(Ke.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:Re(e.onMouseDown,p=>{!a&&p.button===0&&p.ctrlKey===!1?o.onValueChange(r):p.preventDefault()}),onKeyDown:Re(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&o.onValueChange(r)}),onFocus:Re(e.onFocus,()=>{const p=o.activationMode!=="manual";!h&&!a&&p&&o.onValueChange(r)})})})});yB.displayName=xB;var bB="TabsContent",wB=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:i,...o}=e,c=EC(bB,n),d=jB(c.baseId,r),f=SB(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(Hn,{present:a||h,children:({present:x})=>s.jsx(Ke.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})})});wB.displayName=bB;function jB(e,t){return`${e}-trigger-${t}`}function SB(e,t){return`${e}-content-${t}`}var she=mB,NB=gB,CB=yB,AB=wB;const dg=she,Df=v.forwardRef(({className:e,...t},n)=>s.jsx(NB,{ref:n,className:Ne("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Df.displayName=NB.displayName;const gs=v.forwardRef(({className:e,...t},n)=>s.jsx(CB,{ref:n,className:Ne("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}));gs.displayName=CB.displayName;const ff=v.forwardRef(({className:e,...t},n)=>s.jsx(AB,{ref:n,className:Ne("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));ff.displayName=AB.displayName;const xM={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 _B({provider:e}){return s.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${xM[e]??xM.custom}`,children:e})}function pf(e,[t,n]){return Math.min(n,Math.max(t,e))}function ihe(e){const t=ohe(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(che);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 ohe(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=dhe(a),c=uhe(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Cr(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 lhe=Symbol("radix.slottable");function che(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===lhe}function uhe(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 dhe(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 fhe=[" ","Enter","ArrowUp","ArrowDown"],phe=[" ","Enter"],qo="Select",[fg,pg,hhe]=hf(qo),[fu]=lr(qo,[hhe,Gi]),hg=Gi(),[mhe,to]=fu(qo),[vhe,ghe]=fu(qo),EB=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=hg(t),[y,S]=v.useState(null),[C,N]=v.useState(null),[E,_]=v.useState(!1),P=cu(f),[O,T]=oa({prop:r,defaultProp:a??!1,onChange:i,caller:qo}),[R,I]=oa({prop:o,defaultProp:c,onChange:d,caller:qo}),D=v.useRef(null),$=y?j||!!y.closest("form"):!0,[H,F]=v.useState(new Set),q=Array.from(H).map(Q=>Q.props.value).join(";");return s.jsx(tv,{...b,children:s.jsxs(mhe,{required:g,scope:t,trigger:y,onTriggerChange:S,valueNode:C,onValueNodeChange:N,valueNodeHasChildren:E,onValueNodeHasChildrenChange:_,contentId:Wn(),value:R,onValueChange:I,open:O,onOpenChange:T,dir:P,triggerPointerDownPosRef:D,disabled:x,children:[s.jsx(fg.Provider,{scope:t,children:s.jsx(vhe,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(Q=>{F(J=>new Set(J).add(Q))},[]),onNativeOptionRemove:v.useCallback(Q=>{F(J=>{const B=new Set(J);return B.delete(Q),B})},[]),children:n})}),$?s.jsxs(JB,{"aria-hidden":!0,required:g,tabIndex:-1,name:h,autoComplete:p,value:R,onChange:Q=>I(Q.target.value),disabled:x,form:j,children:[R===void 0?s.jsx("option",{value:""}):null,Array.from(H)]},q):null]})})};EB.displayName=qo;var PB="SelectTrigger",kB=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,i=hg(n),o=to(PB,n),c=o.disabled||r,d=vt(t,o.onTriggerChange),f=pg(n),h=v.useRef("touch"),[p,x,g]=ez(b=>{const y=f().filter(N=>!N.disabled),S=y.find(N=>N.value===o.value),C=tz(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(xf,{asChild:!0,...i,children:s.jsx(Ke.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":ZB(o.value)?"":void 0,...a,ref:d,onClick:Re(a.onClick,b=>{b.currentTarget.focus(),h.current!=="mouse"&&j(b)}),onPointerDown:Re(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:Re(a.onKeyDown,b=>{const y=p.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&x(b.key),!(y&&b.key===" ")&&fhe.includes(b.key)&&(j(),b.preventDefault())})})})});kB.displayName=PB;var OB="SelectValue",TB=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:i,placeholder:o="",...c}=e,d=to(OB,n),{onValueNodeHasChildrenChange:f}=d,h=i!==void 0,p=vt(t,d.onValueNodeChange);return Vn(()=>{f(h)},[f,h]),s.jsx(Ke.span,{...c,ref:p,style:{pointerEvents:"none"},children:ZB(d.value)?s.jsx(s.Fragment,{children:o}):i})});TB.displayName=OB;var xhe="SelectIcon",RB=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return s.jsx(Ke.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});RB.displayName=xhe;var yhe="SelectPortal",IB=e=>s.jsx(Gc,{asChild:!0,...e});IB.displayName=yhe;var Wo="SelectContent",MB=v.forwardRef((e,t)=>{const n=to(Wo,e.__scopeSelect),[r,a]=v.useState();if(Vn(()=>{a(new DocumentFragment)},[]),!n.open){const i=r;return i?Kc.createPortal(s.jsx($B,{scope:e.__scopeSelect,children:s.jsx(fg.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),i):null}return s.jsx(DB,{...e,ref:t})});MB.displayName=Wo;var La=10,[$B,no]=fu(Wo),bhe="SelectContentImpl",whe=ihe("SelectContent.RemoveScroll"),DB=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=to(Wo,n),[N,E]=v.useState(null),[_,P]=v.useState(null),O=vt(t,le=>E(le)),[T,R]=v.useState(null),[I,D]=v.useState(null),$=pg(n),[H,F]=v.useState(!1),q=v.useRef(!1);v.useEffect(()=>{if(N)return mv(N)},[N]),pv();const Q=v.useCallback(le=>{const[oe,...ie]=$().map(re=>re.ref.current),[fe]=ie.slice(-1),Ae=document.activeElement;for(const re of le)if(re===Ae||(re?.scrollIntoView({block:"nearest"}),re===oe&&_&&(_.scrollTop=0),re===fe&&_&&(_.scrollTop=_.scrollHeight),re?.focus(),document.activeElement!==Ae))return},[$,_]),J=v.useCallback(()=>Q([T,N]),[Q,T,N]);v.useEffect(()=>{H&&J()},[H,J]);const{onOpenChange:B,triggerPointerDownPosRef:U}=C;v.useEffect(()=>{if(N){let le={x:0,y:0};const oe=fe=>{le={x:Math.abs(Math.round(fe.pageX)-(U.current?.x??0)),y:Math.abs(Math.round(fe.pageY)-(U.current?.y??0))}},ie=fe=>{le.x<=10&&le.y<=10?fe.preventDefault():N.contains(fe.target)||B(!1),document.removeEventListener("pointermove",oe),U.current=null};return U.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",ie,{capture:!0})}}},[N,B,U]),v.useEffect(()=>{const le=()=>B(!1);return window.addEventListener("blur",le),window.addEventListener("resize",le),()=>{window.removeEventListener("blur",le),window.removeEventListener("resize",le)}},[B]);const[Z,z]=ez(le=>{const oe=$().filter(Ae=>!Ae.disabled),ie=oe.find(Ae=>Ae.ref.current===document.activeElement),fe=tz(oe,le,ie);fe&&setTimeout(()=>fe.ref.current.focus())}),L=v.useCallback((le,oe,ie)=>{const fe=!q.current&&!ie;(C.value!==void 0&&C.value===oe||fe)&&(R(le),fe&&(q.current=!0))},[C.value]),ee=v.useCallback(()=>N?.focus(),[N]),se=v.useCallback((le,oe,ie)=>{const fe=!q.current&&!ie;(C.value!==void 0&&C.value===oe||fe)&&D(le)},[C.value]),G=r==="popper"?kS:LB,ue=G===kS?{side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:x,collisionPadding:g,sticky:j,hideWhenDetached:b,avoidCollisions:y}:{};return s.jsx($B,{scope:n,content:N,viewport:_,onViewportChange:P,itemRefCallback:L,selectedItem:T,onItemLeave:ee,itemTextRefCallback:se,focusSelectedItem:J,selectedItemText:I,position:r,isPositioned:H,searchRef:Z,children:s.jsx(bf,{as:whe,allowPinchZoom:!0,children:s.jsx(yf,{asChild:!0,trapped:C.open,onMountAutoFocus:le=>{le.preventDefault()},onUnmountAutoFocus:Re(a,le=>{C.trigger?.focus({preventScroll:!0}),le.preventDefault()}),children:s.jsx(Jo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:le=>le.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:s.jsx(G,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:le=>le.preventDefault(),...S,...ue,onPlaced:()=>F(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:Re(S.onKeyDown,le=>{const oe=le.ctrlKey||le.altKey||le.metaKey;if(le.key==="Tab"&&le.preventDefault(),!oe&&le.key.length===1&&z(le.key),["ArrowUp","ArrowDown","Home","End"].includes(le.key)){let fe=$().filter(Ae=>!Ae.disabled).map(Ae=>Ae.ref.current);if(["ArrowUp","End"].includes(le.key)&&(fe=fe.slice().reverse()),["ArrowUp","ArrowDown"].includes(le.key)){const Ae=le.target,re=fe.indexOf(Ae);fe=fe.slice(re+1)}setTimeout(()=>Q(fe)),le.preventDefault()}})})})})})})});DB.displayName=bhe;var jhe="SelectItemAlignedPosition",LB=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,i=to(Wo,n),o=no(Wo,n),[c,d]=v.useState(null),[f,h]=v.useState(null),p=vt(t,O=>h(O)),x=pg(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(),T=f.getBoundingClientRect(),R=i.valueNode.getBoundingClientRect(),I=S.getBoundingClientRect();if(i.dir!=="rtl"){const Ae=I.left-T.left,re=R.left-Ae,Te=O.left-re,_e=O.width+Te,Ge=Math.max(_e,T.width),je=window.innerWidth-La,Me=pf(re,[La,Math.max(La,je-Ge)]);c.style.minWidth=_e+"px",c.style.left=Me+"px"}else{const Ae=T.right-I.right,re=window.innerWidth-R.right-Ae,Te=window.innerWidth-O.right-re,_e=O.width+Te,Ge=Math.max(_e,T.width),je=window.innerWidth-La,Me=pf(re,[La,Math.max(La,je-Ge)]);c.style.minWidth=_e+"px",c.style.right=Me+"px"}const D=x(),$=window.innerHeight-La*2,H=b.scrollHeight,F=window.getComputedStyle(f),q=parseInt(F.borderTopWidth,10),Q=parseInt(F.paddingTop,10),J=parseInt(F.borderBottomWidth,10),B=parseInt(F.paddingBottom,10),U=q+Q+H+B+J,Z=Math.min(y.offsetHeight*5,U),z=window.getComputedStyle(b),L=parseInt(z.paddingTop,10),ee=parseInt(z.paddingBottom,10),se=O.top+O.height/2-La,G=$-se,ue=y.offsetHeight/2,le=y.offsetTop+ue,oe=q+Q+le,ie=U-oe;if(oe<=se){const Ae=D.length>0&&y===D[D.length-1].ref.current;c.style.bottom="0px";const re=f.clientHeight-b.offsetTop-b.offsetHeight,Te=Math.max(G,ue+(Ae?ee:0)+re+J),_e=oe+Te;c.style.height=_e+"px"}else{const Ae=D.length>0&&y===D[0].ref.current;c.style.top="0px";const Te=Math.max(se,q+b.offsetTop+(Ae?L:0)+ue)+ie;c.style.height=Te+"px",b.scrollTop=oe-se+b.offsetTop}c.style.margin=`${La}px 0`,c.style.minHeight=Z+"px",c.style.maxHeight=$+"px",r?.(),requestAnimationFrame(()=>g.current=!0)}},[x,i.trigger,i.valueNode,c,f,b,y,S,i.dir,r]);Vn(()=>N(),[N]);const[E,_]=v.useState();Vn(()=>{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(Nhe,{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(Ke.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});LB.displayName=jhe;var She="SelectPopperPosition",kS=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=La,...i}=e,o=hg(n);return s.jsx(nv,{...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)"}})});kS.displayName=She;var[Nhe,PC]=fu(Wo,{}),OS="SelectViewport",FB=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,i=no(OS,n),o=PC(OS,n),c=vt(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(fg.Slot,{scope:n,children:s.jsx(Ke.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Re(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-La*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})})})]})});FB.displayName=OS;var BB="SelectGroup",[Che,Ahe]=fu(BB),_he=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Wn();return s.jsx(Che,{scope:n,id:a,children:s.jsx(Ke.div,{role:"group","aria-labelledby":a,...r,ref:t})})});_he.displayName=BB;var zB="SelectLabel",UB=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Ahe(zB,n);return s.jsx(Ke.div,{id:a.id,...r,ref:t})});UB.displayName=zB;var Bm="SelectItem",[Ehe,qB]=fu(Bm),WB=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:i,...o}=e,c=to(Bm,n),d=no(Bm,n),f=c.value===r,[h,p]=v.useState(i??""),[x,g]=v.useState(!1),j=vt(t,C=>d.itemRefCallback?.(C,r,a)),b=Wn(),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(Ehe,{scope:n,value:r,disabled:a,textId:b,isSelected:f,onItemTextChange:v.useCallback(C=>{p(N=>N||(C?.textContent??"").trim())},[]),children:s.jsx(fg.ItemSlot,{scope:n,value:r,disabled:a,textValue:h,children:s.jsx(Ke.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:Re(o.onFocus,()=>g(!0)),onBlur:Re(o.onBlur,()=>g(!1)),onClick:Re(o.onClick,()=>{y.current!=="mouse"&&S()}),onPointerUp:Re(o.onPointerUp,()=>{y.current==="mouse"&&S()}),onPointerDown:Re(o.onPointerDown,C=>{y.current=C.pointerType}),onPointerMove:Re(o.onPointerMove,C=>{y.current=C.pointerType,a?d.onItemLeave?.():y.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Re(o.onPointerLeave,C=>{C.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Re(o.onKeyDown,C=>{d.searchRef?.current!==""&&C.key===" "||(phe.includes(C.key)&&S(),C.key===" "&&C.preventDefault())})})})})});WB.displayName=Bm;var ud="SelectItemText",VB=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...i}=e,o=to(ud,n),c=no(ud,n),d=qB(ud,n),f=ghe(ud,n),[h,p]=v.useState(null),x=vt(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 Vn(()=>(b(j),()=>y(j)),[b,y,j]),s.jsxs(s.Fragment,{children:[s.jsx(Ke.span,{id:d.textId,...i,ref:x}),d.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Kc.createPortal(i.children,o.valueNode):null]})});VB.displayName=ud;var HB="SelectItemIndicator",KB=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return qB(HB,n).isSelected?s.jsx(Ke.span,{"aria-hidden":!0,...r,ref:t}):null});KB.displayName=HB;var TS="SelectScrollUpButton",GB=v.forwardRef((e,t)=>{const n=no(TS,e.__scopeSelect),r=PC(TS,e.__scopeSelect),[a,i]=v.useState(!1),o=vt(t,r.onScrollButtonChange);return Vn(()=>{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(XB,{...e,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});GB.displayName=TS;var RS="SelectScrollDownButton",YB=v.forwardRef((e,t)=>{const n=no(RS,e.__scopeSelect),r=PC(RS,e.__scopeSelect),[a,i]=v.useState(!1),o=vt(t,r.onScrollButtonChange);return Vn(()=>{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(XB,{...e,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});YB.displayName=RS;var XB=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,i=no("SelectScrollButton",n),o=v.useRef(null),c=pg(n),d=v.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return v.useEffect(()=>()=>d(),[d]),Vn(()=>{c().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),s.jsx(Ke.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:Re(a.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Re(a.onPointerMove,()=>{i.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Re(a.onPointerLeave,()=>{d()})})}),Phe="SelectSeparator",QB=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(Ke.div,{"aria-hidden":!0,...r,ref:t})});QB.displayName=Phe;var IS="SelectArrow",khe=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=hg(n),i=to(IS,n),o=no(IS,n);return i.open&&o.position==="popper"?s.jsx(rv,{...a,...r,ref:t}):null});khe.displayName=IS;var Ohe="SelectBubbleInput",JB=v.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=v.useRef(null),i=vt(r,a),o=lg(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(Ke.select,{...n,style:{...ZM,...n.style},ref:i,defaultValue:t})});JB.displayName=Ohe;function ZB(e){return e===""||e===void 0}function ez(e){const t=On(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 tz(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=The(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 The(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Rhe=EB,nz=kB,Ihe=TB,Mhe=RB,$he=IB,rz=MB,Dhe=FB,az=UB,sz=WB,Lhe=VB,Fhe=KB,iz=GB,oz=YB,lz=QB;const wn=Rhe,jn=Ihe,mn=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(nz,{ref:r,className:Ne("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(Mhe,{asChild:!0,children:s.jsx(Dt,{className:"h-4 w-4 opacity-50"})})]}));mn.displayName=nz.displayName;const cz=v.forwardRef(({className:e,...t},n)=>s.jsx(iz,{ref:n,className:Ne("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(fs,{className:"h-4 w-4"})}));cz.displayName=iz.displayName;const uz=v.forwardRef(({className:e,...t},n)=>s.jsx(oz,{ref:n,className:Ne("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Dt,{className:"h-4 w-4"})}));uz.displayName=oz.displayName;const vn=v.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>s.jsx($he,{children:s.jsxs(rz,{ref:a,className:Ne("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(cz,{}),s.jsx(Dhe,{className:Ne("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(uz,{})]})}));vn.displayName=rz.displayName;const Bhe=v.forwardRef(({className:e,...t},n)=>s.jsx(az,{ref:n,className:Ne("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Bhe.displayName=az.displayName;const mt=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(sz,{ref:r,className:Ne("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(Fhe,{children:s.jsx(hc,{className:"h-4 w-4"})})}),s.jsx(Lhe,{children:t})]}));mt.displayName=sz.displayName;const zhe=v.forwardRef(({className:e,...t},n)=>s.jsx(lz,{ref:n,className:Ne("-mx-1 my-1 h-px bg-muted",e),...t}));zhe.displayName=lz.displayName;var mg="Collapsible",[Uhe]=lr(mg),[qhe,kC]=Uhe(mg),dz=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:i,onOpenChange:o,...c}=e,[d,f]=oa({prop:r,defaultProp:a??!1,onChange:o,caller:mg});return s.jsx(qhe,{scope:n,disabled:i,contentId:Wn(),open:d,onOpenToggle:v.useCallback(()=>f(h=>!h),[f]),children:s.jsx(Ke.div,{"data-state":TC(d),"data-disabled":i?"":void 0,...c,ref:t})})});dz.displayName=mg;var fz="CollapsibleTrigger",pz=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,a=kC(fz,n);return s.jsx(Ke.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":TC(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:t,onClick:Re(e.onClick,a.onOpenToggle)})});pz.displayName=fz;var OC="CollapsibleContent",hz=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=kC(OC,e.__scopeCollapsible);return s.jsx(Hn,{present:n||a.open,children:({present:i})=>s.jsx(Whe,{...r,ref:t,present:i})})});hz.displayName=OC;var Whe=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:a,...i}=e,o=kC(OC,n),[c,d]=v.useState(r),f=v.useRef(null),h=vt(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)},[]),Vn(()=>{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(Ke.div,{"data-state":TC(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 TC(e){return e?"open":"closed"}var Vhe=dz;const Mi=Vhe,Us=pz,$i=hz,Hhe=gv,Khe=xv,mz=v.forwardRef(({className:e,...t},n)=>s.jsx(eu,{ref:n,className:Ne("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}));mz.displayName=eu.displayName;const vz=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(Khe,{children:[s.jsx(mz,{}),s.jsxs(tu,{ref:r,className:Ne("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(yv,{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(ys,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));vz.displayName=tu.displayName;const gz=({className:e,...t})=>s.jsx("div",{className:Ne("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});gz.displayName="DialogHeader";const xz=v.forwardRef(({className:e,...t},n)=>s.jsx(wf,{ref:n,className:Ne("text-lg font-semibold leading-none tracking-tight",e),...t}));xz.displayName=wf.displayName;const yz=v.forwardRef(({className:e,...t},n)=>s.jsx(jf,{ref:n,className:Ne("text-sm text-muted-foreground",e),...t}));yz.displayName=jf.displayName;function Ghe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var RC="ScrollArea",[bz]=lr(RC),[Yhe,Pa]=bz(RC),wz=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,T]=v.useState(!1),R=vt(t,D=>d(D)),I=cu(a);return s.jsx(Yhe,{scope:n,type:r,dir:I,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:T,onCornerWidthChange:C,onCornerHeightChange:E,children:s.jsx(Ke.div,{dir:I,...o,ref:R,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":N+"px",...e.style}})})});wz.displayName=RC;var jz="ScrollAreaViewport",Sz=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...i}=e,o=Pa(jz,n),c=v.useRef(null),d=vt(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(Ke.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})})]})});Sz.displayName=jz;var Es="ScrollAreaScrollbar",IC=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Pa(Es,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(Xhe,{...r,ref:t,forceMount:n}):a.type==="scroll"?s.jsx(Qhe,{...r,ref:t,forceMount:n}):a.type==="auto"?s.jsx(Nz,{...r,ref:t,forceMount:n}):a.type==="always"?s.jsx(MC,{...r,ref:t}):null});IC.displayName=Es;var Xhe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Pa(Es,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(Hn,{present:n||i,children:s.jsx(Nz,{"data-state":i?"visible":"hidden",...r,ref:t})})}),Qhe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Pa(Es,e.__scopeScrollArea),i=e.orientation==="horizontal",o=gg(()=>d("SCROLL_END"),100),[c,d]=Ghe("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(Hn,{present:n||c!=="hidden",children:s.jsx(MC,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Re(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Re(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),Nz=v.forwardRef((e,t)=>{const n=Pa(Es,e.__scopeScrollArea),{forceMount:r,...a}=e,[i,o]=v.useState(!1),c=e.orientation==="horizontal",d=gg(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;o(c?f:h)}},10);return qc(n.viewport,d),qc(n.content,d),s.jsx(Hn,{present:r||i,children:s.jsx(MC,{"data-state":i?"visible":"hidden",...a,ref:t})})}),MC=v.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,a=Pa(Es,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=Pz(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 rme(x,o.current,c,g)}return n==="horizontal"?s.jsx(Jhe,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const x=a.viewport.scrollLeft,g=yM(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(Zhe,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const x=a.viewport.scrollTop,g=yM(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}),Jhe=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=Pa(Es,e.__scopeScrollArea),[o,c]=v.useState(),d=v.useRef(null),f=vt(t,d,i.onScrollbarXChange);return v.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),s.jsx(Az,{"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":vg(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),Oz(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:Um(o.paddingLeft),paddingEnd:Um(o.paddingRight)}})}})}),Zhe=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=Pa(Es,e.__scopeScrollArea),[o,c]=v.useState(),d=v.useRef(null),f=vt(t,d,i.onScrollbarYChange);return v.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),s.jsx(Az,{"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":vg(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),Oz(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:Um(o.paddingTop),paddingEnd:Um(o.paddingBottom)}})}})}),[eme,Cz]=bz(Es),Az=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=Pa(Es,n),[j,b]=v.useState(null),y=vt(t,R=>b(R)),S=v.useRef(null),C=v.useRef(""),N=g.viewport,E=r.content-r.viewport,_=On(h),P=On(d),O=gg(p,10);function T(R){if(S.current){const I=R.clientX-S.current.left,D=R.clientY-S.current.top;f({x:I,y:D})}}return v.useEffect(()=>{const R=I=>{const D=I.target;j?.contains(D)&&_(I,E)};return document.addEventListener("wheel",R,{passive:!1}),()=>document.removeEventListener("wheel",R,{passive:!1})},[N,j,E,_]),v.useEffect(P,[r,P]),qc(j,O),qc(g.content,O),s.jsx(eme,{scope:n,scrollbar:j,hasThumb:a,onThumbChange:On(i),onThumbPointerUp:On(o),onThumbPositionChange:P,onThumbPointerDown:On(c),children:s.jsx(Ke.div,{...x,ref:y,style:{position:"absolute",...x.style},onPointerDown:Re(e.onPointerDown,R=>{R.button===0&&(R.target.setPointerCapture(R.pointerId),S.current=j.getBoundingClientRect(),C.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),T(R))}),onPointerMove:Re(e.onPointerMove,T),onPointerUp:Re(e.onPointerUp,R=>{const I=R.target;I.hasPointerCapture(R.pointerId)&&I.releasePointerCapture(R.pointerId),document.body.style.webkitUserSelect=C.current,g.viewport&&(g.viewport.style.scrollBehavior=""),S.current=null})})})}),zm="ScrollAreaThumb",_z=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Cz(zm,e.__scopeScrollArea);return s.jsx(Hn,{present:n||a.hasThumb,children:s.jsx(tme,{ref:t,...r})})}),tme=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,i=Pa(zm,n),o=Cz(zm,n),{onThumbPositionChange:c}=o,d=vt(t,p=>o.onThumbChange(p)),f=v.useRef(void 0),h=gg(()=>{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=ame(p,c);f.current=g,c()}};return c(),p.addEventListener("scroll",x),()=>p.removeEventListener("scroll",x)}},[i.viewport,h,c]),s.jsx(Ke.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:Re(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:Re(e.onPointerUp,o.onThumbPointerUp)})});_z.displayName=zm;var $C="ScrollAreaCorner",Ez=v.forwardRef((e,t)=>{const n=Pa($C,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx(nme,{...e,ref:t}):null});Ez.displayName=$C;var nme=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=Pa($C,n),[i,o]=v.useState(0),[c,d]=v.useState(0),f=!!(i&&c);return qc(a.scrollbarX,()=>{const h=a.scrollbarX?.offsetHeight||0;a.onCornerHeightChange(h),d(h)}),qc(a.scrollbarY,()=>{const h=a.scrollbarY?.offsetWidth||0;a.onCornerWidthChange(h),o(h)}),f?s.jsx(Ke.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 Um(e){return e?parseInt(e,10):0}function Pz(e,t){const n=e/t;return isNaN(n)?0:n}function vg(e){const t=Pz(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function rme(e,t,n,r="ltr"){const a=vg(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 kz([d,f],p)(e)}function yM(e,t,n="ltr"){const r=vg(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=pf(e,d);return kz([0,o],[0,c])(f)}function kz(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 Oz(e,t){return e>0&&e<t}var ame=(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 gg(e,t){const n=On(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 qc(e,t){const n=On(t);Vn(()=>{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 Tz=wz,sme=Sz,ime=Ez;const qm=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(Tz,{ref:r,className:Ne("relative overflow-hidden",e),...n,children:[s.jsx(sme,{className:"h-full w-full rounded-[inherit]",children:t}),s.jsx(Rz,{}),s.jsx(ime,{})]}));qm.displayName=Tz.displayName;const Rz=v.forwardRef(({className:e,orientation:t="vertical",...n},r)=>s.jsx(IC,{ref:r,orientation:t,className:Ne("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(_z,{className:"relative flex-1 rounded-full bg-border"})}));Rz.displayName=IC.displayName;const ome=[{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 lme({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}=Tn(),[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),T=v.useRef(null),[R,I]=v.useState(!1),D=v.useRef(!1),$=d||i[0]?.id||"";v.useEffect(()=>{if(!e||!$||x)return;let G=!1;return N(!0),p.createScenarioAssistantSession({configId:n,configPath:r,scenarioId:a.id,selectedAssistantAgentName:$,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(ue=>({name:ue.name||ue.id,url:ue.url})),availableAgents:i.map(ue=>({name:ue.name||ue.id,provider:ue.provider,model:ue.model}))}}).then(ue=>{G||(g(ue.sessionId),b(ue.session))}).catch(ue=>{G||Oe({title:"Could not start Scenario Assistant",description:ue instanceof Error?ue.message:String(ue),variant:"destructive"})}).finally(()=>{G||N(!1)}),()=>{G=!0}},[e,p,x,n,r,a,c,i,o,$]);const H=()=>{g(null),b(null),S(""),_(new Set),T.current=null},F=G=>{H(),p.closeScenarioAssistantSession(G).catch(()=>{})};v.useEffect(()=>{e||x&&(D.current||R||F(x))},[e,x,p,R]),v.useEffect(()=>()=>{x&&p.closeScenarioAssistantSession(x).catch(()=>{})},[x,p]),v.useEffect(()=>{if(!e)return;R&&I(!1),D.current&&(D.current=!1);const G=window.setTimeout(()=>{P.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(G)},[e,C,j?.messages.length,j?.pendingToolCalls.length,j?.warnings.length]),v.useEffect(()=>{const G=O.current;if(!G)return;G.style.height="0px";const ue=Math.min(G.scrollHeight,160);G.style.height=`${Math.max(40,ue)}px`},[y,e]);const q=i.length>0&&a.serverIds.length>0&&!!$,Q=async G=>{if(!x)return;const ue=G.trim();if(!ue)return;const le=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,oe={id:le,role:"user",text:ue,createdAt:new Date().toISOString()};b(ie=>ie&&{...ie,messages:[...ie.messages,oe]}),S(""),N(!0);try{const ie=await p.sendScenarioAssistantMessage(x,ue);b(ie.session)}catch(ie){b(fe=>fe&&{...fe,messages:fe.messages.filter(Ae=>Ae.id!==le)}),S(fe=>fe.trim()?fe:ue),Oe({title:"Scenario Assistant error",description:ie instanceof Error?ie.message:String(ie),variant:"destructive"})}finally{N(!1)}},J=G=>{S(G),requestAnimationFrame(()=>O.current?.focus())};v.useEffect(()=>{if(!e||!x||!j||!q||C)return;const G=String(f??"").trim();G&&T.current!==G&&(T.current=G,Q(G))},[e,x,j,q,C,f]);const B=async G=>{if(x){N(!0);try{const ue=await p.approveScenarioAssistantToolCall(x,G);b(ue.session)}catch(ue){Oe({title:"Tool call failed",description:ue instanceof Error?ue.message:String(ue),variant:"destructive"})}finally{N(!1)}}},U=async G=>{if(x){N(!0);try{const ue=await p.denyScenarioAssistantToolCall(x,G);b(ue.session)}catch(ue){Oe({title:"Could not deny tool call",description:ue instanceof Error?ue.message:String(ue),variant:"destructive"})}finally{N(!1)}}},Z=async()=>{if(x){N(!0);try{const G=await p.approveAllScenarioAssistantToolCalls(x);b(G.session)}catch(G){Oe({title:"Could not approve all tool calls",description:G instanceof Error?G.message:String(G),variant:"destructive"})}finally{N(!1)}}},z=(G,ue,le)=>{if(!ue)return;if(le==="prompt"&&ue.prompt&&h({prompt:ue.prompt.replacement}),le==="evalRules"&&ue.evalRules&&h({evalRules:ue.evalRules.replacement}),le==="extractRules"&&ue.extractRules&&h({extractRules:ue.extractRules.replacement}),le==="snapshotEval"&&ue.snapshotEval&&h({snapshotEval:{enabled:ue.snapshotEval.patch.enabled,baselineSnapshotId:ue.snapshotEval.patch.baselineSnapshotId}}),G){const ie=`${G}:${le}`;_(fe=>new Set([...fe,ie]))}Oe({title:"Applied suggestion",description:`Updated ${{prompt:"Prompt",evalRules:"Checks",extractRules:"Value Capture Rules",snapshotEval:"Snapshot Settings"}[le]}`})},L=G=>{G||(I(!1),D.current=!1),t(G)},ee=()=>{D.current=!0,I(!0),t(!1)},se=()=>{D.current=!1,I(!1),x&&F(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(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>t(!0),children:[s.jsx(ya,{className:"mr-1.5 h-3.5 w-3.5"}),"Resume"]}),s.jsx(ne,{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(ys,{className:"h-4 w-4"})})]})]}),s.jsx(Hhe,{open:e,onOpenChange:L,children:s.jsxs(vz,{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:ee,"aria-label":"Minimize assistant",title:"Minimize assistant",children:[s.jsx(K7,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Minimize"})]}),s.jsx(gz,{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(xz,{className:"flex items-center gap-2",children:[s.jsx(ya,{className:"h-4 w-4"}),"Scenario Assistant"]}),s.jsx(yz,{children:"LLM-guided scenario authoring with MCP tool introspection and per-tool-call approval."})]})})}),q?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(Be,{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(ls,{className:"h-3.5 w-3.5"}),j?`Loaded ${j.toolsLoaded} tools`:"Preparing..."]})]})}),s.jsx(qm,{className:"min-h-0 flex-1 rounded-md border p-3",children:s.jsxs("div",{className:"space-y-3",children:[j?.warnings?.map((G,ue)=>s.jsx("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900",children:G},`${G}-${ue}`)),j?.messages.map(G=>s.jsxs(v.Fragment,{children:[(()=>{const ue=G.pendingToolCallIds??(G.pendingToolCallId?[G.pendingToolCallId]:[]),le=ue.map(re=>(j?.pendingToolCalls??[]).find(Te=>Te.id===re)).filter(re=>!!re),oe=ue.map(re=>j.pendingToolCalls.find(Te=>Te.id===re)??j.pendingToolCalls.find(Te=>Te.id===re)).filter(Boolean);if(!(G.role==="assistant"&&ue.length>0))return s.jsx("div",{className:"space-y-2",children:s.jsx(cme,{message:G})});const fe=le.length,Ae=oe.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(wa,{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(MS,{text:G.text,variant:"assistant"})}),oe.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:[Ae," of ",oe.length," tool calls resolved"]}),s.jsxs(ne,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:C,onClick:()=>{Z()},children:["Approve All (",fe,")"]})]}),oe.map(re=>{const Te=re.status==="pending",_e=re.tool??re.publicToolName??"unknown_tool";return s.jsxs("details",{open:Te,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(ls,{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 ${_e}`}),s.jsx("span",{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${Te?"bg-amber-100 text-amber-900":re.status==="error"?"bg-red-100 text-red-900":re.status==="denied"?"bg-gray-100 text-gray-700":"bg-muted text-muted-foreground"}`,children:Te?"Needs approval":re.status==="error"?"Error":re.status==="denied"?"Denied":"Approved"})]})}),s.jsx(Dt,{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(re.arguments??{},null,2)})}),Te&&s.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[s.jsx(ne,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:C,onClick:()=>{U(re.id)},children:"Deny"}),s.jsx(ne,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:C,onClick:()=>{B(re.id)},children:"Approve"})]})]})]},re.id)})]})]})})(),G.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(ya,{className:"h-3.5 w-3.5"}),"Structured Suggestions"]}),G.suggestions.prompt&&s.jsx(mh,{title:"Prompt",rationale:G.suggestions.prompt.rationale,preview:G.suggestions.prompt.replacement,applied:E.has(`${G.id}:prompt`),onApply:()=>z(G.id,G.suggestions,"prompt")}),G.suggestions.evalRules&&s.jsx(mh,{title:"Checks",rationale:G.suggestions.evalRules.rationale,preview:JSON.stringify(G.suggestions.evalRules.replacement,null,2),applied:E.has(`${G.id}:evalRules`),onApply:()=>z(G.id,G.suggestions,"evalRules")}),G.suggestions.extractRules&&s.jsx(mh,{title:"Value Capture Rules",rationale:G.suggestions.extractRules.rationale,preview:JSON.stringify(G.suggestions.extractRules.replacement,null,2),applied:E.has(`${G.id}:extractRules`),onApply:()=>z(G.id,G.suggestions,"extractRules")}),G.suggestions.snapshotEval&&s.jsx(mh,{title:"Snapshot Settings",rationale:G.suggestions.snapshotEval.rationale,preview:JSON.stringify(G.suggestions.snapshotEval.patch,null,2),applied:E.has(`${G.id}:snapshotEval`),onApply:()=>z(G.id,G.suggestions,"snapshotEval")}),(()=>{const ue=G.suggestions?.notes,le=Array.isArray(ue)?ue:typeof ue=="string"?[ue]:[];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((oe,ie)=>s.jsx("li",{children:oe},`${G.id}-note-${ie}`))})]})})()]})]},G.id)),(j?.pendingToolCalls??[]).filter(G=>!(j?.messages??[]).some(ue=>ue.pendingToolCallId===G.id||ue.pendingToolCallIds?.includes(G.id))).map(G=>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(ls,{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:G.publicToolName||G.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(Dt,{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(G.arguments??{},null,2)})}),s.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[s.jsx(ne,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:C,onClick:()=>{U(G.id)},children:"Deny"}),s.jsx(ne,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:C,onClick:()=>{B(G.id)},children:"Approve"})]})]})]},G.id)),!j&&C&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(or,{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(wa,{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(or,{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(Wa,{ref:O,value:y,onChange:G=>S(G.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:G=>{G.key==="Enter"&&!G.shiftKey&&(G.preventDefault(),Q(y))}}),s.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 px-1 pt-1",children:[s.jsxs(uu,{children:[s.jsx(du,{asChild:!0,children:s.jsxs(ne,{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(xs,{className:"h-3 w-3"}),"Snippets",s.jsx(Dt,{className:"h-3 w-3"})]})}),s.jsxs(cl,{align:"start",className:"w-[320px]",children:[s.jsx(AC,{children:"Scenario Assistant Snippets"}),s.jsx(_C,{}),ome.map(G=>s.jsx(Nr,{className:"items-start whitespace-normal px-2 py-2",onSelect:()=>J(G.prompt),children:s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("div",{className:"text-xs font-medium leading-tight",children:G.label}),s.jsx("div",{className:"text-[11px] leading-snug text-muted-foreground",children:G.description})]})},G.label))]})]}),s.jsx(ne,{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(or,{className:"h-4 w-4 animate-spin"}):s.jsxs(s.Fragment,{children:[s.jsx(k$,{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 mh({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(ne,{type:"button",size:"sm",variant:r?"secondary":"outline",onClick:a,disabled:r,children:r?s.jsxs(s.Fragment,{children:[s.jsx(rc,{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 cme({message:e}){const t=async o=>{try{await navigator.clipboard.writeText(o),Oe({title:"Copied"})}catch(c){Oe({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(ls,{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(P$,{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(MS,{text:e.text,variant:"assistant"})})]});const r=n==="user",a=r?QS:wa,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(MS,{text:e.text,variant:"assistant"})]}),i&&s.jsx(ne,{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(Ui,{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 MS({text:e,variant:t="assistant"}){const n=ume(e);return s.jsx("div",{className:Ne("space-y-2",t==="system"&&"text-xs"),children:n.map((r,a)=>s.jsx(v.Fragment,{children:dme(r,a,t)},`md-${a}`))})}function ume(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(bM(t,r)){const x=wM(t[r]);r+=2;const g=[];for(;r<t.length&&t[r].includes("|")&&!a(t[r]);)g.push(wM(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)||bM(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 bM(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 wM(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>t.trim())}function dme(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:ad(e.text,`${t}-h`)})}if(e.type==="paragraph")return s.jsx("p",{className:Ne("whitespace-pre-wrap leading-relaxed",n==="system"&&"leading-normal"),children:ad(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:Ne("space-y-1 pl-5",e.ordered?"list-decimal":"list-disc"),children:e.items.map((a,i)=>s.jsx("li",{className:"leading-relaxed",children:ad(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:ad(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:ad(i,`${t}-tdc-${a}-${o}`)},`${t}-td-${a}-${o}`))},`${t}-row-${a}`))})]})}):null}function ad(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 fme="mcplab.feature.";function xg(e,t=!1){if(typeof window>"u")return t;try{const n=window.localStorage.getItem(`${fme}${e}`);return n==null?t:n==="1"||n==="true"}catch{return t}}const pme=()=>({id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]});function $S({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,pme()]),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(ne,{type:"button",variant:"outline",size:"sm",onClick:y,children:[s.jsx(xs,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Scenario"]})]}),e.map((C,N)=>s.jsx(hme,{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 hme({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}=Tn(),N=xg("snapshots",!1),[E,_]=v.useState("required_tool"),[P,O]=v.useState(""),[T,R]=v.useState(""),[I,D]=v.useState(null),[$,H]=v.useState(!1),[F,q]=v.useState(null),[Q,J]=v.useState(""),[B,U]=v.useState(""),[Z,z]=v.useState(!1),[L,ee]=v.useState(!y),se=()=>{P.trim()&&(x({evalRules:[...e.evalRules,{type:E,value:P.trim()}]}),O(""),R(""))},G=de=>{x({evalRules:e.evalRules.filter((Pe,Ye)=>Ye!==de)})},ue=()=>{!Q.trim()||!B.trim()||(x({extractRules:[...e.extractRules,{name:Q.trim(),pattern:B.trim()}]}),J(""),U(""))},le=de=>{x({extractRules:e.extractRules.filter((Pe,Ye)=>Ye!==de)})},oe=de=>{const Pe=e.serverIds.includes(de)?e.serverIds.filter(Ye=>Ye!==de):[...e.serverIds,de];x({serverIds:Pe})},ie={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"},Ae=E==="required_tool"||E==="forbidden_tool",re=e.serverIds.filter(de=>i.some(Pe=>Pe.id===de)),Te=re.length>0,_e=e.snapshotEval?.baselineSnapshotId!==void 0,[Ge,je]=v.useState(""),[Me,Y]=v.useState(0);v.useEffect(()=>{const de=(f??"").trim();de&&Ge!==de&&(z(!0),je(de))},[f,Ge]),v.useEffect(()=>{h&&h!==Me&&(z(!0),Y(h))},[h,Me]),v.useEffect(()=>{D(null),q(null),R("")},[e.serverIds.join("|")]),v.useEffect(()=>{R("")},[E]);const ye=async()=>{if(!(!Te||y)){H(!0),q(null);try{const de=new Set;for(const Pe of re){const Ye=await C.discoverToolsForAnalysis({serverNames:[Pe]});for(const wt of Ye.servers)for(const It of wt.tools)de.add(It.name)}D(Array.from(de).sort((Pe,Ye)=>Pe.localeCompare(Ye)))}catch(de){q(de instanceof Error?de.message:"Failed to load tools")}finally{H(!1)}}};return s.jsx(Mi,{open:L,onOpenChange:ee,children:s.jsxs(Ue,{className:y?"rounded-md border shadow-none":"border-dashed",children:[s.jsxs(St,{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(Us,{asChild:!0,children:s.jsx(ne,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",children:s.jsx(Dt,{className:`h-3.5 w-3.5 transition-transform ${L?"rotate-0":"-rotate-90"}`})})}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[n+1,"."]}),s.jsx(Nt,{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(Us,{asChild:!0,children:s.jsx(ne,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8","aria-label":L?"Collapse scenario details":"Expand scenario details",children:s.jsx(Dt,{className:`h-4 w-4 transition-transform ${L?"rotate-180":""}`})})})]}):S&&s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsxs(ne,{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(ya,{className:"h-3.5 w-3.5"}),"Ask Assistant"]}),s.jsx(ne,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:g,disabled:n===0,"aria-label":"Move scenario up",children:s.jsx(fs,{className:"h-3.5 w-3.5"})}),s.jsx(ne,{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(Dt,{className:"h-3.5 w-3.5"})}),s.jsx(ne,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:b,children:s.jsx(Ca,{className:"h-3.5 w-3.5 text-destructive"})})]})]}),s.jsx($i,{children:s.jsxs(qe,{className:"space-y-3",children:[s.jsx(lme,{open:Z,onOpenChange:z,configId:o,configPath:c,scenario:e,agents:a,servers:i,snapshotEval:p,defaultAssistantAgentName:d,initialUserMessage:f,onApplyPatch:de=>x({...de.prompt!==void 0?{prompt:de.prompt}:{},...de.evalRules!==void 0?{evalRules:de.evalRules}:{},...de.extractRules!==void 0?{extractRules:de.extractRules}:{},...de.snapshotEval!==void 0?{snapshotEval:{...e.snapshotEval??{},...de.snapshotEval}}:{}})}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Be,{className:"text-xs",children:"Name"}),s.jsx(ft,{value:e.name,onChange:de=>x({name:de.target.value}),disabled:y,placeholder:"e.g. List directory"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Be,{className:"text-xs",children:"Servers"}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[i.map(de=>s.jsx(Qe,{variant:e.serverIds.includes(de.id)?"default":"outline",className:`cursor-pointer text-xs ${e.serverIds.includes(de.id)?"":"opacity-50"}`,onClick:()=>!y&&oe(de.id),children:de.name||de.id},de.id)),i.length===0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:"Add servers above first"})]})]}),s.jsxs(Ue,{className:"border bg-card",children:[s.jsxs(St,{className:"pb-2",children:[s.jsx(Nt,{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(qe,{className:"pt-0",children:s.jsx(Wa,{value:e.prompt,onChange:de=>x({prompt:de.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(Ue,{className:"border bg-muted/20",children:[s.jsx(St,{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(Nt,{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(ne,{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(ya,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]})}),s.jsx(qe,{className:"space-y-2",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx(Be,{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((de,Pe)=>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[de.type]}`,children:ie[de.type]}),s.jsx("span",{className:"font-mono break-all",children:de.value})]})}),!y&&s.jsx(ne,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>G(Pe),"aria-label":`Remove check ${Pe+1}`,children:s.jsx(ys,{className:"h-3.5 w-3.5"})})]},Pe))}),!y&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex gap-2 items-end",children:[s.jsxs(wn,{value:E,onValueChange:de=>_(de),children:[s.jsx(mn,{className:"h-8 w-[14.5rem] shrink-0 text-xs",children:s.jsx(jn,{})}),s.jsxs(vn,{children:[s.jsx(mt,{value:"required_tool",children:"Required Tool"}),s.jsx(mt,{value:"forbidden_tool",children:"Forbidden Tool"}),s.jsx(mt,{value:"response_contains",children:"Text matches pattern"}),s.jsx(mt,{value:"response_not_contains",children:"Text must not match"})]})]}),s.jsx(ft,{value:P,onChange:de=>O(de.target.value),placeholder:"Value",className:"h-8 text-xs font-mono",onKeyDown:de=>de.key==="Enter"&&(de.preventDefault(),se())}),s.jsx(ne,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:se,children:"Add"})]}),Ae&&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(Be,{className:"mb-1 block text-[11px] text-muted-foreground",children:"Pick from selected server tools (optional)"}),s.jsxs(wn,{value:T,onValueChange:de=>{R(de),O(de)},disabled:$||!I||I.length===0,children:[s.jsx(mn,{className:"h-8 text-xs",children:s.jsx(jn,{placeholder:$?"Loading tools...":I&&I.length>0?"Select tool to insert in value field":"Load tools first"})}),s.jsx(vn,{children:(I??[]).map(de=>s.jsx(mt,{value:de,children:de},de))})]})]}),s.jsx(ne,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:ye,disabled:!Te||$,children:$?"Loading...":I?"Refresh tools":"Load tools"})]}),!Te&&s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Select at least one server in this scenario to load tool names."}),F&&s.jsxs("p",{className:"text-[11px] text-destructive",children:["Could not load tools: ",F]})]})]})]})})]}),s.jsxs(Ue,{className:"border bg-muted/10",children:[s.jsx(St,{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(Nt,{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(ne,{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(ya,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]})}),s.jsx(qe,{className:"space-y-2",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx(Be,{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((de,Pe)=>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:de.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:de.pattern})]})}),!y&&s.jsx(ne,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>le(Pe),"aria-label":`Remove value capture rule ${Pe+1}`,children:s.jsx(ys,{className:"h-3.5 w-3.5"})})]},Pe))}),!y&&s.jsxs("div",{className:"flex gap-2 items-end",children:[s.jsx(ft,{value:Q,onChange:de=>J(de.target.value),placeholder:"Field name",className:"h-8 text-xs w-36"}),s.jsx(ft,{value:B,onChange:de=>U(de.target.value),placeholder:"Regex pattern",className:"h-8 text-xs font-mono",onKeyDown:de=>de.key==="Enter"&&(de.preventDefault(),ue())}),s.jsx(ne,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:ue,children:"Add"})]})]})})]})]}),N&&s.jsxs(Ue,{className:"border bg-amber-50/40",children:[s.jsxs(St,{className:"pb-2",children:[s.jsx(Nt,{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(qe,{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(Fm,{checked:e.snapshotEval?.enabled!==!1,disabled:y,onCheckedChange:de=>x({snapshotEval:{...e.snapshotEval??{},enabled:de}})})]}),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(Fm,{checked:!_e,disabled:y,onCheckedChange:de=>{if(de){x({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:void 0}});return}x({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:e.snapshotEval?.baselineSnapshotId??""}})}})]}),_e&&s.jsx(ft,{value:e.snapshotEval?.baselineSnapshotId??"",onChange:de=>x({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:de.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 Iz(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 mme=()=>({id:`cfg-${Date.now()}`,name:"",configName:"",description:"",servers:[],serverEntries:[],agents:[],agentEntries:[],scenarios:[],scenarioEntries:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),jM=()=>{const{id:e,tab:t}=el(),n=_a(),[r,a]=Yi(),{getConfig:i,addConfig:o,updateConfig:c,loading:d}=Nf(),{source:f}=Tn(),h=xg("snapshots",!1),{servers:p,agents:x,scenarios:g}=Ga(),j=e==="new",b=!j&&!!e,y=b?i(e):void 0,[S,C]=v.useState(j),[N,E]=v.useState(()=>y?structuredClone(y):mme()),[_,P]=v.useState([]),[O,T]=v.useState(""),[R,I]=v.useState(""),[D,$]=v.useState(""),[H,F]=v.useState(null),[q,Q]=v.useState(!1),[J,B]=v.useState(!1),[U,Z]=v.useState(""),[z,L]=v.useState(""),[ee,se]=v.useState({}),[G,ue]=v.useState({}),[le,oe]=v.useState({}),ie=v.useMemo(()=>{const K=t||r.get("tab");return K==="agents"||K==="scenarios"?K:"scenarios"},[t,r]);v.useEffect(()=>{y&&!S&&E(structuredClone(y))},[y,S]),v.useEffect(()=>{let K=!0;return f.listSnapshots().then(xe=>{K&&P(xe)}).catch(()=>{K&&P([])}),()=>{K=!1}},[f]),v.useEffect(()=>{if(!O.trim()){F(null);return}let K=!0;return f.getResult(O.trim()).then(xe=>{if(!K)return;if(!xe){F(!1);return}const Ve=xe.overallPassRate===1&&xe.scenarios.every(ct=>ct.runs.every(Ot=>Ot.passed));F(Ve)}).catch(()=>{K&&F(!1)}),()=>{K=!1}},[O,f]);const fe=K=>E(xe=>({...xe,...K})),Ae=v.useMemo(()=>N.serverEntries&&N.serverEntries.length>0?N.serverEntries:(N.servers??[]).map(K=>({kind:"inline",server:K})),[N.serverEntries,N.servers]),re=v.useMemo(()=>N.scenarioEntries&&N.scenarioEntries.length>0?N.scenarioEntries:N.scenarios.map(K=>({kind:"inline",scenario:K})),[N.scenarioEntries,N.scenarios]),Te=K=>{fe({scenarioEntries:K,scenarios:K.filter(xe=>xe.kind==="inline").map(xe=>xe.scenario)})},_e=v.useMemo(()=>N.agentEntries&&N.agentEntries.length>0?N.agentEntries:N.agents.map(K=>({kind:"inline",agent:K})),[N.agentEntries,N.agents]),Ge=K=>{fe({agentEntries:K,agents:K.filter(xe=>xe.kind==="inline").map(xe=>xe.agent)})},je=!S,Me=N.runDefaults?.selectedAgentNames??[],Y=async K=>{if(!N.id||je===!1){fe({snapshotEval:{enabled:K.enabled,mode:K.mode,baselineSnapshotId:K.baselineSnapshotId,baselineSourceRunId:K.baselineSourceRunId,lastUpdatedAt:new Date().toISOString()}});return}Q(!0);try{const xe=await f.updateSnapshotPolicy(N.id,K);E(xe),Oe({title:"Snapshot policy updated"})}catch(xe){Oe({title:"Could not update snapshot policy",description:xe instanceof Error?xe.message:String(xe),variant:"destructive"})}finally{Q(!1)}},ye=async()=>{if(!(!N.id||!O.trim())){B(!0);try{const K=await f.generateSnapshotEvalBaseline(O.trim(),N.id,R.trim()||void 0);E(K.config),$(K.snapshot.id),P(xe=>[K.snapshot,...xe.filter(Ve=>Ve.id!==K.snapshot.id)]),Oe({title:"Snapshot baseline generated",description:`${K.snapshot.name} (${K.snapshot.id})`})}catch(K){Oe({title:"Could not generate baseline",description:K instanceof Error?K.message:String(K),variant:"destructive"})}finally{B(!1)}}},de=async()=>{if(!N.name.trim()){Oe({title:"Validation Error",description:"Config ID is required.",variant:"destructive"});return}const K=Ae.map(He=>He.kind==="referenced"?{kind:"referenced",ref:p.find(Ft=>Ft.id===He.ref)?.id||He.ref}:He),xe=_e.map(He=>He.kind==="referenced"?{kind:"referenced",ref:x.find(Ft=>Ft.id===He.ref)?.id||He.ref}:He),Ve=re.map(He=>He.kind==="referenced"?{kind:"referenced",ref:g.find(Ft=>Ft.id===He.ref)?.id||He.ref}:He),ct=K.filter(He=>He.kind==="inline").map(He=>({server:He.server,error:Iz(He.server)})).find(He=>!!He.error);if(ct?.error){Oe({title:"Validation Error",description:ct.error,variant:"destructive"});return}if(Ve.filter(He=>He.kind==="inline").some(He=>!He.scenario.name?.trim())){Oe({title:"Validation Error",description:"Inline scenarios must have a name before saving.",variant:"destructive"});return}const Mt=new Set(xe.map(He=>He.kind==="inline"?He.agent.id:He.ref)),Tt=(N.runDefaults?.selectedAgentNames??[]).filter(He=>Mt.has(He)),En={...N,serverEntries:K,servers:K.filter(He=>He.kind==="inline").map(He=>He.server),agentEntries:xe,agents:xe.filter(He=>He.kind==="inline").map(He=>He.agent),scenarioEntries:Ve,scenarios:Ve.filter(He=>He.kind==="inline").map(He=>He.scenario),runDefaults:Tt.length>0?{...N.runDefaults??{},selectedAgentNames:Tt}:void 0,updatedAt:new Date().toISOString()};if(j){const He=await o(En);E(He);const Vt=He.configName?.trim()||He.name;Oe({title:"MCP Evaluation Created",description:`"${Vt}" has been saved.`}),n(`/mcp-evaluations/${He.id}`)}else{const He=await c(N.id,En);E(He);const Vt=He.configName?.trim()||He.name;Oe({title:"MCP Evaluation Updated",description:`"${Vt}" has been updated.`}),C(!1),He.id!==e&&n(`/mcp-evaluations/${He.id}`,{replace:!0})}},Pe=N.configName?.trim()||N.name,Ye=j?"New MCP Evaluation":S?`Editing: ${Pe}`:Pe,wt=j?"/mcp-evaluations/new":`/mcp-evaluations/${encodeURIComponent(N.id||e||"")}`,It=!!y?.loadError,ve=v.useMemo(()=>x.map(K=>({id:K.id,ref:K.id,label:K.name||K.id,model:K.model})).sort((K,xe)=>K.label.localeCompare(xe.label)),[x]),ce=(K,xe)=>{const Ve=xe?Array.from(new Set([...Me,K])):Me.filter(ct=>ct!==K);fe({runDefaults:{...N.runDefaults??{},selectedAgentNames:Ve}})},Ce=K=>{const xe=new Set([..._e.filter(Mt=>Mt.kind==="inline").map(Mt=>Mt.agent.name||Mt.agent.id),...x.map(Mt=>Mt.name||Mt.id)]),Ve=`${K}-custom`;let ct=Ve,Ot=2;for(;xe.has(ct);)ct=`${Ve}-${Ot}`,Ot+=1;return ct},we=()=>{const xe={id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096};Ge([{kind:"inline",agent:xe},..._e]),se(Ve=>({...Ve,[xe.id]:!0}))},Fe=()=>{const K=x.find(ct=>ct.id===z);if(!K)return;const xe=K.id;new Set(_e.filter(ct=>ct.kind==="referenced").map(ct=>ct.ref)).has(xe)||Ge([..._e,{kind:"referenced",ref:xe}]),L("")},et=()=>{const K=new Set(_e.filter(Ve=>Ve.kind==="referenced").map(Ve=>Ve.ref)),xe=x.filter(Ve=>!K.has(Ve.id)).map(Ve=>({kind:"referenced",ref:Ve.id}));xe.length>0&&Ge([..._e,...xe])},Pt=()=>{const K=x.find(Ot=>Ot.id===z);if(!K)return;const xe=K.name||K.id,Ve=Ce(xe),ct={...structuredClone(K),id:`agt-${Date.now()}`,name:Ve};Ge([..._e,{kind:"inline",agent:ct}]),se(Ot=>({...Ot,[ct.id]:!0})),L(""),Oe({title:"Imported agent as inline",description:Ve})},Gn=K=>{const xe=_e[K];if(!xe)return;const Ve=xe.kind==="inline"?xe.agent.id:xe.ref,ct=Me.filter(Ot=>Ot!==Ve);fe({runDefaults:{...N.runDefaults??{},selectedAgentNames:ct}}),xe.kind==="inline"&&se(Ot=>{const Mt={...Ot};return delete Mt[xe.agent.id],Mt}),Ge(_e.filter((Ot,Mt)=>Mt!==K))},xn=(K,xe)=>{const Ve=K+xe;if(Ve<0||Ve>=_e.length)return;const ct=[..._e],[Ot]=ct.splice(K,1);ct.splice(Ve,0,Ot),Ge(ct)},cr=K=>{const xe=_e[K];if(!xe||xe.kind!=="referenced")return;const Ve=Xt(xe.ref);if(!Ve){Oe({title:"Referenced agent not found",variant:"destructive"});return}const ct=Ve.name||Ve.id,Ot=Ce(ct),Mt={...structuredClone(Ve),id:`agt-${Date.now()}`,name:Ot},Tt=[..._e];if(Tt[K]={kind:"inline",agent:Mt},Ge(Tt),Me.includes(xe.ref)){const En=Me.map(He=>He===xe.ref?Mt.id:He);fe({runDefaults:{...N.runDefaults??{},selectedAgentNames:Array.from(new Set(En))}})}se(En=>({...En,[Mt.id]:!0})),Oe({title:"Referenced agent converted to inline",description:Ot})},ur=()=>{const K=g.find(Ve=>Ve.id===U);if(!K)return;const xe={...structuredClone(K),id:`scn-${Date.now()}`,serverIds:[...K.serverIds]};Te([...re,{kind:"inline",scenario:xe}]),oe(Ve=>({...Ve,[xe.id]:!0})),Z("")},$n=()=>{const xe={id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};Te([{kind:"inline",scenario:xe},...re]),oe(Ve=>({...Ve,[xe.id]:!0}))},dr=()=>{const K=g.find(ct=>ct.id===U);if(!K)return;const xe=K.id;new Set(re.filter(ct=>ct.kind==="referenced").map(ct=>ct.ref)).has(xe)||Te([...re,{kind:"referenced",ref:xe}]),Z("")},_r=K=>{const xe=re[K];xe?.kind==="inline"&&oe(Ve=>{const ct={...Ve};return delete ct[xe.scenario.id],ct}),Te(re.filter((Ve,ct)=>ct!==K))},Ur=(K,xe)=>{const Ve=K+xe;if(Ve<0||Ve>=re.length)return;const ct=[...re],[Ot]=ct.splice(K,1);ct.splice(Ve,0,Ot),Te(ct)},qr=K=>{const xe=re[K];if(!xe||xe.kind!=="referenced")return;const Ve=_n(xe.ref);if(!Ve){Oe({title:"Referenced scenario not found",variant:"destructive"});return}const ct=new Set(re.filter(Ft=>Ft.kind==="inline").map(Ft=>Ft.scenario.name?.trim().toLowerCase()).filter(Boolean)),Ot=`${(Ve.name||Ve.id).trim()}-custom`;let Mt=Ot,Tt=2;for(;ct.has(Mt.toLowerCase());)Mt=`${Ot}-${Tt}`,Tt+=1;const En=Date.now(),He={...structuredClone(Ve),id:`scn-${En}`,name:Mt,serverIds:[...Ve.serverIds]},Vt=[...re];Vt[K]={kind:"inline",scenario:He},Te(Vt),oe(Ft=>({...Ft,[He.id]:!0})),Oe({title:"Referenced scenario converted to inline",description:Mt})},Yn=K=>p.find(xe=>xe.id===K),Xt=K=>x.find(xe=>xe.id===K),_n=K=>g.find(xe=>xe.id===K),pe=Ae.filter(K=>K.kind==="referenced").map(K=>K.ref),De=pe.map(Yn).filter(K=>!!K),st=_e.filter(K=>K.kind==="referenced").map(K=>K.ref),yt=st.map(Xt).filter(K=>!!K);_e.filter(K=>K.kind==="inline");const Lt=_e.flatMap(K=>{if(K.kind==="referenced"){const xe=Xt(K.ref);return xe?[{agent:xe,origin:"referenced",ref:K.ref}]:[]}return[{agent:K.agent,origin:"inline",ref:void 0}]}),nn=re.filter(K=>K.kind==="referenced").map(K=>K.ref),ln=re.flatMap(K=>{if(K.kind==="referenced"){const xe=_n(K.ref);return xe?[{scenario:xe,origin:"referenced"}]:[]}return[{scenario:K.scenario,origin:"inline"}]}),Xn=Array.from(new Map([...x,...N.agents,...yt].map(K=>[K.id,K])).values()),Nn=Array.from(new Map([...p,...N.servers??[],...De].map(K=>[K.id,K])).values()),rr=pe.filter(K=>!Yn(K)),fr=st.filter(K=>!Xt(K)),Wr=nn.filter(K=>!_n(K));new Set(rr);const ci=new Set(Wr),ui=_e.length,ul=re.length;return v.useEffect(()=>{if(!z)return;x.some(xe=>xe.id===z)||L("")},[x,z]),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(ne,{variant:"ghost",size:"icon",asChild:!0,className:"h-8 w-8",children:s.jsx(bt,{to:"/mcp-evaluations",children:s.jsx(Io,{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(ne,{size:"sm",onClick:()=>C(!0),children:"Edit"}),b&&!S&&y&&!It&&s.jsx(ne,{size:"sm",variant:"outline",asChild:!0,children:s.jsxs(bt,{to:`/run?configId=${encodeURIComponent(y.id)}`,children:[s.jsx(ko,{className:"mr-1.5 h-3.5 w-3.5"}),"Run MCP Evaluation"]})}),b&&!S&&It&&s.jsxs(Qe,{variant:"destructive",className:"py-1 px-3 text-xs",children:[s.jsx(wh,{className:"mr-1 h-3 w-3"}),"Broken config"]}),S&&s.jsxs(s.Fragment,{children:[!j&&s.jsx(ne,{variant:"outline",size:"sm",onClick:()=>{E(structuredClone(y)),C(!1)},children:"Cancel"}),s.jsxs(ne,{size:"sm",onClick:()=>{de()},children:[s.jsx(Y7,{className:"mr-1.5 h-3.5 w-3.5"}),"Save"]})]})]})]}),It&&!S&&s.jsx(Ue,{className:"border-destructive/40",children:s.jsxs(qe,{className:"pt-6 space-y-3",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(wh,{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})]}),(rr.length>0||fr.length>0||Wr.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"}),rr.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Servers: ",s.jsx("span",{className:"text-destructive",children:rr.join(", ")})]}),fr.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Agents: ",s.jsx("span",{className:"text-destructive",children:fr.join(", ")})]}),Wr.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Scenarios: ",s.jsx("span",{className:"text-destructive",children:Wr.join(", ")})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Valid items still render below. Only the missing references are marked as broken."})]})}),!It&&(N.loadWarnings?.length??0)>0&&s.jsx(Ue,{className:"border-amber-500/30",children:s.jsxs(qe,{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(wh,{className:"h-4 w-4"}),"Migration warnings"]}),N.loadWarnings?.map((K,xe)=>s.jsx("p",{className:"text-xs text-muted-foreground",children:K},`${K}-${xe}`))]})}),s.jsxs("div",{className:"flex gap-4",children:[s.jsx(Qe,{variant:ie==="scenarios"?"default":"outline",className:"py-1 px-3 text-xs",children:s.jsxs(bt,{to:`${wt}/scenarios`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[s.jsx(EE,{className:"h-3 w-3"}),ul," scenario",ul!==1?"s":""]})}),s.jsx(Qe,{variant:ie==="agents"?"default":"outline",className:"py-1 px-3 text-xs",children:s.jsxs(bt,{to:`${wt}/agents`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[s.jsx(wa,{className:"h-3 w-3"}),ui," agent",ui!==1?"s":""]})})]}),s.jsx(Ue,{children:s.jsx(qe,{className:"pt-6 space-y-3",children:s.jsxs("div",{className:`grid gap-4 ${je||!j?"sm:grid-cols-2":"sm:grid-cols-3"}`,children:[!je&&j&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Be,{className:"text-xs",children:"Config ID"}),s.jsx(ft,{value:N.name,onChange:K=>fe({name:K.target.value}),disabled:je,placeholder:"e.g. check-weather"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Be,{className:"text-xs",children:"Name (optional)"}),s.jsx(ft,{value:N.configName||"",onChange:K=>fe({configName:K.target.value}),disabled:je,placeholder:"e.g. Weather checks baseline"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Be,{className:"text-xs",children:"Description"}),s.jsx(ft,{value:N.description||"",onChange:K=>fe({description:K.target.value}),disabled:je,placeholder:"Brief description..."})]})]})})}),h&&s.jsx(Ue,{children:s.jsxs(qe,{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(Be,{className:"text-xs",children:"Enable snapshot baseline"}),s.jsx(Fm,{checked:N.snapshotEval?.enabled??!1,disabled:q,onCheckedChange:K=>{const xe=N.snapshotEval;Y({enabled:K,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(Be,{className:"text-xs",children:"Drift mode"}),s.jsxs(wn,{value:N.snapshotEval?.mode??"warn",onValueChange:K=>{const xe=N.snapshotEval;Y({enabled:xe?.enabled??!1,mode:K,baselineSnapshotId:xe?.baselineSnapshotId,baselineSourceRunId:xe?.baselineSourceRunId})},children:[s.jsx(mn,{className:"h-8",children:s.jsx(jn,{})}),s.jsxs(vn,{children:[s.jsx(mt,{value:"warn",children:"Warn"}),s.jsx(mt,{value:"fail_on_drift",children:"Fail on drift"})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Be,{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(Be,{className:"text-xs",children:"Generate baseline from passing run"}),s.jsx(ft,{value:O,onChange:K=>T(K.target.value),placeholder:"Run id (e.g. 20260208-140213)",className:"h-8 font-mono text-xs"}),H===!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(Be,{className:"text-xs",children:"Snapshot name (optional)"}),s.jsx(ft,{value:R,onChange:K=>I(K.target.value),placeholder:"e.g. config-baseline-v1",className:"h-8 text-xs"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Be,{className:"text-xs",children:"Switch baseline"}),s.jsxs(wn,{value:D||N.snapshotEval?.baselineSnapshotId||"",onValueChange:K=>{$(K),Y({enabled:N.snapshotEval?.enabled??!0,mode:N.snapshotEval?.mode??"warn",baselineSnapshotId:K||void 0,baselineSourceRunId:N.snapshotEval?.baselineSourceRunId})},children:[s.jsx(mn,{className:"h-8",children:s.jsx(jn,{placeholder:"Select snapshot"})}),s.jsx(vn,{children:_.map(K=>s.jsx(mt,{value:K.id,children:K.name},K.id))})]})]}),s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsx(ne,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:()=>{ye()},disabled:J||!O.trim()||H!==!0,children:J?"Generating...":"Generate Baseline"}),s.jsx(ne,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:()=>{Y({enabled:N.snapshotEval?.enabled??!1,mode:N.snapshotEval?.mode??"warn",baselineSnapshotId:void 0,baselineSourceRunId:void 0})},disabled:q,children:"Clear Baseline"})]})]})]})}),s.jsxs(dg,{value:ie,onValueChange:K=>{if(K!=="servers"&&K!=="agents"&&K!=="scenarios")return;const xe=new URLSearchParams(r);if(xe.delete("tab"),a(xe,{replace:!0}),e&&e!=="new"){n(`/mcp-evaluations/${encodeURIComponent(e)}/${K}`,{replace:!0});return}n(`/mcp-evaluations/${e??"new"}/${K}`,{replace:!0})},className:"space-y-4",children:[s.jsxs(Df,{children:[s.jsxs(gs,{value:"scenarios",className:"gap-1.5",children:[s.jsx(EE,{className:"h-3.5 w-3.5"}),"Scenarios"]}),s.jsxs(gs,{value:"agents",className:"gap-1.5",children:[s.jsx(wa,{className:"h-3.5 w-3.5"}),"Agents"]})]}),s.jsxs(ff,{value:"agents",children:[!je&&s.jsx(Ue,{className:"mb-4",children:s.jsxs(qe,{className:"pt-4 space-y-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[s.jsxs(wn,{value:z,onValueChange:L,children:[s.jsx(mn,{className:"h-8",children:s.jsx(jn,{placeholder:"Select agent from library"})}),s.jsx(vn,{children:ve.map(K=>s.jsx(mt,{value:K.id,children:K.label},K.id))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ne,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!z,onClick:Fe,children:"Add Ref"}),s.jsx(ne,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!z,onClick:Pt,children:"Import Inline"}),s.jsx(ne,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:x.length===0||x.every(K=>_e.some(xe=>xe.kind==="referenced"&&xe.ref===K.id)),onClick:et,children:"Add All Refs"}),s.jsx(ne,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:we,children:"Add agent"})]})]}),s.jsxs("div",{className:"space-y-2",children:[_e.map((K,xe)=>{const Ve=K.kind==="referenced"?Xt(K.ref):null,ct=K.kind==="inline"?K.agent.name?.trim()||K.agent.id:Ve?.name||K.ref,Ot=K.kind==="inline"?K.agent.model:Ve?.model||"unknown",Mt=K.kind==="inline"?K.agent.id:K.ref,Tt=K.kind==="referenced"&&!Ve,En=K.kind==="inline"?K.agent.id:K.ref,He=Me.includes(En),Vt=K.kind==="inline"&&!!ee[K.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(ne,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>xn(xe,-1),disabled:xe===0,"aria-label":"Move agent up",children:s.jsx(fs,{className:"h-3 w-3"})}),s.jsx(ne,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>xn(xe,1),disabled:xe===_e.length-1,"aria-label":"Move agent down",children:s.jsx(Dt,{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:ct}),s.jsx(Qe,{variant:K.kind==="inline"?"secondary":"outline",children:K.kind==="inline"?"Inline":"Referenced"}),s.jsx(Qe,{variant:"outline",className:"font-mono text-[10px]",children:Ot}),He&&s.jsx(Qe,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),Tt&&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:He,onChange:Ft=>ce(En,Ft.target.checked)}),s.jsx("span",{children:"Default"})]}),K.kind==="inline"&&s.jsx(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>se(Ft=>({...Ft,[K.agent.id]:!Ft[K.agent.id]})),children:Vt?"Collapse":"Expand"}),K.kind==="referenced"&&s.jsx(s.Fragment,{children:s.jsx(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>cr(xe),disabled:Tt,children:"Convert to inline"})}),s.jsx(ne,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>Gn(xe),"aria-label":"Remove agent entry",children:s.jsx(Ca,{className:"h-3.5 w-3.5"})})]})]}),K.kind==="inline"&&Vt&&s.jsxs("div",{className:"border-t px-3 py-3 space-y-3",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Be,{className:"text-xs",children:"Name"}),s.jsx(ft,{value:K.agent.name,onChange:Ft=>{const Pn=[..._e];Pn[xe]={kind:"inline",agent:{...K.agent,name:Ft.target.value}},Ge(Pn)},placeholder:"e.g. GPT-5 Mini custom"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Be,{className:"text-xs",children:"Provider"}),s.jsxs(wn,{value:K.agent.provider,onValueChange:Ft=>{const Pn=[..._e];Pn[xe]={kind:"inline",agent:{...K.agent,provider:Ft}},Ge(Pn)},children:[s.jsx(mn,{children:s.jsx(jn,{})}),s.jsxs(vn,{children:[s.jsx(mt,{value:"openai",children:"OpenAI"}),s.jsx(mt,{value:"anthropic",children:"Anthropic"}),s.jsx(mt,{value:"azure",children:"Azure OpenAI"}),s.jsx(mt,{value:"google",children:"Google"}),s.jsx(mt,{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(Be,{className:"text-xs",children:"Model"}),s.jsx(ft,{value:K.agent.model,onChange:Ft=>{const Pn=[..._e];Pn[xe]={kind:"inline",agent:{...K.agent,model:Ft.target.value}},Ge(Pn)},className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Be,{className:"text-xs",children:"Max Tokens"}),s.jsx(ft,{type:"number",min:1,max:128e3,value:K.agent.maxTokens,onChange:Ft=>{const Pn=[..._e];Pn[xe]={kind:"inline",agent:{...K.agent,maxTokens:parseInt(Ft.target.value)||0}},Ge(Pn)},className:"font-mono text-xs"})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Be,{className:"text-xs",children:"Temperature"}),s.jsx(ft,{type:"number",min:0,max:2,step:.01,value:K.agent.temperature,onChange:Ft=>{const Pn=[..._e];Pn[xe]={kind:"inline",agent:{...K.agent,temperature:Number(Ft.target.value)||0}},Ge(Pn)},className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Be,{className:"text-xs",children:"System Prompt"}),s.jsx(Wa,{value:K.agent.systemPrompt||"",onChange:Ft=>{const Pn=[..._e];Pn[xe]={kind:"inline",agent:{...K.agent,systemPrompt:Ft.target.value}},Ge(Pn)},rows:3,className:"text-xs"})]})]})]},`agent-entry-${xe}-${Mt}`)}),_e.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents configured yet. Add inline agents or references."})]}),fr.length>0&&s.jsxs("p",{className:"text-xs text-destructive",children:["Missing agent refs: ",fr.join(", ")]})]})}),je?s.jsx(Ue,{children:s.jsx(qe,{className:"pt-4",children:s.jsxs("div",{className:"space-y-2",children:[Lt.map((K,xe)=>{const Ve=K.agent.name||K.agent.id,ct=Me.includes(K.origin==="inline"?K.agent.id:K.ref||K.agent.id),Ot=K.ref??K.agent.id,Mt=!!G[Ot];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:Ve})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[ct&&s.jsx(Qe,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),s.jsx(Qe,{variant:K.origin==="inline"?"secondary":"outline",children:K.origin==="inline"?"Inline":"Referenced"}),s.jsx(ne,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8",onClick:()=>ue(Tt=>({...Tt,[Ot]:!Tt[Ot]})),"aria-label":Mt?"Collapse agent details":"Expand agent details",children:s.jsx(Dt,{className:`h-4 w-4 transition-transform ${Mt?"rotate-180":""}`})})]})]}),Mt&&s.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 border-t pt-2",children:[s.jsx(_B,{provider:K.agent.provider}),s.jsx(Qe,{variant:"outline",className:"text-xs font-mono",children:K.agent.model}),s.jsxs(Qe,{variant:"outline",className:"text-xs font-mono",children:["max_tokens: ",K.agent.maxTokens]}),s.jsxs(Qe,{variant:"outline",className:"text-xs font-mono",children:["temperature: ",K.agent.temperature]})]})]},`agent-view-${xe}-${K.ref??K.agent.id}`)}),Lt.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No agents configured."})]})})}):null]}),s.jsxs(ff,{value:"scenarios",children:[!je&&s.jsx(Ue,{className:"mb-4",children:s.jsxs(qe,{className:"pt-4 space-y-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[s.jsxs(wn,{value:U,onValueChange:Z,children:[s.jsx(mn,{className:"h-8",children:s.jsx(jn,{placeholder:"Select scenario from library"})}),s.jsx(vn,{children:[...g].sort((K,xe)=>(K.name||K.id).localeCompare(xe.name||xe.id)).map(K=>s.jsx(mt,{value:K.id,children:K.name||K.id},K.id))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ne,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!U,onClick:dr,children:"Add Ref"}),s.jsx(ne,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!U,onClick:ur,children:"Import Inline"}),s.jsx(ne,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:$n,children:"Add scenario"})]})]}),s.jsxs("div",{className:"space-y-2",children:[re.map((K,xe)=>{const Ve=K.kind==="referenced"?_n(K.ref):null,ct=K.kind==="inline"?K.scenario.name?.trim()||K.scenario.id:Ve?.name||K.ref,Ot=K.kind==="inline"&&!K.scenario.name?.trim(),Mt=K.kind==="referenced"&&ci.has(K.ref),Tt=K.kind==="inline"&&!!le[K.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(ne,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Ur(xe,-1),disabled:xe===0,"aria-label":"Move scenario up",children:s.jsx(fs,{className:"h-3 w-3"})}),s.jsx(ne,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Ur(xe,1),disabled:xe===re.length-1,"aria-label":"Move scenario down",children:s.jsx(Dt,{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:ct}),s.jsx(Qe,{variant:K.kind==="inline"?"secondary":"outline",children:K.kind==="inline"?"Inline":"Referenced"}),Ot&&s.jsx(Qe,{variant:"destructive",children:"Name required"}),Mt&&s.jsx(Qe,{variant:"destructive",children:"Missing"})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[K.kind==="inline"&&s.jsx(ne,{type:"button",size:"icon",variant:"outline",className:"h-7 w-7",onClick:()=>oe(En=>({...En,[K.scenario.id]:!En[K.scenario.id]})),"aria-label":Tt?"Collapse scenario details":"Expand scenario details",children:s.jsx(Dt,{className:`h-3.5 w-3.5 transition-transform ${Tt?"rotate-180":""}`})}),K.kind==="referenced"&&s.jsx(s.Fragment,{children:s.jsx(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>qr(xe),disabled:Mt,children:"Convert to inline"})}),s.jsx(ne,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>_r(xe),"aria-label":"Remove scenario entry",children:s.jsx(Ca,{className:"h-3.5 w-3.5"})})]})]}),K.kind==="inline"&&Tt&&s.jsx("div",{className:"border-t px-3 py-3",children:s.jsx($S,{scenarios:[K.scenario],scenarioOrigins:["inline"],agents:[...N.agents,...yt],servers:[...N.servers??[],...De],configId:N.id,configPath:N.sourcePath,defaultAssistantAgentName:N.runDefaults?.selectedAgentNames?.[0],snapshotEval:N.snapshotEval,onChange:En=>{const He=En[0];if(!He)return;const Vt=[...re];Vt[xe]={kind:"inline",scenario:He},Te(Vt)},readOnly:!1,allowAdd:!1,allowStructureEdits:!1})})]},`scenario-entry-${xe}-${K.kind==="inline"?K.scenario.id:K.ref}`)}),re.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No scenarios configured yet. Add inline scenarios or references."})]}),Wr.length>0&&s.jsxs("p",{className:"text-xs text-destructive",children:["Missing scenario refs: ",Wr.join(", ")]})]})}),je?s.jsx(Ue,{children:s.jsx(qe,{className:"pt-4",children:s.jsx($S,{scenarios:ln.map(K=>K.scenario),scenarioOrigins:ln.map(K=>K.origin),agents:Xn,servers:Nn,configId:N.id,configPath:N.sourcePath,defaultAssistantAgentName:N.runDefaults?.selectedAgentNames?.[0],snapshotEval:N.snapshotEval,onChange:()=>{},readOnly:!0})})}):null]})]})]})};var vme=Symbol("radix.slottable");function gme(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=vme,t}var Mz="AlertDialog",[xme]=lr(Mz,[JD]),li=JD(),$z=e=>{const{__scopeAlertDialog:t,...n}=e,r=li(t);return s.jsx(gv,{...r,...n,modal:!0})};$z.displayName=Mz;var yme="AlertDialogTrigger",bme=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=li(n);return s.jsx(nG,{...a,...r,ref:t})});bme.displayName=yme;var wme="AlertDialogPortal",Dz=e=>{const{__scopeAlertDialog:t,...n}=e,r=li(t);return s.jsx(xv,{...r,...n})};Dz.displayName=wme;var jme="AlertDialogOverlay",Lz=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=li(n);return s.jsx(eu,{...a,...r,ref:t})});Lz.displayName=jme;var uc="AlertDialogContent",[Sme,Nme]=xme(uc),Cme=gme("AlertDialogContent"),Fz=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,i=li(n),o=v.useRef(null),c=vt(t,o),d=v.useRef(null);return s.jsx(JK,{contentName:uc,titleName:Bz,docsSlug:"alert-dialog",children:s.jsx(Sme,{scope:n,cancelRef:d,children:s.jsxs(tu,{role:"alertdialog",...i,...a,ref:c,onOpenAutoFocus:Re(a.onOpenAutoFocus,f=>{f.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[s.jsx(Cme,{children:r}),s.jsx(_me,{contentRef:o})]})})})});Fz.displayName=uc;var Bz="AlertDialogTitle",zz=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=li(n);return s.jsx(wf,{...a,...r,ref:t})});zz.displayName=Bz;var Uz="AlertDialogDescription",qz=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=li(n);return s.jsx(jf,{...a,...r,ref:t})});qz.displayName=Uz;var Ame="AlertDialogAction",Wz=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=li(n);return s.jsx(yv,{...a,...r,ref:t})});Wz.displayName=Ame;var Vz="AlertDialogCancel",Hz=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=Nme(Vz,n),i=li(n),o=vt(t,a);return s.jsx(yv,{...i,...r,ref:o})});Hz.displayName=Vz;var _me=({contentRef:e})=>{const t=`\`${uc}\` requires a description for the component to be accessible for screen reader users.
125
-
126
- You can add a description to the \`${uc}\` by passing a \`${Uz}\` 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 \`${uc}\`. 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},Eme=$z,Pme=Dz,Kz=Lz,Gz=Fz,Yz=Wz,Xz=Hz,Qz=zz,Jz=qz;const Ps=Eme,kme=Pme,Zz=v.forwardRef(({className:e,...t},n)=>s.jsx(Kz,{className:Ne("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}));Zz.displayName=Kz.displayName;const Xa=v.forwardRef(({className:e,...t},n)=>s.jsxs(kme,{children:[s.jsx(Zz,{}),s.jsx(Gz,{ref:n,className:Ne("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})]}));Xa.displayName=Gz.displayName;const Qa=({className:e,...t})=>s.jsx("div",{className:Ne("flex flex-col space-y-2 text-center sm:text-left",e),...t});Qa.displayName="AlertDialogHeader";const Ja=({className:e,...t})=>s.jsx("div",{className:Ne("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Ja.displayName="AlertDialogFooter";const Za=v.forwardRef(({className:e,...t},n)=>s.jsx(Qz,{ref:n,className:Ne("text-lg font-semibold",e),...t}));Za.displayName=Qz.displayName;const es=v.forwardRef(({className:e,...t},n)=>s.jsx(Jz,{ref:n,className:Ne("text-sm text-muted-foreground",e),...t}));es.displayName=Jz.displayName;const ts=v.forwardRef(({className:e,...t},n)=>s.jsx(Yz,{ref:n,className:Ne(hN(),e),...t}));ts.displayName=Yz.displayName;const ns=v.forwardRef(({className:e,...t},n)=>s.jsx(Xz,{ref:n,className:Ne(hN({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));ns.displayName=Xz.displayName;const Ome=()=>{const{servers:e,setServers:t,reload:n,loading:r}=Ga(),a=_a(),[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]),Oe({title:"Server duplicated",description:`Created ${S}.`})},x=async b=>{await t(e.filter(y=>y.id!==b.id)),Oe({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(S$,{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(xC,{value:c,onValueChange:d,placeholder:"Search servers..."}),s.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[s.jsx(Na,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(ne,{type:"button",size:"sm",onClick:()=>a("/libraries/servers/new"),children:[s.jsx(xs,{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(ne,{type:"button",size:"sm",className:"mt-4",onClick:()=>a("/libraries/servers/new"),children:[s.jsx(xs,{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(Ue,{children:s.jsx(qe,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs($t,{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(Lr,{children:j.map(b=>s.jsxs($t,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>a(`/libraries/servers/${encodeURIComponent(b.id)}`),children:[s.jsx(ze,{className:"font-medium",children:h(b)}),s.jsx(ze,{children:s.jsx(Qe,{variant:"secondary",className:"font-mono text-xs",children:b.transport})}),s.jsx(ze,{children:s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:g(b)})}),s.jsx(ze,{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(ze,{className:"text-right",onClick:y=>y.stopPropagation(),children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsxs(ne,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>o(b),children:[s.jsx(Ca,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{p(b)},children:[s.jsx(Ui,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>a(`/libraries/servers/${encodeURIComponent(b.id)}`),children:[s.jsx(Ym,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},b.id))})]})})}),s.jsx(Ps,{open:!!i,onOpenChange:b=>!b&&o(null),children:s.jsxs(Xa,{children:[s.jsxs(Qa,{children:[s.jsx(Za,{children:"Delete server?"}),s.jsxs(es,{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(Ja,{children:[s.jsx(ns,{children:"Cancel"}),s.jsx(ts,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{i&&x(i)},children:"Delete Server"})]})]})})]})},SM={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"},Tme=()=>({id:`srv-${Date.now()}`,name:"",transport:"stdio",authType:"none",oauthRedirectUrl:"http://localhost:6274/oauth/"}),Rme=()=>{const{serverId:e}=el(),t=_a(),{servers:n,setServers:r}=Ga(),{source:a}=Tn(),i=e==="new",o=e?decodeURIComponent(e):"",c=i?null:n.find(T=>T.id===o||T.name===o),d=T=>T.name?.trim()||T.id,[f,h]=v.useState(()=>c??Tme()),[p,x]=v.useState(!1),[g,j]=v.useState(!1),[b,y]=v.useState({status:"idle"}),[S,C]=v.useState(!1);v.useEffect(()=>{c&&h(c)},[c]);const N=T=>{h(R=>({...R,authType:T,...T!=="bearer"&&T!=="api-key"?{authValue:void 0}:{},...T!=="api-key"?{apiKeyHeaderName:void 0}:{apiKeyHeaderName:R.apiKeyHeaderName||"X-API-Key"},...T!=="oauth2"?{oauthClientId:void 0,oauthClientSecret:void 0,oauthRedirectUrl:void 0,oauthScope:void 0}:{oauthRedirectUrl:R.oauthRedirectUrl||"http://localhost:6274/oauth/"}}))},E=async()=>{C(!0),y({status:"loading"});try{const R=(await a.discoverToolsForAnalysis({serverNames:[f.id]})).servers[0];R&&R.warnings.length===0?y({status:"success",toolNames:R.tools.map(I=>I.name),toolCount:R.tools.length,testedAt:new Date().toISOString()}):y({status:"error",message:R?.warnings[0]??"Connection failed",testedAt:new Date().toISOString()})}catch(T){y({status:"error",message:T instanceof Error?T.message:String(T),testedAt:new Date().toISOString()})}},_=async()=>{if(!f.name.trim()){Oe({title:"Name is required",variant:"destructive"});return}const T=Iz(f);if(T){Oe({title:"Validation Error",description:T,variant:"destructive"});return}const R={...f,authValue:f.authValue?.trim(),apiKeyHeaderName:f.apiKeyHeaderName?.trim()||void 0};j(!0);try{if(i)await r([...n,R]),Oe({title:"Server created"}),t(`/libraries/servers/${encodeURIComponent(R.id)}`);else{const I=n.map(D=>D.id===c?.id?R:D);await r(I),Oe({title:"Server saved"}),R.id!==o&&t(`/libraries/servers/${encodeURIComponent(R.id)}`,{replace:!0})}}finally{j(!1)}},P=async()=>{const T=n.filter(R=>R.id!==c?.id);await r(T),Oe({title:"Server deleted"}),t("/libraries/servers")},O=()=>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(bt,{to:"/libraries/servers",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(Io,{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(bt,{to:"/libraries/servers",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(Io,{className:"h-4 w-4"})," Servers"]}),s.jsx("h1",{className:"text-2xl font-bold",children:i?"New Server":d(f)})]}),!i&&s.jsxs(ne,{type:"button",onClick:()=>{E()},children:[s.jsx(T$,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),S&&s.jsxs(Ue,{children:[s.jsxs(St,{className:"flex-row items-center justify-between space-y-0",children:[s.jsx(Nt,{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(ys,{className:"h-4 w-4"})})]}),s.jsxs(qe,{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}),O()&&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:O()})]})]}),b.status==="loading"&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(or,{className:"h-4 w-4 animate-spin"}),"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(hc,{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(T=>s.jsx("li",{className:"font-mono text-xs",children:T},T))})]}),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]}),SM[f.transport]&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",SM[f.transport]]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(b.testedAt).toLocaleString()]})]})]})]}),s.jsxs(Ue,{children:[s.jsx(St,{children:s.jsx(Nt,{className:"text-base",children:"Configuration"})}),s.jsxs(qe,{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(Be,{children:"Name"}),s.jsx(ft,{value:f.name,onChange:T=>h(R=>({...R,name:T.target.value})),placeholder:"e.g. Filesystem MCP"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Be,{children:"Transport"}),s.jsxs(wn,{value:f.transport,onValueChange:T=>h(R=>({...R,transport:T})),children:[s.jsx(mn,{children:s.jsx(jn,{})}),s.jsxs(vn,{children:[s.jsx(mt,{value:"stdio",children:"stdio"}),s.jsx(mt,{value:"sse",children:"SSE"}),s.jsx(mt,{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(Be,{children:"Command"}),s.jsx(ft,{value:f.command||"",onChange:T=>h(R=>({...R,command:T.target.value})),placeholder:"npx",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Be,{children:"Args (comma-separated)"}),s.jsx(ft,{value:(f.args||[]).join(", "),onChange:T=>h(R=>({...R,args:T.target.value.split(",").map(I=>I.trim()).filter(Boolean)})),placeholder:"-y, @mcp/server",className:"font-mono text-xs"})]})]}):s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Be,{children:"URL"}),s.jsx(ft,{value:f.url||"",onChange:T=>h(R=>({...R,url:T.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(Be,{children:"Auth Type"}),s.jsxs(wn,{value:f.authType||"none",onValueChange:T=>N(T),children:[s.jsx(mn,{children:s.jsx(jn,{})}),s.jsxs(vn,{children:[s.jsx(mt,{value:"none",children:"None"}),s.jsx(mt,{value:"bearer",children:"Bearer Token"}),s.jsx(mt,{value:"api-key",children:"API Key"}),s.jsx(mt,{value:"oauth2",children:"OAuth 2.0"})]})]})]}),f.authType==="bearer"&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Be,{children:"Token"}),s.jsx(ft,{value:f.authValue||"",onChange:T=>h(R=>({...R,authValue:T.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(Be,{className:"text-xs",children:"Header Name"}),s.jsx(ft,{value:f.apiKeyHeaderName||"X-API-Key",onChange:T=>h(R=>({...R,apiKeyHeaderName:T.target.value})),placeholder:"X-API-Key",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Be,{className:"text-xs",children:"Value"}),s.jsx(ft,{value:f.authValue||"",onChange:T=>h(R=>({...R,authValue:T.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:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Be,{className:"text-xs",children:"Client ID"}),s.jsx(ft,{value:f.oauthClientId||"",onChange:T=>h(R=>({...R,oauthClientId:T.target.value})),placeholder:"your-client-id",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Be,{className:"text-xs",children:"Client Secret (optional)"}),s.jsx(ft,{type:"password",value:f.oauthClientSecret||"",onChange:T=>h(R=>({...R,oauthClientSecret:T.target.value})),placeholder:"••••••••",className:"font-mono text-xs"})]})]}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Be,{className:"text-xs",children:"Redirect URL"}),s.jsx(ft,{value:f.oauthRedirectUrl||"http://localhost:6274/oauth/",onChange:T=>h(R=>({...R,oauthRedirectUrl:T.target.value})),placeholder:"http://localhost:6274/oauth/",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Be,{className:"text-xs",children:"Scope (space-separated)"}),s.jsx(ft,{value:f.oauthScope||"",onChange:T=>h(R=>({...R,oauthScope:T.target.value})),placeholder:"openid profile mcp",className:"font-mono text-xs"})]})]})]}),s.jsxs("div",{className:"flex items-center justify-between pt-2",children:[s.jsx("div",{children:!i&&s.jsx(ne,{type:"button",variant:"destructive",size:"sm",onClick:()=>x(!0),children:"Delete"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ne,{type:"button",variant:"outline",size:"sm",onClick:()=>t("/libraries/servers"),children:"Cancel"}),s.jsxs(ne,{type:"button",size:"sm",onClick:()=>{_()},disabled:g,children:[g&&s.jsx(or,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Create Server":"Save"]})]})]})]})]}),s.jsx(Ps,{open:p,onOpenChange:x,children:s.jsxs(Xa,{children:[s.jsxs(Qa,{children:[s.jsx(Za,{children:"Delete server?"}),s.jsxs(es,{children:["This will permanently remove the server"," ",s.jsx("span",{className:"font-mono",children:f.name}),". This action cannot be undone."]})]}),s.jsxs(Ja,{children:[s.jsx(ns,{children:"Cancel"}),s.jsx(ts,{onClick:()=>{P()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},Ime=()=>{const{agents:e,setAgents:t,reload:n,loading:r}=Ga(),a=_a(),[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]),Oe({title:"Agent duplicated",description:`Created ${b}.`})},x=async g=>{await t(e.filter(j=>j.id!==g.id)),Oe({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(wa,{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(xC,{value:c,onValueChange:d,placeholder:"Search agents..."}),s.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[s.jsx(Na,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(ne,{type:"button",size:"sm",onClick:()=>a("/libraries/agents/new"),children:[s.jsx(xs,{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(ne,{type:"button",size:"sm",className:"mt-4",onClick:()=>a("/libraries/agents/new"),children:[s.jsx(xs,{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(Ue,{children:s.jsx(qe,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs($t,{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(Lr,{children:h.map(g=>s.jsxs($t,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>a(`/libraries/agents/${encodeURIComponent(g.id)}`),children:[s.jsx(ze,{className:"font-medium",children:g.name}),s.jsx(ze,{children:s.jsx(_B,{provider:g.provider})}),s.jsx(ze,{children:s.jsx("span",{className:"font-mono text-xs",children:g.model})}),s.jsx(ze,{className:"font-mono text-xs",children:g.maxTokens}),s.jsx(ze,{className:"font-mono text-xs",children:g.temperature.toFixed(2)}),s.jsx(ze,{className:"text-right",onClick:j=>j.stopPropagation(),children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsxs(ne,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>o(g),children:[s.jsx(Ca,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{p(g)},children:[s.jsx(Ui,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>a(`/libraries/agents/${encodeURIComponent(g.id)}`),children:[s.jsx(Ym,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},g.id))})]})})}),s.jsx(Ps,{open:!!i,onOpenChange:g=>!g&&o(null),children:s.jsxs(Xa,{children:[s.jsxs(Qa,{children:[s.jsx(Za,{children:"Delete agent?"}),s.jsxs(es,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-mono",children:i?.name})," from the library. This action cannot be undone."]})]}),s.jsxs(Ja,{children:[s.jsx(ns,{children:"Cancel"}),s.jsx(ts,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{i&&x(i)},children:"Delete Agent"})]})]})})]})};var e8=["PageUp","PageDown"],t8=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],n8={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},pu="Slider",[DS,Mme,$me]=hf(pu),[r8]=lr(pu,[$me]),[Dme,yg]=r8(pu),a8=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"?Lme:Fme,[E=[],_]=oa({prop:h,defaultProp:f,onChange:D=>{[...y.current][S.current]?.focus(),p(D)}}),P=v.useRef(E);function O(D){const $=Wme(E,D);I(D,$)}function T(D){I(D,S.current)}function R(){const D=P.current[S.current];E[S.current]!==D&&x(E)}function I(D,$,{commit:H}={commit:!1}){const F=Gme(i),q=Yme(Math.round((D-r)/i)*i+r,F),Q=pf(q,[r,a]);_((J=[])=>{const B=Ume(J,Q,$);if(Kme(B,d*i)){S.current=B.indexOf(Q);const U=String(B)!==String(J);return U&&H&&x(B),U?B:J}else return J})}return s.jsx(Dme,{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(DS.Provider,{scope:e.__scopeSlider,children:s.jsx(DS.Slot,{scope:e.__scopeSlider,children:s.jsx(N,{"aria-disabled":c,"data-disabled":c?"":void 0,...b,ref:t,onPointerDown:Re(b.onPointerDown,()=>{c||(P.current=E)}),min:r,max:a,inverted:g,onSlideStart:c?void 0:O,onSlideMove:c?void 0:T,onSlideEnd:c?void 0:R,onHomeKeyDown:()=>!c&&I(r,0,{commit:!0}),onEndKeyDown:()=>!c&&I(a,E.length-1,{commit:!0}),onStepKeyDown:({event:D,direction:$})=>{if(!c){const q=e8.includes(D.key)||D.shiftKey&&t8.includes(D.key)?10:1,Q=S.current,J=E[Q],B=i*q*$;I(J+B,Q,{commit:!0})}}})})})})});a8.displayName=pu;var[s8,i8]=r8(pu,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Lme=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=vt(t,N=>x(N)),j=v.useRef(void 0),b=cu(a),y=b==="ltr",S=y&&!i||!y&&i;function C(N){const E=j.current||p.getBoundingClientRect(),_=[0,E.width],O=DC(_,S?[n,r]:[r,n]);return j.current=E,O(N-E.left)}return s.jsx(s8,{scope:e.__scopeSlider,startEdge:S?"left":"right",endEdge:S?"right":"left",direction:S?1:-1,size:"width",children:s.jsx(o8,{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 _=n8[S?"from-left":"from-right"].includes(N.key);f?.({event:N,direction:_?-1:1})}})})}),Fme=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=vt(t,h),x=v.useRef(void 0),g=!a;function j(b){const y=x.current||h.current.getBoundingClientRect(),S=[0,y.height],N=DC(S,g?[r,n]:[n,r]);return x.current=y,N(b-y.top)}return s.jsx(s8,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:s.jsx(o8,{"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=n8[g?"from-bottom":"from-top"].includes(b.key);d?.({event:b,direction:S?-1:1})}})})}),o8=v.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:a,onSlideEnd:i,onHomeKeyDown:o,onEndKeyDown:c,onStepKeyDown:d,...f}=e,h=yg(pu,n);return s.jsx(Ke.span,{...f,ref:t,onKeyDown:Re(e.onKeyDown,p=>{p.key==="Home"?(o(p),p.preventDefault()):p.key==="End"?(c(p),p.preventDefault()):e8.concat(t8).includes(p.key)&&(d(p),p.preventDefault())}),onPointerDown:Re(e.onPointerDown,p=>{const x=p.target;x.setPointerCapture(p.pointerId),p.preventDefault(),h.thumbs.has(x)?x.focus():r(p)}),onPointerMove:Re(e.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&a(p)}),onPointerUp:Re(e.onPointerUp,p=>{const x=p.target;x.hasPointerCapture(p.pointerId)&&(x.releasePointerCapture(p.pointerId),i(p))})})}),l8="SliderTrack",c8=v.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=yg(l8,n);return s.jsx(Ke.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...r,ref:t})});c8.displayName=l8;var LS="SliderRange",u8=v.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=yg(LS,n),i=i8(LS,n),o=v.useRef(null),c=vt(t,o),d=a.values.length,f=a.values.map(x=>p8(x,a.min,a.max)),h=d>1?Math.min(...f):0,p=100-Math.max(...f);return s.jsx(Ke.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...r,ref:c,style:{...e.style,[i.startEdge]:h+"%",[i.endEdge]:p+"%"}})});u8.displayName=LS;var FS="SliderThumb",d8=v.forwardRef((e,t)=>{const n=Mme(e.__scopeSlider),[r,a]=v.useState(null),i=vt(t,c=>a(c)),o=v.useMemo(()=>r?n().findIndex(c=>c.ref.current===r):-1,[n,r]);return s.jsx(Bme,{...e,ref:i,index:o})}),Bme=v.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:a,...i}=e,o=yg(FS,n),c=i8(FS,n),[d,f]=v.useState(null),h=vt(t,C=>f(C)),p=d?o.form||!!d.closest("form"):!0,x=ev(d),g=o.values[r],j=g===void 0?0:p8(g,o.min,o.max),b=qme(r,o.values.length),y=x?.[c.size],S=y?Vme(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(DS.ItemSlot,{scope:e.__scopeSlider,children:s.jsx(Ke.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:Re(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),p&&s.jsx(f8,{name:a??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:g},r)]})});d8.displayName=FS;var zme="RadioBubbleInput",f8=v.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const a=v.useRef(null),i=vt(a,r),o=lg(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(Ke.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});f8.displayName=zme;function Ume(e=[],t,n){const r=[...e];return r[n]=t,r.sort((a,i)=>a-i)}function p8(e,t,n){const i=100/(n-t)*(e-t);return pf(i,[0,100])}function qme(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Wme(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 Vme(e,t,n){const r=e/2,i=DC([0,50],[0,r]);return(r-i(t)*n)*n}function Hme(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Kme(e,t){if(t>0){const n=Hme(e);return Math.min(...n)>=t}return!0}function DC(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 Gme(e){return(String(e).split(".")[1]||"").length}function Yme(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var h8=a8,Xme=c8,Qme=u8,Jme=d8;const m8=v.forwardRef(({className:e,...t},n)=>s.jsxs(h8,{ref:n,className:Ne("relative flex w-full touch-none select-none items-center",e),...t,children:[s.jsx(Xme,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:s.jsx(Qme,{className:"absolute h-full bg-primary"})}),s.jsx(Jme,{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"})]}));m8.displayName=h8.displayName;function Zme(e){const t=eve(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(nve);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 eve(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=ave(a),c=rve(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Cr(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 tve=Symbol("radix.slottable");function nve(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===tve}function rve(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 ave(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 bg="Popover",[v8]=lr(bg,[Gi]),Lf=Gi(),[sve,ro]=v8(bg),g8=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!1}=e,c=Lf(t),d=v.useRef(null),[f,h]=v.useState(!1),[p,x]=oa({prop:r,defaultProp:a??!1,onChange:i,caller:bg});return s.jsx(tv,{...c,children:s.jsx(sve,{scope:t,contentId:Wn(),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})})};g8.displayName=bg;var x8="PopoverAnchor",ive=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=ro(x8,n),i=Lf(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:c}=a;return v.useEffect(()=>(o(),()=>c()),[o,c]),s.jsx(xf,{...i,...r,ref:t})});ive.displayName=x8;var y8="PopoverTrigger",b8=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=ro(y8,n),i=Lf(n),o=vt(t,a.triggerRef),c=s.jsx(Ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":C8(a.open),...r,ref:o,onClick:Re(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:s.jsx(xf,{asChild:!0,...i,children:c})});b8.displayName=y8;var LC="PopoverPortal",[ove,lve]=v8(LC,{forceMount:void 0}),w8=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=ro(LC,t);return s.jsx(ove,{scope:t,forceMount:n,children:s.jsx(Hn,{present:n||i.open,children:s.jsx(Gc,{asChild:!0,container:a,children:r})})})};w8.displayName=LC;var Wc="PopoverContent",j8=v.forwardRef((e,t)=>{const n=lve(Wc,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=ro(Wc,e.__scopePopover);return s.jsx(Hn,{present:r||i.open,children:i.modal?s.jsx(uve,{...a,ref:t}):s.jsx(dve,{...a,ref:t})})});j8.displayName=Wc;var cve=Zme("PopoverContent.RemoveScroll"),uve=v.forwardRef((e,t)=>{const n=ro(Wc,e.__scopePopover),r=v.useRef(null),a=vt(t,r),i=v.useRef(!1);return v.useEffect(()=>{const o=r.current;if(o)return mv(o)},[]),s.jsx(bf,{as:cve,allowPinchZoom:!0,children:s.jsx(S8,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(e.onCloseAutoFocus,o=>{o.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Re(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:Re(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),dve=v.forwardRef((e,t)=>{const n=ro(Wc,e.__scopePopover),r=v.useRef(!1),a=v.useRef(!1);return s.jsx(S8,{...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()}})}),S8=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=ro(Wc,n),g=Lf(n);return pv(),s.jsx(yf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(Jo,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>x.onOpenChange(!1),children:s.jsx(nv,{"data-state":C8(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)"}})})})}),N8="PopoverClose",fve=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=ro(N8,n);return s.jsx(Ke.button,{type:"button",...r,ref:t,onClick:Re(e.onClick,()=>a.onOpenChange(!1))})});fve.displayName=N8;var pve="PopoverArrow",hve=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Lf(n);return s.jsx(rv,{...a,...r,ref:t})});hve.displayName=pve;function C8(e){return e?"open":"closed"}var mve=g8,vve=b8,gve=w8,A8=j8;const Vc=mve,Hc=vve,Vo=v.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>s.jsx(gve,{children:s.jsx(A8,{ref:a,align:t,sideOffset:n,className:Ne("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})}));Vo.displayName=A8.displayName;var NM=1,xve=.9,yve=.8,bve=.17,Oj=.1,Tj=.999,wve=.9999,jve=.99,Sve=/[\\\/_+.#"@\[\(\{&]/,Nve=/[\\\/_+.#"@\[\(\{&]/g,Cve=/[\s-]/,_8=/[\s-]/g;function BS(e,t,n,r,a,i,o){if(i===t.length)return a===e.length?NM:jve;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=BS(e,t,n,r,f+1,i+1,o),p>h&&(f===a?p*=NM:Sve.test(e.charAt(f-1))?(p*=yve,g=e.slice(a,f-1).match(Nve),g&&a>0&&(p*=Math.pow(Tj,g.length))):Cve.test(e.charAt(f-1))?(p*=xve,j=e.slice(a,f-1).match(_8),j&&a>0&&(p*=Math.pow(Tj,j.length))):(p*=bve,a>0&&(p*=Math.pow(Tj,f-a))),e.charAt(f)!==t.charAt(i)&&(p*=wve)),(p<Oj&&n.charAt(f-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(f-1)!==r.charAt(i))&&(x=BS(e,t,n,r,f+1,i+2,o),x*Oj>p&&(p=x*Oj)),p>h&&(h=p),f=n.indexOf(d,f+1);return o[c]=h,h}function CM(e){return e.toLowerCase().replace(_8," ")}function Ave(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,BS(e,t,CM(e),CM(t),0,0,{})}var sd='[cmdk-group=""]',Rj='[cmdk-group-items=""]',_ve='[cmdk-group-heading=""]',E8='[cmdk-item=""]',AM=`${E8}:not([aria-disabled="true"])`,zS="cmdk-item-select",Gl="data-value",Eve=(e,t,n)=>Ave(e,t,n),P8=v.createContext(void 0),Ff=()=>v.useContext(P8),k8=v.createContext(void 0),FC=()=>v.useContext(k8),O8=v.createContext(void 0),T8=v.forwardRef((e,t)=>{let n=Yl(()=>{var L,ee;return{search:"",value:(ee=(L=e.value)!=null?L:e.defaultValue)!=null?ee:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Yl(()=>new Set),a=Yl(()=>new Map),i=Yl(()=>new Map),o=Yl(()=>new Set),c=R8(e),{label:d,children:f,value:h,onValueChange:p,filter:x,shouldFilter:g,loop:j,disablePointerSelection:b=!1,vimBindings:y=!0,...S}=e,C=Wn(),N=Wn(),E=Wn(),_=v.useRef(null),P=Fve();Ho(()=>{if(h!==void 0){let L=h.trim();n.current.value=L,O.emit()}},[h]),Ho(()=>{P(6,H)},[]);let O=v.useMemo(()=>({subscribe:L=>(o.current.add(L),()=>o.current.delete(L)),snapshot:()=>n.current,setState:(L,ee,se)=>{var G,ue,le,oe;if(!Object.is(n.current[L],ee)){if(n.current[L]=ee,L==="search")$(),I(),P(1,D);else if(L==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ie=document.getElementById(E);ie?ie.focus():(G=document.getElementById(C))==null||G.focus()}if(P(7,()=>{var ie;n.current.selectedItemId=(ie=F())==null?void 0:ie.id,O.emit()}),se||P(5,H),((ue=c.current)==null?void 0:ue.value)!==void 0){let ie=ee??"";(oe=(le=c.current).onValueChange)==null||oe.call(le,ie);return}}O.emit()}},emit:()=>{o.current.forEach(L=>L())}}),[]),T=v.useMemo(()=>({value:(L,ee,se)=>{var G;ee!==((G=i.current.get(L))==null?void 0:G.value)&&(i.current.set(L,{value:ee,keywords:se}),n.current.filtered.items.set(L,R(ee,se)),P(2,()=>{I(),O.emit()}))},item:(L,ee)=>(r.current.add(L),ee&&(a.current.has(ee)?a.current.get(ee).add(L):a.current.set(ee,new Set([L]))),P(3,()=>{$(),I(),n.current.value||D(),O.emit()}),()=>{i.current.delete(L),r.current.delete(L),n.current.filtered.items.delete(L);let se=F();P(4,()=>{$(),se?.getAttribute("id")===L&&D(),O.emit()})}),group:L=>(a.current.has(L)||a.current.set(L,new Set),()=>{i.current.delete(L),a.current.delete(L)}),filter:()=>c.current.shouldFilter,label:d||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:C,inputId:E,labelId:N,listInnerRef:_}),[]);function R(L,ee){var se,G;let ue=(G=(se=c.current)==null?void 0:se.filter)!=null?G:Eve;return L?ue(L,n.current.search,ee):0}function I(){if(!n.current.search||c.current.shouldFilter===!1)return;let L=n.current.filtered.items,ee=[];n.current.filtered.groups.forEach(G=>{let ue=a.current.get(G),le=0;ue.forEach(oe=>{let ie=L.get(oe);le=Math.max(ie,le)}),ee.push([G,le])});let se=_.current;q().sort((G,ue)=>{var le,oe;let ie=G.getAttribute("id"),fe=ue.getAttribute("id");return((le=L.get(fe))!=null?le:0)-((oe=L.get(ie))!=null?oe:0)}).forEach(G=>{let ue=G.closest(Rj);ue?ue.appendChild(G.parentElement===ue?G:G.closest(`${Rj} > *`)):se.appendChild(G.parentElement===se?G:G.closest(`${Rj} > *`))}),ee.sort((G,ue)=>ue[1]-G[1]).forEach(G=>{var ue;let le=(ue=_.current)==null?void 0:ue.querySelector(`${sd}[${Gl}="${encodeURIComponent(G[0])}"]`);le?.parentElement.appendChild(le)})}function D(){let L=q().find(se=>se.getAttribute("aria-disabled")!=="true"),ee=L?.getAttribute(Gl);O.setState("value",ee||void 0)}function $(){var L,ee,se,G;if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ue=0;for(let le of r.current){let oe=(ee=(L=i.current.get(le))==null?void 0:L.value)!=null?ee:"",ie=(G=(se=i.current.get(le))==null?void 0:se.keywords)!=null?G:[],fe=R(oe,ie);n.current.filtered.items.set(le,fe),fe>0&&ue++}for(let[le,oe]of a.current)for(let ie of oe)if(n.current.filtered.items.get(ie)>0){n.current.filtered.groups.add(le);break}n.current.filtered.count=ue}function H(){var L,ee,se;let G=F();G&&(((L=G.parentElement)==null?void 0:L.firstChild)===G&&((se=(ee=G.closest(sd))==null?void 0:ee.querySelector(_ve))==null||se.scrollIntoView({block:"nearest"})),G.scrollIntoView({block:"nearest"}))}function F(){var L;return(L=_.current)==null?void 0:L.querySelector(`${E8}[aria-selected="true"]`)}function q(){var L;return Array.from(((L=_.current)==null?void 0:L.querySelectorAll(AM))||[])}function Q(L){let ee=q()[L];ee&&O.setState("value",ee.getAttribute(Gl))}function J(L){var ee;let se=F(),G=q(),ue=G.findIndex(oe=>oe===se),le=G[ue+L];(ee=c.current)!=null&&ee.loop&&(le=ue+L<0?G[G.length-1]:ue+L===G.length?G[0]:G[ue+L]),le&&O.setState("value",le.getAttribute(Gl))}function B(L){let ee=F(),se=ee?.closest(sd),G;for(;se&&!G;)se=L>0?Dve(se,sd):Lve(se,sd),G=se?.querySelector(AM);G?O.setState("value",G.getAttribute(Gl)):J(L)}let U=()=>Q(q().length-1),Z=L=>{L.preventDefault(),L.metaKey?U():L.altKey?B(1):J(1)},z=L=>{L.preventDefault(),L.metaKey?Q(0):L.altKey?B(-1):J(-1)};return v.createElement(Ke.div,{ref:t,tabIndex:-1,...S,"cmdk-root":"",onKeyDown:L=>{var ee;(ee=S.onKeyDown)==null||ee.call(S,L);let se=L.nativeEvent.isComposing||L.keyCode===229;if(!(L.defaultPrevented||se))switch(L.key){case"n":case"j":{y&&L.ctrlKey&&Z(L);break}case"ArrowDown":{Z(L);break}case"p":case"k":{y&&L.ctrlKey&&z(L);break}case"ArrowUp":{z(L);break}case"Home":{L.preventDefault(),Q(0);break}case"End":{L.preventDefault(),U();break}case"Enter":{L.preventDefault();let G=F();if(G){let ue=new Event(zS);G.dispatchEvent(ue)}}}}},v.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:zve},d),wg(e,L=>v.createElement(k8.Provider,{value:O},v.createElement(P8.Provider,{value:T},L))))}),Pve=v.forwardRef((e,t)=>{var n,r;let a=Wn(),i=v.useRef(null),o=v.useContext(O8),c=Ff(),d=R8(e),f=(r=(n=d.current)==null?void 0:n.forceMount)!=null?r:o?.forceMount;Ho(()=>{if(!f)return c.item(a,o?.id)},[f]);let h=I8(a,i,[e.value,e.children,i],e.keywords),p=FC(),x=Ki(P=>P.value&&P.value===h.current),g=Ki(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(zS,j),()=>P.removeEventListener(zS,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(Ke.div,{ref:Cr(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)}),kve=v.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...i}=e,o=Wn(),c=v.useRef(null),d=v.useRef(null),f=Wn(),h=Ff(),p=Ki(g=>a||h.filter()===!1?!0:g.search?g.filtered.groups.has(o):!0);Ho(()=>h.group(o),[]),I8(o,c,[e.value,e.heading,d]);let x=v.useMemo(()=>({id:o,forceMount:a}),[a]);return v.createElement(Ke.div,{ref:Cr(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),wg(e,g=>v.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},v.createElement(O8.Provider,{value:x},g))))}),Ove=v.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=v.useRef(null),i=Ki(o=>!o.search);return!n&&!i?null:v.createElement(Ke.div,{ref:Cr(a,t),...r,"cmdk-separator":"",role:"separator"})}),Tve=v.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,i=FC(),o=Ki(f=>f.search),c=Ki(f=>f.selectedItemId),d=Ff();return v.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),v.createElement(Ke.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)}})}),Rve=v.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,i=v.useRef(null),o=v.useRef(null),c=Ki(f=>f.selectedItemId),d=Ff();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(Ke.div,{ref:Cr(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:d.listId},wg(e,f=>v.createElement("div",{ref:Cr(o,d.listInnerRef),"cmdk-list-sizer":""},f)))}),Ive=v.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:i,container:o,...c}=e;return v.createElement(gv,{open:n,onOpenChange:r},v.createElement(xv,{container:o},v.createElement(eu,{"cmdk-overlay":"",className:a}),v.createElement(tu,{"aria-label":e.label,"cmdk-dialog":"",className:i},v.createElement(T8,{ref:t,...c}))))}),Mve=v.forwardRef((e,t)=>Ki(n=>n.filtered.count===0)?v.createElement(Ke.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),$ve=v.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...i}=e;return v.createElement(Ke.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},wg(e,o=>v.createElement("div",{"aria-hidden":!0},o)))}),zr=Object.assign(T8,{List:Rve,Item:Pve,Input:Tve,Group:kve,Separator:Ove,Dialog:Ive,Empty:Mve,Loading:$ve});function Dve(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Lve(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function R8(e){let t=v.useRef(e);return Ho(()=>{t.current=e}),t}var Ho=typeof window>"u"?v.useEffect:v.useLayoutEffect;function Yl(e){let t=v.useRef();return t.current===void 0&&(t.current=e()),t}function Ki(e){let t=FC(),n=()=>e(t.snapshot());return v.useSyncExternalStore(t.subscribe,n,n)}function I8(e,t,n,r=[]){let a=v.useRef(),i=Ff();return Ho(()=>{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(Gl,c),a.current=c}),a}var Fve=()=>{let[e,t]=v.useState(),n=Yl(()=>new Map);return Ho(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function Bve(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function wg({asChild:e,children:t},n){return e&&v.isValidElement(t)?v.cloneElement(Bve(t),{ref:t.ref},n(t.props.children)):n(t)}var zve={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ko=v.forwardRef(({className:e,...t},n)=>s.jsx(zr,{ref:n,className:Ne("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Ko.displayName=zr.displayName;const Go=v.forwardRef(({className:e,...t},n)=>s.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[s.jsx(YS,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),s.jsx(zr.Input,{ref:n,className:Ne("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})]}));Go.displayName=zr.Input.displayName;const Yo=v.forwardRef(({className:e,...t},n)=>s.jsx(zr.List,{ref:n,className:Ne("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));Yo.displayName=zr.List.displayName;const Xo=v.forwardRef((e,t)=>s.jsx(zr.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Xo.displayName=zr.Empty.displayName;const Qo=v.forwardRef(({className:e,...t},n)=>s.jsx(zr.Group,{ref:n,className:Ne("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}));Qo.displayName=zr.Group.displayName;const Uve=v.forwardRef(({className:e,...t},n)=>s.jsx(zr.Separator,{ref:n,className:Ne("-mx-1 h-px bg-border",e),...t}));Uve.displayName=zr.Separator.displayName;const na=v.forwardRef(({className:e,...t},n)=>s.jsx(zr.Item,{ref:n,className:Ne("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}));na.displayName=zr.Item.displayName;const _M={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:[]},EM={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"},qve=()=>({id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096}),Wve=()=>{const{agentName:e}=el(),t=_a(),{agents:n,setAgents:r}=Ga(),{source:a}=Tn(),i=e==="new",o=e?decodeURIComponent(e):"",c=i?null:n.find(B=>B.id===o)??n.find(B=>B.name===o),[d,f]=v.useState(()=>c??qve()),[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),[T,R]=v.useState(!1);v.useEffect(()=>{c&&f(c)},[c]);const I=d.provider==="anthropic"||d.provider==="openai"||d.provider==="azure",D=Array.from(new Set([..._M[d.provider]||[],...C])),$=D.includes(d.model),H=T||!!d.model&&!$,F=async()=>{if(S(!0),d.provider==="google"||d.provider==="custom"){b({status:"unsupported"});return}b({status:"loading"});try{const B=await a.listProviderModels(d.provider);b({status:"success",items:B.items,source:B.source,kind:B.kind,testedAt:new Date().toISOString()})}catch(B){b({status:"error",message:B instanceof Error?B.message:String(B),testedAt:new Date().toISOString()})}},q=async()=>{if(!I){Oe({title:"Provider discovery not supported",description:"Model discovery is available for Anthropic, OpenAI, and Azure OpenAI."});return}_(!0);try{const B=await a.listProviderModels(d.provider);N(B.items),Oe({title:B.kind==="deployments"?"Deployments loaded":"Models loaded",description:`${B.items.length} ${B.kind} from ${B.source}`})}catch(B){Oe({title:"Could not load provider models",description:String(B instanceof Error?B.message:B),variant:"destructive"})}finally{_(!1)}},Q=async()=>{if(!d.name.trim()){Oe({title:"Name is required",variant:"destructive"});return}g(!0);try{if(i)await r([...n,d]),Oe({title:"Agent created"}),t(`/libraries/agents/${encodeURIComponent(d.id)}`);else{const B=n.map(U=>U.id===c?.id?d:U);await r(B),Oe({title:"Agent saved"}),d.id!==o&&t(`/libraries/agents/${encodeURIComponent(d.id)}`,{replace:!0})}}finally{g(!1)}},J=async()=>{const B=n.filter(U=>U.id!==c?.id);await r(B),Oe({title:"Agent deleted"}),t("/libraries/agents")};return!i&&!c?s.jsxs("div",{className:"space-y-4",children:[s.jsxs(bt,{to:"/libraries/agents",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(Io,{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(bt,{to:"/libraries/agents",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(Io,{className:"h-4 w-4"})," Agents"]}),s.jsx("h1",{className:"text-2xl font-bold",children:i?"New Agent":d.name})]}),!i&&s.jsxs(ne,{type:"button",onClick:()=>{F()},children:[s.jsx(T$,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),y&&s.jsxs(Ue,{children:[s.jsxs(St,{className:"flex-row items-center justify-between space-y-0",children:[s.jsx(Nt,{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(ys,{className:"h-4 w-4"})})]}),s.jsxs(qe,{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(or,{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(hc,{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(B=>s.jsx("li",{className:"font-mono text-xs",children:B},B))})]}),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]}),EM[d.provider]&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",EM[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(Ue,{children:[s.jsx(St,{children:s.jsx(Nt,{className:"text-base",children:"Configuration"})}),s.jsxs(qe,{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(Be,{children:"Name"}),s.jsx(ft,{value:d.name,onChange:B=>f(U=>({...U,name:B.target.value})),placeholder:"e.g. GPT-4o"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Be,{children:"Provider"}),s.jsxs(wn,{value:d.provider,onValueChange:B=>f(U=>({...U,provider:B,model:_M[B]?.[0]||""})),children:[s.jsx(mn,{children:s.jsx(jn,{})}),s.jsxs(vn,{children:[s.jsx(mt,{value:"openai",children:"OpenAI"}),s.jsx(mt,{value:"anthropic",children:"Anthropic"}),s.jsx(mt,{value:"azure",children:"Azure OpenAI"}),s.jsx(mt,{value:"google",children:"Google"}),s.jsx(mt,{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(Be,{children:d.provider==="azure"?"Deployment":"Model"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(Vc,{open:P,onOpenChange:O,children:[s.jsx(Hc,{asChild:!0,children:s.jsxs(ne,{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(Dt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(Vo,{className:"w-[420px] p-0",align:"start",children:s.jsxs(Ko,{children:[s.jsx(Go,{placeholder:`Search ${d.provider==="azure"?"deployments":"models"}...`}),s.jsxs(Yo,{children:[s.jsxs(Xo,{children:["No ",d.provider==="azure"?"deployments":"models"," found."]}),s.jsxs(Qo,{heading:d.provider==="azure"?"Deployments":"Models",children:[D.map(B=>s.jsxs(na,{value:B,onSelect:U=>{f(Z=>({...Z,model:U})),R(!1),O(!1)},children:[s.jsx(hc,{className:Ne("mr-2 h-4 w-4",d.model===B?"opacity-100":"opacity-0")}),s.jsx("span",{className:"font-mono text-xs",children:B})]},B)),s.jsx(na,{value:"__custom_model_id__",onSelect:()=>{R(!0),O(!1)},children:s.jsx("span",{className:"font-medium",children:d.provider==="azure"?"Custom deployment ID...":"Custom model ID..."})})]})]})]})})]}),I&&s.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"h-9 shrink-0 text-xs",onClick:()=>{q()},disabled:E,title:d.provider==="azure"?"Fetch Azure OpenAI deployments":`Fetch ${d.provider} models`,children:[E?s.jsx(or,{className:"mr-1 h-3 w-3 animate-spin"}):s.jsx(Na,{className:"mr-1 h-3 w-3"}),d.provider==="azure"?"Fetch Deployments":"Fetch Models"]})]}),H&&s.jsx(ft,{value:d.model,onChange:B=>f(U=>({...U,model:B.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(Be,{children:"Max Tokens"}),s.jsx(ft,{type:"number",min:1,max:128e3,value:d.maxTokens,onChange:B=>f(U=>({...U,maxTokens:parseInt(B.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(Be,{children:"Max Turns"}),s.jsx(ft,{type:"number",min:1,max:50,value:d.maxTurns??"",onChange:B=>{const U=B.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(Be,{children:"Temperature"}),s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:d.temperature.toFixed(2)})]}),s.jsx(m8,{value:[d.temperature],onValueChange:([B])=>f(U=>({...U,temperature:B})),min:0,max:2,step:.01})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Be,{children:"System Prompt"}),s.jsx(Wa,{value:d.systemPrompt||"",onChange:B=>f(U=>({...U,systemPrompt:B.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(ne,{type:"button",variant:"destructive",size:"sm",onClick:()=>p(!0),children:"Delete"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ne,{type:"button",variant:"outline",size:"sm",onClick:()=>t("/libraries/agents"),children:"Cancel"}),s.jsxs(ne,{type:"button",size:"sm",onClick:()=>{Q()},disabled:x,children:[x&&s.jsx(or,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Create Agent":"Save"]})]})]})]})]}),s.jsx(Ps,{open:h,onOpenChange:p,children:s.jsxs(Xa,{children:[s.jsxs(Qa,{children:[s.jsx(Za,{children:"Delete agent?"}),s.jsxs(es,{children:["This will permanently remove the agent"," ",s.jsx("span",{className:"font-mono",children:d.name}),". This action cannot be undone."]})]}),s.jsxs(Ja,{children:[s.jsx(ns,{children:"Cancel"}),s.jsx(ts,{onClick:()=>{J()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},PM="mcplab.resultAssistantScenarioHandoff",kM=()=>{const{testCaseId:e}=el(),[t,n]=Yi(),r=_a(),{source:a}=Tn(),{scenarios:i,setScenarios:o,agents:c,servers:d,reload:f,loading:h}=Ga(),[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,T]=v.useState("idle"),[R,I]=v.useState(""),[D,$]=v.useState(""),[H,F]=v.useState(0),[q,Q]=v.useState(null),J=v.useRef(null),B=v.useRef(!1),U=v.useRef(!1),Z=v.useRef(null),z=v.useRef(0),L=e?decodeURIComponent(e):void 0,ee=L?i.findIndex(je=>je.id===L):-1,se=ee>=0?i[ee]:void 0,G=async je=>{if(!se||ee<0||!je)return;const Me=[...i];Me[ee]=je,await o(Me)},ue=async()=>{const je=Z.current;if(!je||!se)return;if(B.current){U.current=!0;return}B.current=!0,U.current=!1;const Me=++z.current;T("saving"),I("");try{await G(je),Me===z.current&&T("saved")}catch(Y){const ye=Y instanceof Error?Y.message:String(Y);Me===z.current&&(T("error"),I(ye)),Oe({title:"Could not save scenario",description:ye,variant:"destructive"})}finally{B.current=!1,U.current&&(U.current=!1,ue())}},le=je=>{Z.current=je,T("dirty"),I(""),J.current&&window.clearTimeout(J.current),J.current=window.setTimeout(()=>{J.current=null,ue()},700)},oe=async()=>{const je=`scn-${Date.now()}`;let Me=je,Y=1;for(;i.some(de=>de.id===Me);)Me=`${je}-${Y}`,Y+=1;const ye={id:Me,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};await o([...i,ye]),r(`/libraries/test-cases/${encodeURIComponent(Me)}`),Oe({title:"Test case created",description:`Opened ${Me} for editing.`})},ie=je=>{const Me=(je||`scn-${Date.now()}`).trim().replace(/\s+/g,"-").replace(/[^a-zA-Z0-9_-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")||`scn-${Date.now()}`;let Y=Me,ye=1;for(;i.some(de=>de.id===Y);)Y=`${Me}-${ye}`,ye+=1;return Y},fe=async(je,Me=!1)=>{const Y=ie(`${je.id}-copy`),ye={...structuredClone(je),id:Y,name:je.name?`${je.name} (Copy)`:""};await o([...i,ye]),Oe({title:"Test case duplicated",description:`Created ${ye.id}.`}),Me&&r(`/libraries/test-cases/${encodeURIComponent(ye.id)}`)},Ae=async je=>{J.current&&(window.clearTimeout(J.current),J.current=null);const Me=i.filter(Y=>Y.id!==je.id);await o(Me),Oe({title:"Test case deleted",description:`${je.id} was removed.`}),se?.id===je.id&&(P(null),Z.current=null,T("idle"),I(""),r("/libraries/test-cases"))},re=je=>je.map(Me=>d.find(Y=>Y.id===Me)).filter(Boolean).map(Me=>Me?.name||Me?.id).filter(Boolean),Te=v.useMemo(()=>{const je=new Set;for(const Me of i)for(const Y of re(Me.serverIds))je.add(Y);return Array.from(je).sort((Me,Y)=>Me.localeCompare(Y))},[i,d]),_e=v.useMemo(()=>{const je=p.trim().toLowerCase(),Me=i.filter(Y=>{const ye=(Y.name||"").toLowerCase(),de=Y.id.toLowerCase(),Pe=(Y.prompt||"").toLowerCase(),Ye=re(Y.serverIds);return g!=="all"&&!Ye.includes(g)?!1:je?ye.includes(je)||de.includes(je)||Pe.includes(je)||Ye.some(wt=>wt.toLowerCase().includes(je)):!0});return Me.sort((Y,ye)=>{const de=re(Y.serverIds),Pe=re(ye.serverIds);let Ye=0;switch(b){case"id":Ye=Y.id.localeCompare(ye.id);break;case"servers":Ye=de.length-Pe.length;break;case"evalRules":Ye=Y.evalRules.length-ye.evalRules.length;break;case"extractRules":Ye=Y.extractRules.length-ye.extractRules.length;break;default:Ye=(Y.name||Y.id).localeCompare(ye.name||ye.id);break}return Ye===0&&(Ye=Y.id.localeCompare(ye.id)),S==="asc"?Ye:-Ye}),Me},[i,p,g,b,S,d]);v.useEffect(()=>{let je=!0;return a.getWorkspaceSettings().then(Me=>{!je||!Me||E(Me.scenarioAssistantAgentName??"")}).catch(()=>{je&&E("")}),()=>{je=!1}},[a]),v.useEffect(()=>{if(L&&t.get("assistantHandoff")==="1")try{const je=window.sessionStorage.getItem(PM);if(!je)return;const Me=JSON.parse(je);if(!Me||Me.scenarioId!==L||!Me.prompt)return;$(String(Me.prompt)),F(Date.now()),window.sessionStorage.removeItem(PM);const Y=new URLSearchParams(t);Y.delete("assistantHandoff"),n(Y,{replace:!0}),Oe({title:"Suggestion sent to Scenario Assistant",description:"Review the suggestion and apply changes in the scenario editor."})}catch{}},[L,t,n]),v.useEffect(()=>{se?(P(structuredClone(se)),Z.current=structuredClone(se),T("idle"),I("")):(P(null),Z.current=null,T("idle"),I("")),J.current&&(window.clearTimeout(J.current),J.current=null),B.current=!1,U.current=!1},[se]),v.useEffect(()=>()=>{J.current&&window.clearTimeout(J.current)},[]);const Ge=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(N$,{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(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>r("/libraries/test-cases"),children:[s.jsx(Io,{className:"mr-2 h-4 w-4"}),"Back to Overview"]}),s.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{f()},disabled:h,children:[s.jsx(Na,{className:"mr-2 h-4 w-4"}),"Refresh"]}),!se&&s.jsxs(ne,{type:"button",size:"sm",onClick:()=>{oe()},children:[s.jsx(xs,{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(Be,{className:"text-xs",children:"Search"}),s.jsxs("div",{className:"relative",children:[s.jsx(YS,{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(ft,{value:p,onChange:je=>x(je.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(Be,{className:"text-xs",children:"Server Filter"}),s.jsxs(wn,{value:g,onValueChange:j,children:[s.jsx(mn,{className:"h-8 text-xs",children:s.jsx(jn,{})}),s.jsxs(vn,{children:[s.jsx(mt,{value:"all",children:"All servers"}),Te.map(je=>s.jsx(mt,{value:je,children:je},je))]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Be,{className:"text-xs",children:"Sort By"}),s.jsxs(wn,{value:b,onValueChange:je=>y(je),children:[s.jsx(mn,{className:"h-8 text-xs",children:s.jsx(jn,{})}),s.jsxs(vn,{children:[s.jsx(mt,{value:"name",children:"Name"}),s.jsx(mt,{value:"id",children:"ID"}),s.jsx(mt,{value:"servers",children:"# Servers"}),s.jsx(mt,{value:"evalRules",children:"# Eval Rules"}),s.jsx(mt,{value:"extractRules",children:"# Extract Rules"})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Be,{className:"text-xs",children:"Direction"}),s.jsxs(wn,{value:S,onValueChange:je=>C(je),children:[s.jsx(mn,{className:"h-8 w-28 text-xs",children:s.jsx(jn,{})}),s.jsxs(vn,{children:[s.jsx(mt,{value:"asc",children:"Ascending"}),s.jsx(mt,{value:"desc",children:"Descending"})]})]})]})]}),s.jsx(Ue,{children:s.jsxs(qe,{className:"space-y-3 pt-6",children:[s.jsxs("div",{className:"text-xs text-muted-foreground",children:["Showing ",_e.length," of ",i.length," test case",i.length!==1?"s":"","."]}),L&&!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:L})," was not found."]}),i.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No library test cases yet."}):_e.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:_e.map(je=>{const Me=L===je.id,Y=`/libraries/test-cases/${encodeURIComponent(je.id)}`,ye=re(je.serverIds);return s.jsx("div",{className:`rounded-lg border p-3 ${Me?"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(bt,{to:Y,className:"font-medium truncate hover:underline",children:je.name||je.id}),s.jsx(Qe,{variant:"outline",className:"font-mono text-[10px]",children:je.id}),Me&&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:[ye.length," server",ye.length!==1?"s":""]}),s.jsxs("span",{children:[je.evalRules.length," eval rule",je.evalRules.length!==1?"s":""]}),s.jsxs("span",{children:[je.extractRules.length," extract rule",je.extractRules.length!==1?"s":""]})]}),ye.length>0&&s.jsx("div",{className:"flex flex-wrap gap-1",children:ye.map(de=>s.jsx(Qe,{variant:"secondary",className:"text-[10px]",children:de},`${je.id}-${de}`))})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(ne,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>Q(je),children:[s.jsx(Ca,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{fe(je)},children:[s.jsx(Ui,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsx(ne,{type:"button",size:"sm",variant:Me?"default":"outline",asChild:!0,children:s.jsxs(bt,{to:Y,children:[s.jsx(Ym,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})})]})]})},je.id)})})]})})]}),se&&_?s.jsxs(Ue,{children:[s.jsxs(St,{className:"pb-3",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsx("div",{children:s.jsx(Nt,{className:"text-base",children:"Edit Test Case"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{fe(_,!0)},children:[s.jsx(Ui,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(ne,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>Q(_),children:[s.jsx(Ca,{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"&&R&&s.jsx("span",{className:"text-[11px] text-destructive",children:R})]})})]}),s.jsx(qe,{className:"pt-3",children:s.jsx($S,{scenarios:[_],agents:c,servers:d,defaultAssistantAgentName:Ge,assistantInitialPromptByScenarioId:D&&_?.id?{[_.id]:D}:void 0,assistantAutoOpenNonceByScenarioId:_?.id&&H?{[_.id]:H}:void 0,onChange:je=>{const Me=je[0];Me&&(P(Me),le(Me))},allowAdd:!1})})]}):null,s.jsx(Ps,{open:!!q,onOpenChange:je=>!je&&Q(null),children:s.jsxs(Xa,{children:[s.jsxs(Qa,{children:[s.jsx(Za,{children:"Delete test case?"}),s.jsxs(es,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-medium",children:q?.name||q?.id})," ","from the library. This action cannot be undone."]})]}),s.jsxs(Ja,{children:[s.jsx(ns,{children:"Cancel"}),s.jsx(ts,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{q&&(Ae(q),Q(null))},children:"Delete Test Case"})]})]})})]})},Vve=()=>{const{source:e}=Tn(),{agents:t,reload:n,loading:r}=Ga(),[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(""),Oe({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}),Oe({title:"Settings updated",description:j?`Scenario Assistant Agent set to ${j}.`:"Scenario Assistant Agent cleared (will use first available agent by default)."})}catch(b){Oe({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(XS,{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(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{g()},disabled:r||a,children:[s.jsx(Na,{className:"mr-2 h-4 w-4"}),"Refresh"]})]}),s.jsxs(Ue,{children:[s.jsxs(St,{className:"pb-3",children:[s.jsx(Nt,{className:"text-base",children:"Scenario Assistant"}),s.jsx(hs,{children:"Default assistant model used on library test case pages. If unset, MCP Lab uses the first available agent automatically."})]}),s.jsxs(qe,{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(Be,{className:"text-xs",children:"Assistant Agent"}),s.jsxs(wn,{value:h||"__none__",onValueChange:j=>{x(j==="__none__"?"":j)},disabled:o,children:[s.jsx(mn,{className:"h-9 text-sm",children:s.jsx(jn,{placeholder:"Select assistant agent"})}),s.jsxs(vn,{children:[s.jsx(mt,{value:"__none__",children:"None (use first agent)"}),t.map(j=>s.jsxs(mt,{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 jg="Checkbox",[Hve]=lr(jg),[Kve,BC]=Hve(jg);function Gve(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]=oa({prop:n,defaultProp:a??!1,onChange:d,caller:jg}),[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:zi(a)?!1:a,isFormControl:N,bubbleInput:y,setBubbleInput:S};return s.jsx(Kve,{scope:t,...E,children:Yve(p)?p(E):r})}var M8="CheckboxTrigger",$8=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}=BC(M8,e),b=vt(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(Ke.button,{type:"button",role:"checkbox","aria-checked":zi(d)?"mixed":d,"aria-required":f,"data-state":z8(d),"data-disabled":c?"":void 0,disabled:c,value:o,...r,ref:b,onKeyDown:Re(t,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:Re(n,S=>{p(C=>zi(C)?!0:!C),j&&g&&(x.current=S.isPropagationStopped(),x.current||S.stopPropagation())})})});$8.displayName=M8;var zC=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(Gve,{__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($8,{...p,ref:t,__scopeCheckbox:n}),x&&s.jsx(B8,{__scopeCheckbox:n})]})})});zC.displayName=jg;var D8="CheckboxIndicator",L8=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,i=BC(D8,n);return s.jsx(Hn,{present:r||zi(i.checked)||i.checked===!0,children:s.jsx(Ke.span,{"data-state":z8(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});L8.displayName=D8;var F8="CheckboxBubbleInput",B8=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}=BC(F8,e),j=vt(n,g),b=lg(i),y=ev(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=zi(i),_.call(C,zi(i)?!1:i),C.dispatchEvent(O)}},[x,b,i,a]);const S=v.useRef(zi(i)?!1:i);return s.jsx(Ke.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%)"}})});B8.displayName=F8;function Yve(e){return typeof e=="function"}function zi(e){return e==="indeterminate"}function z8(e){return zi(e)?"indeterminate":e?"checked":"unchecked"}const ra=v.forwardRef(({className:e,...t},n)=>s.jsx(zC,{ref:n,className:Ne("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(L8,{className:Ne("flex items-center justify-center text-current"),children:s.jsx(hc,{className:"h-4 w-4"})})}));ra.displayName=zC.displayName;const Xve=Zo("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"}}),dc=v.forwardRef(({className:e,variant:t,...n},r)=>s.jsx("div",{ref:r,role:"alert",className:Ne(Xve({variant:t}),e),...n}));dc.displayName="Alert";const fc=v.forwardRef(({className:e,...t},n)=>s.jsx("h5",{ref:n,className:Ne("mb-1 font-medium leading-none tracking-tight",e),...t}));fc.displayName="AlertTitle";const pc=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Ne("text-sm [&_p]:leading-relaxed",e),...t}));pc.displayName="AlertDescription";function Qve(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,Jve(a,...t)]}function Jve(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=r.reduce((c,{useScope:d,scopeName:f})=>{const p=d(i)[`__scope${f}`];return{...c,...p}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var Zve=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],U8=Zve.reduce((e,t)=>{const n=fv(`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}},{}),UC="Progress",qC=100,[ege]=Qve(UC),[tge,nge]=ege(UC),q8=v.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:a,getValueLabel:i=rge,...o}=e;(a||a===0)&&!OM(a)&&console.error(age(`${a}`,"Progress"));const c=OM(a)?a:qC;r!==null&&!TM(r,c)&&console.error(sge(`${r}`,"Progress"));const d=TM(r,c)?r:null,f=Wm(d)?i(d,c):void 0;return s.jsx(tge,{scope:n,value:d,max:c,children:s.jsx(U8.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":Wm(d)?d:void 0,"aria-valuetext":f,role:"progressbar","data-state":H8(d,c),"data-value":d??void 0,"data-max":c,...o,ref:t})})});q8.displayName=UC;var W8="ProgressIndicator",V8=v.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,a=nge(W8,n);return s.jsx(U8.div,{"data-state":H8(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...r,ref:t})});V8.displayName=W8;function rge(e,t){return`${Math.round(e/t*100)}%`}function H8(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Wm(e){return typeof e=="number"}function OM(e){return Wm(e)&&!isNaN(e)&&e>0}function TM(e,t){return Wm(e)&&!isNaN(e)&&e<=t&&e>=0}function age(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${qC}\`.`}function sge(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 ${qC} if no \`max\` prop is set)
133
- - \`null\` or \`undefined\` if the progress is indeterminate.
134
-
135
- Defaulting to \`null\`.`}var K8=q8,ige=V8;const Sg=v.forwardRef(({className:e,value:t,...n},r)=>s.jsx(K8,{ref:r,className:Ne("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:s.jsx(ige,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Sg.displayName=K8.displayName;function G8(e){const t=e.toLowerCase();return t.includes("side-effectful prefix")||t.includes("destructive behavior")||t.includes("destructivehint")}function RM(e){try{return JSON.stringify(e,null,2)}catch{return"[schema not serializable]"}}const bo=["critical","high","medium","low","info"];function vh(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 oge(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 IM(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"tool"}function Ij({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(H7,{className:"h-3.5 w-3.5"}),"Suggested improvement"]}),s.jsx("p",{children:e})]})}function WC(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("```")};t.push("# MCP Tool Analysis Report",""),t.push(`- Created: ${e.createdAt}`),t.push(`- Assistant Agent: ${e.assistantAgentName}`),t.push(`- Assistant Model: ${e.assistantAgentModel}`),t.push(`- Modes: ${[e.modes.metadataReview?"metadata review":null,e.modes.deeperAnalysis?"deeper analysis":null].filter(Boolean).join(" + ")}`),t.push("","## Summary"),t.push(`- Servers analyzed: ${e.summary.serversAnalyzed}`),t.push(`- Tools analyzed: ${e.summary.toolsAnalyzed}`),t.push(`- Tools skipped: ${e.summary.toolsSkipped}`,"");for(const 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 Y8({report:e}){const[t,n]=Yi(),[r,a]=v.useState([...bo]),[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=T=>{a(R=>{const I=R.includes(T)?R.filter(D=>D!==T):[...R,T];return I.length===0?[...bo]:I})},y=T=>{const R=new URLSearchParams(t);T==="severity"?R.set("groupBy","severity"):R.delete("groupBy"),n(R,{replace:!0})},S=v.useMemo(()=>{const T={critical:[],high:[],medium:[],low:[],info:[]};for(const R of e.servers)for(const I of R.tools){const D=`tool-${IM(`${R.serverName}-${I.publicToolName}`)}`,$=`${R.serverName}::${I.publicToolName}`,H=I.publicToolName.split("::").pop()??I.publicToolName;for(const F of I.metadataReview?.issues??[]){const q=F.severity;T[q].push({key:`${$}-metadata-${F.id}`,toolAnchorId:D,toolLabel:$,toolDisplayName:H,sourceLabel:"Metadata review",issue:{id:F.id,title:F.title,detail:F.detail,severity:q,suggestion:F.suggestion}})}for(const F of I.deeperAnalysis?.sampleCalls??[])for(const q of F.issues){const Q=q.severity;T[Q].push({key:`${$}-call-${F.callIndex}-${q.id}`,toolAnchorId:D,toolLabel:$,toolDisplayName:H,sourceLabel:`Sample call ${F.callIndex}`,issue:{id:q.id,title:q.title,detail:q.detail,severity:Q,suggestion:q.suggestion}})}}return T},[e.servers]),C=v.useMemo(()=>Array.from(new Set(e.servers.flatMap(T=>T.tools.map(R=>R.publicToolName)).map(T=>T.split("::").pop()??T))).sort((T,R)=>T.localeCompare(R)),[e.servers]),N=T=>g.length===0?!0:(T.toLowerCase().split("::").pop()??T.toLowerCase()).includes(g),E=T=>{if(!x.current)return;x.current.querySelectorAll("details").forEach(I=>{I.open=T})},_=()=>o(new Set(bo)),P=()=>o(new Set),O=T=>{o(R=>{const I=new Set(R);return I.has(T)?I.delete(T):I.add(T),I})};return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[s.jsx(Ue,{children:s.jsxs(qe,{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(Ue,{children:s.jsxs(qe,{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(Ue,{children:s.jsxs(qe,{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(Ue,{children:[s.jsxs(St,{className:"pb-3",children:[s.jsx(Nt,{className:"text-base",children:"Analysis Overview"}),s.jsx(hs,{children:"Visual breakdown of findings by severity. Click badges to filter the report."})]}),s.jsx(qe,{children:s.jsxs("div",{className:"flex flex-wrap gap-2",children:[bo.filter(T=>e.summary.issueCounts[T]>0).map(T=>{const R=j.has(T);return s.jsx("button",{type:"button",onClick:()=>b(T),className:"rounded-full","aria-pressed":R,children:s.jsxs(Qe,{variant:"outline",className:`capitalize font-normal ${R?vh(T):oge(T)} ${R?"ring-1 ring-current":"opacity-70"}`,children:[T,": ",e.summary.issueCounts[T]]})},T)}),s.jsx(ne,{type:"button",size:"sm",variant:"ghost",onClick:()=>a([...bo]),className:"h-7 px-2 text-xs",children:"Reset"})]})})]}),s.jsxs("div",{className:"space-y-0",children:[s.jsx(dg,{value:p,onValueChange:T=>{(T==="tool"||T==="severity")&&y(T)},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(Df,{className:"h-auto justify-start rounded-none bg-transparent p-0",children:[s.jsx(gs,{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(gs,{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(Vc,{open:f,onOpenChange:h,children:[s.jsx(Hc,{asChild:!0,children:s.jsxs(ne,{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(Dt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(Vo,{className:"w-[320px] p-0",align:"end",children:s.jsxs(Ko,{children:[s.jsx(Go,{placeholder:"Search tools..."}),s.jsxs(Yo,{children:[s.jsx(Xo,{children:"No tools found."}),s.jsxs(Qo,{children:[s.jsx(na,{value:"all tools",onSelect:()=>{d(""),h(!1)},children:"All tools"}),C.map(T=>s.jsx(na,{value:T,onSelect:()=>{d(T),h(!1)},children:T},T))]})]})]})})]}),p==="severity"&&s.jsxs(s.Fragment,{children:[s.jsx(ne,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:P,children:"Expand all"}),s.jsx(ne,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:_,children:"Collapse all"})]}),p==="tool"&&s.jsxs(s.Fragment,{children:[s.jsx(ne,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>E(!0),children:"Expand all"}),s.jsx(ne,{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:bo.filter(T=>j.has(T)).map(T=>{const R=S[T].filter(D=>N(D.toolLabel));if(R.length===0)return null;const I=i.has(T);return s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx(Nt,{className:"text-base capitalize",children:T}),s.jsxs(hs,{children:[R.length," finding(s)"]})]}),s.jsx("div",{className:"flex gap-2",children:s.jsx(ne,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>O(T),children:I?"Expand":"Collapse"})})]})}),!I&&s.jsx(qe,{className:"space-y-2",children:R.map((D,$)=>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:$+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] ${vh(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(ne,{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(Ij,{text:D.issue.suggestion})]},D.key))})]},T)})}):s.jsx("div",{ref:x,className:"space-y-4",children:e.servers.map(T=>{const R=T.tools.filter(I=>{const D=`${T.serverName}::${I.publicToolName}`;if(!N(D))return!1;const $=[...I.metadataReview?.issues??[],...I.deeperAnalysis?.sampleCalls.flatMap(H=>H.issues)??[]];return $.length===0?r.length===bo.length:$.some(H=>j.has(H.severity))});return R.length===0?null:s.jsxs(Ue,{children:[s.jsxs(St,{className:"pb-3",children:[s.jsx(Nt,{className:"text-base",children:T.serverName}),s.jsxs(hs,{children:["Discovered ",T.toolCountDiscovered," · Showing ",R.length," of ",T.toolCountAnalyzed," analyzed · Skipped ",T.toolCountSkipped]})]}),s.jsxs(qe,{className:"space-y-3",children:[T.warnings.length>0&&s.jsxs(dc,{children:[s.jsx(fc,{children:"Warnings"}),s.jsx(pc,{children:s.jsx("ul",{className:"ml-4 list-disc space-y-1",children:T.warnings.map(I=>s.jsx("li",{children:I},`${T.serverName}-${I}`))})})]}),R.map(I=>{const D=I.publicToolName.split("::").pop()??I.publicToolName,$=G8(I.classificationReason),H=I.safetyClassification==="read_like"?"read-like":$?"write/delete":"unsafe/unknown";return s.jsxs("details",{id:`tool-${IM(`${T.serverName}-${I.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:I.publicToolName,children:D}),s.jsx(Qe,{variant:"outline",className:`shrink-0 whitespace-nowrap ${I.safetyClassification==="read_like"?"border-emerald-200 bg-emerald-50 text-emerald-700":$?"border-amber-300 bg-amber-50 text-amber-800":"border-slate-300 bg-slate-100 text-slate-700"}`,children:H})]}),s.jsx(Dt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),I.title&&s.jsx("p",{className:"text-sm text-foreground/85",children:I.title}),I.description&&s.jsx("p",{className:"text-xs text-muted-foreground",children:I.description})]})}),s.jsxs("div",{className:"mt-3 space-y-2",children:[(I.inputSchema!==void 0||I.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(Dt,{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:[I.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:RM(I.inputSchema)})]}),I.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:RM(I.outputSchema)})]})]})]}),I.metadataReview&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:"Metadata review"}),I.metadataReview.issues.filter(F=>j.has(F.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:I.metadataReview.issues.filter(F=>j.has(F.severity)).map((F,q)=>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:q+1}),s.jsx("span",{className:"min-w-0 font-bold leading-tight",children:F.title})]}),s.jsx(Qe,{variant:"outline",className:`shrink-0 text-[10px] ${vh(F.severity)}`,children:F.severity})]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",F.detail]}),F.suggestion&&s.jsx(Ij,{text:F.suggestion})]},F.id))})]}),I.deeperAnalysis&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:"Deeper analysis"}),I.deeperAnalysis.attempted?s.jsx("div",{className:"space-y-2",children:I.deeperAnalysis.sampleCalls.map(F=>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:F.ok?"secondary":"destructive",className:"text-[10px]",children:F.ok?"ok":"error"}),s.jsxs("span",{children:["Call ",F.callIndex]}),F.durationMs!==void 0&&s.jsxs("span",{className:"text-muted-foreground",children:[F.durationMs,"ms"]})]}),F.error&&s.jsx("p",{className:"text-destructive",children:F.error}),F.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:F.observations.map((q,Q)=>s.jsx("li",{children:q},`${I.publicToolName}-obs-${F.callIndex}-${Q}`))})]}),F.issues.filter(q=>j.has(q.severity)).length>0&&s.jsx("div",{className:"mt-2 space-y-1",children:F.issues.filter(q=>j.has(q.severity)).map((q,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:q.title})]}),s.jsx(Qe,{variant:"outline",className:`shrink-0 text-[10px] ${vh(q.severity)}`,children:q.severity})]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",q.detail]}),q.suggestion&&s.jsx(Ij,{text:q.suggestion})]},`${F.callIndex}-${q.id}`))})]},`${I.publicToolName}-call-${F.callIndex}`))}):s.jsx("p",{className:"text-xs text-muted-foreground",children:I.deeperAnalysis.skippedReason??"Skipped"})]})]})]},I.publicToolName)})]})]},T.serverName)})})]})]})}function lge(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 Mj="mcplab.toolAnalysis.activeJobId";function MM(e,t,n){const r=new Blob([t],{type:n}),a=URL.createObjectURL(r),i=document.createElement("a");i.href=a,i.download=e,i.click(),URL.revokeObjectURL(a)}function $M({text:e}){return s.jsxs(yD,{children:[s.jsx(bD,{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(U7,{className:"h-3.5 w-3.5"})})}),s.jsx(lN,{className:"max-w-xs text-xs",children:s.jsx("p",{children:e})})]})}function cge(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 uge=()=>{const{source:e}=Tn(),{servers:t,agents:n,loading:r,reload:a}=Ga(),[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,T]=v.useState(1),[R,I]=v.useState(1e4),[D,$]=v.useState(null),[H,F]=v.useState([]),[q,Q]=v.useState(null),[J,B]=v.useState(null),[U,Z]=v.useState(!1),[z,L]=v.useState("configure"),[ee,se]=v.useState("idle"),G=v.useRef(null),ue=v.useRef(null),le=i||n[0]?.name||"",oe=v.useMemo(()=>lge(H),[H]);v.useEffect(()=>{let ce=!0;return e.getWorkspaceSettings().then(Ce=>{!ce||!Ce||o(Ce.scenarioAssistantAgentName??"")}).catch(()=>{ce&&o("")}),()=>{ce=!1}},[e]),v.useEffect(()=>()=>{G.current?.()},[]),v.useEffect(()=>{const ce=ue.current;ce&&requestAnimationFrame(()=>{ce.scrollTop=ce.scrollHeight})},[H.length]);const ie=()=>{try{sessionStorage.removeItem(Mj)}catch{}},fe=ce=>{try{sessionStorage.setItem(Mj,ce)}catch{}},Ae=ce=>{G.current?.(),G.current=e.subscribeToolAnalysisJob(ce,Ce=>{if(F(we=>[...we,Ce]),Ce.type==="completed")e.getToolAnalysisResult(ce).then(we=>{Q(we.report),B(we.savedReportId??null)}).catch(we=>Oe({title:"Could not load analysis report",description:we instanceof Error?we.message:String(we),variant:"destructive"})).finally(()=>{ie(),$(null),Z(!1),se("idle"),L("run")});else if(Ce.type==="error"){const we=String(Ce.payload?.message??"");ie(),se(we.toLowerCase().includes("abort")?"stopped":"error"),$(null),Z(!1)}})};v.useEffect(()=>{if(D||q)return;let ce="";try{ce=sessionStorage.getItem(Mj)??""}catch{ce=""}if(ce)return L("run"),se("running"),Z(!0),$(ce),F([]),Ae(ce),()=>{}},[e,D,q]);const re=async()=>{if(c.length===0){x([]),j({});return}h(!0);try{const ce=await e.discoverToolsForAnalysis({serverNames:c});x(ce.servers),j(Ce=>{const we={};for(const Fe of ce.servers){const et=Ce[Fe.serverName]??[],Pt=Fe.tools.map(xn=>xn.name),Gn=et.filter(xn=>Pt.includes(xn));we[Fe.serverName]=Gn.length>0?Gn:Pt}return we})}catch(ce){Oe({title:"Could not discover MCP tools",description:ce instanceof Error?ce.message:String(ce),variant:"destructive"})}finally{h(!1)}};v.useEffect(()=>{re()},[c.join("|")]);const Te=v.useMemo(()=>{const ce=b.trim().toLowerCase();return ce?p.map(Ce=>({...Ce,tools:Ce.tools.filter(we=>we.name.toLowerCase().includes(ce)||(we.description||"").toLowerCase().includes(ce))})).filter(Ce=>Ce.tools.length>0):p},[p,b]),_e=v.useMemo(()=>Object.values(g).reduce((ce,Ce)=>ce+Ce.length,0),[g]),Ge=c[0]??"",je=async()=>{if(!S&&!N){Oe({title:"Select at least one mode",variant:"destructive"});return}if(c.length!==1){Oe({title:"Select exactly one server",variant:"destructive"});return}if(_e===0){Oe({title:"Select at least one tool",variant:"destructive"});return}Z(!0),F([]),Q(null),B(null),L("run"),se("running");try{const{jobId:ce}=await e.startToolAnalysis({serverNames:c,selectedToolsByServer:g,maxParallelTools:_,modes:{metadataReview:S,deeperAnalysis:N},deeperAnalysisOptions:{autoRunPolicy:"read_only_allowlist",sampleCallsPerTool:O,toolCallTimeoutMs:R}});$(ce),fe(ce),Ae(ce)}catch(ce){Z(!1),se("error"),L("run"),Oe({title:"Could not start tool analysis",description:ce instanceof Error?ce.message:String(ce),variant:"destructive"})}},Me=async()=>{if(!D)return;const ce=D;try{const Ce=await e.stopToolAnalysis(ce);if(Ce.status==="completed"){G.current?.(),G.current=null;const we=await e.getToolAnalysisResult(ce);Q(we.report),B(we.savedReportId??null),ie(),$(null),Z(!1),se("idle"),L("run"),Oe({title:"Analysis already finished",description:"Showing the result overview."});return}if(Ce.status==="stopped"){G.current?.(),G.current=null,ie(),$(null),Z(!1),se("stopped"),Oe({title:"Analysis stopped"});return}if(Ce.status==="error"){G.current?.(),G.current=null,ie(),$(null),Z(!1),se("error"),Oe({title:"Analysis already ended with an error",description:"Review the progress log and return to Configure Analysis."});return}Oe({title:"Stopping analysis..."})}catch(Ce){Oe({title:"Could not stop analysis",description:Ce instanceof Error?Ce.message:String(Ce),variant:"destructive"})}},Y=()=>{L("configure"),se("idle"),$(null)},ye=(ce,Ce)=>{d(we=>Ce?[ce]:we.filter(Fe=>Fe!==ce))},de=(ce,Ce,we)=>{j(Fe=>{const et=new Set(Fe[ce]??[]);return we?et.add(Ce):et.delete(Ce),{...Fe,[ce]:Array.from(et)}})},Pe=(ce,Ce)=>{j(we=>({...we,[ce]:Ce}))},Ye=!0,wt=D!==null||H.length>0||ee==="stopped"||ee==="error",It=!!q,ve=ce=>{if(ce==="configure"&&Ye){L("configure");return}if(ce==="run"&&wt){L("run");return}ce==="report"&&It&&L("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(_$,{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:()=>ve("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:()=>ve("run"),disabled:!wt,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:wt?"cursor-pointer":"cursor-not-allowed",children:"Run Analysis"})}),s.jsx("button",{type:"button",onClick:()=>ve("report"),disabled:!It,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Report",children:s.jsx(Qe,{variant:z==="report"?"default":"outline",className:It?"cursor-pointer":"cursor-not-allowed",children:"Report"})})]})]}),z==="configure"&&s.jsxs(Ue,{children:[s.jsxs(St,{children:[s.jsx(Nt,{className:"text-base",children:"Run MCP analysis"}),s.jsx(hs,{children:"Select servers and tools, choose metadata review and/or deeper sample-call analysis, then run the report."})]}),s.jsxs(qe,{className:"space-y-5",children:[!le&&s.jsxs(dc,{children:[s.jsx(fc,{children:"No assistant agent available"}),s.jsxs(pc,{children:["Add a library agent in"," ",s.jsx(bt,{to:"/libraries/agents",className:"underline",children:"Agents"})," ","and optionally set the default Scenario Assistant Agent in"," ",s.jsx(bt,{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(Be,{className:"text-xs",children:"Servers"}),s.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{a()},disabled:r,children:[s.jsx(Na,{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(ce=>{const Ce=c.includes(ce.id);return s.jsxs("label",{className:"flex items-start gap-2 rounded-md border p-2 text-sm",children:[s.jsx(ra,{checked:Ce,onCheckedChange:we=>ye(ce.id,!!we)}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"font-medium",children:ce.name||ce.id}),ce.url&&s.jsx("div",{className:"truncate text-xs text-muted-foreground",children:ce.url})]})]},ce.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(Be,{className:"text-xs",children:"Filter visible tools"}),s.jsxs("div",{className:"relative",children:[s.jsx(YS,{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(ft,{className:"h-9 pl-8",placeholder:"Filter tools by name or description...",value:b,onChange:ce=>y(ce.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(Be,{className:"text-xs",children:Ge?`Tools for ${Ge}`:"Tools"}),s.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{re()},disabled:f||c.length===0,children:[f&&s.jsx(or,{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..."}):Te.length===0&&!f?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No discovered tools match the current filters."}):Te.map(ce=>{const Ce=new Set(g[ce.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:ce.serverName}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ne,{type:"button",size:"sm",variant:"ghost",onClick:()=>Pe(ce.serverName,ce.tools.map(we=>we.name)),children:"Select all"}),s.jsx(ne,{type:"button",size:"sm",variant:"ghost",onClick:()=>Pe(ce.serverName,[]),children:"Clear"})]})]}),ce.warnings.length>0&&s.jsx("div",{className:"mb-2 space-y-1",children:ce.warnings.map(we=>s.jsx("div",{className:"text-xs text-amber-700",children:cge(ce.serverName,we)},`${ce.serverName}-${we}`))}),s.jsx("div",{className:"grid gap-2",children:ce.tools.map(we=>{const Fe=G8(we.classificationReason),et=we.safetyClassification==="read_like"?"read-like":Fe?"write/delete":"unsafe/unknown";return s.jsxs("label",{className:"flex items-start gap-2 rounded border p-2",children:[s.jsx(ra,{checked:Ce.has(we.name),onCheckedChange:Pt=>de(ce.serverName,we.name,!!Pt)}),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:we.name}),we.title&&s.jsx("span",{className:"text-xs text-muted-foreground",children:we.title}),s.jsx(Qe,{variant:"outline",className:`text-[10px] ${we.safetyClassification==="read_like"?"border-emerald-200 bg-emerald-50 text-emerald-700":Fe?"border-amber-300 bg-amber-50 text-amber-800":"border-slate-300 bg-slate-100 text-slate-700"}`,children:et}),we.inputSchema&&s.jsx(Qe,{variant:"outline",className:"border-border text-[10px] text-muted-foreground",children:"schema: input"}),we.outputSchema&&s.jsx(Qe,{variant:"outline",className:"border-border text-[10px] text-muted-foreground",children:"schema: output"})]}),we.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:we.description}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:we.classificationReason})]})]},`${ce.serverName}-${we.name}`)})})]},ce.serverName)})}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Selected tools: ",_e]})]}),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(ra,{checked:S,onCheckedChange:ce=>C(!!ce)}),s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Metadata / schema review",s.jsx($M,{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(ra,{checked:N,onCheckedChange:ce=>E(!!ce)}),s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Deeper analysis",s.jsx($M,{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(Be,{className:"text-xs",children:"Max parallel tools"}),s.jsx(ft,{type:"number",min:1,max:8,value:_,onChange:ce=>P(Math.max(1,Math.min(8,Number(ce.target.value)||2))),className:"h-8"})]}),N?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Be,{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(Be,{className:"text-xs",children:"Sample calls per tool"}),s.jsx(ft,{type:"number",min:1,max:5,value:O,onChange:ce=>T(Math.max(1,Math.min(5,Number(ce.target.value)||1))),className:"h-8"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Be,{className:"text-xs",children:"Tool call timeout (ms)"}),s.jsx(ft,{type:"number",min:1e3,max:6e4,step:500,value:R,onChange:ce=>I(Math.max(1e3,Math.min(6e4,Number(ce.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(ne,{type:"button",onClick:()=>{je()},disabled:U||!!D,children:[(U||!!D)&&s.jsx(or,{className:"mr-2 h-4 w-4 animate-spin"}),"Analyze Tools"]})})]})]}),z==="run"&&s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Nt,{className:"flex items-center gap-2 text-base",children:s.jsx("span",{children:"Progress"})}),s.jsx(hs,{children:D?"Live tool-analysis job events:":q?"Analysis finished. Review the summary below or open the saved report details.":ee==="stopped"?"Analysis was stopped. You can return to Configure Analysis.":ee==="error"?"Analysis ended with an error. Review the log and go back to Configure Analysis.":"Analysis finished."})]}),D?s.jsx(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{Me()},children:"Stop Analysis"}):s.jsx(ne,{type:"button",size:"sm",variant:"outline",onClick:Y,children:"Back to Configure Analysis"})]})}),s.jsxs(qe,{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(or,{className:"h-3.5 w-3.5 animate-spin"}),"Analysis is still running..."]}),(oe.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:oe.totalTools>0?`${oe.finishedTools}/${oe.totalTools} tools finished`:"Preparing analysis..."}),s.jsx("span",{children:oe.totalTools>0?`${oe.percent}%`:"0%"})]}),s.jsx(Sg,{value:oe.totalTools>0?oe.percent:0,className:"h-2"})]}),H.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:D?"Starting analysis...":"No progress events captured."}):s.jsx("div",{ref:ue,className:"max-h-64 space-y-1 overflow-auto rounded border bg-muted/20 p-2",children:H.map((ce,Ce)=>s.jsxs("div",{className:"text-xs",children:[s.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(ce.ts).toLocaleTimeString()}),s.jsx(Qe,{variant:"outline",className:"mr-2 text-[10px]",children:ce.type}),s.jsx("span",{className:"break-all",children:typeof ce.payload.message=="string"?ce.payload.message:JSON.stringify(ce.payload)})]},`${ce.ts}-${Ce}`))}),!D&&q&&s.jsx(Ue,{className:"mt-2 border-green-200 bg-green-50/40 dark:border-green-900/40 dark:bg-green-950/10",children:s.jsxs(qe,{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:[q.summary.toolsAnalyzed," tools analyzed, ",q.summary.toolsSkipped," skipped, across"," ",q.summary.serversAnalyzed," server",q.summary.serversAnalyzed!==1?"s":"","."]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[J&&s.jsx(ne,{asChild:!0,size:"sm",children:s.jsx(bt,{to:`/tool-analysis-results/${J}`,children:"Open result details"})}),s.jsx(ne,{asChild:!0,size:"sm",variant:"outline",children:s.jsx(bt,{to:"/tool-analysis-results",children:"View all results"})}),s.jsx(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>ve("report"),children:"View inline report"})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[q.summary.issueCounts.critical>0&&s.jsxs(Qe,{className:"bg-red-600 text-white hover:bg-red-600",children:["Critical: ",q.summary.issueCounts.critical]}),q.summary.issueCounts.high>0&&s.jsxs(Qe,{className:"bg-orange-500 text-white hover:bg-orange-500",children:["High: ",q.summary.issueCounts.high]}),q.summary.issueCounts.medium>0&&s.jsxs(Qe,{className:"bg-amber-500 text-white hover:bg-amber-500",children:["Medium: ",q.summary.issueCounts.medium]}),q.summary.issueCounts.low>0&&s.jsxs(Qe,{className:"bg-blue-500 text-white hover:bg-blue-500",children:["Low: ",q.summary.issueCounts.low]}),q.summary.issueCounts.info>0&&s.jsxs(Qe,{variant:"outline",children:["Info: ",q.summary.issueCounts.info]}),Object.values(q.summary.issueCounts).every(ce=>ce===0)&&s.jsx(Qe,{className:"bg-green-600 text-white hover:bg-green-600",children:"No findings"})]})]})})]})]}),z==="report"&&q&&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:[q.summary.toolsAnalyzed," tools analyzed across ",q.summary.serversAnalyzed," server",q.summary.serversAnalyzed!==1?"s":"","."]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ne,{type:"button",size:"sm",variant:"outline",onClick:Y,children:"Back to Configure Analysis"}),J&&s.jsxs(s.Fragment,{children:[s.jsx(ne,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx(bt,{to:`/tool-analysis-results/${J}`,children:"Open saved report"})}),s.jsx(ne,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx(bt,{to:"/tool-analysis-results",children:"View all reports"})})]}),s.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>MM(`tool-analysis-${Date.now()}.json`,`${JSON.stringify(q,null,2)}
138
- `,"application/json"),children:[s.jsx(qa,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>MM(`tool-analysis-${Date.now()}.md`,WC(q),"text/markdown"),children:[s.jsx(qa,{className:"mr-2 h-4 w-4"}),"Export Markdown"]})]})]}),s.jsx(Y8,{report:q})]})]})};function DM(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 dge(){const{source:e}=Tn(),[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){Oe({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)),Oe({title:"Tool analysis report deleted"}),o(null)}catch(N){Oe({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"?DM(`${N}.json`,`${JSON.stringify(_,null,2)}
139
- `,"application/json"):DM(`${N}.md`,WC(_.report),"text/markdown")}catch(_){Oe({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(E$,{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(Vc,{open:p,onOpenChange:x,children:[s.jsx(Hc,{asChild:!0,children:s.jsxs(ne,{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(Dt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(Vo,{className:"w-[240px] p-0",align:"start",children:s.jsxs(Ko,{children:[s.jsx(Go,{placeholder:"Search servers..."}),s.jsxs(Yo,{children:[s.jsx(Xo,{children:"No servers found."}),s.jsxs(Qo,{children:[s.jsx(na,{value:"all servers",onSelect:()=>{h("all"),x(!1)},children:"All servers"}),j.map(N=>s.jsx(na,{value:N,onSelect:()=>{h(N),x(!1)},children:N},N))]})]})]})})]})]}),s.jsx(ne,{variant:"outline",onClick:()=>{g()},disabled:r,children:r?"Refreshing...":"Refresh"}),s.jsx(ne,{asChild:!0,variant:"outline",children:s.jsx(bt,{to:"/tool-analysis",children:"Analyze MCP Tools"})})]})]}),s.jsx(Ue,{children:s.jsx(qe,{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($r,{children:[s.jsx(Dr,{children:s.jsxs($t,{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(Lr,{children:b.map(N=>s.jsxs($t,{children:[s.jsx(ze,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(bt,{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(ze,{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(ze,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(vf,{className:"h-3 w-3"}),new Date(N.createdAt).toLocaleString()]})}),s.jsx(ze,{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(ze,{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(ze,{children:s.jsxs(uu,{children:[s.jsx(du,{asChild:!0,children:s.jsx(ne,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Gm,{className:"h-4 w-4"})})}),s.jsxs(cl,{align:"end",children:[s.jsx(Nr,{asChild:!0,children:s.jsx(bt,{to:`/tool-analysis-results/${N.reportId}`,children:"View"})}),s.jsxs(Nr,{onSelect:()=>{C(N.reportId,"json")},children:[s.jsx(qa,{className:"mr-2 h-3.5 w-3.5"})," Export JSON"]}),s.jsxs(Nr,{onSelect:()=>{C(N.reportId,"markdown")},children:[s.jsx(qa,{className:"mr-2 h-3.5 w-3.5"})," Export Markdown"]}),s.jsxs(Nr,{className:"text-destructive",onSelect:E=>{E.preventDefault(),o(N.reportId)},children:[s.jsx(Ca,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},N.reportId))})]})]})})}),s.jsx(Ps,{open:!!i,onOpenChange:N=>!N&&o(null),children:s.jsxs(Xa,{children:[s.jsxs(Qa,{children:[s.jsx(Za,{children:"Delete tool analysis report?"}),s.jsx(es,{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(Ja,{children:[s.jsx(ns,{disabled:c,children:"Cancel"}),s.jsx(ts,{onClick:N=>{N.preventDefault(),S()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}function LM(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 fge(){const{id:e=""}=el(),t=_a(),{source:n}=Tn(),[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}Oe({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),Oe({title:"Tool analysis report deleted"}),t("/tool-analysis-results")}catch(j){Oe({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(ne,{asChild:!0,variant:"outline",children:s.jsx(bt,{to:"/tool-analysis-results",children:"Back to Tool Analysis Results"})})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"font-mono text-xl font-semibold",children:r.reportId}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:[new Date(r.createdAt).toLocaleString()," · ",r.serverNames.join(", ")||"—"]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(ne,{asChild:!0,size:"sm",variant:"outline",children:s.jsx(bt,{to:"/tool-analysis-results",children:"Back to results"})}),s.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>LM(`${r.reportId}.json`,`${JSON.stringify(r,null,2)}
140
- `,"application/json"),children:[s.jsx(qa,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>LM(`${r.reportId}.md`,WC(r.report),"text/markdown"),children:[s.jsx(qa,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),s.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>h(!0),children:[s.jsx(Ca,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]}),s.jsx(Y8,{report:r.report}),s.jsx(Ps,{open:f,onOpenChange:h,children:s.jsxs(Xa,{children:[s.jsxs(Qa,{children:[s.jsx(Za,{children:"Delete tool analysis report?"}),s.jsxs(es,{children:["Delete saved report '",r.reportId,"' from disk? This cannot be undone."]})]}),s.jsxs(Ja,{children:[s.jsx(ns,{disabled:p,children:"Cancel"}),s.jsx(ts,{onClick:j=>{j.preventDefault(),g()},disabled:p,children:p?"Deleting...":"Delete"})]})]})})]})}const pge=[{id:"configure",label:"Configure Debug Session"},{id:"run",label:"Run / Inspect Flow"},{id:"report",label:"Report / Export"}];function hge(e){return navigator.clipboard.writeText(e)}function mge(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}function vge(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 gge(){const{source:e}=Tn(),{servers:t,reload:n,loading:r}=Ga(),[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(""),[C,N]=v.useState(""),[E,_]=v.useState(""),[P,O]=v.useState(""),[T,R]=v.useState("client_secret_basic"),[I,D]=v.useState("{}"),[$,H]=v.useState(""),[F,q]=v.useState(""),[Q,J]=v.useState(""),[B,U]=v.useState(""),[Z,z]=v.useState(""),[L,ee]=v.useState(""),[se,G]=v.useState(""),[ue,le]=v.useState(""),[oe,ie]=v.useState(null),[fe,Ae]=v.useState(null),[re,Te]=v.useState([]),[_e,Ge]=v.useState(!1),[je,Me]=v.useState(!1),[Y,ye]=v.useState(!1),[de,Pe]=v.useState("all"),[Ye,wt]=v.useState("all"),[It,ve]=v.useState("inspector"),ce=v.useRef(null),Ce=v.useRef(null);v.useEffect(()=>()=>{ce.current?.(),ce.current=null},[]),v.useEffect(()=>{Ce.current?.scrollIntoView({behavior:"smooth",block:"end"})},[re.length]);const we=v.useMemo(()=>t.filter(pe=>pe.authType==="oauth2"),[t]),Fe=we.find(pe=>pe.id===o);v.useEffect(()=>{o&&(we.some(pe=>pe.id===o)||c(""))},[we,o]);const et=v.useMemo(()=>{const pe=oe?.stepStates.length??0,De=oe?.stepStates.filter(Lt=>Lt.status==="completed"||Lt.status==="skipped").length??0,st=oe?.stepStates.filter(Lt=>Lt.status==="failed").length??0,yt=pe>0?Math.round((De+st)/pe*100):0;return{total:pe,completed:De,failed:st,percent:yt}},[oe]),Pt=v.useMemo(()=>(oe?.network??[]).filter(De=>!(de!=="all"&&De.stepId!==de||Ye==="error"&&!(De.phase==="response"&&(De.status??0)>=400)||Ye==="ok"&&!(De.phase==="response"&&(De.status??0)<400))),[oe?.network,de,Ye]),Gn=!!fe,xn=!!(oe&&(oe.status==="completed"||oe.status==="error"||oe.status==="stopped")),cr=pe=>{if(pe==="configure"||pe==="run"&&Gn||pe==="report"&&xn)return i(pe)},ur=()=>{let pe;if(d==="dcr"&&I.trim())try{pe=JSON.parse(I)}catch{throw new Error("DCR metadata JSON is invalid")}if(!Fe)throw new Error("Select an MCP server");return{profile:"latest",target:{serverName:Fe.id,overrides:{authorizationServerMetadataUrl:Q||void 0,authorizationEndpoint:B||void 0,tokenEndpoint:Z||void 0,registrationEndpoint:L||void 0,cimdUrl:$||void 0,resourceBaseUrl:se||void 0}},registrationMethod:d,clientConfig:{preRegistered:d==="pre_registered"?{clientId:E.trim(),clientSecret:P.trim()||void 0,tokenEndpointAuthMethod:T||void 0}:void 0,dcr:d==="dcr"?{metadata:pe,tokenEndpointAuthMethod:T||void 0}:void 0,cimd:d==="cimd"?{cimdUrl:$||void 0,expectedClientId:F||void 0}:void 0},runtime:{redirectMode:h,scopes:y.split(/[,\s]+/).map(De=>De.trim()).filter(Boolean),resource:C.trim()||void 0,usePkce:j,codeChallengeMethod:"S256"},display:{showSensitiveValues:x}}},$n=pe=>{ce.current?.(),ce.current=e.subscribeOAuthDebuggerSession(pe,De=>{Te(yt=>[...yt,De]),(De.type==="completed"||De.type==="error"||De.type==="stopped")&&Ge(!1),e.getOAuthDebuggerSession(pe).then(yt=>{ie(yt.session),yt.session.status==="completed"&&i("report")}).catch(()=>{})})},dr=async()=>{Me(!0);try{const pe=ur(),De=await e.createOAuthDebuggerSession(pe);Ae(De.sessionId),ie(De.session),Te([]),i("run"),$n(De.sessionId);const st=await e.startOAuthDebuggerSession(De.sessionId);ie(st.session),Ge(!0),(st.session.status==="waiting_for_user"||st.session.status==="waiting_for_browser_callback")&&Ge(!1)}catch(pe){Oe({title:"Could not start OAuth Debugger session",description:pe instanceof Error?pe.message:String(pe),variant:"destructive"})}finally{Me(!1)}},_r=async()=>{if(fe)try{Me(!0);const pe=await e.submitOAuthDebuggerManualCallback(fe,{redirectUrl:ue.trim()||void 0});ie(pe.session),le(""),Ge(!0)}catch(pe){Oe({title:"Could not submit callback",description:pe instanceof Error?pe.message:String(pe),variant:"destructive"})}finally{Me(!1)}},Ur=async()=>{if(fe){ye(!0);try{const pe=await e.stopOAuthDebuggerSession(fe);if(Ge(!1),pe.status!=="running"){const De=await e.getOAuthDebuggerSession(fe);ie(De.session),De.session.status==="completed"?i("report"):i("run")}}catch(pe){Oe({title:"Could not stop session",description:pe instanceof Error?pe.message:String(pe),variant:"destructive"})}finally{ye(!1)}}},qr=async()=>{ce.current?.(),ce.current=null,ie(null),Ae(null),Te([]),Ge(!1),ye(!1),Me(!1),le(""),Pe("all"),wt("all"),ve("inspector"),i("run"),await dr()},Yn=async pe=>{if(!(!fe||!oe))try{const De=await e.exportOAuthDebuggerSession(fe,pe);let st="";const yt=pe==="json"?"json":pe==="raw"?"txt":"md";typeof De=="string"?st=De:st=`${JSON.stringify(De,null,2)}
143
- `;const Lt=new Blob([st],{type:"text/plain;charset=utf-8"}),nn=URL.createObjectURL(Lt),ln=document.createElement("a");ln.href=nn,ln.download=`oauth-debugger-${fe}.${yt}`,ln.click(),URL.revokeObjectURL(nn)}catch(De){if(pe==="markdown"){const st=vge(oe,re),yt=new Blob([st],{type:"text/markdown;charset=utf-8"}),Lt=URL.createObjectURL(yt),nn=document.createElement("a");nn.href=Lt,nn.download=`oauth-debugger-${oe.id}.md`,nn.click(),URL.revokeObjectURL(Lt);return}Oe({title:"Export failed",description:De instanceof Error?De.message:String(De),variant:"destructive"})}},Xt=fe?`${mge()}/api/oauth-debugger/sessions/${fe}/authorize`:void 0,_n=pe=>pe==="error"?"destructive":pe==="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:pge.map(pe=>{const De=a===pe.id,st=pe.id==="configure"||pe.id==="run"&&Gn||pe.id==="report"&&xn;return s.jsx("button",{type:"button",onClick:()=>st&&cr(pe.id),disabled:!st,className:"rounded-full",children:s.jsx(Qe,{variant:De?"default":"outline",className:st?"":"opacity-50",children:pe.label})},pe.id)})})]}),a==="configure"&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Nt,{className:"text-base",children:"Target MCP Server"}),s.jsx(hs,{children:"Select one MCP server from Libraries and optionally override endpoints."})]}),s.jsxs(ne,{type:"button",variant:"outline",size:"sm",onClick:()=>{n()},disabled:r,children:[s.jsx(Na,{className:`mr-2 h-4 w-4 ${r?"animate-spin":""}`}),"Refresh Servers"]})]})}),s.jsx(qe,{className:"space-y-3",children:s.jsxs("div",{className:"max-w-xl space-y-2",children:[s.jsx(Be,{children:"MCP Server"}),s.jsxs(wn,{value:o,onValueChange:c,children:[s.jsx(mn,{children:s.jsx(jn,{placeholder:"Select an MCP server"})}),s.jsx(vn,{children:we.map(pe=>s.jsx(mt,{value:pe.id,children:pe.name||pe.id},pe.id))})]}),we.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"}),"."]}),Fe&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:[Fe.transport," · ",Fe.url||Fe.command||"No URL/command"]})]})})]}),s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Client Registration Method"})}),s.jsxs(qe,{className:"space-y-3",children:[s.jsx("div",{className:"grid gap-2 md:grid-cols-3",children:[{id:"pre_registered",label:"Pre-registered client"},{id:"dcr",label:"Dynamic Client Registration (DCR)"},{id:"cimd",label:"Client ID Metadata Document (CIMD)"}].map(pe=>s.jsx("button",{type:"button",onClick:()=>f(pe.id),className:"rounded-md border p-3 text-left",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:`h-2.5 w-2.5 rounded-full ${d===pe.id?"bg-primary":"bg-muted-foreground/30"}`}),s.jsx("span",{className:"text-sm font-medium",children:pe.label})]})},pe.id))}),s.jsx("div",{className:"grid gap-3 md:grid-cols-1",children:s.jsxs("div",{className:"max-w-md space-y-1",children:[s.jsx(Be,{className:"text-xs",children:"Redirect mode"}),s.jsxs(wn,{value:h,onValueChange:pe=>p(pe),children:[s.jsx(mn,{children:s.jsx(jn,{})}),s.jsxs(vn,{children:[s.jsx(mt,{value:"local_callback",children:"Local callback (recommended)"}),s.jsx(mt,{value:"manual",children:"Manual paste redirect URL"})]})]})]})}),d==="pre_registered"&&s.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Be,{className:"text-xs",children:"client_id"}),s.jsx(ft,{value:E,onChange:pe=>_(pe.target.value)})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Be,{className:"text-xs",children:"client_secret (optional)"}),s.jsx(ft,{value:P,onChange:pe=>O(pe.target.value),type:"password"})]})]}),d==="cimd"&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(Be,{className:"text-xs",children:"CIMD URL"}),s.jsx(ft,{value:$,onChange:pe=>H(pe.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Runtime OAuth Inputs"})}),s.jsxs(qe,{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Be,{className:"text-xs",children:"Scopes (space or comma separated)"}),s.jsx(ft,{value:y,onChange:pe=>S(pe.target.value),placeholder:"openid profile mcp"})]}),s.jsxs("div",{className:"flex items-center gap-2 md:col-span-2",children:[s.jsx(ra,{checked:j,onCheckedChange:pe=>b(!!pe)}),s.jsx(Be,{children:"Use PKCE (S256)"})]})]})]}),s.jsxs("details",{className:"rounded-md border bg-card p-3 shadow-sm",children:[s.jsx("summary",{className:"cursor-pointer text-sm font-medium",children:"Advanced"}),s.jsxs("div",{className:"mt-3 space-y-4",children:[s.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Be,{className:"text-xs",children:"Token endpoint auth method"}),s.jsx(ft,{value:T,onChange:pe=>R(pe.target.value),placeholder:"client_secret_basic / none / client_secret_post"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Be,{className:"text-xs",children:"Resource / audience (optional)"}),s.jsx(ft,{value:C,onChange:pe=>N(pe.target.value),placeholder:"https://resource.example.com"})]})]}),d==="dcr"&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(Be,{className:"text-xs",children:"DCR metadata JSON (optional overrides)"}),s.jsx(Wa,{value:I,onChange:pe=>D(pe.target.value),className:"min-h-32 font-mono text-xs"})]}),d==="cimd"&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(Be,{className:"text-xs",children:"Expected client_id (optional)"}),s.jsx(ft,{value:F,onChange:pe=>q(pe.target.value)})]}),s.jsxs("div",{className:"rounded-md border bg-background p-3",children:[s.jsx("div",{className:"mb-3 text-sm font-medium",children:"Endpoint overrides"}),s.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Be,{className:"text-xs",children:"Authorization server metadata URL"}),s.jsx(ft,{value:Q,onChange:pe=>J(pe.target.value),placeholder:"https://.../.well-known/oauth-authorization-server"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Be,{className:"text-xs",children:"Resource server base URL"}),s.jsx(ft,{value:se,onChange:pe=>G(pe.target.value),placeholder:"https://resource.example.com"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Be,{className:"text-xs",children:"Authorization endpoint"}),s.jsx(ft,{value:B,onChange:pe=>U(pe.target.value),placeholder:"https://.../authorize"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Be,{className:"text-xs",children:"Token endpoint"}),s.jsx(ft,{value:Z,onChange:pe=>z(pe.target.value),placeholder:"https://.../token"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Be,{className:"text-xs",children:"Registration endpoint (DCR)"}),s.jsx(ft,{value:L,onChange:pe=>ee(pe.target.value),placeholder:"https://.../register"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Be,{className:"text-xs",children:"CIMD URL override"}),s.jsx(ft,{value:$,onChange:pe=>H(pe.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),s.jsxs(dc,{children:[s.jsx(fy,{className:"h-4 w-4"}),s.jsx(fc,{children:"Secrets display"}),s.jsxs(pc,{className:"space-y-2",children:[s.jsx("p",{children:"This debugger is configured to show full tokens/secrets in network logs and exports."}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ra,{checked:!x,onCheckedChange:pe=>g(pe===!1)}),s.jsx(Be,{children:"Hide sensitive values in inspector"})]})]})]})]})]}),s.jsx("div",{className:"flex justify-end",children:s.jsxs(ne,{type:"button",onClick:()=>{dr()},disabled:je,children:[je&&s.jsx(or,{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(Ue,{className:"xl:col-span-1",children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Nt,{className:"text-base",children:"Progress"}),s.jsx(hs,{children:"Visual OAuth flow guide with live session events and next-step actions."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[oe?.uiHints.authorizationUrl&&Xt&&s.jsx(ne,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsxs("a",{href:Xt,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(Ah,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})}),s.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{qr()},disabled:je,children:[s.jsx(Na,{className:"mr-2 h-4 w-4"}),"Restart"]}),fe&&s.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{Ur()},disabled:Y||!fe,children:[(Y||_e)&&Y&&s.jsx(or,{className:"mr-2 h-4 w-4 animate-spin"}),s.jsx(bh,{className:"mr-2 h-4 w-4"}),"Stop Debug Session"]})]})]})}),s.jsxs(qe,{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:[et.completed+et.failed,"/",et.total," steps"]}),s.jsxs("span",{children:[et.percent,"%"]})]}),s.jsx(Sg,{value:et.percent,className:"h-2"})]}),oe?.status==="waiting_for_user"&&s.jsx(Ue,{children:s.jsxs(qe,{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(Wa,{value:ue,onChange:pe=>le(pe.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(ne,{type:"button",size:"sm",onClick:()=>{_r()},disabled:je||!ue.trim(),children:[je&&s.jsx(or,{className:"mr-2 h-4 w-4 animate-spin"}),"Continue"]}),oe.uiHints.authorizationUrl&&Xt&&s.jsx(ne,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx("a",{href:Xt,target:"_blank",rel:"noopener noreferrer",children:"Open Authorization URL"})})]})]})}),oe?.status==="waiting_for_browser_callback"&&s.jsxs(dc,{children:[s.jsx(fy,{className:"h-4 w-4"}),s.jsx(fc,{children:"Waiting for browser callback"}),s.jsxs(pc,{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:oe.uiHints.callbackUrl}),oe.uiHints.authorizationUrl&&Xt&&s.jsx("div",{className:"pt-2",children:s.jsx(ne,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsxs("a",{href:Xt,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(Ah,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})})})]})]}),s.jsx("div",{className:"space-y-2",children:oe?.stepStates.map(pe=>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:pe.title}),s.jsx("div",{className:"text-xs text-muted-foreground",children:pe.description})]}),s.jsx(Qe,{variant:pe.status==="failed"?"destructive":pe.status==="completed"?"outline":pe.status==="active"?"secondary":"outline",className:pe.status==="completed"?"border-emerald-300 bg-emerald-50 text-emerald-700":void 0,children:pe.status})]}),pe.outcomeSummary&&s.jsx("p",{className:"mt-2 text-xs text-muted-foreground break-all",children:pe.outcomeSummary})]},pe.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(Ue,{children:[s.jsxs(St,{className:"pb-3",children:[s.jsx(Nt,{className:"text-base",children:"Inspect"}),s.jsx(hs,{children:"Live events and network requests/responses for the OAuth flow."})]}),s.jsx(qe,{className:"space-y-3",children:s.jsxs(dg,{value:It,onValueChange:pe=>ve(pe),children:[s.jsxs(Df,{className:"grid grid-cols-2",children:[s.jsx(gs,{value:"inspector",children:"Network Inspector"}),s.jsx(gs,{value:"events",children:"Live Debug"})]}),s.jsx(ff,{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:[re.length===0?s.jsx("p",{className:"text-muted-foreground",children:"No events yet."}):re.map((pe,De)=>s.jsxs("div",{className:"break-all",children:[s.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(pe.ts).toLocaleTimeString()}),s.jsx(Qe,{variant:"outline",className:"mr-2 text-[10px]",children:pe.type}),typeof pe.payload.message=="string"?pe.payload.message:JSON.stringify(pe.payload)]},`${pe.ts}-${De}`)),s.jsx("div",{ref:Ce})]})}),s.jsxs(ff,{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(Be,{className:"text-xs",children:"Filter by step"}),s.jsxs(wn,{value:de,onValueChange:Pe,children:[s.jsx(mn,{className:"h-8",children:s.jsx(jn,{})}),s.jsxs(vn,{children:[s.jsx(mt,{value:"all",children:"All steps"}),(oe?.stepStates??[]).map(pe=>s.jsx(mt,{value:pe.id,children:pe.title},pe.id))]})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Be,{className:"text-xs",children:"Filter by status"}),s.jsxs(wn,{value:Ye,onValueChange:wt,children:[s.jsx(mn,{className:"h-8",children:s.jsx(jn,{})}),s.jsxs(vn,{children:[s.jsx(mt,{value:"all",children:"All"}),s.jsx(mt,{value:"ok",children:"Successful responses"}),s.jsx(mt,{value:"error",children:"Error responses"})]})]})]})]}),s.jsx("div",{className:"max-h-[34rem] space-y-2 overflow-auto",children:Pt.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No network exchanges captured yet."}):Pt.map(pe=>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:pe.label}),s.jsxs("div",{className:"text-xs text-muted-foreground break-all",children:[pe.method?`${pe.method} `:"",pe.url]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Qe,{variant:"outline",children:pe.phase}),typeof pe.status=="number"&&s.jsx(Qe,{variant:pe.status>=400?"destructive":"secondary",children:pe.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(pe.headers,null,2)})]}),pe.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:pe.bodyText})]}),s.jsx("div",{className:"flex gap-2",children:s.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{hge(JSON.stringify(pe,null,2))},children:[s.jsx(Ui,{className:"mr-2 h-4 w-4"}),"Copy JSON"]})})]})]},pe.id))})]})]})})]})})]})}),a==="report"&&oe&&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(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>i("configure"),children:"Back to Configure"}),s.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{Yn("json")},children:[s.jsx(qa,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{Yn("markdown")},children:[s.jsx(qa,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),s.jsxs(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>{Yn("raw")},children:[s.jsx(qa,{className:"mr-2 h-4 w-4"}),"Copy/Export Raw Trace"]})]})]}),s.jsxs(dc,{children:[s.jsx(fy,{className:"h-4 w-4"}),s.jsx(fc,{children:"Secrets display mode"}),s.jsx(pc,{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(Ue,{children:s.jsxs(qe,{className:"pt-4",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Status"}),s.jsx("div",{className:"text-lg font-semibold",children:oe.status})]})}),s.jsx(Ue,{children:s.jsxs(qe,{className:"pt-4",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Requests"}),s.jsx("div",{className:"text-lg font-semibold",children:oe.networkSummary.requestCount})]})}),s.jsx(Ue,{children:s.jsxs(qe,{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:oe.networkSummary.errorCount})]})}),s.jsx(Ue,{children:s.jsxs(qe,{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:oe.validations.length})]})})]}),s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Key values"})}),s.jsxs(qe,{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx(Be,{className:"text-xs",children:"Issuer"}),s.jsx("p",{className:"text-sm break-all",children:oe.summary?.issuer||"-"})]}),s.jsxs("div",{children:[s.jsx(Be,{className:"text-xs",children:"Client ID"}),s.jsx("p",{className:"text-sm break-all",children:oe.summary?.clientId||"-"})]}),s.jsxs("div",{children:[s.jsx(Be,{className:"text-xs",children:"Redirect URI"}),s.jsx("p",{className:"text-sm break-all",children:oe.summary?.redirectUri||"-"})]}),s.jsxs("div",{children:[s.jsx(Be,{className:"text-xs",children:"Token endpoint status"}),s.jsx("p",{className:"text-sm",children:oe.summary?.tokenEndpointStatus??"-"})]}),s.jsxs("div",{children:[s.jsx(Be,{className:"text-xs",children:"Token type"}),s.jsx("p",{className:"text-sm",children:oe.summary?.tokenType||"-"})]}),s.jsxs("div",{children:[s.jsx(Be,{className:"text-xs",children:"Scopes granted"}),s.jsx("p",{className:"text-sm break-all",children:(oe.summary?.grantedScopes??[]).join(", ")||"-"})]})]})]}),s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Validation findings"})}),s.jsx(qe,{className:"space-y-2",children:oe.validations.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No validation findings recorded."}):oe.validations.map((pe,De)=>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:De+1}),s.jsx("span",{className:"font-bold",children:pe.title})]}),s.jsx(Qe,{variant:_n(pe.severity),children:pe.severity})]}),s.jsxs("p",{className:"text-sm",children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",pe.detail]}),pe.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:pe.recommendation})]}),s.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Step: ",pe.stepId,pe.specReference&&s.jsxs(s.Fragment,{children:[" · ",s.jsx("a",{href:pe.specReference,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"Spec reference"})]})]})]},pe.id))})]})]})]})}const $j="mcplab.runEvaluation.activeJobId",xge=()=>{const[e]=Yi(),[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,T]=v.useState(!0),[R,I]=v.useState(""),[D,$]=v.useState(""),[H,F]=v.useState(!1),[q,Q]=v.useState([]),[J,B]=v.useState(null),U=v.useRef(null),Z=v.useRef(null),{configs:z,reload:L}=Nf(),{source:ee}=Tn(),se=xg("snapshots",!1),{agents:G,scenarios:ue,reload:le}=Ga(),oe=b.trim(),ie=oe?`/results/${encodeURIComponent(oe)}${t?`?configId=${encodeURIComponent(t)}`:""}`:"/results",fe=z.find(ve=>ve.id===t),Ae=e.get("configId"),re=v.useMemo(()=>{if(!fe)return[];const ve=new Map,ce=fe.agentEntries&&fe.agentEntries.length>0?fe.agentEntries:fe.agents.map(Ce=>({kind:"inline",agent:Ce}));for(const Ce of ce){if(Ce.kind==="inline"){const Fe=Ce.agent.id;ve.has(Fe)||ve.set(Fe,Ce.agent);continue}const we=G.find(Fe=>Fe.id===Ce.ref);we&&!ve.has(we.id)&&ve.set(we.id,we)}for(const Ce of G)ve.has(Ce.id)||ve.set(Ce.id,Ce);return Array.from(ve.values())},[fe,G]),Te=v.useMemo(()=>{if(!fe)return[];const ve=new Map,ce=fe.scenarioEntries&&fe.scenarioEntries.length>0?fe.scenarioEntries:fe.scenarios.map(Ce=>({kind:"inline",scenario:Ce}));for(const Ce of ce){if(Ce.kind==="inline"){ve.has(Ce.scenario.id)||ve.set(Ce.scenario.id,Ce.scenario);continue}const we=ue.find(Fe=>Fe.id===Ce.ref);we&&!ve.has(we.id)&&ve.set(we.id,we)}return Array.from(ve.values())},[fe,ue]);v.useEffect(()=>{Ae&&z.some(ve=>ve.id===Ae)&&n(Ae)},[Ae,z]);const _e=v.useRef("");v.useEffect(()=>{const ve=fe?`${fe.id}::${fe.sourcePath??""}`:"";if(ve===_e.current)return;if(_e.current=ve,!fe){E([]),P([]);return}const ce=re.filter(Ce=>(fe.runDefaults?.selectedAgentNames??[]).includes(Ce.id)).map(Ce=>Ce.id);E(ce.length>0?ce:re.map(Ce=>Ce.id)),P(Te.map(Ce=>Ce.id)),T(!0)},[fe?.id,fe?.sourcePath,re,Te]);const Ge=async()=>{if(!fe?.sourcePath){h(we=>[...we,`[${new Date().toLocaleTimeString()}] Missing source path for selected config.`]);return}const ve=re.filter(we=>N.includes(we.id));if(ve.length===0){h(we=>[...we,`[${new Date().toLocaleTimeString()}] Select at least one agent.`]);return}const ce=Te.filter(we=>_.includes(we.id));if(ce.length===0){h(we=>[...we,`[${new Date().toLocaleTimeString()}] Select at least one test.`]);return}o(!0),x(!1),j(!1),y("");const Ce=(fe.serverEntries??[]).some(we=>we.kind==="referenced")||(fe.agentEntries??[]).some(we=>we.kind==="referenced")||(fe.scenarioEntries??[]).some(we=>we.kind==="referenced")?"refs-composed":"single-file/inline";h([`[${new Date().toLocaleTimeString()}] Starting evaluation run...`,`[${new Date().toLocaleTimeString()}] Config=${fe.name} mode=${Ce} agents=${ve.map(we=>we.name||we.id).join(", ")} tests=${ce.map(we=>we.id).join(", ")} runs=${Number(r)} snapshotEval=${se&&O?"on":"off"}${R.trim()?` note=${R.trim()}`:""}`]),d(10);try{const{jobId:we}=await ee.startRun({configPath:fe.sourcePath,runsPerScenario:Number(r),agents:ve.map(Fe=>Fe.id),scenarioIds:ce.map(Fe=>Fe.id),applySnapshotEval:se?O:!1,runNote:R.trim()?R.trim():void 0});C(we),de(we),It(we),Pe()}catch(we){const Fe=we instanceof Error?we.message:String(we),et=Fe.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(Pt=>[...Pt,`[${new Date().toLocaleTimeString()}] Error: ${Fe}${et}`]),o(!1),d(0),C(null)}},je=()=>{Ge()},Me=()=>{S&&ee.stopRun(S),Z.current?.(),Z.current=null,ye(),C(null),o(!1),x(!1),j(!0),h(ve=>[...ve,`[${new Date().toLocaleTimeString()}] Run aborted by user.`]),Pe()},Y=async()=>{if(b){F(!0);try{const ve=await ee.createSnapshotFromRun(b,D.trim()||void 0);Oe({title:"Snapshot saved",description:`Created ${ve.name} (${ve.id})`}),D.trim()||$(ve.name)}catch(ve){Oe({title:"Could not save snapshot",description:ve instanceof Error?ve.message:String(ve),variant:"destructive"})}finally{F(!1)}}};v.useEffect(()=>{U.current&&(U.current.scrollTop=U.current.scrollHeight)},[f]),v.useEffect(()=>()=>{Z.current?.()},[]),v.useEffect(()=>{if(S||p)return;let ve="";try{ve=sessionStorage.getItem($j)??""}catch{ve=""}if(ve)return C(ve),o(!0),x(!1),j(!1),h(ce=>ce.length>0?ce:[`[${new Date().toLocaleTimeString()}] Reattached to in-progress evaluation run...`]),It(ve),()=>{}},[S,p]);const ye=()=>{try{sessionStorage.removeItem($j)}catch{}},de=ve=>{try{sessionStorage.setItem($j,ve)}catch{}},Pe=async()=>{try{const ve=await ee.getRunQueue();Q(ve.queued),B(ve.active)}catch{}},Ye=()=>{L(),le()};v.useEffect(()=>{Ye(),Pe();const ve=()=>{Ye(),Pe()};return window.addEventListener("focus",ve),()=>{window.removeEventListener("focus",ve)}},[L,le]);const wt=async ve=>{try{await ee.removeQueuedRun(ve),Q(ce=>ce.filter(Ce=>Ce.jobId!==ve))}catch(ce){const Ce=ce instanceof Error?ce.message:String(ce);if(Ce.includes("Use the /stop endpoint"))try{await ee.stopRun(ve)}catch{}else Oe({title:"Could not remove queued run",description:Ce,variant:"destructive"})}Pe()},It=ve=>{Z.current?.(),Z.current=ee.subscribeRunJob(ve,ce=>{const Ce=new Date(ce.ts).toLocaleTimeString();if(ce.type==="queued"){h(we=>{const Fe=ce.payload.position?` (position ${ce.payload.position})`:"",et=`[${Ce}] Run queued${Fe}. Waiting for active run to finish...`;return we.includes(et)?we:[...we,et]}),d(5);return}if(ce.type==="started"&&(h(we=>{const Fe=`[${Ce}] Run started.`;return we.includes(Fe)?we:[...we,Fe]}),d(we=>Math.max(we,30)),j(!1)),ce.type==="log"){const we=String(ce.payload.message??"").trim();we&&(h(Fe=>{const et=`[${Ce}] ${we}`;return Fe.includes(et)?Fe:[...Fe,et]}),d(Fe=>{const et=we.toLowerCase();if(et.startsWith("loading mcp evaluation config"))return Math.max(Fe,15);if(et.startsWith("loaded config"))return Math.max(Fe,20);if(et.startsWith("selected "))return Math.max(Fe,30);if(et.startsWith("using requested agents")||et.startsWith("using resolved default agents"))return Math.max(Fe,35);if(et.startsWith("expanded to "))return Math.max(Fe,45);if(et.startsWith("running evaluation"))return Math.max(Fe,50);const Pt=et.match(/^scenario (\d+)\/(\d+) finished:/);if(Pt){const Gn=Number(Pt[1]),xn=Number(Pt[2]);return Math.max(Fe,50+Math.round(Gn/xn*25))}return et.startsWith("evaluation execution finished")?Math.max(Fe,78):et.startsWith("applying snapshot evaluation policy")?Math.max(Fe,82):et.includes("snapshot evaluation applied")||et.includes("snapshot evaluation enabled")?Math.max(Fe,88):et.startsWith("writing results to ")?Math.max(Fe,94):et.startsWith("run finished:")?Math.max(Fe,98):Fe}))}if(ce.type==="completed"){const we=String(ce.payload.runId??"").trim();if(h(Fe=>{const et=`[${Ce}] Run completed.`;return Fe.includes(et)?Fe:[...Fe,et]}),ce.payload.snapshotEval&&typeof ce.payload.snapshotEval=="object"){const Fe=ce.payload.snapshotEval;h(et=>{const Pt=`[${Ce}] Snapshot eval (${Fe.mode??"warn"}) baseline=${Fe.baseline_snapshot_id??"-"} score=${Fe.overall_score??"-"} status=${Fe.status??"-"}`;return et.includes(Pt)?et:[...et,Pt]})}d(100),o(!1),x(!0),j(!1),y(we),ye(),C(null),Z.current?.(),Z.current=null,Pe()}if(ce.type==="error"){const we=String(ce.payload.message??"Unknown error"),Fe=we.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(et=>[...et,`[${Ce}] Error: ${we}${Fe}`]),o(!1),x(!1),j(!1),d(0),ye(),C(null),Z.current?.(),Z.current=null,Pe()}})};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(ko,{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(Ue,{children:s.jsxs(qe,{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(Be,{children:"MCP Evaluation"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(wn,{value:t,onValueChange:n,children:[s.jsx(mn,{children:s.jsx(jn,{placeholder:"Select a config"})}),s.jsx(vn,{children:z.map(ve=>s.jsx(mt,{value:ve.id,children:ve.name},ve.id))})]}),s.jsx(ne,{type:"button",variant:"outline",size:"icon",className:"h-10 w-10 shrink-0",onClick:Ye,"aria-label":"Refresh configs",title:"Refresh configs",children:s.jsx(Na,{className:"h-4 w-4"})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Be,{children:"Variance Runs"}),s.jsx(ft,{type:"number",min:"1",max:"10",value:r,onChange:ve=>a(ve.target.value)})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Be,{htmlFor:"run-note",children:"Run Note"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[R.length,"/500"]})]}),s.jsx(Wa,{id:"run-note",value:R,onChange:ve=>I(ve.target.value.slice(0,500)),placeholder:"Optional context for this run (for example: mcp-server v1.8.2 #staging)",rows:2})]}),fe&&s.jsxs("div",{className:"space-y-2",children:[se&&fe.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 (",fe.snapshotEval.mode,") · baseline:"," ",s.jsx("span",{className:"font-mono",children:fe.snapshotEval.baselineSnapshotId??"none"})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Be,{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(re.map(ve=>ve.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:re.map(ve=>{const ce=N.includes(ve.id);return s.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[s.jsx(ra,{checked:ce,onCheckedChange:Ce=>{const we=Ce===!0;E(Fe=>we?[...Fe,ve.id]:Fe.filter(et=>et!==ve.id))}}),s.jsx("span",{children:ve.name||ve.id})]},ve.id)})}),re.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."})]}),fe&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Be,{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(Te.map(ve=>ve.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 ",Te.length," selected"]}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:Te.map(ve=>{const ce=_.includes(ve.id);return s.jsxs("label",{className:"flex items-start gap-2 text-sm rounded-md border p-2",children:[s.jsx(ra,{checked:ce,onCheckedChange:Ce=>{const we=Ce===!0;P(Fe=>we?[...Fe,ve.id]:Fe.filter(et=>et!==ve.id))}}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:"block font-medium",children:ve.name||ve.id}),s.jsx("span",{className:"block font-mono text-xs text-muted-foreground truncate",children:ve.id})]})]},ve.id)})})]}),se&&s.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[s.jsx(ra,{checked:O,onCheckedChange:ve=>T(ve===!0)}),s.jsx("span",{children:"Apply snapshot evaluation policy (if configured)"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(ne,{onClick:je,disabled:!t||re.length>0&&N.length===0||Te.length>0&&_.length===0,children:[s.jsx(ko,{className:"mr-2 h-4 w-4"}),J?"Queue Run":"Run"]}),i&&s.jsxs(ne,{variant:"destructive",onClick:Me,children:[s.jsx(bh,{className:"mr-2 h-4 w-4"}),"Stop"]})]})]})}),(i||f.length>0)&&s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Nt,{className:"text-base",children:"Progress"}),s.jsxs("span",{className:"text-xs text-muted-foreground font-mono",children:[Math.round(c),"%"]})]})}),s.jsxs(qe,{className:"space-y-4",children:[s.jsx(Sg,{value:c,className:"h-2"}),s.jsx("div",{ref:U,className:"h-64 overflow-auto rounded-md border bg-muted/30 p-3 font-mono text-xs space-y-0.5",children:f.map((ve,ce)=>s.jsx("div",{className:ve.includes("✓")?"text-success":ve.includes("aborted")?"text-destructive":"text-foreground",children:ve},ce))})]})]}),s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(Nt,{className:"inline-flex items-center gap-2 text-base",children:[s.jsx(vf,{className:"h-4 w-4"}),"Run Queue"]}),s.jsx(ne,{variant:"ghost",size:"sm",onClick:()=>{Pe()},children:s.jsx(Na,{className:"h-3 w-3"})})]})}),s.jsx(qe,{children:!J&&q.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:[J&&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===J.jobId?"ring-2 ring-primary/40":""}`,onClick:()=>{S!==J.jobId&&(C(J.jobId),de(J.jobId),o(!0),x(!1),j(!1),h([`[${new Date().toLocaleTimeString()}] Attached to running job ${J.jobId}...`]),d(10),It(J.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:J.runParams.configPath.split("/").pop()??J.runParams.configPath}),J.runParams.agents&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:["agents: ",J.runParams.agents.join(", ")]}),J.runParams.runNote&&s.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["note: ",J.runParams.runNote]})]}),s.jsxs(ne,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-destructive hover:text-destructive hover:bg-destructive/10",onClick:ve=>{ve.stopPropagation(),J&&(ee.stopRun(J.jobId),Pe())},title:"Stop running job",children:[s.jsx(bh,{className:"mr-1 h-3 w-3"}),"Stop"]})]}),q.map((ve,ce)=>{const Ce=ve.runParams.configPath.split("/").pop()??ve.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:["#",ce+1," Queued"]}),s.jsx("span",{className:"font-mono text-xs",children:Ce}),ve.runParams.agents&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:["agents: ",ve.runParams.agents.join(", ")]}),ve.runParams.runNote&&s.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["note: ",ve.runParams.runNote]})]}),s.jsx(ne,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:()=>{wt(ve.jobId)},title:"Remove from queue",children:s.jsx(ys,{className:"h-4 w-4"})})]},ve.jobId)})]})})]}),g&&!i&&!p&&s.jsx(Ue,{className:"border-amber-300/60 bg-amber-50/40",children:s.jsx(qe,{className:"pt-6",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsx(bh,{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(ne,{type:"button",variant:"outline",onClick:()=>{h([]),d(0),j(!1)},children:"Clear Progress"}),s.jsxs(ne,{type:"button",onClick:je,disabled:!t,children:[s.jsx(ko,{className:"mr-2 h-4 w-4"}),"Run Again"]})]})]})})}),p&&s.jsx(Ue,{className:"border-success/50",children:s.jsxs(qe,{className:"pt-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(rc,{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(ne,{asChild:!0,className:"ml-auto",children:s.jsx(bt,{to:ie,children:oe?"View Results":"View Runs"})})]}),se&&oe&&s.jsxs("div",{className:"mt-4 flex flex-wrap items-end gap-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Be,{className:"text-xs",children:"Snapshot name (optional)"}),s.jsx(ft,{value:D,onChange:ve=>$(ve.target.value),placeholder:"e.g. baseline-v1",className:"h-8 w-64"})]}),s.jsx(ne,{type:"button",variant:"outline",size:"sm",onClick:()=>{Y()},disabled:H,children:H?"Saving...":"Save Snapshot"})]})]})})]})};function yge(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 bge=()=>{const{source:e}=Tn(),[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=I=>{if(f===I){x(D=>D==="asc"?"desc":"asc");return}h(I),x(I==="timestamp"?"desc":"asc")},C=async()=>{a(!0);try{n(await e.listResults())}catch(I){Oe({title:"Could not load results",description:I instanceof Error?I.message:String(I),variant:"destructive"})}finally{a(!1)}};v.useEffect(()=>{let I=!0;return a(!0),e.listResults().then(D=>{I&&n(D)}).catch(D=>{I&&Oe({title:"Could not load results",description:D instanceof Error?D.message:String(D),variant:"destructive"})}).finally(()=>{I&&a(!1)}),()=>{I=!1}},[e]);const N=v.useMemo(()=>{const I=new Set;return t.forEach(D=>{D.scenarios.forEach($=>{const H=String($.scenarioName??"").trim(),F=String($.scenarioId??"").trim(),q=H||F;q&&I.add(q)})}),Array.from(I).sort((D,$)=>D.localeCompare($))},[t]),E=v.useMemo(()=>g==="all"?t:t.filter(I=>I.scenarios.some(D=>{const $=String(D.scenarioName??"").trim(),H=String(D.scenarioId??"").trim();return($||H)===g})),[t,g]),_=v.useMemo(()=>{const I=($,H)=>$===null&&H===null?0:$===null?1:H===null?-1:p==="asc"?$-H:H-$;return[...E].sort(($,H)=>{if(f==="toolTokens")return I($.toolTokenUsage?.totalTokens??null,H.toolTokenUsage?.totalTokens??null);let F=0;return f==="id"&&(F=$.id.localeCompare(H.id)),f==="timestamp"&&(F=new Date($.timestamp).getTime()-new Date(H.timestamp).getTime()),f==="passRate"&&(F=$.overallPassRate-H.overallPassRate),f==="scenarios"&&(F=$.totalScenarios-H.totalScenarios),f==="avgToolCalls"&&(F=$.avgToolCalls-H.avgToolCalls),p==="asc"?F:-F})},[E,f,p]),P=I=>f!==I?s.jsx(nc,{className:"h-3.5 w-3.5 text-muted-foreground"}):p==="asc"?s.jsx(fs,{className:"h-3.5 w-3.5"}):s.jsx(Dt,{className:"h-3.5 w-3.5"}),O=I=>{const D=I.toolTokenUsage?.totalTokens;return typeof D=="number"?D.toLocaleString():"n/a"},T=v.useMemo(()=>{const I=new Map;for(const D of _)I.set(D.id,yge(D));return I},[_]),R=async I=>{d(!0);try{await e.deleteResult(I),n(D=>D.filter($=>$.id!==I)),Oe({title:"Run deleted",description:I}),o(null)}catch(D){Oe({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(Ps,{open:i!==null,onOpenChange:I=>{!I&&!c&&o(null)},children:s.jsxs(Xa,{children:[s.jsxs(Qa,{children:[s.jsx(Za,{children:"Delete run?"}),s.jsxs(es,{children:["This will permanently remove the run artifacts from disk for"," ",s.jsx("span",{className:"font-mono",children:i??""}),"."]})]}),s.jsxs(Ja,{children:[s.jsx(ns,{disabled:c,children:"Cancel"}),s.jsx(ts,{disabled:c||!i,onClick:I=>{I.preventDefault(),i&&R(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(wd,{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(Vc,{open:b,onOpenChange:y,children:[s.jsx(Hc,{asChild:!0,children:s.jsxs(ne,{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(Dt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(Vo,{className:"w-[260px] p-0",align:"start",children:s.jsxs(Ko,{children:[s.jsx(Go,{placeholder:"Search scenarios..."}),s.jsxs(Yo,{children:[s.jsx(Xo,{children:"No scenarios found."}),s.jsxs(Qo,{children:[s.jsx(na,{value:"all scenarios",onSelect:()=>{j("all"),y(!1)},children:"All scenarios"}),N.map(I=>s.jsx(na,{value:I,onSelect:()=>{j(I),y(!1)},children:I},I))]})]})]})})]}),s.jsx(ne,{variant:"outline",onClick:()=>{C()},disabled:r,children:r?"Refreshing...":"Refresh"})]})]}),s.jsx(Ue,{children:s.jsx(qe,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs($t,{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(Lr,{children:_.map(I=>s.jsxs($t,{children:[s.jsx(ze,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(bt,{to:`/results/${I.id}`,className:"font-mono text-xs text-primary hover:underline",children:I.id}),I.configId?s.jsx("div",{className:"text-[11px] text-muted-foreground",children:I.configId}):null,I.runNote?s.jsxs("div",{className:"text-[11px] text-muted-foreground break-words",children:["Note: ",I.runNote]}):null]})}),s.jsx(ze,{className:"text-[11px] text-muted-foreground",children:(()=>{const D=T.get(I.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(ze,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(vf,{className:"h-3 w-3"}),new Date(I.timestamp).toLocaleString()]})}),s.jsx(ze,{children:s.jsx(Vs,{rate:I.overallPassRate})}),s.jsx(ze,{className:"font-mono text-sm",children:I.totalScenarios}),s.jsx(ze,{className:"font-mono text-sm",children:I.avgToolCalls.toFixed(0)}),s.jsx(ze,{className:"font-mono text-sm",children:O(I)}),s.jsx(ze,{children:s.jsxs(uu,{children:[s.jsx(du,{asChild:!0,children:s.jsx(ne,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Gm,{className:"h-4 w-4"})})}),s.jsxs(cl,{align:"end",children:[s.jsx(Nr,{asChild:!0,children:s.jsxs(bt,{to:`/results/${I.id}`,children:[s.jsx(W7,{className:"mr-2 h-3.5 w-3.5"}),"View"]})}),s.jsxs(Nr,{children:[s.jsx(qa,{className:"mr-2 h-3.5 w-3.5"}),"Export JSON"]}),s.jsxs(Nr,{className:"text-destructive",onSelect:D=>{D.preventDefault(),o(I.id)},children:[s.jsx(Ca,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]})})]},I.id))})]})})})]})};function bd({text:e,variant:t="assistant",className:n}){const r=wge(e);return s.jsx("div",{className:Ne("space-y-2",t==="system"&&"text-xs",n),children:r.map((a,i)=>s.jsx(v.Fragment,{children:jge(a,i,t)},`md-${i}`))})}function wge(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(FM(t,r)){const x=BM(t[r]);r+=2;const g=[];for(;r<t.length&&t[r].includes("|")&&!a(t[r]);)g.push(BM(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(">")||FM(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 FM(e,t){if(t+1>=e.length)return!1;const n=e[t].trim(),r=e[t+1].trim();return n.includes("|")?/^\|?(\s*:?-{3,}:?\s*\|)+\s*:?-{3,}:?\s*\|?$/.test(r):!1}function BM(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>t.trim())}function jge(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:Wl(e.text,`${t}-h`)})}if(e.type==="paragraph")return s.jsx("p",{className:Ne("whitespace-pre-wrap leading-relaxed",n==="system"&&"leading-normal"),children:Wl(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:Wl(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:Ne("space-y-1 pl-5",e.ordered?"list-decimal":"list-disc"),children:e.items.map((a,i)=>s.jsx("li",{className:"leading-relaxed",children:Wl(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:Wl(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:Wl(i,`${t}-tdc-${a}-${o}`)},`${t}-td-${a}-${o}`))},`${t}-row-${a}`))})]})}):null}function Wl(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 Sge(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">${wo(c.scenarioName)}</span>
153
- <span class="scenario-agent">${wo(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">${wo(f.name)} <small>${f.duration}ms</small></span>`).join("")}
166
- </div>
167
- ${d.failureReasons.length?`<div class="failure-reasons">${d.failureReasons.map(f=>wo(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 — ${wo(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">${wo(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">${wo(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 wo(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}const Nge="mcplab.resultAssistantScenarioHandoff",Cge=[{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 zM(e){const t=new Date().toISOString().replace(/[:]/g,"-").replace(/\..+/,"");return`mcplab/reports/result-assistant/${e}-${t}.md`}function UM(e){const t=e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}function jo(e){return typeof e=="number"?e.toLocaleString():"n/a"}const Age=()=>{const{id:e}=el(),t=_a(),[n]=Yi(),{source:r}=Tn(),a=xg("snapshots",!1),{configs:i}=Nf(),{scenarios:o}=Ga(),[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,T]=v.useState(""),[R,I]=v.useState(null),[D,$]=v.useState(!1),[H,F]=v.useState(""),[q,Q]=v.useState(""),[J,B]=v.useState(!1),[U,Z]=v.useState(!1),[z,L]=v.useState(null),[ee,se]=v.useState([]),[G,ue]=v.useState([]),[le,oe]=v.useState(""),[ie,fe]=v.useState(!1),[Ae,re]=v.useState(!1),[Te,_e]=v.useState("assistant"),[Ge,je]=v.useState(null),[Me,Y]=v.useState(null),[ye,de]=v.useState(!1),[Pe,Ye]=v.useState(""),[wt,It]=v.useState(""),[ve,ce]=v.useState(!1),[Ce,we]=v.useState(!1),[Fe,et]=v.useState(!1),[Pt,Gn]=v.useState([]),[xn,cr]=v.useState(!1),[ur,$n]=v.useState(""),[dr,_r]=v.useState(null),[Ur,qr]=v.useState(!1),[Yn,Xt]=v.useState(null),_n=v.useRef(null),pe=v.useRef(null),De=v.useCallback(async(V,be)=>{cr(!0);try{const $e=(await r.listMarkdownReports()).filter(kt=>{const dt=String(kt.relativePath??""),Ht=String(kt.name??"");return dt.includes(V)||Ht.includes(V)});if(Gn($e),be&&$e.length>0){const kt=$e.find(dt=>dt.relativePath===be||dt.path===be||dt.relativePath.endsWith(be)||dt.path.endsWith(be));kt&&$n(kt.relativePath)}return $e}catch{return Gn([]),[]}finally{cr(!1)}},[r]);v.useEffect(()=>{if(!e)return;let V=!0;const be=z;return be&&(r.closeResultAssistantSession(be).catch(()=>{}),L(null),se([]),ue([]),Y(null)),h(!0),r.getResult(e).then(rt=>{V&&(d(rt),j(rt?.runNote??""),x(!1),h(!1))}),()=>{V=!1}},[e,r]),v.useEffect(()=>{let V=!0;return r.listSnapshots().then(be=>{V&&P(be)}).catch(()=>{V&&P([])}),()=>{V=!1}},[r]),v.useEffect(()=>{if(!c?.id){Gn([]);return}let V=!0;return(async()=>{const be=await De(c.id)})(),()=>{V=!1}},[c?.id,De]),v.useEffect(()=>{if(Pt.length===0){$n(""),_r(null),Xt(null);return}(!ur||!Pt.some(V=>V.relativePath===ur))&&$n(Pt[0].relativePath)},[Pt,ur]),v.useEffect(()=>{if(!U||Te!=="reports")return;if(!ur){_r(null),Xt(null);return}let V=!0;return qr(!0),Xt(null),r.getMarkdownReport(ur).then(be=>{V&&_r(be)}).catch(be=>{V&&(_r(null),Xt(be instanceof Error?be.message:String(be)))}).finally(()=>{V&&qr(!1)}),()=>{V=!1}},[U,Te,ur,r]);const st=n.get("configId")??"",yt=(n.get("agent")??"").trim(),Lt=v.useMemo(()=>{const V=st?i.find(be=>be.id===st):void 0;return V||(c?i.find(be=>be.id===c.configId):void 0)},[i,st,c]),nn=v.useMemo(()=>{const V=new Map;if(Lt){for(const be of Lt.scenarios)V.set(be.id,be),be.name&&!V.has(be.name)&&V.set(be.name,be);for(const be of Lt.scenarioEntries??[]){if(be.kind!=="referenced")continue;const rt=o.find($e=>$e.id===be.ref);rt&&(V.set(rt.id,rt),rt.name&&V.set(rt.name,rt),V.has(be.ref)||V.set(be.ref,rt))}}for(const be of o)V.has(be.id)||V.set(be.id,be),be.name&&!V.has(be.name)&&V.set(be.name,be);return V},[Lt,o]),ln=v.useMemo(()=>{if(!c?.snapshotEval?.baselineSnapshotId)return"";const V=i.filter(be=>be.snapshotEval?.baselineSnapshotId===c.snapshotEval?.baselineSnapshotId);return V.length===1?V[0].id:""},[i,c?.snapshotEval?.baselineSnapshotId]);v.useEffect(()=>{c?.snapshotEval?.baselineSnapshotId&&T(V=>V||c.snapshotEval.baselineSnapshotId)},[c?.snapshotEval?.baselineSnapshotId]),v.useEffect(()=>{if(st&&i.some(V=>V.id===st)){F(st);return}ln&&F(V=>V||ln)},[st,i,ln]),v.useEffect(()=>{if(!U)return;const V=window.setTimeout(()=>{_n.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(V)},[U,ee.length,ie]),v.useEffect(()=>()=>{z&&r.closeResultAssistantSession(z).catch(()=>{})},[z,r]),v.useEffect(()=>{const V=pe.current;if(!V)return;V.style.height="0px";const be=Math.min(V.scrollHeight,160);V.style.height=`${Math.max(40,be)}px`},[le,U]);const{filteredScenarios:Xn,filteredTotalRuns:Nn,filteredPassCount:rr,displayPassRate:fr,displayAvgToolCalls:Wr,displayAvgLatency:ci,displayToolTokenUsage:ui}=v.useMemo(()=>{if(!c)return{filteredScenarios:[],filteredTotalRuns:0,filteredPassCount:0,displayPassRate:0,displayAvgToolCalls:0,displayAvgLatency:0,displayToolTokenUsage:null};const V=yt?c.scenarios.filter(dt=>dt.agentId===yt||dt.agentName===yt):c.scenarios,be=V.reduce((dt,Ht)=>dt+Ht.runs.length,0),rt=V.reduce((dt,Ht)=>dt+Ht.runs.filter(Dn=>Dn.passed).length,0),$e=V.reduce((dt,Ht)=>dt+Ht.runs.reduce((Dn,Qt)=>Dn+Qt.toolCalls.length,0),0),kt=V.reduce((dt,Ht)=>dt+Ht.runs.reduce((Dn,Qt)=>Dn+Qt.duration,0),0);return{filteredScenarios:V,filteredTotalRuns:be,filteredPassCount:rt,displayPassRate:be===0?0:rt/be,displayAvgToolCalls:be===0?0:$e/be,displayAvgLatency:be===0?0:Math.round(kt/be),displayToolTokenUsage:AG(V.map(dt=>dt.toolTokenUsage))}},[c,yt]),ul=v.useMemo(()=>{const V={};return Xn.forEach(be=>be.runs.forEach(rt=>rt.toolCalls.forEach($e=>{V[$e.name]=(V[$e.name]||0)+1}))),Object.entries(V).map(([be,rt])=>({name:be,count:rt})).sort((be,rt)=>rt.count-be.count)},[Xn]);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(([V,be])=>`${V}: ${be??"unknown"}`).join(", "),Ve=rr,ct=Math.max(0,Nn-Ve),Ot=[{name:"Pass",value:Ve,color:"hsl(152, 69%, 40%)"},{name:"Fail",value:ct,color:"hsl(0, 72%, 51%)"}],Mt=V=>{C(be=>{const rt=new Set(be);return rt.has(V)?rt.delete(V):rt.add(V),rt})},Tt=(V,be,rt,$e)=>`${V}:${be}:${rt}:${$e}`,En=(V,be)=>`${V}::${be}`,He=V=>{E(be=>{const rt=new Set(be);return rt.has(V)?rt.delete(V):rt.add(V),rt})},Vt=V=>{const be=!V.endsWith(":conversation");return N.has(V)?!be:be},Ft=new Map((R?.scenario_results??[]).map(V=>[V.scenario_id,V])),Pn=async()=>{if(!(!c||!O)){$(!0);try{const V=await r.compareSnapshot(O,c.id);I(V)}finally{$(!1)}}},cn=async V=>{const be=V||c.snapshotEval?.baselineSnapshotId;if(be){T(be),$(!0);try{const rt=await r.compareSnapshot(be,c.id);I(rt)}catch(rt){Oe({title:"Could not review drift",description:rt instanceof Error?rt.message:String(rt),variant:"destructive"})}finally{$(!1)}}},Ng=async()=>{if(!H){Oe({title:"Select a configuration",description:"Choose which config should receive the new baseline.",variant:"destructive"});return}B(!0);try{const V=await r.generateSnapshotEvalBaseline(c.id,H,q.trim()||void 0);P(be=>[V.snapshot,...be.filter(rt=>rt.id!==V.snapshot.id)]),T(V.snapshot.id),Oe({title:"Baseline updated",description:`${V.snapshot.name} is now linked to the selected config.`}),q.trim()||Q(V.snapshot.name),c.snapshotEval?.applied&&cn(V.snapshot.id)}catch(V){Oe({title:"Could not accept new baseline",description:V instanceof Error?V.message:String(V),variant:"destructive"})}finally{B(!1)}},dl=async()=>{const V=le.trim();if(!V||!c)return;const be=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,rt={id:be,role:"user",text:V,createdAt:new Date().toISOString()};oe(""),se($e=>[...$e,rt]),fe(!0);try{let $e=z;if(!$e){const dt=await r.createResultAssistantSession(c.id);$e=dt.sessionId,L(dt.session.id),ue(dt.session.pendingToolCalls),Y({assistantAgentName:dt.session.selectedAssistantAgentName,provider:dt.session.provider,model:dt.session.model}),se(Ht=>{const Dn=Ht.some(ca=>ca.id===be),Qt=dt.session.messages;return Dn?[...Qt,rt]:Qt})}const kt=await r.sendResultAssistantMessage($e,V);di(kt.session)}catch($e){se(kt=>kt.filter(dt=>dt.id!==be)),Oe({title:"MCP Labs Assistant error",description:$e instanceof Error?$e.message:String($e),variant:"destructive"})}finally{fe(!1)}},Bf=V=>{oe(V),requestAnimationFrame(()=>pe.current?.focus())},di=V=>{L(V.id),se(V.messages),ue(V.pendingToolCalls),Y({assistantAgentName:V.selectedAssistantAgentName,provider:V.provider,model:V.model})},zf=async V=>{if(z){fe(!0);try{const be=await r.approveResultAssistantToolCall(z,V);di(be.session)}catch(be){Oe({title:"Could not approve assistant action",description:be instanceof Error?be.message:String(be),variant:"destructive"})}finally{fe(!1)}}},hu=async V=>{if(z){fe(!0);try{const be=await r.denyResultAssistantToolCall(z,V);di(be.session)}catch(be){Oe({title:"Could not deny assistant action",description:be instanceof Error?be.message:String(be),variant:"destructive"})}finally{fe(!1)}}},ks=(V,be)=>{_e("assistant"),Z(!0),je(be?.scenarioId??null),ee.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()}]),V&&oe(V)},la=V=>{_e("reports"),Z(!0)},Cg=()=>{_e("note"),Z(!0)},Vr=V=>{if(!c)return;if(!Ge){Oe({title:"No scenario context",description:"Ask about a specific scenario or run first, then send the suggestion.",variant:"destructive"});return}const be=o.find($e=>$e.id===Ge)??o.find($e=>$e.name===Ge);if(!be){Oe({title:"Scenario not found in library",description:`Could not find library scenario '${Ge}' to open in Scenario Assistant.`,variant:"destructive"});return}const rt=[`I am sending a suggestion from the Result Assistant for scenario '${Ge}' 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:",V].join(`
249
- `);try{window.sessionStorage.setItem(Nge,JSON.stringify({type:"result-assistant-handoff-v1",runId:c.id,configId:st||c.configId||"",scenarioId:be.id,prompt:rt,sourceReply:V})),t(`/libraries/test-cases/${encodeURIComponent(be.id)}?assistantHandoff=1`)}catch($e){Oe({title:"Could not create handoff",description:$e instanceof Error?$e.message:String($e),variant:"destructive"})}},Uf=V=>{c&&(et(!1),Ye(V),It(zM(c.id)),ce(!1),de(!0))},Ag=()=>{c&&(et(!0),Ye(""),It(zM(c.id)),ce(!1),de(!0))},_g=async()=>{if(!c)return;if(!Pe.trim()){Oe({title:"No markdown to write",description:"The selected assistant response is empty.",variant:"destructive"});return}we(!0);try{const be=await r.applyResultAssistantReport({runId:c.id,markdown:Pe,outputPath:wt.trim()||void 0,overwrite:ve});Oe({title:"Markdown report written",description:typeof be.path=="string"&&be.path?be.path:be.outputPath}),await De(c.id,typeof be.path=="string"&&be.path||be.outputPath||void 0),U&&_e("reports"),de(!1)}catch(be){Oe({title:"Could not write markdown report",description:be instanceof Error?be.message:String(be),variant:"destructive"})}finally{we(!1)}},fl=async V=>{try{await navigator.clipboard.writeText(V),Oe({title:"Copied"})}catch(be){Oe({title:"Could not copy",description:be instanceof Error?be.message:String(be),variant:"destructive"})}},pl=async()=>{if(c){y(!0);try{const V=g.trim();await r.updateRunNote(c.id,V||void 0),d(be=>be&&{...be,runNote:V||void 0}),j(V),x(!1),Oe({title:"Run note saved"})}catch(V){Oe({title:"Could not save run note",description:V instanceof Error?V.message:String(V),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(ne,{variant:"ghost",size:"icon",asChild:!0,children:s.jsx(bt,{to:"/results",children:s.jsx(Io,{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(Vs,{rate:fr}),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()," ","·",yt?` Agent: ${yt} ·`:""," 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(ne,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>{cn()},disabled:D,children:[s.jsx(GS,{className:"h-3.5 w-3.5"}),D?"Reviewing drift...":"Review Drift"]}),s.jsxs(ne,{variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>{const V=Sge(c),be=new Blob([V],{type:"text/html"}),rt=URL.createObjectURL(be),$e=document.createElement("a");$e.href=rt,$e.download=`mcplab-report-${c.id}.html`,$e.click(),URL.revokeObjectURL(rt)},children:[s.jsx(qa,{className:"h-3.5 w-3.5"}),"Download Report"]}),s.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>la(),disabled:xn,children:[s.jsx(Xl,{className:"h-3.5 w-3.5"}),xn?"Reference Reports...":`Reference Reports${Pt.length?` (${Pt.length})`:""}`]}),s.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>Cg(),children:[s.jsx(Xl,{className:"h-3.5 w-3.5"}),"Run Note"]}),s.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>ks(),children:[s.jsx(ya,{className:"h-3.5 w-3.5"}),"MCP Labs Assistant"]})]})]})}),s.jsxs("div",{className:`grid gap-6 items-start ${U?Ae?"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(Ue,{className:"border-amber-500/30",children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Snapshot Drift Review"})}),s.jsxs(qe,{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(wn,{value:H,onValueChange:F,children:[s.jsx(mn,{className:"h-8",children:s.jsx(jn,{placeholder:"Select config to update"})}),s.jsx(vn,{children:i.map(V=>s.jsx(mt,{value:V.id,children:V.name},V.id))})]}),!H&&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:q,onChange:V=>Q(V.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(ne,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5",onClick:()=>{cn()},disabled:D,children:[s.jsx(Na,{className:`h-3.5 w-3.5 ${D?"animate-spin":""}`}),"Review Drift"]}),s.jsx(ne,{type:"button",size:"sm",className:"h-8",onClick:()=>{Ng()},disabled:J||fr!==1,children:J?"Accepting...":"Accept as New Baseline"})]})]}),fr!==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(os,{title:"Scenarios",value:Xn.length,icon:Uj}),s.jsx(os,{title:"Total Runs",value:Nn,icon:w$}),s.jsx(os,{title:"Pass Rate",value:`${Math.round(fr*100)}%`,icon:wd}),s.jsx(os,{title:"Avg Tool Calls",value:UM(Wr),icon:rc}),s.jsx(os,{title:"Avg Latency",value:`${ci}ms`,icon:O$}),s.jsx(os,{title:"Tool Tokens",value:jo(ui?.totalTokens),icon:ls})]}),s.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-2",children:s.jsx(Nt,{className:"text-base",children:"Pass / Fail"})}),s.jsxs(qe,{className:"flex items-center justify-center",children:[s.jsxs(mfe,{width:180,height:180,children:[s.jsx(oi,{data:Ot,dataKey:"value",innerRadius:50,outerRadius:75,paddingAngle:3,children:Ot.map((V,be)=>s.jsx(Tv,{fill:V.color},be))}),s.jsx(Mr,{})]}),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"}),Ve," 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"}),ct," failed"]})]})]})]}),s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-2",children:s.jsx(Nt,{className:"text-base",children:"Tool Usage"})}),s.jsx(qe,{children:s.jsx(Kh,{width:"100%",height:180,children:s.jsxs(hfe,{data:ul,layout:"vertical",children:[s.jsx(Vi,{type:"number",tick:{fontSize:11}}),s.jsx(Hi,{type:"category",dataKey:"name",tick:{fontSize:11},width:120}),s.jsx(Mr,{}),s.jsx(il,{dataKey:"count",fill:"hsl(38, 92%, 50%)",radius:[0,4,4,0]})]})})})]})]}),s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx(Nt,{className:"text-base",children:"Scenarios"}),s.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5 px-2 text-xs",onClick:()=>ks("Summarize the scenario results in this run. Highlight failed scenarios/checks first, then mention notable tool usage and extracted values."),children:[s.jsx(ya,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]})}),s.jsxs(qe,{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(wn,{value:O,onValueChange:T,children:[s.jsx(mn,{className:"h-8",children:s.jsx(jn,{placeholder:"Select snapshot"})}),s.jsx(vn,{children:_.map(V=>s.jsx(mt,{value:V.id,children:V.name},V.id))})]})]}),s.jsx(ne,{type:"button",variant:"outline",size:"sm",disabled:!O||D,onClick:()=>{Pn()},children:D?"Comparing...":"Compare Snapshot"}),R&&s.jsxs(Qe,{variant:"outline",className:"h-8 px-2 py-0 text-xs",children:["Overall snapshot score: ",R.overall_score]})]}),s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs($t,{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(Lr,{children:Xn.map(V=>{const be=En(V.scenarioId,V.agentName),rt=V.scenarioName||V.scenarioId;return s.jsx(Mi,{open:S.has(be),onOpenChange:()=>Mt(be),asChild:!0,children:s.jsxs(s.Fragment,{children:[s.jsx(Us,{asChild:!0,children:s.jsxs($t,{className:"cursor-pointer hover:bg-muted/50",children:[s.jsx(ze,{children:s.jsx(Dt,{className:`h-4 w-4 transition-transform ${S.has(be)?"rotate-180":""}`})}),s.jsx(ze,{className:"font-medium text-sm",children:V.scenarioName}),s.jsx(ze,{className:"text-sm",children:V.agentName}),s.jsx(ze,{className:"font-mono text-sm",children:V.runs.length}),s.jsx(ze,{children:s.jsx(Vs,{rate:V.passRate})}),s.jsx(ze,{className:"font-mono text-sm",children:UM(V.avgToolCalls)}),s.jsx(ze,{className:"font-mono text-sm",children:jo(V.toolTokenUsage?.totalTokens)}),s.jsx(ze,{children:(()=>{const $e=Ft.get(V.scenarioId);if(!$e)return s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"});const kt=$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 ${kt}`,children:[$e.status," · ",$e.score]})})()})]})}),s.jsx($i,{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," · ",V.agentName," · ",Math.round(V.passRate*100),"% pass rate · ",jo(V.toolTokenUsage?.totalTokens)," tool tokens"]})]}),s.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>ks(`Explain why scenario '${rt}' failed (agent: ${V.agentName}). Summarize the likely cause from the result details and suggest what to inspect next.`,{scenarioId:V.scenarioId}),children:[s.jsx(ya,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]}),(()=>{const $e=Ft.get(V.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((kt,dt)=>s.jsxs("li",{children:["• ",kt]},dt))})]})})(),V.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(rc,{className:"h-4 w-4 text-success"}):s.jsx(yh,{className:"h-4 w-4 text-destructive"})}),s.jsxs("div",{className:"flex-1 space-y-1",children:[(()=>{const kt=nn.get(V.scenarioId),dt=kt?Pge(kt.evalRules,$e.failureReasons):[],Ht=dt.filter(Qt=>Qt.status==="failed"),Dn=dt.filter(Qt=>Qt.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:[jo($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(yh,{className:"h-3.5 w-3.5"}),"Failure reasons"]}),s.jsx("ul",{className:"space-y-1 text-xs text-destructive",children:$e.failureReasons.map((Qt,ca)=>s.jsxs("li",{children:["• ",VM(Qt)]},ca))})]}),dt.length>0&&s.jsx(Mi,{open:Vt(Tt(V.scenarioId,V.agentName,$e.runIndex,"checks")),onOpenChange:()=>He(Tt(V.scenarioId,V.agentName,$e.runIndex,"checks")),children:s.jsxs("div",{className:"rounded-md border bg-muted/20 p-2",children:[s.jsx(Us,{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(Dt,{className:`h-3.5 w-3.5 transition-transform ${Vt(Tt(V.scenarioId,V.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:[Dn.length," passed"]}),s.jsxs(Qe,{variant:"outline",className:`h-5 text-[10px] ${Ht.length>0?"border-destructive/30 bg-destructive/10 text-destructive":""}`,children:[Ht.length," failed"]})]})}),s.jsx($i,{children:s.jsx("div",{className:"space-y-1",children:dt.map((Qt,ca)=>s.jsxs("div",{className:`flex items-start justify-between gap-2 rounded-md border px-2 py-1.5 text-xs ${Qt.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:[Qt.status==="failed"?s.jsx(yh,{className:"h-3.5 w-3.5 shrink-0 text-destructive"}):s.jsx(rc,{className:"h-3.5 w-3.5 shrink-0 text-success"}),s.jsx("span",{className:"font-medium",children:Oge(Qt.rule)})]}),Qt.failureReason&&s.jsx("p",{className:"mt-1 pl-5 text-[11px] text-destructive",children:VM(Qt.failureReason)})]}),s.jsx(Qe,{variant:"outline",className:`shrink-0 text-[10px] ${Qt.status==="failed"?"border-destructive/30 text-destructive":"border-success/30 text-success"}`,children:Qt.status})]},`${Qt.rule.type}-${Qt.rule.value}-${ca}`))})})]})})]})})(),s.jsx(Mi,{open:Vt(Tt(V.scenarioId,V.agentName,$e.runIndex,"extracts")),onOpenChange:()=>He(Tt(V.scenarioId,V.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(Us,{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(Dt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${Vt(Tt(V.scenarioId,V.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(Uj,{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($i,{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(([kt,dt])=>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:kt}),s.jsx("div",{className:"font-mono break-all text-foreground",children:dt===null?"null":String(dt)})]},kt))})})]})}),s.jsx(Mi,{open:Vt(Tt(V.scenarioId,V.agentName,$e.runIndex,"tools")),onOpenChange:()=>He(Tt(V.scenarioId,V.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(Us,{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(Dt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${Vt(Tt(V.scenarioId,V.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(ls,{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($i,{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((kt,dt)=>s.jsxs(Qe,{variant:"outline",className:"font-mono text-xs bg-background",children:[s.jsxs("span",{className:"mr-1 text-muted-foreground",children:["#",dt+1]}),kt.name,s.jsxs("span",{className:"ml-1 text-muted-foreground",children:[kt.duration,"ms"]})]},dt))}),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(([kt,dt])=>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:kt}),s.jsxs("div",{className:"text-muted-foreground",children:["total: ",jo(dt.totalTokens)," · in: ",jo(dt.inputTokens)," · out: ",jo(dt.outputTokens)]})]},kt))})]})]})})]})}),s.jsx(Mi,{open:Vt(Tt(V.scenarioId,V.agentName,$e.runIndex,"final")),onOpenChange:()=>He(Tt(V.scenarioId,V.agentName,$e.runIndex,"final")),children:s.jsxs("div",{className:"rounded-md border border-muted-foreground/20 bg-card p-2",children:[s.jsx(Us,{asChild:!0,children:s.jsxs("button",{type:"button",className:"mb-2 flex w-full items-center gap-2 text-left",children:[s.jsx(Dt,{className:`h-3.5 w-3.5 transition-transform ${Vt(Tt(V.scenarioId,V.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(wa,{className:"h-3.5 w-3.5"}),"Final answer"]})]})}),s.jsx($i,{children:s.jsx(US,{text:$e.finalAnswer||"No final answer captured.",maxLength:1200,className:"text-xs text-foreground"})})]})}),s.jsx(Mi,{open:Vt(Tt(V.scenarioId,V.agentName,$e.runIndex,"conversation")),onOpenChange:()=>He(Tt(V.scenarioId,V.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(Us,{asChild:!0,children:s.jsxs("button",{type:"button",className:"flex min-w-0 items-center gap-2 text-left",children:[s.jsx(Dt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${Vt(Tt(V.scenarioId,V.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(ne,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>ks(`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:V.scenarioId}),children:[s.jsx(ya,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})})]}),s.jsx($i,{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(kt=>s.jsx(_ge,{item:kt,fallbackUserPrompt:nn.get(V.scenarioId)?.prompt},kt.id))})}),!Vt(Tt(V.scenarioId,V.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))]})})})})]})},be)})})]})]})]})]}),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(dg,{value:Te,onValueChange:V=>_e(V),className:"min-w-0 -mb-px px-3 pt-1",children:s.jsxs(Df,{className:"h-auto w-full justify-start rounded-none border-b bg-transparent p-0",children:[s.jsx(gs,{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(gs,{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(gs,{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"})]})}),Te==="assistant"?s.jsxs(Ue,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[s.jsx(St,{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(Nt,{className:"flex items-center gap-2 text-base",children:[s.jsx(ya,{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(ne,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>re(V=>!V),children:[Ae?s.jsx(py,{className:"h-3.5 w-3.5"}):s.jsx(hy,{className:"h-3.5 w-3.5"}),Ae?"Compact":"Expand"]}),s.jsx(ne,{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(qe,{className:"flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1",children:[s.jsx(qm,{className:"min-h-0 flex-1 bg-muted/15 px-4 py-4",children:s.jsxs("div",{className:"space-y-3 pr-2",children:[ee.map((V,be)=>{const rt=V.role==="user",$e=V.role==="assistant",kt=V.role==="system",dt=V.role==="tool",Ht=V.pendingToolCallId?G.find(hl=>hl.id===V.pendingToolCallId):void 0,Dn=$e&&!!V.pendingToolCallId;if(dt&&/^(Approved|Denied) tool call\b/i.test(String(V.text??"").trim()))return null;Ht?.server??V.toolRequestServer;const Qt=Ht?.tool??V.toolRequestName,ca=Ht?.publicToolName??V.toolRequestPublicName,zt=$e&&!Dn&&Ege(V.text,!!Ge);if(Dn){const hl=Qt??ca??"unknown_tool";return Qt&&Qt.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(wa,{className:"h-3 w-3"})}),s.jsxs("details",{open:!!Ht,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(ls,{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 ${hl}`}),s.jsx("span",{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${Ht?"bg-amber-100 text-amber-900":"bg-muted text-muted-foreground"}`,children:Ht?"Needs approval":"Completed"})]})}),s.jsx(Dt,{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(bd,{text:V.text,className:"text-sm"}),Ht&&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(Ht.arguments??{},null,2)})}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(ne,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:ie,onClick:()=>{hu(Ht.id)},children:"Deny"}),s.jsx(ne,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:ie,onClick:()=>{zf(Ht.id)},children:"Approve"})]})]})]})]})]},`${V.id??`${V.role}-${be}`}:${Ht?"pending":"completed"}`)}const qf=rt||$e&&!dt&&!kt;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:kt?s.jsx(P$,{className:"h-3 w-3"}):s.jsx(wa,{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":kt?"border-amber-400/30 bg-amber-50/70":dt?"border-blue-300/30 bg-blue-50/50":"border-border/80 bg-background shadow-sm"}`,children:[!(rt||kt)&&s.jsx("p",{className:`mb-2 text-[11px] font-semibold text-muted-foreground ${rt?"text-right":""}`,children:dt?"Tool":"Assistant"}),s.jsx(bd,{text:V.text,className:"text-sm"}),zt&&s.jsxs("div",{className:"mt-3 flex max-w-full flex-wrap justify-end gap-2 overflow-x-auto pb-1",children:[s.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>Vr(V.text),children:[s.jsx(ya,{className:"h-3.5 w-3.5"}),"Send to Scenario Assistant"]}),s.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>Uf(V.text),children:[s.jsx(ls,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})]}),!zt&&$e&&!Dn&&s.jsx("div",{className:"mt-3 flex max-w-full justify-end overflow-x-auto pb-1",children:s.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>Uf(V.text),children:[s.jsx(ls,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})})]}),qf&&s.jsx(ne,{type:"button",variant:"ghost",size:"icon",className:"absolute -right-8 bottom-1 h-6 w-6 text-muted-foreground",onClick:()=>{fl(V.text)},"aria-label":"Copy message",title:"Copy message",children:s.jsx(Ui,{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(QS,{className:"h-3 w-3"})})]},V.id??`${V.role}-${be}`)}),G.filter(V=>!ee.some(be=>be.pendingToolCallId===V.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)"}),G.filter(V=>!ee.some(be=>be.pendingToolCallId===V.id)).map(V=>s.jsxs("details",{open:!0,className:"group min-w-0 rounded-md border bg-background",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-2 p-3",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"break-all font-mono text-xs font-semibold",children:V.publicToolName}),s.jsxs("p",{className:"break-all text-xs text-muted-foreground",children:[V.server,"::",V.tool]})]}),s.jsx(Dt,{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(V.arguments??{},null,2)})}),s.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[s.jsx(ne,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:ie,onClick:()=>{hu(V.id)},children:"Deny"}),s.jsx(ne,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:ie,onClick:()=>{zf(V.id)},children:"Approve"})]})]})]},V.id))]}),ie&&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(wa,{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(or,{className:"h-4 w-4 animate-spin"}),"Thinking..."]})]}),s.jsx("div",{ref:_n})]})}),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(Wa,{ref:pe,value:le,onChange:V=>oe(V.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:V=>{V.key==="Enter"&&!V.shiftKey&&(V.preventDefault(),ie||dl())}}),s.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 px-1 pt-1",children:[s.jsxs(uu,{children:[s.jsx(du,{asChild:!0,children:s.jsxs(ne,{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:ie,children:[s.jsx(xs,{className:"h-3 w-3"}),"Snippets",s.jsx(Dt,{className:"h-3 w-3"})]})}),s.jsxs(cl,{align:"start",className:"w-[360px]",children:[s.jsx(AC,{children:"Result Assistant Snippets"}),s.jsx(_C,{}),Cge.map(V=>s.jsx(Nr,{className:"items-start whitespace-normal px-2 py-2",onSelect:()=>Bf(V.prompt),children:s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("div",{className:"text-xs font-medium leading-tight",children:V.label}),s.jsx("div",{className:"text-[11px] leading-snug text-muted-foreground",children:V.description})]})},V.label))]})]}),s.jsx(ne,{type:"button",size:"icon",className:"h-8 w-8 shrink-0 rounded-full",onClick:()=>{dl()},disabled:ie||!le.trim(),"aria-label":"Send assistant message",title:"Send assistant message",children:ie?s.jsx(or,{className:"h-4 w-4 animate-spin"}):s.jsxs(s.Fragment,{children:[s.jsx(k$,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Ask"})]})})]})]})})]})]}):Te==="reports"?s.jsxs(Ue,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[s.jsx(St,{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(Nt,{className:"flex items-center gap-2 text-base",children:[s.jsx(Xl,{className:"h-4 w-4 text-muted-foreground"}),"Reference Reports"]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>re(V=>!V),children:[Ae?s.jsx(py,{className:"h-3.5 w-3.5"}):s.jsx(hy,{className:"h-3.5 w-3.5"}),Ae?"Compact":"Expand"]}),s.jsx(ne,{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(qe,{className:"flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1",children:[(xn||Pt.length===0||Pt.length>1)&&s.jsx("div",{className:"border-b px-4 py-3",children:xn?s.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading reference reports..."}):Pt.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(ne,{type:"button",size:"sm",variant:"outline",className:"shrink-0 gap-1.5",onClick:()=>Ag(),children:[s.jsx(xs,{className:"h-3.5 w-3.5"}),"New Report"]})]}):s.jsx("div",{className:"space-y-2",children:Pt.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(wn,{value:ur,onValueChange:$n,children:[s.jsx(mn,{className:"h-8",children:s.jsx(jn,{placeholder:"Select a report"})}),s.jsx(vn,{children:Pt.map(V=>s.jsx(mt,{value:V.relativePath,children:V.name},V.path))})]})]}):null})}),s.jsx(qm,{className:"min-h-0 flex-1 bg-muted/15 px-4 py-4",children:Pt.length===0?s.jsx("div",{className:"text-sm text-muted-foreground",children:"No report selected."}):Ur?s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(or,{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]}):dr?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:dr.name}),s.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:dr.relativePath}),s.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:new Date(dr.mtime).toLocaleString()})]}),s.jsx("div",{className:"rounded-md border bg-background p-3",children:s.jsx(bd,{text:dr.content,className:"text-sm"})})]}):s.jsx("div",{className:"text-sm text-muted-foreground",children:"Select a report to preview."})})]})]}):s.jsxs(Ue,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[s.jsx(St,{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(Nt,{className:"flex items-center gap-2 text-base",children:[s.jsx(Xl,{className:"h-4 w-4 text-muted-foreground"}),"Run Note"]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>re(V=>!V),children:[Ae?s.jsx(py,{className:"h-3.5 w-3.5"}):s.jsx(hy,{className:"h-3.5 w-3.5"}),Ae?"Compact":"Expand"]}),s.jsx(ne,{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(qe,{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(Wa,{value:g,onChange:V=>j(V.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(ne,{size:"sm",onClick:()=>{pl()},disabled:b,children:b?"Saving...":"Save note"}),s.jsx(ne,{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(ne,{size:"sm",variant:"ghost",className:"ml-auto h-6 px-2 text-xs",onClick:()=>x(!0),children:c.runNote?"Edit":"Add note"})]})})]})]}),s.jsx(Ps,{open:ye,onOpenChange:V=>!Ce&&de(V),children:s.jsxs(Xa,{className:"max-w-2xl",children:[s.jsxs(Qa,{children:[s.jsx(Za,{children:Fe?"Create markdown report":"Approve MCP action: write markdown report"}),s.jsx(es,{children:Fe?"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:[!Fe&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Output path"}),s.jsx(ft,{value:wt,onChange:V=>It(V.target.value),placeholder:"mcplab/reports/result-assistant/my-report.md",disabled:Ce})]}),s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx(ra,{checked:ve,onCheckedChange:V=>ce(V===!0),disabled:Ce}),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:Fe?"Markdown content":"Markdown preview (to be written)"}),s.jsx(Wa,{value:Pe,onChange:V=>Ye(V.target.value),rows:10,className:"font-mono text-xs",disabled:Ce})]})]}),s.jsxs(Ja,{children:[s.jsx(ns,{disabled:Ce,children:"Cancel"}),s.jsx(ts,{onClick:V=>{V.preventDefault(),_g()},disabled:Ce,children:Ce?"Writing...":Fe?"Save Report":"Approve & Write"})]})]})})]})]})};function _ge({item:e,fallbackUserPrompt:t}){if(e.kind==="tool_call")return s.jsx(WM,{variant:"call",title:`Tool call · ${e.toolName||"unknown"}`,text:e.text});if(e.kind==="tool_result"){const d=e.ok?s.jsx(rc,{className:"h-3.5 w-3.5 text-emerald-700 dark:text-emerald-300"}):s.jsx(yh,{className:"h-3.5 w-3.5 text-rose-700 dark:text-rose-300"});return s.jsx(WM,{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=qM(e.text,e.kind),a=t?qM(t,"user_prompt"):"",i=n&&!r&&a?a:r,o=n?"User prompt":e.kind==="assistant_final"?"Agent final":"Agent",c=n?QS:wa;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(US,{text:i,maxLength:280,className:"text-xs"}):s.jsx(US,{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 qM(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 Ege(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 WM({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(Mi,{open:a,onOpenChange:i,children:s.jsxs("div",{className:`rounded-md border p-2 text-xs ${o[e]}`,children:[s.jsx(Us,{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(ls,{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($i,{children:s.jsx("p",{className:"mt-2 font-mono whitespace-pre-wrap text-foreground",children:n})})]})})}function US({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(bd,{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 Pge(e,t){return e.map(n=>{const r=kge(n,t);return{rule:n,status:r?"failed":"passed",failureReason:r}})}function kge(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 Oge(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 VM(e){const t=String(e??"").trim(),n=t.match(/^Regex assertion failed:\s*(.+)$/i);return n?`Text match failed: ${n[1]}`:t}const Dj=["hsl(38, 92%, 50%)","hsl(200, 80%, 50%)","hsl(152, 69%, 40%)","hsl(280, 60%, 50%)","hsl(0, 72%, 51%)"];function Tge(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 Rge=()=>{const{source:e}=Tn(),[t,n]=Yi(),[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(Y=>Y.trim()).filter(Boolean),_=t.get("scenario")??"all",[P,O]=v.useState(C),[T,R]=v.useState(N),[I,D]=v.useState(E),[$,H]=v.useState(_),[F,q]=v.useState(!1),Q=async()=>{o(!0);try{a(await e.listResults())}catch(Y){Oe({title:"Could not load results",description:Y instanceof Error?Y.message:String(Y),variant:"destructive"})}finally{o(!1)}};v.useEffect(()=>{let Y=!0;return o(!0),e.listResults().then(ye=>{Y&&a(ye)}).catch(ye=>{Y&&Oe({title:"Could not load results",description:ye instanceof Error?ye.message:String(ye),variant:"destructive"})}).finally(()=>{Y&&o(!1)}),()=>{Y=!1}},[e]);const J=Y=>{if(f===Y){x(ye=>ye==="asc"?"desc":"asc");return}h(Y),x(Y==="timestamp"?"desc":"asc")},B=Y=>{d(ye=>{const de=new Set(ye);return de.has(Y)?de.delete(Y):de.add(Y),de})},U=v.useMemo(()=>{const Y=new Set;return r.forEach(ye=>{ye.scenarios.forEach(de=>{const Pe=String(de.scenarioName??"").trim(),Ye=String(de.scenarioId??"").trim(),wt=Pe||Ye;wt&&Y.add(wt)})}),Array.from(Y).sort((ye,de)=>ye.localeCompare(de))},[r]),Z=v.useMemo(()=>g==="all"?r:r.filter(Y=>Y.scenarios.some(ye=>{const de=String(ye.scenarioName??"").trim(),Pe=String(ye.scenarioId??"").trim();return(de||Pe)===g})),[r,g]),z=v.useMemo(()=>[...Z].sort((ye,de)=>{let Pe=0;return f==="id"&&(Pe=ye.id.localeCompare(de.id)),f==="timestamp"&&(Pe=new Date(ye.timestamp).getTime()-new Date(de.timestamp).getTime()),f==="passRate"&&(Pe=ye.overallPassRate-de.overallPassRate),f==="scenarios"&&(Pe=ye.totalScenarios-de.totalScenarios),p==="asc"?Pe:-Pe}),[Z,f,p]),L=v.useMemo(()=>z.filter(Y=>c.has(Y.id)),[z,c]),ee=Y=>f!==Y?s.jsx(nc,{className:"h-3.5 w-3.5 text-muted-foreground"}):p==="asc"?s.jsx(fs,{className:"h-3.5 w-3.5"}):s.jsx(Dt,{className:"h-3.5 w-3.5"}),se=v.useMemo(()=>{const Y=new Map;for(const ye of z)Y.set(ye.id,Tge(ye));return Y},[z]),G=Y=>{const ye=Array.from(new Set(Y.scenarios.map(de=>de.agentId).filter(Boolean)));return ye.slice(0,Math.min(2,ye.length))},ue=Y=>{O("within-run"),R(Y.id),D(G(Y)),H("all")},le=v.useMemo(()=>[...new Set(L.flatMap(Y=>Y.scenarios.map(ye=>ye.scenarioId)))],[L]),oe=v.useMemo(()=>r.find(Y=>Y.id===T),[r,T]),ie=v.useMemo(()=>{if(!oe)return[];const Y=new Map;for(const ye of oe.scenarios)Y.set(ye.agentId,ye.agentName||ye.agentId);return Array.from(Y.entries()).map(([ye,de])=>({id:ye,name:de})).sort((ye,de)=>ye.name.localeCompare(de.name))},[oe]),fe=v.useMemo(()=>{if(!oe)return[];const Y=new Set;for(const ye of oe.scenarios){const de=String(ye.scenarioName??"").trim(),Pe=String(ye.scenarioId??"").trim(),Ye=de||Pe;Ye&&Y.add(Ye)}return Array.from(Y).sort((ye,de)=>ye.localeCompare(de))},[oe]),Ae=v.useMemo(()=>I.join(","),[I]);v.useEffect(()=>{if(P!=="within-run"||r.length===0)return;let Y=T;(!Y||!r.some(ve=>ve.id===Y))&&(Y=r[0].id);const ye=r.find(ve=>ve.id===Y),de=(()=>{if(!ye)return[];const ve=new Map;for(const ce of ye.scenarios)ve.set(ce.agentId,ce.agentName||ce.agentId);return Array.from(ve.keys())})(),Pe=new Set(de);let Ye=Ae.split(",").map(ve=>ve.trim()).filter(ve=>!!ve).filter(ve=>Pe.has(ve));Ye.length===0&&de.length>0&&(Ye=de.slice(0,Math.min(2,de.length)));const wt=(()=>{if(!ye)return[];const ve=new Set;for(const ce of ye.scenarios){const Ce=String(ce.scenarioName??"").trim(),we=String(ce.scenarioId??"").trim(),Fe=Ce||we;Fe&&ve.add(Fe)}return new Set(ve)})(),It=$!=="all"&&!wt.has($)?"all":$;Y!==T&&R(Y),Ye.join(",")!==Ae&&D(Ye),It!==$&&H(It)},[P,r,T,Ae,$]),v.useEffect(()=>{const Y=new URLSearchParams(t);P==="within-run"?(Y.set("mode","within-run"),T?Y.set("runId",T):Y.delete("runId"),I.length>0?Y.set("agents",I.join(",")):Y.delete("agents"),$!=="all"?Y.set("scenario",$):Y.delete("scenario")):(Y.delete("mode"),Y.delete("runId"),Y.delete("agents"),Y.delete("scenario"));const ye=t.toString(),de=Y.toString();ye!==de&&n(Y,{replace:!0})},[P,T,I,$,n]);const re=v.useMemo(()=>{if(!oe)return[];const Y=new Map;for(const de of oe.scenarios){const Pe=String(de.scenarioId??"").trim(),Ye=String(de.scenarioName??"").trim(),wt=Ye||Pe;if(!Pe&&!wt)continue;const It=Pe||wt,ve=Y.get(It);if(ve){ve.byAgent[de.agentId]=de;continue}Y.set(It,{scenarioId:Pe||wt,scenarioName:Ye,displayLabel:wt||Pe,byAgent:{[de.agentId]:de}})}const ye=Array.from(Y.values()).sort((de,Pe)=>{const Ye=(de.displayLabel||de.scenarioId).toLowerCase(),wt=(Pe.displayLabel||Pe.scenarioId).toLowerCase();return Ye.localeCompare(wt)});return $==="all"?ye:ye.filter(de=>de.displayLabel===$)},[oe,$]),Te=v.useMemo(()=>{const Y=new Map(ie.map(ye=>[ye.id,ye]));return I.map(ye=>Y.get(ye)).filter(ye=>!!ye)},[I,ie]),_e=v.useMemo(()=>{if(!oe||Te.length!==2)return null;const[Y,ye]=Te;return{left:Y,right:ye,link:`/compare/results?left=${encodeURIComponent(oe.id)}&right=${encodeURIComponent(oe.id)}&leftConfig=${encodeURIComponent(oe.configId)}&rightConfig=${encodeURIComponent(oe.configId)}&leftAgent=${encodeURIComponent(Y.id)}&rightAgent=${encodeURIComponent(ye.id)}`}},[oe,Te]),Ge=v.useMemo(()=>!oe||Te.length===0?[]:Te.map(Y=>{const de=re.map(ve=>ve.byAgent[Y.id]).filter(ve=>!!ve).flatMap(ve=>ve.runs),Pe=de.length,Ye=de.filter(ve=>ve.passed).length,wt=de.reduce((ve,ce)=>ve+ce.toolCalls.length,0),It=de.reduce((ve,ce)=>ve+ce.duration,0);return{agentId:Y.id,agentName:Y.name,passRate:Pe===0?0:Ye/Pe,totalRuns:Pe,avgToolCalls:Pe===0?0:wt/Pe,avgLatency:Pe===0?0:It/Pe}}),[oe,Te,re]),je=Y=>{D(ye=>ye.includes(Y)?ye.filter(de=>de!==Y):[...ye,Y])},Me=Y=>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:["#",Y.runIndex+1]})," ",s.jsx("span",{className:Y.passed?"text-emerald-700":"text-destructive",children:Y.passed?"PASS":"FAIL"})," ","· tools: ",Y.toolCalls.length," · ",Y.duration,"ms"]}),!Y.passed&&Y.failureReasons.length>0&&s.jsx("div",{className:"mt-1 text-[11px] text-muted-foreground",children:Y.failureReasons.join("; ")})]},Y.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(GS,{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(Vc,{open:b,onOpenChange:y,children:[s.jsx(Hc,{asChild:!0,children:s.jsxs(ne,{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(Dt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(Vo,{className:"w-[260px] p-0",align:"start",children:s.jsxs(Ko,{children:[s.jsx(Go,{placeholder:"Search scenarios..."}),s.jsxs(Yo,{children:[s.jsx(Xo,{children:"No scenarios found."}),s.jsxs(Qo,{children:[s.jsx(na,{value:"all scenarios",onSelect:()=>{j("all"),y(!1)},children:"All scenarios"}),U.map(Y=>s.jsx(na,{value:Y,onSelect:()=>{j(Y),y(!1)},children:Y},Y))]})]})]})})]}),s.jsx(ne,{variant:"outline",onClick:()=>{Q()},disabled:i,children:i?"Refreshing...":"Refresh"})]})]}),s.jsx(Ue,{children:s.jsx(qe,{className:"pt-6",children:s.jsx("div",{className:"flex flex-wrap gap-2",children:s.jsx(ne,{type:"button",variant:P==="runs"?"default":"outline",size:"sm",onClick:()=>O("runs"),children:"Run vs Run"})})})}),P==="within-run"&&s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(Nt,{className:"text-base",children:"Within One Run Controls"}),s.jsx(ne,{type:"button",variant:"outline",size:"sm",onClick:()=>O("runs"),children:"Back to run list"})]})}),s.jsxs(qe,{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(wn,{value:T,onValueChange:R,children:[s.jsx(mn,{children:s.jsx(jn,{placeholder:"Select run"})}),s.jsx(vn,{children:r.map(Y=>s.jsx(mt,{value:Y.id,children:Y.id},Y.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(Vc,{open:F,onOpenChange:q,children:[s.jsx(Hc,{asChild:!0,children:s.jsxs(ne,{type:"button",variant:"outline",role:"combobox","aria-expanded":F,className:"w-full justify-between font-normal",children:[s.jsx("span",{className:"truncate text-left",children:$==="all"?"All scenarios":$}),s.jsx(Dt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(Vo,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:s.jsxs(Ko,{children:[s.jsx(Go,{placeholder:"Search scenarios..."}),s.jsxs(Yo,{children:[s.jsx(Xo,{children:"No scenarios found."}),s.jsxs(Qo,{children:[s.jsx(na,{value:"all scenarios",onSelect:()=>{H("all"),q(!1)},children:"All scenarios"}),fe.map(Y=>s.jsx(na,{value:Y,onSelect:()=>{H(Y),q(!1)},children:Y},Y))]})]})]})})]})]})]}),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:[ie.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents available for selected run."}),ie.map(Y=>s.jsxs("label",{className:"inline-flex items-center gap-2 text-sm",children:[s.jsx(ra,{checked:I.includes(Y.id),onCheckedChange:()=>je(Y.id)}),s.jsx("span",{children:Y.name})]},Y.id))]})]})]})]}),P==="runs"&&s.jsx(Ue,{children:s.jsx(qe,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs($t,{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:()=>J("id"),children:["Run ID",ee("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:()=>J("timestamp"),children:["Timestamp",ee("timestamp")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>J("passRate"),children:["Pass Rate",ee("passRate")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>J("scenarios"),children:["Scenarios",ee("scenarios")]})}),s.jsx(tt,{children:"Agents"}),s.jsx(tt,{className:"w-[140px] text-right",children:"Action"})]})}),s.jsx(Lr,{children:z.map(Y=>s.jsxs($t,{children:[s.jsx(ze,{children:s.jsx(ra,{checked:c.has(Y.id),onCheckedChange:()=>B(Y.id),disabled:!c.has(Y.id)&&c.size>=5})}),s.jsx(ze,{className:"font-mono text-xs",children:Y.id}),s.jsx(ze,{className:"text-[11px] text-muted-foreground",children:(()=>{const ye=se.get(Y.id);return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Evaluated: ",ye.scenarioCount," scenario",ye.scenarioCount===1?"":"s"," · ",ye.agentCount," agent",ye.agentCount===1?"":"s"]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:ye.scenarioPreview})]})})()}),s.jsx(ze,{className:"text-xs text-muted-foreground",children:new Date(Y.timestamp).toLocaleString()}),s.jsx(ze,{children:s.jsx(Vs,{rate:Y.overallPassRate})}),s.jsx(ze,{className:"font-mono text-sm",children:Y.totalScenarios}),s.jsx(ze,{className:"font-mono text-sm",children:se.get(Y.id)?.agentCount??0}),s.jsx(ze,{className:"text-right",children:(se.get(Y.id)?.agentCount??0)>1?s.jsx(ne,{type:"button",size:"sm",variant:"outline",onClick:()=>ue(Y),children:"Compare agents"}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})})]},Y.id))})]})})}),P==="runs"&&L.length>=2&&s.jsxs(s.Fragment,{children:[L.length===2&&s.jsx(Ue,{children:s.jsx(qe,{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(ne,{asChild:!0,size:"sm",children:s.jsx(bt,{to:`/compare/results?left=${encodeURIComponent(L[0].id)}&right=${encodeURIComponent(L[1].id)}&leftConfig=${encodeURIComponent(L[0].configId)}&rightConfig=${encodeURIComponent(L[1].configId)}`,children:"Compare full results"})})]})})}),s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Summary Comparison"})}),s.jsx(qe,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs($t,{children:[s.jsx(tt,{children:"Metric"}),L.map((Y,ye)=>s.jsx(tt,{style:{color:Dj[ye]},className:"font-mono text-xs",children:Y.id},Y.id))]})}),s.jsxs(Lr,{children:[s.jsxs($t,{children:[s.jsx(ze,{className:"font-medium",children:"Pass Rate"}),L.map(Y=>s.jsx(ze,{children:s.jsx(Vs,{rate:Y.overallPassRate})},Y.id))]}),s.jsxs($t,{children:[s.jsx(ze,{className:"font-medium",children:"Total Runs"}),L.map(Y=>s.jsx(ze,{className:"font-mono",children:Y.totalRuns},Y.id))]}),s.jsxs($t,{children:[s.jsx(ze,{className:"font-medium",children:"Tool Calls"}),L.map(Y=>s.jsx(ze,{className:"font-mono",children:Y.avgToolCalls.toFixed(1)},Y.id))]}),s.jsxs($t,{children:[s.jsx(ze,{className:"font-medium",children:"Avg Latency"}),L.map(Y=>s.jsxs(ze,{className:"font-mono",children:[Y.avgLatency,"ms"]},Y.id))]})]})]})})]}),s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Scenario Breakdown"})}),s.jsx(qe,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs($t,{children:[s.jsx(tt,{children:"Scenario"}),L.map((Y,ye)=>s.jsx(tt,{style:{color:Dj[ye]},className:"font-mono text-xs",children:Y.id},Y.id))]})}),s.jsx(Lr,{children:le.map(Y=>s.jsxs($t,{children:[s.jsx(ze,{className:"font-medium text-sm",children:Y}),L.map(ye=>{const de=ye.scenarios.find(Pe=>Pe.scenarioId===Y);return s.jsx(ze,{children:de?s.jsx(Vs,{rate:de.passRate}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},ye.id)})]},Y))})]})})]})]}),P==="runs"&&L.length>=2&&s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Pass Rate Trend"})}),s.jsx(qe,{className:"h-72",children:s.jsx(Kh,{width:"100%",height:"100%",children:s.jsxs(_S,{data:L.map((Y,ye)=>({idx:ye+1,runId:Y.id,passRate:Number((Y.overallPassRate*100).toFixed(1))})),children:[s.jsx(Vi,{dataKey:"idx",tickFormatter:Y=>String(Y)}),s.jsx(Hi,{unit:"%",domain:[0,100]}),s.jsx(Mr,{formatter:Y=>[`${Y}%`,"Pass Rate"],labelFormatter:Y=>`Run ${Y}`}),s.jsx(Oo,{}),s.jsx(Uo,{type:"monotone",dataKey:"passRate",stroke:Dj[0],strokeWidth:2.5,dot:!0})]})})})]}),P==="within-run"&&oe&&Te.length<2&&s.jsx(Ue,{children:s.jsx(qe,{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"&&oe&&Te.length>=2&&s.jsxs(s.Fragment,{children:[s.jsx(Ue,{children:s.jsx(qe,{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:_e?"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(ne,{asChild:!0,size:"sm",children:_e?s.jsx(bt,{to:_e.link,children:"Compare full results"}):s.jsx(bt,{to:`/results/${encodeURIComponent(oe.id)}${oe.configId?`?configId=${encodeURIComponent(oe.configId)}`:""}`,children:"Open full result"})})]})})}),s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Agent Summary"})}),s.jsx(qe,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs($t,{children:[s.jsx(tt,{children:"Metric"}),Ge.map(Y=>s.jsx(tt,{className:"font-mono text-xs",children:Y.agentName},Y.agentId))]})}),s.jsxs(Lr,{children:[s.jsxs($t,{children:[s.jsx(ze,{className:"font-medium",children:"Pass Rate"}),Ge.map(Y=>s.jsx(ze,{children:s.jsx(Vs,{rate:Y.passRate})},Y.agentId))]}),s.jsxs($t,{children:[s.jsx(ze,{className:"font-medium",children:"Total Runs"}),Ge.map(Y=>s.jsx(ze,{className:"font-mono",children:Y.totalRuns},Y.agentId))]}),s.jsxs($t,{children:[s.jsx(ze,{className:"font-medium",children:"Avg Tool Calls"}),Ge.map(Y=>s.jsx(ze,{className:"font-mono",children:Y.avgToolCalls.toFixed(1)},Y.agentId))]}),s.jsxs($t,{children:[s.jsx(ze,{className:"font-medium",children:"Avg Latency"}),Ge.map(Y=>s.jsxs(ze,{className:"font-mono",children:[Math.round(Y.avgLatency),"ms"]},Y.agentId))]})]})]})})]}),s.jsxs(Ue,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Scenario × Agent Matrix"})}),s.jsx(qe,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs($t,{children:[s.jsx(tt,{className:"w-[260px]",children:"Scenario"}),Te.map(Y=>s.jsx(tt,{className:"font-mono text-xs",children:Y.name},Y.id))]})}),s.jsx(Lr,{children:re.map(Y=>s.jsxs($t,{children:[s.jsx(ze,{className:"font-medium text-sm",children:Y.displayLabel}),Te.map(ye=>{const de=Y.byAgent[ye.id];return de?s.jsx(ze,{className:"align-top",children:s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"text-xs text-muted-foreground",children:[s.jsx(Vs,{rate:de.passRate})," ",s.jsxs("span",{className:"ml-2",children:["runs: ",de.runs.length]})," ","· calls: ",de.avgToolCalls.toFixed(1)," · latency: ",Math.round(de.avgDuration),"ms"]}),de.runs.length>0?s.jsx("div",{className:"space-y-1.5",children:de.runs.map(Pe=>Me(Pe))}):s.jsx("div",{className:"text-xs text-muted-foreground",children:"No runs captured."})]})},ye.id):s.jsx(ze,{children:s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},ye.id)})]},Y.scenarioId))})]})})]})]})]})},HM=(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()}`},KM=(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}`:""}`},Ige=()=>{const[e]=Yi(),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(Ue,{children:[s.jsx(St,{children:s.jsx(Nt,{className:"text-base",children:"Full Result Compare"})}),s.jsxs(qe,{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(ne,{asChild:!0,variant:"outline",children:s.jsx(bt,{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(ne,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs(bt,{to:"/compare",children:[s.jsx(z7,{className:"mr-1.5 h-4 w-4"}),"Back to Compare"]})}),s.jsx(ne,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:KM(t,r,i),target:"_blank",rel:"noreferrer",children:["Open Left",s.jsx(Ah,{className:"ml-1.5 h-3.5 w-3.5"})]})}),s.jsx(ne,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:KM(n,a,o),target:"_blank",rel:"noreferrer",children:["Open Right",s.jsx(Ah,{className:"ml-1.5 h-3.5 w-3.5"})]})})]})]}),s.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[s.jsxs(Ue,{className:"overflow-hidden",children:[s.jsx(St,{className:"py-3",children:s.jsx(Nt,{className:"text-sm font-mono",children:c})}),s.jsx(qe,{className:"p-0",children:s.jsx("iframe",{title:`Result ${c}`,src:HM(t,r,i),className:"h-[calc(100vh-15rem)] w-full border-0"})})]}),s.jsxs(Ue,{className:"overflow-hidden",children:[s.jsx(St,{className:"py-3",children:s.jsx(Nt,{className:"text-sm font-mono",children:d})}),s.jsx(qe,{className:"p-0",children:s.jsx("iframe",{title:`Result ${d}`,src:HM(n,a,o),className:"h-[calc(100vh-15rem)] w-full border-0"})})]})]})]})};function Mge(e){return e.match(/(?:^|\/)(?:result-assistant|results?)\/([0-9]{8}-[0-9]{6})(?:-|\/)/i)?.[1]??null}function $ge(){const{source:e}=Tn(),[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){Oe({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)),Oe({title:"Markdown report deleted"}),o(null)}catch(g){Oe({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(Xl,{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(ne,{variant:"outline",onClick:()=>{f()},children:"Refresh"}),h?s.jsx(ne,{asChild:!0,variant:"outline",children:s.jsx(bt,{to:`/markdown-reports/view?path=${encodeURIComponent(h.relativePath)}`,children:"Open latest"})}):null]})]}),s.jsx(Ue,{children:s.jsx(qe,{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($r,{children:[s.jsx(Dr,{children:s.jsxs($t,{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(Lr,{children:t.map(g=>s.jsxs($t,{children:[s.jsx(ze,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(bt,{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(ze,{className:"text-xs text-muted-foreground font-mono",children:(()=>{const j=Mge(g.relativePath);return j?s.jsx(bt,{to:`/results/${encodeURIComponent(j)}`,className:"text-primary hover:underline",children:j}):s.jsx("span",{className:"text-muted-foreground",children:"—"})})()}),s.jsx(ze,{className:"text-xs text-muted-foreground font-mono",children:g.relativePath.includes("/")?g.relativePath.slice(0,g.relativePath.lastIndexOf("/")):"."}),s.jsx(ze,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(vf,{className:"h-3 w-3"}),new Date(g.mtime).toLocaleString()]})}),s.jsx(ze,{children:s.jsxs(uu,{children:[s.jsx(du,{asChild:!0,children:s.jsx(ne,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Gm,{className:"h-4 w-4"})})}),s.jsxs(cl,{align:"end",children:[s.jsx(Nr,{asChild:!0,children:s.jsx(bt,{to:`/markdown-reports/view?path=${encodeURIComponent(g.relativePath)}`,children:"View"})}),s.jsxs(Nr,{className:"text-destructive",onSelect:j=>{j.preventDefault(),o(g.relativePath)},children:[s.jsx(Ca,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},g.path))})]})})}),s.jsx(Ps,{open:!!i,onOpenChange:g=>!g&&o(null),children:s.jsxs(Xa,{children:[s.jsxs(Qa,{children:[s.jsx(Za,{children:"Delete markdown report?"}),s.jsx(es,{children:p?`Delete '${p.name}' from disk? This cannot be undone.`:"Delete this report from disk? This cannot be undone."})]}),s.jsxs(Ja,{children:[s.jsx(ns,{disabled:c,children:"Cancel"}),s.jsx(ts,{onClick:g=>{g.preventDefault(),x()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}function Dge(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Lge(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 Fge(){const{source:e}=Tn(),[t]=Yi(),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}Oe({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(ne,{asChild:!0,variant:"outline",children:s.jsx(bt,{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(ne,{asChild:!0,variant:"outline",children:s.jsx(bt,{to:"/markdown-reports",children:"Back to Markdown Reports"})})]});const p=Lge(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()," "," · "," ",Dge(r.sizeBytes)]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[p?s.jsxs(s.Fragment,{children:[s.jsx(ne,{variant:"outline",size:"sm",onClick:()=>h(!0),children:"Open Result Panel"}),s.jsx(ne,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(bt,{to:`/results/${encodeURIComponent(p)}`,children:"Open Result"})})]}):null,s.jsx(ne,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(bt,{to:"/markdown-reports",children:"Back to reports"})})]})]}),s.jsx(Ue,{children:s.jsx(qe,{className:"pt-6",children:s.jsx(bd,{text:r.content,variant:"assistant"})})}),p?s.jsx(h3,{open:f,onOpenChange:h,children:s.jsxs(xN,{side:"right",className:"w-[96vw] max-w-none p-0 sm:max-w-5xl",children:[s.jsx(v3,{className:"border-b px-4 py-3 pr-12",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(g3,{className:"text-base",children:["Result ",p]}),s.jsx(ne,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(bt,{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 Bge=()=>{const e=Cs();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"})]})})},zge=new CV;function Uge(){const{scenarioId:e}=el();return s.jsx($D,{to:e?`/libraries/test-cases/${encodeURIComponent(e)}`:"/libraries/test-cases",replace:!0})}const qge=()=>s.jsx(_V,{client:zge,children:s.jsx(xD,{children:s.jsx(FG,{children:s.jsx(qG,{children:s.jsxs(UG,{children:[s.jsx(Tq,{}),s.jsx(u9,{}),s.jsx(EH,{children:s.jsxs(yH,{children:[s.jsxs(Zt,{element:s.jsx(zG,{}),children:[s.jsx(Zt,{path:"/",element:s.jsx(vfe,{})}),s.jsx(Zt,{path:"/mcp-evaluations",element:s.jsx(Kpe,{})}),s.jsx(Zt,{path:"/mcp-evaluations/:id",element:s.jsx(jM,{})}),s.jsx(Zt,{path:"/mcp-evaluations/:id/:tab",element:s.jsx(jM,{})}),s.jsx(Zt,{path:"/tool-analysis",element:s.jsx(uge,{})}),s.jsx(Zt,{path:"/tool-analysis-results",element:s.jsx(dge,{})}),s.jsx(Zt,{path:"/tool-analysis-results/:id",element:s.jsx(fge,{})}),s.jsx(Zt,{path:"/oauth-debugger",element:s.jsx(gge,{})}),s.jsx(Zt,{path:"/libraries/servers",element:s.jsx(Ome,{})}),s.jsx(Zt,{path:"/libraries/servers/:serverId",element:s.jsx(Rme,{})}),s.jsx(Zt,{path:"/libraries/agents",element:s.jsx(Ime,{})}),s.jsx(Zt,{path:"/libraries/agents/:agentName",element:s.jsx(Wve,{})}),s.jsx(Zt,{path:"/libraries/test-cases",element:s.jsx(kM,{})}),s.jsx(Zt,{path:"/libraries/test-cases/:testCaseId",element:s.jsx(kM,{})}),s.jsx(Zt,{path:"/libraries/scenarios",element:s.jsx($D,{to:"/libraries/test-cases",replace:!0})}),s.jsx(Zt,{path:"/libraries/scenarios/:scenarioId",element:s.jsx(Uge,{})}),s.jsx(Zt,{path:"/settings",element:s.jsx(Vve,{})}),s.jsx(Zt,{path:"/run",element:s.jsx(xge,{})}),s.jsx(Zt,{path:"/results",element:s.jsx(bge,{})}),s.jsx(Zt,{path:"/results/:id",element:s.jsx(Age,{})}),s.jsx(Zt,{path:"/markdown-reports",element:s.jsx($ge,{})}),s.jsx(Zt,{path:"/markdown-reports/view",element:s.jsx(Fge,{})}),s.jsx(Zt,{path:"/compare",element:s.jsx(Rge,{})}),s.jsx(Zt,{path:"/compare/results",element:s.jsx(Ige,{})})]}),s.jsx(Zt,{path:"*",element:s.jsx(Bge,{})})]})})]})})})})});$U.createRoot(document.getElementById("root")).render(s.jsx(qge,{}));