@inspectr/mcplab 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,249 +0,0 @@
1
- function h7(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();var Sp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Vt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Iy={exports:{}},Su={},My={exports:{}},Et={};var zA;function m7(){if(zA)return Et;zA=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 y(F){return F===null||typeof F!="object"?null:(F=p&&F[p]||F["@@iterator"],typeof F=="function"?F:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,b={};function x(F,$,Z){this.props=F,this.context=$,this.refs=b,this.updater=Z||g}x.prototype.isReactComponent={},x.prototype.setState=function(F,$){if(typeof F!="object"&&typeof F!="function"&&F!=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,F,$,"setState")},x.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function S(){}S.prototype=x.prototype;function N(F,$,Z){this.props=F,this.context=$,this.refs=b,this.updater=Z||g}var _=N.prototype=new S;_.constructor=N,j(_,x.prototype),_.isPureReactComponent=!0;var P=Array.isArray,A=Object.prototype.hasOwnProperty,O={current:null},k={key:!0,ref:!0,__self:!0,__source:!0};function R(F,$,Z){var ae,V={},ie=null,ne=null;if($!=null)for(ae in $.ref!==void 0&&(ne=$.ref),$.key!==void 0&&(ie=""+$.key),$)A.call($,ae)&&!k.hasOwnProperty(ae)&&(V[ae]=$[ae]);var de=arguments.length-2;if(de===1)V.children=Z;else if(1<de){for(var oe=Array(de),ge=0;ge<de;ge++)oe[ge]=arguments[ge+2];V.children=oe}if(F&&F.defaultProps)for(ae in de=F.defaultProps,de)V[ae]===void 0&&(V[ae]=de[ae]);return{$$typeof:e,type:F,key:ie,ref:ne,props:V,_owner:O.current}}function M(F,$){return{$$typeof:e,type:F.type,key:$,ref:F.ref,props:F.props,_owner:F._owner}}function z(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function B(F){var $={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(Z){return $[Z]})}var D=/\/+/g;function G(F,$){return typeof F=="object"&&F!==null&&F.key!=null?B(""+F.key):$.toString(36)}function U(F,$,Z,ae,V){var ie=typeof F;(ie==="undefined"||ie==="boolean")&&(F=null);var ne=!1;if(F===null)ne=!0;else switch(ie){case"string":case"number":ne=!0;break;case"object":switch(F.$$typeof){case e:case t:ne=!0}}if(ne)return ne=F,V=V(ne),F=ae===""?"."+G(ne,0):ae,P(V)?(Z="",F!=null&&(Z=F.replace(D,"$&/")+"/"),U(V,$,Z,"",function(ge){return ge})):V!=null&&(z(V)&&(V=M(V,Z+(!V.key||ne&&ne.key===V.key?"":(""+V.key).replace(D,"$&/")+"/")+F)),$.push(V)),1;if(ne=0,ae=ae===""?".":ae+":",P(F))for(var de=0;de<F.length;de++){ie=F[de];var oe=ae+G(ie,de);ne+=U(ie,$,Z,oe,V)}else if(oe=y(F),typeof oe=="function")for(F=oe.call(F),de=0;!(ie=F.next()).done;)ie=ie.value,oe=ae+G(ie,de++),ne+=U(ie,$,Z,oe,V);else if(ie==="object")throw $=String(F),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(F).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.");return ne}function W(F,$,Z){if(F==null)return F;var ae=[],V=0;return U(F,ae,"","",function(ie){return $.call(Z,ie,V++)}),ae}function X(F){if(F._status===-1){var $=F._result;$=$(),$.then(function(Z){(F._status===0||F._status===-1)&&(F._status=1,F._result=Z)},function(Z){(F._status===0||F._status===-1)&&(F._status=2,F._result=Z)}),F._status===-1&&(F._status=0,F._result=$)}if(F._status===1)return F._result.default;throw F._result}var J={current:null},T={transition:null},L={ReactCurrentDispatcher:J,ReactCurrentBatchConfig:T,ReactCurrentOwner:O};function Q(){throw Error("act(...) is not supported in production builds of React.")}return Et.Children={map:W,forEach:function(F,$,Z){W(F,function(){$.apply(this,arguments)},Z)},count:function(F){var $=0;return W(F,function(){$++}),$},toArray:function(F){return W(F,function($){return $})||[]},only:function(F){if(!z(F))throw Error("React.Children.only expected to receive a single React element child.");return F}},Et.Component=x,Et.Fragment=n,Et.Profiler=a,Et.PureComponent=N,Et.StrictMode=r,Et.Suspense=d,Et.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=L,Et.act=Q,Et.cloneElement=function(F,$,Z){if(F==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+F+".");var ae=j({},F.props),V=F.key,ie=F.ref,ne=F._owner;if($!=null){if($.ref!==void 0&&(ie=$.ref,ne=O.current),$.key!==void 0&&(V=""+$.key),F.type&&F.type.defaultProps)var de=F.type.defaultProps;for(oe in $)A.call($,oe)&&!k.hasOwnProperty(oe)&&(ae[oe]=$[oe]===void 0&&de!==void 0?de[oe]:$[oe])}var oe=arguments.length-2;if(oe===1)ae.children=Z;else if(1<oe){de=Array(oe);for(var ge=0;ge<oe;ge++)de[ge]=arguments[ge+2];ae.children=de}return{$$typeof:e,type:F.type,key:V,ref:ie,props:ae,_owner:ne}},Et.createContext=function(F){return F={$$typeof:o,_currentValue:F,_currentValue2:F,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},F.Provider={$$typeof:i,_context:F},F.Consumer=F},Et.createElement=R,Et.createFactory=function(F){var $=R.bind(null,F);return $.type=F,$},Et.createRef=function(){return{current:null}},Et.forwardRef=function(F){return{$$typeof:c,render:F}},Et.isValidElement=z,Et.lazy=function(F){return{$$typeof:h,_payload:{_status:-1,_result:F},_init:X}},Et.memo=function(F,$){return{$$typeof:f,type:F,compare:$===void 0?null:$}},Et.startTransition=function(F){var $=T.transition;T.transition={};try{F()}finally{T.transition=$}},Et.unstable_act=Q,Et.useCallback=function(F,$){return J.current.useCallback(F,$)},Et.useContext=function(F){return J.current.useContext(F)},Et.useDebugValue=function(){},Et.useDeferredValue=function(F){return J.current.useDeferredValue(F)},Et.useEffect=function(F,$){return J.current.useEffect(F,$)},Et.useId=function(){return J.current.useId()},Et.useImperativeHandle=function(F,$,Z){return J.current.useImperativeHandle(F,$,Z)},Et.useInsertionEffect=function(F,$){return J.current.useInsertionEffect(F,$)},Et.useLayoutEffect=function(F,$){return J.current.useLayoutEffect(F,$)},Et.useMemo=function(F,$){return J.current.useMemo(F,$)},Et.useReducer=function(F,$,Z){return J.current.useReducer(F,$,Z)},Et.useRef=function(F){return J.current.useRef(F)},Et.useState=function(F){return J.current.useState(F)},Et.useSyncExternalStore=function(F,$,Z){return J.current.useSyncExternalStore(F,$,Z)},Et.useTransition=function(){return J.current.useTransition()},Et.version="18.3.1",Et}var UA;function vS(){return UA||(UA=1,My.exports=m7()),My.exports}var qA;function v7(){if(qA)return Su;qA=1;var e=vS(),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={},y=null,g=null;f!==void 0&&(y=""+f),d.key!==void 0&&(y=""+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:y,ref:g,props:p,_owner:a.current}}return Su.Fragment=n,Su.jsx=o,Su.jsxs=o,Su}var WA;function g7(){return WA||(WA=1,Iy.exports=v7()),Iy.exports}var s=g7(),Np={},$y={exports:{}},Or={},Dy={exports:{}},Ly={};var VA;function y7(){return VA||(VA=1,(function(e){function t(T,L){var Q=T.length;T.push(L);e:for(;0<Q;){var F=Q-1>>>1,$=T[F];if(0<a($,L))T[F]=L,T[Q]=$,Q=F;else break e}}function n(T){return T.length===0?null:T[0]}function r(T){if(T.length===0)return null;var L=T[0],Q=T.pop();if(Q!==L){T[0]=Q;e:for(var F=0,$=T.length,Z=$>>>1;F<Z;){var ae=2*(F+1)-1,V=T[ae],ie=ae+1,ne=T[ie];if(0>a(V,Q))ie<$&&0>a(ne,V)?(T[F]=ne,T[ie]=Q,F=ie):(T[F]=V,T[ae]=Q,F=ae);else if(ie<$&&0>a(ne,Q))T[F]=ne,T[ie]=Q,F=ie;else break e}}return L}function a(T,L){var Q=T.sortIndex-L.sortIndex;return Q!==0?Q:T.id-L.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,y=3,g=!1,j=!1,b=!1,x=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(T){for(var L=n(f);L!==null;){if(L.callback===null)r(f);else if(L.startTime<=T)r(f),L.sortIndex=L.expirationTime,t(d,L);else break;L=n(f)}}function P(T){if(b=!1,_(T),!j)if(n(d)!==null)j=!0,X(A);else{var L=n(f);L!==null&&J(P,L.startTime-T)}}function A(T,L){j=!1,b&&(b=!1,S(R),R=-1),g=!0;var Q=y;try{for(_(L),p=n(d);p!==null&&(!(p.expirationTime>L)||T&&!B());){var F=p.callback;if(typeof F=="function"){p.callback=null,y=p.priorityLevel;var $=F(p.expirationTime<=L);L=e.unstable_now(),typeof $=="function"?p.callback=$:p===n(d)&&r(d),_(L)}else r(d);p=n(d)}if(p!==null)var Z=!0;else{var ae=n(f);ae!==null&&J(P,ae.startTime-L),Z=!1}return Z}finally{p=null,y=Q,g=!1}}var O=!1,k=null,R=-1,M=5,z=-1;function B(){return!(e.unstable_now()-z<M)}function D(){if(k!==null){var T=e.unstable_now();z=T;var L=!0;try{L=k(!0,T)}finally{L?G():(O=!1,k=null)}}else O=!1}var G;if(typeof N=="function")G=function(){N(D)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,W=U.port2;U.port1.onmessage=D,G=function(){W.postMessage(null)}}else G=function(){x(D,0)};function X(T){k=T,O||(O=!0,G())}function J(T,L){R=x(function(){T(e.unstable_now())},L)}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(T){T.callback=null},e.unstable_continueExecution=function(){j||g||(j=!0,X(A))},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(T){switch(y){case 1:case 2:case 3:var L=3;break;default:L=y}var Q=y;y=L;try{return T()}finally{y=Q}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(T,L){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var Q=y;y=T;try{return L()}finally{y=Q}},e.unstable_scheduleCallback=function(T,L,Q){var F=e.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?F+Q:F):Q=F,T){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=Q+$,T={id:h++,callback:L,priorityLevel:T,startTime:Q,expirationTime:$,sortIndex:-1},Q>F?(T.sortIndex=Q,t(f,T),n(d)===null&&T===n(f)&&(b?(S(R),R=-1):b=!0,J(P,Q-F))):(T.sortIndex=$,t(d,T),j||g||(j=!0,X(A))),T},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(T){var L=y;return function(){var Q=y;y=L;try{return T.apply(this,arguments)}finally{y=Q}}}})(Ly)),Ly}var HA;function x7(){return HA||(HA=1,Dy.exports=y7()),Dy.exports}var KA;function b7(){if(KA)return Or;KA=1;var e=vS(),t=x7();function n(l){for(var u="https://reactjs.org/docs/error-decoder.html?invariant="+l,m=1;m<arguments.length;m++)u+="&args[]="+encodeURIComponent(arguments[m]);return"Minified React error #"+l+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,a={};function i(l,u){o(l,u),o(l+"Capture",u)}function o(l,u){for(a[l]=u,l=0;l<u.length;l++)r.add(u[l])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,h={},p={};function y(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,C,E,I){this.acceptsBooleans=u===2||u===3||u===4,this.attributeName=w,this.attributeNamespace=C,this.mustUseProperty=m,this.propertyName=l,this.type=u,this.sanitizeURL=E,this.removeEmptyString=I}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){x[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];x[u]=new b(u,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){x[l]=new b(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){x[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){x[l]=new b(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){x[l]=new b(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){x[l]=new b(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){x[l]=new b(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){x[l]=new b(l,5,!1,l.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function N(l){return l[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(l){var u=l.replace(S,N);x[u]=new 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,N);x[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,N);x[u]=new b(u,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){x[l]=new b(l,1,!1,l.toLowerCase(),null,!1,!1)}),x.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){x[l]=new b(l,1,!1,l.toLowerCase(),null,!0,!0)});function _(l,u,m,w){var C=x.hasOwnProperty(u)?x[u]:null;(C!==null?C.type!==0:w||!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(j(u,m,C,w)&&(m=null),w||C===null?y(u)&&(m===null?l.removeAttribute(u):l.setAttribute(u,""+m)):C.mustUseProperty?l[C.propertyName]=m===null?C.type===3?!1:"":m:(u=C.attributeName,w=C.attributeNamespace,m===null?l.removeAttribute(u):(C=C.type,m=C===3||C===4&&m===!0?"":""+m,w?l.setAttributeNS(w,u,m):l.setAttribute(u,m))))}var P=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),O=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),z=Symbol.for("react.provider"),B=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),J=Symbol.for("react.offscreen"),T=Symbol.iterator;function L(l){return l===null||typeof l!="object"?null:(l=T&&l[T]||l["@@iterator"],typeof l=="function"?l:null)}var Q=Object.assign,F;function $(l){if(F===void 0)try{throw Error()}catch(m){var u=m.stack.trim().match(/\n( *(at )?)/);F=u&&u[1]||""}return`
2
- `+F+l}var Z=!1;function ae(l,u){if(!l||Z)return"";Z=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(u)if(u=function(){throw Error()},Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(me){var w=me}Reflect.construct(l,[],u)}else{try{u.call()}catch(me){w=me}l.call(u.prototype)}else{try{throw Error()}catch(me){w=me}l()}}catch(me){if(me&&w&&typeof me.stack=="string"){for(var C=me.stack.split(`
3
- `),E=w.stack.split(`
4
- `),I=C.length-1,Y=E.length-1;1<=I&&0<=Y&&C[I]!==E[Y];)Y--;for(;1<=I&&0<=Y;I--,Y--)if(C[I]!==E[Y]){if(I!==1||Y!==1)do if(I--,Y--,0>Y||C[I]!==E[Y]){var ee=`
5
- `+C[I].replace(" at new "," at ");return l.displayName&&ee.includes("<anonymous>")&&(ee=ee.replace("<anonymous>",l.displayName)),ee}while(1<=I&&0<=Y);break}}}finally{Z=!1,Error.prepareStackTrace=m}return(l=l?l.displayName||l.name:"")?$(l):""}function V(l){switch(l.tag){case 5:return $(l.type);case 16:return $("Lazy");case 13:return $("Suspense");case 19:return $("SuspenseList");case 0:case 2:case 15:return l=ae(l.type,!1),l;case 11:return l=ae(l.type.render,!1),l;case 1:return l=ae(l.type,!0),l;default:return""}}function ie(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case k:return"Fragment";case O:return"Portal";case M:return"Profiler";case R:return"StrictMode";case G:return"Suspense";case U:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case B:return(l.displayName||"Context")+".Consumer";case z:return(l._context.displayName||"Context")+".Provider";case D:var u=l.render;return l=l.displayName,l||(l=u.displayName||u.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case W:return u=l.displayName||null,u!==null?u:ie(l.type)||"Memo";case X:u=l._payload,l=l._init;try{return ie(l(u))}catch{}}return null}function ne(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 ie(u);case 8:return u===R?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u}return null}function de(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function oe(l){var u=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function ge(l){var u=oe(l)?"checked":"value",m=Object.getOwnPropertyDescriptor(l.constructor.prototype,u),w=""+l[u];if(!l.hasOwnProperty(u)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var C=m.get,E=m.set;return Object.defineProperty(l,u,{configurable:!0,get:function(){return C.call(this)},set:function(I){w=""+I,E.call(this,I)}}),Object.defineProperty(l,u,{enumerable:m.enumerable}),{getValue:function(){return w},setValue:function(I){w=""+I},stopTracking:function(){l._valueTracker=null,delete l[u]}}}}function Re(l){l._valueTracker||(l._valueTracker=ge(l))}function re(l){if(!l)return!1;var u=l._valueTracker;if(!u)return!0;var m=u.getValue(),w="";return l&&(w=oe(l)?l.checked?"true":"false":l.value),l=w,l!==m?(u.setValue(l),!0):!1}function De(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}function Ae(l,u){var m=u.checked;return Q({},u,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:m??l._wrapperState.initialChecked})}function We(l,u){var m=u.defaultValue==null?"":u.defaultValue,w=u.checked!=null?u.checked:u.defaultChecked;m=de(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 ye(l,u){u=u.checked,u!=null&&_(l,"checked",u,!1)}function Ee(l,u){ye(l,u);var m=de(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")?_e(l,u.type,m):u.hasOwnProperty("defaultValue")&&_e(l,u.type,de(u.defaultValue)),u.checked==null&&u.defaultChecked!=null&&(l.defaultChecked=!!u.defaultChecked)}function le(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 _e(l,u,m){(u!=="number"||De(l.ownerDocument)!==l)&&(m==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+m&&(l.defaultValue=""+m))}var pe=Array.isArray;function we(l,u,m,w){if(l=l.options,u){u={};for(var C=0;C<m.length;C++)u["$"+m[C]]=!0;for(m=0;m<l.length;m++)C=u.hasOwnProperty("$"+l[m].value),l[m].selected!==C&&(l[m].selected=C),C&&w&&(l[m].defaultSelected=!0)}else{for(m=""+de(m),u=null,C=0;C<l.length;C++){if(l[C].value===m){l[C].selected=!0,w&&(l[C].defaultSelected=!0);return}u!==null||l[C].disabled||(u=l[C])}u!==null&&(u.selected=!0)}}function Se(l,u){if(u.dangerouslySetInnerHTML!=null)throw Error(n(91));return Q({},u,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function Ve(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(pe(m)){if(1<m.length)throw Error(n(93));m=m[0]}u=m}u==null&&(u=""),m=u}l._wrapperState={initialValue:de(m)}}function Ot(l,u){var m=de(u.value),w=de(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 xe(l){var u=l.textContent;u===l._wrapperState.initialValue&&u!==""&&u!==null&&(l.value=u)}function ze(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 Ge(l,u){return l==null||l==="http://www.w3.org/1999/xhtml"?ze(u):l==="http://www.w3.org/2000/svg"&&u==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var Dt,Lt=(function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(u,m,w,C){MSApp.execUnsafeLocalFunction(function(){return l(u,m,w,C)})}:l})(function(l,u){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=u;else{for(Dt=Dt||document.createElement("div"),Dt.innerHTML="<svg>"+u.valueOf().toString()+"</svg>",u=Dt.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;u.firstChild;)l.appendChild(u.firstChild)}});function $t(l,u){if(u){var m=l.firstChild;if(m&&m===l.lastChild&&m.nodeType===3){m.nodeValue=u;return}}l.textContent=u}var mn={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},_n=["Webkit","ms","Moz","O"];Object.keys(mn).forEach(function(l){_n.forEach(function(u){u=u+l.charAt(0).toUpperCase()+l.substring(1),mn[u]=mn[l]})});function tr(l,u,m){return u==null||typeof u=="boolean"||u===""?"":m||typeof u!="number"||u===0||mn.hasOwnProperty(l)&&mn[l]?(""+u).trim():u+"px"}function or(l,u){l=l.style;for(var m in u)if(u.hasOwnProperty(m)){var w=m.indexOf("--")===0,C=tr(m,u[m],w);m==="float"&&(m="cssFloat"),w?l.setProperty(m,C):l[m]=C}}var Ca=Q({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Mn(l,u){if(u){if(Ca[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 Mr(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 hr(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var $n=null,On=null,en=null;function Sn(l){if(l=lu(l)){if(typeof $n!="function")throw Error(n(280));var u=l.stateNode;u&&(u=Lf(u),$n(l.stateNode,l.type,u))}}function ce(l){On?en?en.push(l):en=[l]:On=l}function Te(){if(On){var l=On,u=en;if(en=On=null,Sn(l),u)for(l=0;l<u.length;l++)Sn(u[l])}}function ot(l,u){return l(u)}function gt(){}var Ft=!1;function cn(l,u,m){if(Ft)return l(u,m);Ft=!0;try{return ot(l,u,m)}finally{Ft=!1,(On!==null||en!==null)&&(gt(),Te())}}function At(l,u){var m=l.stateNode;if(m===null)return null;var w=Lf(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 mr=!1;if(c)try{var un={};Object.defineProperty(un,"passive",{get:function(){mr=!0}}),window.addEventListener("test",un,un),window.removeEventListener("test",un,un)}catch{mr=!1}function Kt(l,u,m,w,C,E,I,Y,ee){var me=Array.prototype.slice.call(arguments,3);try{u.apply(m,me)}catch(Ce){this.onError(Ce)}}var Nr=!1,Dr=null,Qa=!1,ti=null,Vi={onError:function(l){Nr=!0,Dr=l}};function K(l,u,m,w,C,E,I,Y,ee){Nr=!1,Dr=null,Kt.apply(Vi,arguments)}function ve(l,u,m,w,C,E,I,Y,ee){if(K.apply(this,arguments),Nr){if(Nr){var me=Dr;Nr=!1,Dr=null}else throw Error(n(198));Qa||(Qa=!0,ti=me)}}function Fe(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 jt(l){if(Fe(l)!==l)throw Error(n(188))}function Pt(l){var u=l.alternate;if(!u){if(u=Fe(l),u===null)throw Error(n(188));return u!==l?null:l}for(var m=l,w=u;;){var C=m.return;if(C===null)break;var E=C.alternate;if(E===null){if(w=C.return,w!==null){m=w;continue}break}if(C.child===E.child){for(E=C.child;E;){if(E===m)return jt(C),l;if(E===w)return jt(C),u;E=E.sibling}throw Error(n(188))}if(m.return!==w.return)m=C,w=E;else{for(var I=!1,Y=C.child;Y;){if(Y===m){I=!0,m=C,w=E;break}if(Y===w){I=!0,w=C,m=E;break}Y=Y.sibling}if(!I){for(Y=E.child;Y;){if(Y===m){I=!0,m=E,w=C;break}if(Y===w){I=!0,w=E,m=C;break}Y=Y.sibling}if(!I)throw Error(n(189))}}if(m.alternate!==w)throw Error(n(190))}if(m.tag!==3)throw Error(n(188));return m.stateNode.current===m?l:u}function yn(l){return l=Pt(l),l!==null?Ye(l):null}function Ye(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var u=Ye(l);if(u!==null)return u;l=l.sibling}return null}var xn=t.unstable_scheduleCallback,Dn=t.unstable_cancelCallback,tn=t.unstable_shouldYield,H=t.unstable_requestPaint,he=t.unstable_now,at=t.unstable_getCurrentPriorityLevel,Ie=t.unstable_ImmediatePriority,kt=t.unstable_UserBlockingPriority,_t=t.unstable_NormalPriority,kn=t.unstable_LowPriority,Ja=t.unstable_IdlePriority,Gt=null,Ln=null;function xf(l){if(Ln&&typeof Ln.onCommitFiberRoot=="function")try{Ln.onCommitFiberRoot(Gt,l,void 0,(l.current.flags&128)===128)}catch{}}var Lr=Math.clz32?Math.clz32:Rz,qc=Math.log,kz=Math.LN2;function Rz(l){return l>>>=0,l===0?32:31-(qc(l)/kz|0)|0}var bf=64,wf=4194304;function Wc(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 jf(l,u){var m=l.pendingLanes;if(m===0)return 0;var w=0,C=l.suspendedLanes,E=l.pingedLanes,I=m&268435455;if(I!==0){var Y=I&~C;Y!==0?w=Wc(Y):(E&=I,E!==0&&(w=Wc(E)))}else I=m&~C,I!==0?w=Wc(I):E!==0&&(w=Wc(E));if(w===0)return 0;if(u!==0&&u!==w&&(u&C)===0&&(C=w&-w,E=u&-u,C>=E||C===16&&(E&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-Lr(u),C=1<<m,w|=l[m],u&=~C;return w}function Tz(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 Iz(l,u){for(var m=l.suspendedLanes,w=l.pingedLanes,C=l.expirationTimes,E=l.pendingLanes;0<E;){var I=31-Lr(E),Y=1<<I,ee=C[I];ee===-1?((Y&m)===0||(Y&w)!==0)&&(C[I]=Tz(Y,u)):ee<=u&&(l.expiredLanes|=Y),E&=~Y}}function tg(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function yC(){var l=bf;return bf<<=1,(bf&4194240)===0&&(bf=64),l}function ng(l){for(var u=[],m=0;31>m;m++)u.push(l);return u}function Vc(l,u,m){l.pendingLanes|=u,u!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,u=31-Lr(u),l[u]=m}function Mz(l,u){var m=l.pendingLanes&~u;l.pendingLanes=u,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=u,l.mutableReadLanes&=u,l.entangledLanes&=u,u=l.entanglements;var w=l.eventTimes;for(l=l.expirationTimes;0<m;){var C=31-Lr(m),E=1<<C;u[C]=0,w[C]=-1,l[C]=-1,m&=~E}}function rg(l,u){var m=l.entangledLanes|=u;for(l=l.entanglements;m;){var w=31-Lr(m),C=1<<w;C&u|l[w]&u&&(l[w]|=u),m&=~C}}var qt=0;function xC(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var bC,ag,wC,jC,SC,sg=!1,Sf=[],ni=null,ri=null,ai=null,Hc=new Map,Kc=new Map,si=[],$z="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function NC(l,u){switch(l){case"focusin":case"focusout":ni=null;break;case"dragenter":case"dragleave":ri=null;break;case"mouseover":case"mouseout":ai=null;break;case"pointerover":case"pointerout":Hc.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":Kc.delete(u.pointerId)}}function Gc(l,u,m,w,C,E){return l===null||l.nativeEvent!==E?(l={blockedOn:u,domEventName:m,eventSystemFlags:w,nativeEvent:E,targetContainers:[C]},u!==null&&(u=lu(u),u!==null&&ag(u)),l):(l.eventSystemFlags|=w,u=l.targetContainers,C!==null&&u.indexOf(C)===-1&&u.push(C),l)}function Dz(l,u,m,w,C){switch(u){case"focusin":return ni=Gc(ni,l,u,m,w,C),!0;case"dragenter":return ri=Gc(ri,l,u,m,w,C),!0;case"mouseover":return ai=Gc(ai,l,u,m,w,C),!0;case"pointerover":var E=C.pointerId;return Hc.set(E,Gc(Hc.get(E)||null,l,u,m,w,C)),!0;case"gotpointercapture":return E=C.pointerId,Kc.set(E,Gc(Kc.get(E)||null,l,u,m,w,C)),!0}return!1}function CC(l){var u=Hi(l.target);if(u!==null){var m=Fe(u);if(m!==null){if(u=m.tag,u===13){if(u=ct(m),u!==null){l.blockedOn=u,SC(l.priority,function(){wC(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 Nf(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=lu(m),u!==null&&ag(u),l.blockedOn=m,!1;u.shift()}return!0}function _C(l,u,m){Nf(l)&&m.delete(u)}function Lz(){sg=!1,ni!==null&&Nf(ni)&&(ni=null),ri!==null&&Nf(ri)&&(ri=null),ai!==null&&Nf(ai)&&(ai=null),Hc.forEach(_C),Kc.forEach(_C)}function Yc(l,u){l.blockedOn===u&&(l.blockedOn=null,sg||(sg=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Lz)))}function Xc(l){function u(C){return Yc(C,l)}if(0<Sf.length){Yc(Sf[0],l);for(var m=1;m<Sf.length;m++){var w=Sf[m];w.blockedOn===l&&(w.blockedOn=null)}}for(ni!==null&&Yc(ni,l),ri!==null&&Yc(ri,l),ai!==null&&Yc(ai,l),Hc.forEach(u),Kc.forEach(u),m=0;m<si.length;m++)w=si[m],w.blockedOn===l&&(w.blockedOn=null);for(;0<si.length&&(m=si[0],m.blockedOn===null);)CC(m),m.blockedOn===null&&si.shift()}var Vo=P.ReactCurrentBatchConfig,Cf=!0;function Fz(l,u,m,w){var C=qt,E=Vo.transition;Vo.transition=null;try{qt=1,ig(l,u,m,w)}finally{qt=C,Vo.transition=E}}function Bz(l,u,m,w){var C=qt,E=Vo.transition;Vo.transition=null;try{qt=4,ig(l,u,m,w)}finally{qt=C,Vo.transition=E}}function ig(l,u,m,w){if(Cf){var C=og(l,u,m,w);if(C===null)Ng(l,u,w,_f,m),NC(l,w);else if(Dz(C,l,u,m,w))w.stopPropagation();else if(NC(l,w),u&4&&-1<$z.indexOf(l)){for(;C!==null;){var E=lu(C);if(E!==null&&bC(E),E=og(l,u,m,w),E===null&&Ng(l,u,w,_f,m),E===C)break;C=E}C!==null&&w.stopPropagation()}else Ng(l,u,w,null,m)}}var _f=null;function og(l,u,m,w){if(_f=null,l=hr(w),l=Hi(l),l!==null)if(u=Fe(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 _f=l,null}function AC(l){switch(l){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(at()){case Ie:return 1;case kt:return 4;case _t:case kn:return 16;case Ja:return 536870912;default:return 16}default:return 16}}var ii=null,lg=null,Af=null;function EC(){if(Af)return Af;var l,u=lg,m=u.length,w,C="value"in ii?ii.value:ii.textContent,E=C.length;for(l=0;l<m&&u[l]===C[l];l++);var I=m-l;for(w=1;w<=I&&u[m-w]===C[E-w];w++);return Af=C.slice(l,1<w?1-w:void 0)}function Ef(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 Pf(){return!0}function PC(){return!1}function Fr(l){function u(m,w,C,E,I){this._reactName=m,this._targetInst=C,this.type=w,this.nativeEvent=E,this.target=I,this.currentTarget=null;for(var Y in l)l.hasOwnProperty(Y)&&(m=l[Y],this[Y]=m?m(E):E[Y]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?Pf:PC,this.isPropagationStopped=PC,this}return Q(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var m=this.nativeEvent;m&&(m.preventDefault?m.preventDefault():typeof m.returnValue!="unknown"&&(m.returnValue=!1),this.isDefaultPrevented=Pf)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=Pf)},persist:function(){},isPersistent:Pf}),u}var Ho={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cg=Fr(Ho),Qc=Q({},Ho,{view:0,detail:0}),zz=Fr(Qc),ug,dg,Jc,Of=Q({},Qc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pg,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!==Jc&&(Jc&&l.type==="mousemove"?(ug=l.screenX-Jc.screenX,dg=l.screenY-Jc.screenY):dg=ug=0,Jc=l),ug)},movementY:function(l){return"movementY"in l?l.movementY:dg}}),OC=Fr(Of),Uz=Q({},Of,{dataTransfer:0}),qz=Fr(Uz),Wz=Q({},Qc,{relatedTarget:0}),fg=Fr(Wz),Vz=Q({},Ho,{animationName:0,elapsedTime:0,pseudoElement:0}),Hz=Fr(Vz),Kz=Q({},Ho,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),Gz=Fr(Kz),Yz=Q({},Ho,{data:0}),kC=Fr(Yz),Xz={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Qz={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Jz={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Zz(l){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(l):(l=Jz[l])?!!u[l]:!1}function pg(){return Zz}var e6=Q({},Qc,{key:function(l){if(l.key){var u=Xz[l.key]||l.key;if(u!=="Unidentified")return u}return l.type==="keypress"?(l=Ef(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?Qz[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pg,charCode:function(l){return l.type==="keypress"?Ef(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?Ef(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),t6=Fr(e6),n6=Q({},Of,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),RC=Fr(n6),r6=Q({},Qc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pg}),a6=Fr(r6),s6=Q({},Ho,{propertyName:0,elapsedTime:0,pseudoElement:0}),i6=Fr(s6),o6=Q({},Of,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),l6=Fr(o6),c6=[9,13,27,32],hg=c&&"CompositionEvent"in window,Zc=null;c&&"documentMode"in document&&(Zc=document.documentMode);var u6=c&&"TextEvent"in window&&!Zc,TC=c&&(!hg||Zc&&8<Zc&&11>=Zc),IC=" ",MC=!1;function $C(l,u){switch(l){case"keyup":return c6.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function DC(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var Ko=!1;function d6(l,u){switch(l){case"compositionend":return DC(u);case"keypress":return u.which!==32?null:(MC=!0,IC);case"textInput":return l=u.data,l===IC&&MC?null:l;default:return null}}function f6(l,u){if(Ko)return l==="compositionend"||!hg&&$C(l,u)?(l=EC(),Af=lg=ii=null,Ko=!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 TC&&u.locale!=="ko"?null:u.data;default:return null}}var p6={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function LC(l){var u=l&&l.nodeName&&l.nodeName.toLowerCase();return u==="input"?!!p6[l.type]:u==="textarea"}function FC(l,u,m,w){ce(w),u=Mf(u,"onChange"),0<u.length&&(m=new cg("onChange","change",null,m,w),l.push({event:m,listeners:u}))}var eu=null,tu=null;function h6(l){r_(l,0)}function kf(l){var u=Jo(l);if(re(u))return l}function m6(l,u){if(l==="change")return u}var BC=!1;if(c){var mg;if(c){var vg="oninput"in document;if(!vg){var zC=document.createElement("div");zC.setAttribute("oninput","return;"),vg=typeof zC.oninput=="function"}mg=vg}else mg=!1;BC=mg&&(!document.documentMode||9<document.documentMode)}function UC(){eu&&(eu.detachEvent("onpropertychange",qC),tu=eu=null)}function qC(l){if(l.propertyName==="value"&&kf(tu)){var u=[];FC(u,tu,l,hr(l)),cn(h6,u)}}function v6(l,u,m){l==="focusin"?(UC(),eu=u,tu=m,eu.attachEvent("onpropertychange",qC)):l==="focusout"&&UC()}function g6(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return kf(tu)}function y6(l,u){if(l==="click")return kf(u)}function x6(l,u){if(l==="input"||l==="change")return kf(u)}function b6(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var _a=typeof Object.is=="function"?Object.is:b6;function nu(l,u){if(_a(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 C=m[w];if(!d.call(u,C)||!_a(l[C],u[C]))return!1}return!0}function WC(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function VC(l,u){var m=WC(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=WC(m)}}function HC(l,u){return l&&u?l===u?!0:l&&l.nodeType===3?!1:u&&u.nodeType===3?HC(l,u.parentNode):"contains"in l?l.contains(u):l.compareDocumentPosition?!!(l.compareDocumentPosition(u)&16):!1:!1}function KC(){for(var l=window,u=De();u instanceof l.HTMLIFrameElement;){try{var m=typeof u.contentWindow.location.href=="string"}catch{m=!1}if(m)l=u.contentWindow;else break;u=De(l.document)}return u}function gg(l){var u=l&&l.nodeName&&l.nodeName.toLowerCase();return u&&(u==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||u==="textarea"||l.contentEditable==="true")}function w6(l){var u=KC(),m=l.focusedElem,w=l.selectionRange;if(u!==m&&m&&m.ownerDocument&&HC(m.ownerDocument.documentElement,m)){if(w!==null&&gg(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 C=m.textContent.length,E=Math.min(w.start,C);w=w.end===void 0?E:Math.min(w.end,C),!l.extend&&E>w&&(C=w,w=E,E=C),C=VC(m,E);var I=VC(m,w);C&&I&&(l.rangeCount!==1||l.anchorNode!==C.node||l.anchorOffset!==C.offset||l.focusNode!==I.node||l.focusOffset!==I.offset)&&(u=u.createRange(),u.setStart(C.node,C.offset),l.removeAllRanges(),E>w?(l.addRange(u),l.extend(I.node,I.offset)):(u.setEnd(I.node,I.offset),l.addRange(u)))}}for(u=[],l=m;l=l.parentNode;)l.nodeType===1&&u.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<u.length;m++)l=u[m],l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}var j6=c&&"documentMode"in document&&11>=document.documentMode,Go=null,yg=null,ru=null,xg=!1;function GC(l,u,m){var w=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;xg||Go==null||Go!==De(w)||(w=Go,"selectionStart"in w&&gg(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}),ru&&nu(ru,w)||(ru=w,w=Mf(yg,"onSelect"),0<w.length&&(u=new cg("onSelect","select",null,u,m),l.push({event:u,listeners:w}),u.target=Go)))}function Rf(l,u){var m={};return m[l.toLowerCase()]=u.toLowerCase(),m["Webkit"+l]="webkit"+u,m["Moz"+l]="moz"+u,m}var Yo={animationend:Rf("Animation","AnimationEnd"),animationiteration:Rf("Animation","AnimationIteration"),animationstart:Rf("Animation","AnimationStart"),transitionend:Rf("Transition","TransitionEnd")},bg={},YC={};c&&(YC=document.createElement("div").style,"AnimationEvent"in window||(delete Yo.animationend.animation,delete Yo.animationiteration.animation,delete Yo.animationstart.animation),"TransitionEvent"in window||delete Yo.transitionend.transition);function Tf(l){if(bg[l])return bg[l];if(!Yo[l])return l;var u=Yo[l],m;for(m in u)if(u.hasOwnProperty(m)&&m in YC)return bg[l]=u[m];return l}var XC=Tf("animationend"),QC=Tf("animationiteration"),JC=Tf("animationstart"),ZC=Tf("transitionend"),e_=new Map,t_="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function oi(l,u){e_.set(l,u),i(u,[l])}for(var wg=0;wg<t_.length;wg++){var jg=t_[wg],S6=jg.toLowerCase(),N6=jg[0].toUpperCase()+jg.slice(1);oi(S6,"on"+N6)}oi(XC,"onAnimationEnd"),oi(QC,"onAnimationIteration"),oi(JC,"onAnimationStart"),oi("dblclick","onDoubleClick"),oi("focusin","onFocus"),oi("focusout","onBlur"),oi(ZC,"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 au="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),C6=new Set("cancel close invalid load scroll toggle".split(" ").concat(au));function n_(l,u,m){var w=l.type||"unknown-event";l.currentTarget=m,ve(w,u,void 0,l),l.currentTarget=null}function r_(l,u){u=(u&4)!==0;for(var m=0;m<l.length;m++){var w=l[m],C=w.event;w=w.listeners;e:{var E=void 0;if(u)for(var I=w.length-1;0<=I;I--){var Y=w[I],ee=Y.instance,me=Y.currentTarget;if(Y=Y.listener,ee!==E&&C.isPropagationStopped())break e;n_(C,Y,me),E=ee}else for(I=0;I<w.length;I++){if(Y=w[I],ee=Y.instance,me=Y.currentTarget,Y=Y.listener,ee!==E&&C.isPropagationStopped())break e;n_(C,Y,me),E=ee}}}if(Qa)throw l=ti,Qa=!1,ti=null,l}function dn(l,u){var m=u[Og];m===void 0&&(m=u[Og]=new Set);var w=l+"__bubble";m.has(w)||(a_(u,l,2,!1),m.add(w))}function Sg(l,u,m){var w=0;u&&(w|=4),a_(m,l,w,u)}var If="_reactListening"+Math.random().toString(36).slice(2);function su(l){if(!l[If]){l[If]=!0,r.forEach(function(m){m!=="selectionchange"&&(C6.has(m)||Sg(m,!1,l),Sg(m,!0,l))});var u=l.nodeType===9?l:l.ownerDocument;u===null||u[If]||(u[If]=!0,Sg("selectionchange",!1,u))}}function a_(l,u,m,w){switch(AC(u)){case 1:var C=Fz;break;case 4:C=Bz;break;default:C=ig}m=C.bind(null,u,m,l),C=void 0,!mr||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(C=!0),w?C!==void 0?l.addEventListener(u,m,{capture:!0,passive:C}):l.addEventListener(u,m,!0):C!==void 0?l.addEventListener(u,m,{passive:C}):l.addEventListener(u,m,!1)}function Ng(l,u,m,w,C){var E=w;if((u&1)===0&&(u&2)===0&&w!==null)e:for(;;){if(w===null)return;var I=w.tag;if(I===3||I===4){var Y=w.stateNode.containerInfo;if(Y===C||Y.nodeType===8&&Y.parentNode===C)break;if(I===4)for(I=w.return;I!==null;){var ee=I.tag;if((ee===3||ee===4)&&(ee=I.stateNode.containerInfo,ee===C||ee.nodeType===8&&ee.parentNode===C))return;I=I.return}for(;Y!==null;){if(I=Hi(Y),I===null)return;if(ee=I.tag,ee===5||ee===6){w=E=I;continue e}Y=Y.parentNode}}w=w.return}cn(function(){var me=E,Ce=hr(m),ke=[];e:{var Ne=e_.get(l);if(Ne!==void 0){var He=cg,Ze=l;switch(l){case"keypress":if(Ef(m)===0)break e;case"keydown":case"keyup":He=t6;break;case"focusin":Ze="focus",He=fg;break;case"focusout":Ze="blur",He=fg;break;case"beforeblur":case"afterblur":He=fg;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":He=OC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":He=qz;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":He=a6;break;case XC:case QC:case JC:He=Hz;break;case ZC:He=i6;break;case"scroll":He=zz;break;case"wheel":He=l6;break;case"copy":case"cut":case"paste":He=Gz;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":He=RC}var et=(u&4)!==0,An=!et&&l==="scroll",ue=et?Ne!==null?Ne+"Capture":null:Ne;et=[];for(var te=me,fe;te!==null;){fe=te;var Me=fe.stateNode;if(fe.tag===5&&Me!==null&&(fe=Me,ue!==null&&(Me=At(te,ue),Me!=null&&et.push(iu(te,Me,fe)))),An)break;te=te.return}0<et.length&&(Ne=new He(Ne,Ze,null,m,Ce),ke.push({event:Ne,listeners:et}))}}if((u&7)===0){e:{if(Ne=l==="mouseover"||l==="pointerover",He=l==="mouseout"||l==="pointerout",Ne&&m!==$r&&(Ze=m.relatedTarget||m.fromElement)&&(Hi(Ze)||Ze[ws]))break e;if((He||Ne)&&(Ne=Ce.window===Ce?Ce:(Ne=Ce.ownerDocument)?Ne.defaultView||Ne.parentWindow:window,He?(Ze=m.relatedTarget||m.toElement,He=me,Ze=Ze?Hi(Ze):null,Ze!==null&&(An=Fe(Ze),Ze!==An||Ze.tag!==5&&Ze.tag!==6)&&(Ze=null)):(He=null,Ze=me),He!==Ze)){if(et=OC,Me="onMouseLeave",ue="onMouseEnter",te="mouse",(l==="pointerout"||l==="pointerover")&&(et=RC,Me="onPointerLeave",ue="onPointerEnter",te="pointer"),An=He==null?Ne:Jo(He),fe=Ze==null?Ne:Jo(Ze),Ne=new et(Me,te+"leave",He,m,Ce),Ne.target=An,Ne.relatedTarget=fe,Me=null,Hi(Ce)===me&&(et=new et(ue,te+"enter",Ze,m,Ce),et.target=fe,et.relatedTarget=An,Me=et),An=Me,He&&Ze)t:{for(et=He,ue=Ze,te=0,fe=et;fe;fe=Xo(fe))te++;for(fe=0,Me=ue;Me;Me=Xo(Me))fe++;for(;0<te-fe;)et=Xo(et),te--;for(;0<fe-te;)ue=Xo(ue),fe--;for(;te--;){if(et===ue||ue!==null&&et===ue.alternate)break t;et=Xo(et),ue=Xo(ue)}et=null}else et=null;He!==null&&s_(ke,Ne,He,et,!1),Ze!==null&&An!==null&&s_(ke,An,Ze,et,!0)}}e:{if(Ne=me?Jo(me):window,He=Ne.nodeName&&Ne.nodeName.toLowerCase(),He==="select"||He==="input"&&Ne.type==="file")var nt=m6;else if(LC(Ne))if(BC)nt=x6;else{nt=g6;var ut=v6}else(He=Ne.nodeName)&&He.toLowerCase()==="input"&&(Ne.type==="checkbox"||Ne.type==="radio")&&(nt=y6);if(nt&&(nt=nt(l,me))){FC(ke,nt,m,Ce);break e}ut&&ut(l,Ne,me),l==="focusout"&&(ut=Ne._wrapperState)&&ut.controlled&&Ne.type==="number"&&_e(Ne,"number",Ne.value)}switch(ut=me?Jo(me):window,l){case"focusin":(LC(ut)||ut.contentEditable==="true")&&(Go=ut,yg=me,ru=null);break;case"focusout":ru=yg=Go=null;break;case"mousedown":xg=!0;break;case"contextmenu":case"mouseup":case"dragend":xg=!1,GC(ke,m,Ce);break;case"selectionchange":if(j6)break;case"keydown":case"keyup":GC(ke,m,Ce)}var dt;if(hg)e:{switch(l){case"compositionstart":var vt="onCompositionStart";break e;case"compositionend":vt="onCompositionEnd";break e;case"compositionupdate":vt="onCompositionUpdate";break e}vt=void 0}else Ko?$C(l,m)&&(vt="onCompositionEnd"):l==="keydown"&&m.keyCode===229&&(vt="onCompositionStart");vt&&(TC&&m.locale!=="ko"&&(Ko||vt!=="onCompositionStart"?vt==="onCompositionEnd"&&Ko&&(dt=EC()):(ii=Ce,lg="value"in ii?ii.value:ii.textContent,Ko=!0)),ut=Mf(me,vt),0<ut.length&&(vt=new kC(vt,l,null,m,Ce),ke.push({event:vt,listeners:ut}),dt?vt.data=dt:(dt=DC(m),dt!==null&&(vt.data=dt)))),(dt=u6?d6(l,m):f6(l,m))&&(me=Mf(me,"onBeforeInput"),0<me.length&&(Ce=new kC("onBeforeInput","beforeinput",null,m,Ce),ke.push({event:Ce,listeners:me}),Ce.data=dt))}r_(ke,u)})}function iu(l,u,m){return{instance:l,listener:u,currentTarget:m}}function Mf(l,u){for(var m=u+"Capture",w=[];l!==null;){var C=l,E=C.stateNode;C.tag===5&&E!==null&&(C=E,E=At(l,m),E!=null&&w.unshift(iu(l,E,C)),E=At(l,u),E!=null&&w.push(iu(l,E,C))),l=l.return}return w}function Xo(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function s_(l,u,m,w,C){for(var E=u._reactName,I=[];m!==null&&m!==w;){var Y=m,ee=Y.alternate,me=Y.stateNode;if(ee!==null&&ee===w)break;Y.tag===5&&me!==null&&(Y=me,C?(ee=At(m,E),ee!=null&&I.unshift(iu(m,ee,Y))):C||(ee=At(m,E),ee!=null&&I.push(iu(m,ee,Y)))),m=m.return}I.length!==0&&l.push({event:u,listeners:I})}var _6=/\r\n?/g,A6=/\u0000|\uFFFD/g;function i_(l){return(typeof l=="string"?l:""+l).replace(_6,`
6
- `).replace(A6,"")}function $f(l,u,m){if(u=i_(u),i_(l)!==u&&m)throw Error(n(425))}function Df(){}var Cg=null,_g=null;function Ag(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 Eg=typeof setTimeout=="function"?setTimeout:void 0,E6=typeof clearTimeout=="function"?clearTimeout:void 0,o_=typeof Promise=="function"?Promise:void 0,P6=typeof queueMicrotask=="function"?queueMicrotask:typeof o_<"u"?function(l){return o_.resolve(null).then(l).catch(O6)}:Eg;function O6(l){setTimeout(function(){throw l})}function Pg(l,u){var m=u,w=0;do{var C=m.nextSibling;if(l.removeChild(m),C&&C.nodeType===8)if(m=C.data,m==="/$"){if(w===0){l.removeChild(C),Xc(u);return}w--}else m!=="$"&&m!=="$?"&&m!=="$!"||w++;m=C}while(m);Xc(u)}function li(l){for(;l!=null;l=l.nextSibling){var u=l.nodeType;if(u===1||u===3)break;if(u===8){if(u=l.data,u==="$"||u==="$!"||u==="$?")break;if(u==="/$")return null}}return l}function l_(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 Qo=Math.random().toString(36).slice(2),Za="__reactFiber$"+Qo,ou="__reactProps$"+Qo,ws="__reactContainer$"+Qo,Og="__reactEvents$"+Qo,k6="__reactListeners$"+Qo,R6="__reactHandles$"+Qo;function Hi(l){var u=l[Za];if(u)return u;for(var m=l.parentNode;m;){if(u=m[ws]||m[Za]){if(m=u.alternate,u.child!==null||m!==null&&m.child!==null)for(l=l_(l);l!==null;){if(m=l[Za])return m;l=l_(l)}return u}l=m,m=l.parentNode}return null}function lu(l){return l=l[Za]||l[ws],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function Jo(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(n(33))}function Lf(l){return l[ou]||null}var kg=[],Zo=-1;function ci(l){return{current:l}}function fn(l){0>Zo||(l.current=kg[Zo],kg[Zo]=null,Zo--)}function nn(l,u){Zo++,kg[Zo]=l.current,l.current=u}var ui={},lr=ci(ui),Cr=ci(!1),Ki=ui;function el(l,u){var m=l.type.contextTypes;if(!m)return ui;var w=l.stateNode;if(w&&w.__reactInternalMemoizedUnmaskedChildContext===u)return w.__reactInternalMemoizedMaskedChildContext;var C={},E;for(E in m)C[E]=u[E];return w&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=u,l.__reactInternalMemoizedMaskedChildContext=C),C}function _r(l){return l=l.childContextTypes,l!=null}function Ff(){fn(Cr),fn(lr)}function c_(l,u,m){if(lr.current!==ui)throw Error(n(168));nn(lr,u),nn(Cr,m)}function u_(l,u,m){var w=l.stateNode;if(u=u.childContextTypes,typeof w.getChildContext!="function")return m;w=w.getChildContext();for(var C in w)if(!(C in u))throw Error(n(108,ne(l)||"Unknown",C));return Q({},m,w)}function Bf(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||ui,Ki=lr.current,nn(lr,l),nn(Cr,Cr.current),!0}function d_(l,u,m){var w=l.stateNode;if(!w)throw Error(n(169));m?(l=u_(l,u,Ki),w.__reactInternalMemoizedMergedChildContext=l,fn(Cr),fn(lr),nn(lr,l)):fn(Cr),nn(Cr,m)}var js=null,zf=!1,Rg=!1;function f_(l){js===null?js=[l]:js.push(l)}function T6(l){zf=!0,f_(l)}function di(){if(!Rg&&js!==null){Rg=!0;var l=0,u=qt;try{var m=js;for(qt=1;l<m.length;l++){var w=m[l];do w=w(!0);while(w!==null)}js=null,zf=!1}catch(C){throw js!==null&&(js=js.slice(l+1)),xn(Ie,di),C}finally{qt=u,Rg=!1}}return null}var tl=[],nl=0,Uf=null,qf=0,ra=[],aa=0,Gi=null,Ss=1,Ns="";function Yi(l,u){tl[nl++]=qf,tl[nl++]=Uf,Uf=l,qf=u}function p_(l,u,m){ra[aa++]=Ss,ra[aa++]=Ns,ra[aa++]=Gi,Gi=l;var w=Ss;l=Ns;var C=32-Lr(w)-1;w&=~(1<<C),m+=1;var E=32-Lr(u)+C;if(30<E){var I=C-C%5;E=(w&(1<<I)-1).toString(32),w>>=I,C-=I,Ss=1<<32-Lr(u)+C|m<<C|w,Ns=E+l}else Ss=1<<E|m<<C|w,Ns=l}function Tg(l){l.return!==null&&(Yi(l,1),p_(l,1,0))}function Ig(l){for(;l===Uf;)Uf=tl[--nl],tl[nl]=null,qf=tl[--nl],tl[nl]=null;for(;l===Gi;)Gi=ra[--aa],ra[aa]=null,Ns=ra[--aa],ra[aa]=null,Ss=ra[--aa],ra[aa]=null}var Br=null,zr=null,vn=!1,Aa=null;function h_(l,u){var m=la(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 m_(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,Br=l,zr=li(u.firstChild),!0):!1;case 6:return u=l.pendingProps===""||u.nodeType!==3?null:u,u!==null?(l.stateNode=u,Br=l,zr=null,!0):!1;case 13:return u=u.nodeType!==8?null:u,u!==null?(m=Gi!==null?{id:Ss,overflow:Ns}:null,l.memoizedState={dehydrated:u,treeContext:m,retryLane:1073741824},m=la(18,null,null,0),m.stateNode=u,m.return=l,l.child=m,Br=l,zr=null,!0):!1;default:return!1}}function Mg(l){return(l.mode&1)!==0&&(l.flags&128)===0}function $g(l){if(vn){var u=zr;if(u){var m=u;if(!m_(l,u)){if(Mg(l))throw Error(n(418));u=li(m.nextSibling);var w=Br;u&&m_(l,u)?h_(w,m):(l.flags=l.flags&-4097|2,vn=!1,Br=l)}}else{if(Mg(l))throw Error(n(418));l.flags=l.flags&-4097|2,vn=!1,Br=l}}}function v_(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;Br=l}function Wf(l){if(l!==Br)return!1;if(!vn)return v_(l),vn=!0,!1;var u;if((u=l.tag!==3)&&!(u=l.tag!==5)&&(u=l.type,u=u!=="head"&&u!=="body"&&!Ag(l.type,l.memoizedProps)),u&&(u=zr)){if(Mg(l))throw g_(),Error(n(418));for(;u;)h_(l,u),u=li(u.nextSibling)}if(v_(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){zr=li(l.nextSibling);break e}u--}else m!=="$"&&m!=="$!"&&m!=="$?"||u++}l=l.nextSibling}zr=null}}else zr=Br?li(l.stateNode.nextSibling):null;return!0}function g_(){for(var l=zr;l;)l=li(l.nextSibling)}function rl(){zr=Br=null,vn=!1}function Dg(l){Aa===null?Aa=[l]:Aa.push(l)}var I6=P.ReactCurrentBatchConfig;function cu(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 C=w,E=""+l;return u!==null&&u.ref!==null&&typeof u.ref=="function"&&u.ref._stringRef===E?u.ref:(u=function(I){var Y=C.refs;I===null?delete Y[E]:Y[E]=I},u._stringRef=E,u)}if(typeof l!="string")throw Error(n(284));if(!m._owner)throw Error(n(290,l))}return l}function Vf(l,u){throw l=Object.prototype.toString.call(u),Error(n(31,l==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":l))}function y_(l){var u=l._init;return u(l._payload)}function x_(l){function u(ue,te){if(l){var fe=ue.deletions;fe===null?(ue.deletions=[te],ue.flags|=16):fe.push(te)}}function m(ue,te){if(!l)return null;for(;te!==null;)u(ue,te),te=te.sibling;return null}function w(ue,te){for(ue=new Map;te!==null;)te.key!==null?ue.set(te.key,te):ue.set(te.index,te),te=te.sibling;return ue}function C(ue,te){return ue=xi(ue,te),ue.index=0,ue.sibling=null,ue}function E(ue,te,fe){return ue.index=fe,l?(fe=ue.alternate,fe!==null?(fe=fe.index,fe<te?(ue.flags|=2,te):fe):(ue.flags|=2,te)):(ue.flags|=1048576,te)}function I(ue){return l&&ue.alternate===null&&(ue.flags|=2),ue}function Y(ue,te,fe,Me){return te===null||te.tag!==6?(te=Ey(fe,ue.mode,Me),te.return=ue,te):(te=C(te,fe),te.return=ue,te)}function ee(ue,te,fe,Me){var nt=fe.type;return nt===k?Ce(ue,te,fe.props.children,Me,fe.key):te!==null&&(te.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===X&&y_(nt)===te.type)?(Me=C(te,fe.props),Me.ref=cu(ue,te,fe),Me.return=ue,Me):(Me=mp(fe.type,fe.key,fe.props,null,ue.mode,Me),Me.ref=cu(ue,te,fe),Me.return=ue,Me)}function me(ue,te,fe,Me){return te===null||te.tag!==4||te.stateNode.containerInfo!==fe.containerInfo||te.stateNode.implementation!==fe.implementation?(te=Py(fe,ue.mode,Me),te.return=ue,te):(te=C(te,fe.children||[]),te.return=ue,te)}function Ce(ue,te,fe,Me,nt){return te===null||te.tag!==7?(te=ro(fe,ue.mode,Me,nt),te.return=ue,te):(te=C(te,fe),te.return=ue,te)}function ke(ue,te,fe){if(typeof te=="string"&&te!==""||typeof te=="number")return te=Ey(""+te,ue.mode,fe),te.return=ue,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case A:return fe=mp(te.type,te.key,te.props,null,ue.mode,fe),fe.ref=cu(ue,null,te),fe.return=ue,fe;case O:return te=Py(te,ue.mode,fe),te.return=ue,te;case X:var Me=te._init;return ke(ue,Me(te._payload),fe)}if(pe(te)||L(te))return te=ro(te,ue.mode,fe,null),te.return=ue,te;Vf(ue,te)}return null}function Ne(ue,te,fe,Me){var nt=te!==null?te.key:null;if(typeof fe=="string"&&fe!==""||typeof fe=="number")return nt!==null?null:Y(ue,te,""+fe,Me);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case A:return fe.key===nt?ee(ue,te,fe,Me):null;case O:return fe.key===nt?me(ue,te,fe,Me):null;case X:return nt=fe._init,Ne(ue,te,nt(fe._payload),Me)}if(pe(fe)||L(fe))return nt!==null?null:Ce(ue,te,fe,Me,null);Vf(ue,fe)}return null}function He(ue,te,fe,Me,nt){if(typeof Me=="string"&&Me!==""||typeof Me=="number")return ue=ue.get(fe)||null,Y(te,ue,""+Me,nt);if(typeof Me=="object"&&Me!==null){switch(Me.$$typeof){case A:return ue=ue.get(Me.key===null?fe:Me.key)||null,ee(te,ue,Me,nt);case O:return ue=ue.get(Me.key===null?fe:Me.key)||null,me(te,ue,Me,nt);case X:var ut=Me._init;return He(ue,te,fe,ut(Me._payload),nt)}if(pe(Me)||L(Me))return ue=ue.get(fe)||null,Ce(te,ue,Me,nt,null);Vf(te,Me)}return null}function Ze(ue,te,fe,Me){for(var nt=null,ut=null,dt=te,vt=te=0,Qn=null;dt!==null&&vt<fe.length;vt++){dt.index>vt?(Qn=dt,dt=null):Qn=dt.sibling;var Tt=Ne(ue,dt,fe[vt],Me);if(Tt===null){dt===null&&(dt=Qn);break}l&&dt&&Tt.alternate===null&&u(ue,dt),te=E(Tt,te,vt),ut===null?nt=Tt:ut.sibling=Tt,ut=Tt,dt=Qn}if(vt===fe.length)return m(ue,dt),vn&&Yi(ue,vt),nt;if(dt===null){for(;vt<fe.length;vt++)dt=ke(ue,fe[vt],Me),dt!==null&&(te=E(dt,te,vt),ut===null?nt=dt:ut.sibling=dt,ut=dt);return vn&&Yi(ue,vt),nt}for(dt=w(ue,dt);vt<fe.length;vt++)Qn=He(dt,ue,vt,fe[vt],Me),Qn!==null&&(l&&Qn.alternate!==null&&dt.delete(Qn.key===null?vt:Qn.key),te=E(Qn,te,vt),ut===null?nt=Qn:ut.sibling=Qn,ut=Qn);return l&&dt.forEach(function(bi){return u(ue,bi)}),vn&&Yi(ue,vt),nt}function et(ue,te,fe,Me){var nt=L(fe);if(typeof nt!="function")throw Error(n(150));if(fe=nt.call(fe),fe==null)throw Error(n(151));for(var ut=nt=null,dt=te,vt=te=0,Qn=null,Tt=fe.next();dt!==null&&!Tt.done;vt++,Tt=fe.next()){dt.index>vt?(Qn=dt,dt=null):Qn=dt.sibling;var bi=Ne(ue,dt,Tt.value,Me);if(bi===null){dt===null&&(dt=Qn);break}l&&dt&&bi.alternate===null&&u(ue,dt),te=E(bi,te,vt),ut===null?nt=bi:ut.sibling=bi,ut=bi,dt=Qn}if(Tt.done)return m(ue,dt),vn&&Yi(ue,vt),nt;if(dt===null){for(;!Tt.done;vt++,Tt=fe.next())Tt=ke(ue,Tt.value,Me),Tt!==null&&(te=E(Tt,te,vt),ut===null?nt=Tt:ut.sibling=Tt,ut=Tt);return vn&&Yi(ue,vt),nt}for(dt=w(ue,dt);!Tt.done;vt++,Tt=fe.next())Tt=He(dt,ue,vt,Tt.value,Me),Tt!==null&&(l&&Tt.alternate!==null&&dt.delete(Tt.key===null?vt:Tt.key),te=E(Tt,te,vt),ut===null?nt=Tt:ut.sibling=Tt,ut=Tt);return l&&dt.forEach(function(p7){return u(ue,p7)}),vn&&Yi(ue,vt),nt}function An(ue,te,fe,Me){if(typeof fe=="object"&&fe!==null&&fe.type===k&&fe.key===null&&(fe=fe.props.children),typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case A:e:{for(var nt=fe.key,ut=te;ut!==null;){if(ut.key===nt){if(nt=fe.type,nt===k){if(ut.tag===7){m(ue,ut.sibling),te=C(ut,fe.props.children),te.return=ue,ue=te;break e}}else if(ut.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===X&&y_(nt)===ut.type){m(ue,ut.sibling),te=C(ut,fe.props),te.ref=cu(ue,ut,fe),te.return=ue,ue=te;break e}m(ue,ut);break}else u(ue,ut);ut=ut.sibling}fe.type===k?(te=ro(fe.props.children,ue.mode,Me,fe.key),te.return=ue,ue=te):(Me=mp(fe.type,fe.key,fe.props,null,ue.mode,Me),Me.ref=cu(ue,te,fe),Me.return=ue,ue=Me)}return I(ue);case O:e:{for(ut=fe.key;te!==null;){if(te.key===ut)if(te.tag===4&&te.stateNode.containerInfo===fe.containerInfo&&te.stateNode.implementation===fe.implementation){m(ue,te.sibling),te=C(te,fe.children||[]),te.return=ue,ue=te;break e}else{m(ue,te);break}else u(ue,te);te=te.sibling}te=Py(fe,ue.mode,Me),te.return=ue,ue=te}return I(ue);case X:return ut=fe._init,An(ue,te,ut(fe._payload),Me)}if(pe(fe))return Ze(ue,te,fe,Me);if(L(fe))return et(ue,te,fe,Me);Vf(ue,fe)}return typeof fe=="string"&&fe!==""||typeof fe=="number"?(fe=""+fe,te!==null&&te.tag===6?(m(ue,te.sibling),te=C(te,fe),te.return=ue,ue=te):(m(ue,te),te=Ey(fe,ue.mode,Me),te.return=ue,ue=te),I(ue)):m(ue,te)}return An}var al=x_(!0),b_=x_(!1),Hf=ci(null),Kf=null,sl=null,Lg=null;function Fg(){Lg=sl=Kf=null}function Bg(l){var u=Hf.current;fn(Hf),l._currentValue=u}function zg(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 il(l,u){Kf=l,Lg=sl=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&u)!==0&&(Ar=!0),l.firstContext=null)}function sa(l){var u=l._currentValue;if(Lg!==l)if(l={context:l,memoizedValue:u,next:null},sl===null){if(Kf===null)throw Error(n(308));sl=l,Kf.dependencies={lanes:0,firstContext:l}}else sl=sl.next=l;return u}var Xi=null;function Ug(l){Xi===null?Xi=[l]:Xi.push(l)}function w_(l,u,m,w){var C=u.interleaved;return C===null?(m.next=m,Ug(u)):(m.next=C.next,C.next=m),u.interleaved=m,Cs(l,w)}function Cs(l,u){l.lanes|=u;var m=l.alternate;for(m!==null&&(m.lanes|=u),m=l,l=l.return;l!==null;)l.childLanes|=u,m=l.alternate,m!==null&&(m.childLanes|=u),m=l,l=l.return;return m.tag===3?m.stateNode:null}var fi=!1;function qg(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function j_(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 pi(l,u,m){var w=l.updateQueue;if(w===null)return null;if(w=w.shared,(Rt&2)!==0){var C=w.pending;return C===null?u.next=u:(u.next=C.next,C.next=u),w.pending=u,Cs(l,m)}return C=w.interleaved,C===null?(u.next=u,Ug(w)):(u.next=C.next,C.next=u),w.interleaved=u,Cs(l,m)}function Gf(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,rg(l,m)}}function S_(l,u){var m=l.updateQueue,w=l.alternate;if(w!==null&&(w=w.updateQueue,m===w)){var C=null,E=null;if(m=m.firstBaseUpdate,m!==null){do{var I={eventTime:m.eventTime,lane:m.lane,tag:m.tag,payload:m.payload,callback:m.callback,next:null};E===null?C=E=I:E=E.next=I,m=m.next}while(m!==null);E===null?C=E=u:E=E.next=u}else C=E=u;m={baseState:w.baseState,firstBaseUpdate:C,lastBaseUpdate:E,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 Yf(l,u,m,w){var C=l.updateQueue;fi=!1;var E=C.firstBaseUpdate,I=C.lastBaseUpdate,Y=C.shared.pending;if(Y!==null){C.shared.pending=null;var ee=Y,me=ee.next;ee.next=null,I===null?E=me:I.next=me,I=ee;var Ce=l.alternate;Ce!==null&&(Ce=Ce.updateQueue,Y=Ce.lastBaseUpdate,Y!==I&&(Y===null?Ce.firstBaseUpdate=me:Y.next=me,Ce.lastBaseUpdate=ee))}if(E!==null){var ke=C.baseState;I=0,Ce=me=ee=null,Y=E;do{var Ne=Y.lane,He=Y.eventTime;if((w&Ne)===Ne){Ce!==null&&(Ce=Ce.next={eventTime:He,lane:0,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null});e:{var Ze=l,et=Y;switch(Ne=u,He=m,et.tag){case 1:if(Ze=et.payload,typeof Ze=="function"){ke=Ze.call(He,ke,Ne);break e}ke=Ze;break e;case 3:Ze.flags=Ze.flags&-65537|128;case 0:if(Ze=et.payload,Ne=typeof Ze=="function"?Ze.call(He,ke,Ne):Ze,Ne==null)break e;ke=Q({},ke,Ne);break e;case 2:fi=!0}}Y.callback!==null&&Y.lane!==0&&(l.flags|=64,Ne=C.effects,Ne===null?C.effects=[Y]:Ne.push(Y))}else He={eventTime:He,lane:Ne,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},Ce===null?(me=Ce=He,ee=ke):Ce=Ce.next=He,I|=Ne;if(Y=Y.next,Y===null){if(Y=C.shared.pending,Y===null)break;Ne=Y,Y=Ne.next,Ne.next=null,C.lastBaseUpdate=Ne,C.shared.pending=null}}while(!0);if(Ce===null&&(ee=ke),C.baseState=ee,C.firstBaseUpdate=me,C.lastBaseUpdate=Ce,u=C.shared.interleaved,u!==null){C=u;do I|=C.lane,C=C.next;while(C!==u)}else E===null&&(C.shared.lanes=0);Zi|=I,l.lanes=I,l.memoizedState=ke}}function N_(l,u,m){if(l=u.effects,u.effects=null,l!==null)for(u=0;u<l.length;u++){var w=l[u],C=w.callback;if(C!==null){if(w.callback=null,w=m,typeof C!="function")throw Error(n(191,C));C.call(w)}}}var uu={},es=ci(uu),du=ci(uu),fu=ci(uu);function Qi(l){if(l===uu)throw Error(n(174));return l}function Wg(l,u){switch(nn(fu,u),nn(du,l),nn(es,uu),l=u.nodeType,l){case 9:case 11:u=(u=u.documentElement)?u.namespaceURI:Ge(null,"");break;default:l=l===8?u.parentNode:u,u=l.namespaceURI||null,l=l.tagName,u=Ge(u,l)}fn(es),nn(es,u)}function ol(){fn(es),fn(du),fn(fu)}function C_(l){Qi(fu.current);var u=Qi(es.current),m=Ge(u,l.type);u!==m&&(nn(du,l),nn(es,m))}function Vg(l){du.current===l&&(fn(es),fn(du))}var bn=ci(0);function Xf(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 Hg=[];function Kg(){for(var l=0;l<Hg.length;l++)Hg[l]._workInProgressVersionPrimary=null;Hg.length=0}var Qf=P.ReactCurrentDispatcher,Gg=P.ReactCurrentBatchConfig,Ji=0,wn=null,Fn=null,Yn=null,Jf=!1,pu=!1,hu=0,M6=0;function cr(){throw Error(n(321))}function Yg(l,u){if(u===null)return!1;for(var m=0;m<u.length&&m<l.length;m++)if(!_a(l[m],u[m]))return!1;return!0}function Xg(l,u,m,w,C,E){if(Ji=E,wn=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,Qf.current=l===null||l.memoizedState===null?F6:B6,l=m(w,C),pu){E=0;do{if(pu=!1,hu=0,25<=E)throw Error(n(301));E+=1,Yn=Fn=null,u.updateQueue=null,Qf.current=z6,l=m(w,C)}while(pu)}if(Qf.current=tp,u=Fn!==null&&Fn.next!==null,Ji=0,Yn=Fn=wn=null,Jf=!1,u)throw Error(n(300));return l}function Qg(){var l=hu!==0;return hu=0,l}function ts(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Yn===null?wn.memoizedState=Yn=l:Yn=Yn.next=l,Yn}function ia(){if(Fn===null){var l=wn.alternate;l=l!==null?l.memoizedState:null}else l=Fn.next;var u=Yn===null?wn.memoizedState:Yn.next;if(u!==null)Yn=u,Fn=l;else{if(l===null)throw Error(n(310));Fn=l,l={memoizedState:Fn.memoizedState,baseState:Fn.baseState,baseQueue:Fn.baseQueue,queue:Fn.queue,next:null},Yn===null?wn.memoizedState=Yn=l:Yn=Yn.next=l}return Yn}function mu(l,u){return typeof u=="function"?u(l):u}function Jg(l){var u=ia(),m=u.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=l;var w=Fn,C=w.baseQueue,E=m.pending;if(E!==null){if(C!==null){var I=C.next;C.next=E.next,E.next=I}w.baseQueue=C=E,m.pending=null}if(C!==null){E=C.next,w=w.baseState;var Y=I=null,ee=null,me=E;do{var Ce=me.lane;if((Ji&Ce)===Ce)ee!==null&&(ee=ee.next={lane:0,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null}),w=me.hasEagerState?me.eagerState:l(w,me.action);else{var ke={lane:Ce,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null};ee===null?(Y=ee=ke,I=w):ee=ee.next=ke,wn.lanes|=Ce,Zi|=Ce}me=me.next}while(me!==null&&me!==E);ee===null?I=w:ee.next=Y,_a(w,u.memoizedState)||(Ar=!0),u.memoizedState=w,u.baseState=I,u.baseQueue=ee,m.lastRenderedState=w}if(l=m.interleaved,l!==null){C=l;do E=C.lane,wn.lanes|=E,Zi|=E,C=C.next;while(C!==l)}else C===null&&(m.lanes=0);return[u.memoizedState,m.dispatch]}function Zg(l){var u=ia(),m=u.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=l;var w=m.dispatch,C=m.pending,E=u.memoizedState;if(C!==null){m.pending=null;var I=C=C.next;do E=l(E,I.action),I=I.next;while(I!==C);_a(E,u.memoizedState)||(Ar=!0),u.memoizedState=E,u.baseQueue===null&&(u.baseState=E),m.lastRenderedState=E}return[E,w]}function __(){}function A_(l,u){var m=wn,w=ia(),C=u(),E=!_a(w.memoizedState,C);if(E&&(w.memoizedState=C,Ar=!0),w=w.queue,ey(O_.bind(null,m,w,l),[l]),w.getSnapshot!==u||E||Yn!==null&&Yn.memoizedState.tag&1){if(m.flags|=2048,vu(9,P_.bind(null,m,w,C,u),void 0,null),Xn===null)throw Error(n(349));(Ji&30)!==0||E_(m,u,C)}return C}function E_(l,u,m){l.flags|=16384,l={getSnapshot:u,value:m},u=wn.updateQueue,u===null?(u={lastEffect:null,stores:null},wn.updateQueue=u,u.stores=[l]):(m=u.stores,m===null?u.stores=[l]:m.push(l))}function P_(l,u,m,w){u.value=m,u.getSnapshot=w,k_(u)&&R_(l)}function O_(l,u,m){return m(function(){k_(u)&&R_(l)})}function k_(l){var u=l.getSnapshot;l=l.value;try{var m=u();return!_a(l,m)}catch{return!0}}function R_(l){var u=Cs(l,1);u!==null&&ka(u,l,1,-1)}function T_(l){var u=ts();return typeof l=="function"&&(l=l()),u.memoizedState=u.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:mu,lastRenderedState:l},u.queue=l,l=l.dispatch=L6.bind(null,wn,l),[u.memoizedState,l]}function vu(l,u,m,w){return l={tag:l,create:u,destroy:m,deps:w,next:null},u=wn.updateQueue,u===null?(u={lastEffect:null,stores:null},wn.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 I_(){return ia().memoizedState}function Zf(l,u,m,w){var C=ts();wn.flags|=l,C.memoizedState=vu(1|u,m,void 0,w===void 0?null:w)}function ep(l,u,m,w){var C=ia();w=w===void 0?null:w;var E=void 0;if(Fn!==null){var I=Fn.memoizedState;if(E=I.destroy,w!==null&&Yg(w,I.deps)){C.memoizedState=vu(u,m,E,w);return}}wn.flags|=l,C.memoizedState=vu(1|u,m,E,w)}function M_(l,u){return Zf(8390656,8,l,u)}function ey(l,u){return ep(2048,8,l,u)}function $_(l,u){return ep(4,2,l,u)}function D_(l,u){return ep(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 F_(l,u,m){return m=m!=null?m.concat([l]):null,ep(4,4,L_.bind(null,u,l),m)}function ty(){}function B_(l,u){var m=ia();u=u===void 0?null:u;var w=m.memoizedState;return w!==null&&u!==null&&Yg(u,w[1])?w[0]:(m.memoizedState=[l,u],l)}function z_(l,u){var m=ia();u=u===void 0?null:u;var w=m.memoizedState;return w!==null&&u!==null&&Yg(u,w[1])?w[0]:(l=l(),m.memoizedState=[l,u],l)}function U_(l,u,m){return(Ji&21)===0?(l.baseState&&(l.baseState=!1,Ar=!0),l.memoizedState=m):(_a(m,u)||(m=yC(),wn.lanes|=m,Zi|=m,l.baseState=!0),u)}function $6(l,u){var m=qt;qt=m!==0&&4>m?m:4,l(!0);var w=Gg.transition;Gg.transition={};try{l(!1),u()}finally{qt=m,Gg.transition=w}}function q_(){return ia().memoizedState}function D6(l,u,m){var w=gi(l);if(m={lane:w,action:m,hasEagerState:!1,eagerState:null,next:null},W_(l))V_(u,m);else if(m=w_(l,u,m,w),m!==null){var C=gr();ka(m,l,w,C),H_(m,u,w)}}function L6(l,u,m){var w=gi(l),C={lane:w,action:m,hasEagerState:!1,eagerState:null,next:null};if(W_(l))V_(u,C);else{var E=l.alternate;if(l.lanes===0&&(E===null||E.lanes===0)&&(E=u.lastRenderedReducer,E!==null))try{var I=u.lastRenderedState,Y=E(I,m);if(C.hasEagerState=!0,C.eagerState=Y,_a(Y,I)){var ee=u.interleaved;ee===null?(C.next=C,Ug(u)):(C.next=ee.next,ee.next=C),u.interleaved=C;return}}catch{}m=w_(l,u,C,w),m!==null&&(C=gr(),ka(m,l,w,C),H_(m,u,w))}}function W_(l){var u=l.alternate;return l===wn||u!==null&&u===wn}function V_(l,u){pu=Jf=!0;var m=l.pending;m===null?u.next=u:(u.next=m.next,m.next=u),l.pending=u}function H_(l,u,m){if((m&4194240)!==0){var w=u.lanes;w&=l.pendingLanes,m|=w,u.lanes=m,rg(l,m)}}var tp={readContext:sa,useCallback:cr,useContext:cr,useEffect:cr,useImperativeHandle:cr,useInsertionEffect:cr,useLayoutEffect:cr,useMemo:cr,useReducer:cr,useRef:cr,useState:cr,useDebugValue:cr,useDeferredValue:cr,useTransition:cr,useMutableSource:cr,useSyncExternalStore:cr,useId:cr,unstable_isNewReconciler:!1},F6={readContext:sa,useCallback:function(l,u){return ts().memoizedState=[l,u===void 0?null:u],l},useContext:sa,useEffect:M_,useImperativeHandle:function(l,u,m){return m=m!=null?m.concat([l]):null,Zf(4194308,4,L_.bind(null,u,l),m)},useLayoutEffect:function(l,u){return Zf(4194308,4,l,u)},useInsertionEffect:function(l,u){return Zf(4,2,l,u)},useMemo:function(l,u){var m=ts();return u=u===void 0?null:u,l=l(),m.memoizedState=[l,u],l},useReducer:function(l,u,m){var w=ts();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=D6.bind(null,wn,l),[w.memoizedState,l]},useRef:function(l){var u=ts();return l={current:l},u.memoizedState=l},useState:T_,useDebugValue:ty,useDeferredValue:function(l){return ts().memoizedState=l},useTransition:function(){var l=T_(!1),u=l[0];return l=$6.bind(null,l[1]),ts().memoizedState=l,[u,l]},useMutableSource:function(){},useSyncExternalStore:function(l,u,m){var w=wn,C=ts();if(vn){if(m===void 0)throw Error(n(407));m=m()}else{if(m=u(),Xn===null)throw Error(n(349));(Ji&30)!==0||E_(w,u,m)}C.memoizedState=m;var E={value:m,getSnapshot:u};return C.queue=E,M_(O_.bind(null,w,E,l),[l]),w.flags|=2048,vu(9,P_.bind(null,w,E,m,u),void 0,null),m},useId:function(){var l=ts(),u=Xn.identifierPrefix;if(vn){var m=Ns,w=Ss;m=(w&~(1<<32-Lr(w)-1)).toString(32)+m,u=":"+u+"R"+m,m=hu++,0<m&&(u+="H"+m.toString(32)),u+=":"}else m=M6++,u=":"+u+"r"+m.toString(32)+":";return l.memoizedState=u},unstable_isNewReconciler:!1},B6={readContext:sa,useCallback:B_,useContext:sa,useEffect:ey,useImperativeHandle:F_,useInsertionEffect:$_,useLayoutEffect:D_,useMemo:z_,useReducer:Jg,useRef:I_,useState:function(){return Jg(mu)},useDebugValue:ty,useDeferredValue:function(l){var u=ia();return U_(u,Fn.memoizedState,l)},useTransition:function(){var l=Jg(mu)[0],u=ia().memoizedState;return[l,u]},useMutableSource:__,useSyncExternalStore:A_,useId:q_,unstable_isNewReconciler:!1},z6={readContext:sa,useCallback:B_,useContext:sa,useEffect:ey,useImperativeHandle:F_,useInsertionEffect:$_,useLayoutEffect:D_,useMemo:z_,useReducer:Zg,useRef:I_,useState:function(){return Zg(mu)},useDebugValue:ty,useDeferredValue:function(l){var u=ia();return Fn===null?u.memoizedState=l:U_(u,Fn.memoizedState,l)},useTransition:function(){var l=Zg(mu)[0],u=ia().memoizedState;return[l,u]},useMutableSource:__,useSyncExternalStore:A_,useId:q_,unstable_isNewReconciler:!1};function Ea(l,u){if(l&&l.defaultProps){u=Q({},u),l=l.defaultProps;for(var m in l)u[m]===void 0&&(u[m]=l[m]);return u}return u}function ny(l,u,m,w){u=l.memoizedState,m=m(w,u),m=m==null?u:Q({},u,m),l.memoizedState=m,l.lanes===0&&(l.updateQueue.baseState=m)}var np={isMounted:function(l){return(l=l._reactInternals)?Fe(l)===l:!1},enqueueSetState:function(l,u,m){l=l._reactInternals;var w=gr(),C=gi(l),E=_s(w,C);E.payload=u,m!=null&&(E.callback=m),u=pi(l,E,C),u!==null&&(ka(u,l,C,w),Gf(u,l,C))},enqueueReplaceState:function(l,u,m){l=l._reactInternals;var w=gr(),C=gi(l),E=_s(w,C);E.tag=1,E.payload=u,m!=null&&(E.callback=m),u=pi(l,E,C),u!==null&&(ka(u,l,C,w),Gf(u,l,C))},enqueueForceUpdate:function(l,u){l=l._reactInternals;var m=gr(),w=gi(l),C=_s(m,w);C.tag=2,u!=null&&(C.callback=u),u=pi(l,C,w),u!==null&&(ka(u,l,w,m),Gf(u,l,w))}};function K_(l,u,m,w,C,E,I){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(w,E,I):u.prototype&&u.prototype.isPureReactComponent?!nu(m,w)||!nu(C,E):!0}function G_(l,u,m){var w=!1,C=ui,E=u.contextType;return typeof E=="object"&&E!==null?E=sa(E):(C=_r(u)?Ki:lr.current,w=u.contextTypes,E=(w=w!=null)?el(l,C):ui),u=new u(m,E),l.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=np,l.stateNode=u,u._reactInternals=l,w&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=C,l.__reactInternalMemoizedMaskedChildContext=E),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&&np.enqueueReplaceState(u,u.state,null)}function ry(l,u,m,w){var C=l.stateNode;C.props=m,C.state=l.memoizedState,C.refs={},qg(l);var E=u.contextType;typeof E=="object"&&E!==null?C.context=sa(E):(E=_r(u)?Ki:lr.current,C.context=el(l,E)),C.state=l.memoizedState,E=u.getDerivedStateFromProps,typeof E=="function"&&(ny(l,u,E,m),C.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(u=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),u!==C.state&&np.enqueueReplaceState(C,C.state,null),Yf(l,m,C,w),C.state=l.memoizedState),typeof C.componentDidMount=="function"&&(l.flags|=4194308)}function ll(l,u){try{var m="",w=u;do m+=V(w),w=w.return;while(w);var C=m}catch(E){C=`
7
- Error generating stack: `+E.message+`
8
- `+E.stack}return{value:l,source:u,stack:C,digest:null}}function ay(l,u,m){return{value:l,source:null,stack:m??null,digest:u??null}}function sy(l,u){try{console.error(u.value)}catch(m){setTimeout(function(){throw m})}}var U6=typeof WeakMap=="function"?WeakMap:Map;function X_(l,u,m){m=_s(-1,m),m.tag=3,m.payload={element:null};var w=u.value;return m.callback=function(){cp||(cp=!0,by=w),sy(l,u)},m}function Q_(l,u,m){m=_s(-1,m),m.tag=3;var w=l.type.getDerivedStateFromError;if(typeof w=="function"){var C=u.value;m.payload=function(){return w(C)},m.callback=function(){sy(l,u)}}var E=l.stateNode;return E!==null&&typeof E.componentDidCatch=="function"&&(m.callback=function(){sy(l,u),typeof w!="function"&&(mi===null?mi=new Set([this]):mi.add(this));var I=u.stack;this.componentDidCatch(u.value,{componentStack:I!==null?I:""})}),m}function J_(l,u,m){var w=l.pingCache;if(w===null){w=l.pingCache=new U6;var C=new Set;w.set(u,C)}else C=w.get(u),C===void 0&&(C=new Set,w.set(u,C));C.has(m)||(C.add(m),l=n7.bind(null,l,u,m),u.then(l,l))}function Z_(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 eA(l,u,m,w,C){return(l.mode&1)===0?(l===u?l.flags|=65536:(l.flags|=128,m.flags|=131072,m.flags&=-52805,m.tag===1&&(m.alternate===null?m.tag=17:(u=_s(-1,1),u.tag=2,pi(m,u,1))),m.lanes|=1),l):(l.flags|=65536,l.lanes=C,l)}var q6=P.ReactCurrentOwner,Ar=!1;function vr(l,u,m,w){u.child=l===null?b_(u,null,m,w):al(u,l.child,m,w)}function tA(l,u,m,w,C){m=m.render;var E=u.ref;return il(u,C),w=Xg(l,u,m,w,E,C),m=Qg(),l!==null&&!Ar?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~C,As(l,u,C)):(vn&&m&&Tg(u),u.flags|=1,vr(l,u,w,C),u.child)}function nA(l,u,m,w,C){if(l===null){var E=m.type;return typeof E=="function"&&!Ay(E)&&E.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(u.tag=15,u.type=E,rA(l,u,E,w,C)):(l=mp(m.type,null,w,u,u.mode,C),l.ref=u.ref,l.return=u,u.child=l)}if(E=l.child,(l.lanes&C)===0){var I=E.memoizedProps;if(m=m.compare,m=m!==null?m:nu,m(I,w)&&l.ref===u.ref)return As(l,u,C)}return u.flags|=1,l=xi(E,w),l.ref=u.ref,l.return=u,u.child=l}function rA(l,u,m,w,C){if(l!==null){var E=l.memoizedProps;if(nu(E,w)&&l.ref===u.ref)if(Ar=!1,u.pendingProps=w=E,(l.lanes&C)!==0)(l.flags&131072)!==0&&(Ar=!0);else return u.lanes=l.lanes,As(l,u,C)}return iy(l,u,m,w,C)}function aA(l,u,m){var w=u.pendingProps,C=w.children,E=l!==null?l.memoizedState:null;if(w.mode==="hidden")if((u.mode&1)===0)u.memoizedState={baseLanes:0,cachePool:null,transitions:null},nn(ul,Ur),Ur|=m;else{if((m&1073741824)===0)return l=E!==null?E.baseLanes|m:m,u.lanes=u.childLanes=1073741824,u.memoizedState={baseLanes:l,cachePool:null,transitions:null},u.updateQueue=null,nn(ul,Ur),Ur|=l,null;u.memoizedState={baseLanes:0,cachePool:null,transitions:null},w=E!==null?E.baseLanes:m,nn(ul,Ur),Ur|=w}else E!==null?(w=E.baseLanes|m,u.memoizedState=null):w=m,nn(ul,Ur),Ur|=w;return vr(l,u,C,m),u.child}function sA(l,u){var m=u.ref;(l===null&&m!==null||l!==null&&l.ref!==m)&&(u.flags|=512,u.flags|=2097152)}function iy(l,u,m,w,C){var E=_r(m)?Ki:lr.current;return E=el(u,E),il(u,C),m=Xg(l,u,m,w,E,C),w=Qg(),l!==null&&!Ar?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~C,As(l,u,C)):(vn&&w&&Tg(u),u.flags|=1,vr(l,u,m,C),u.child)}function iA(l,u,m,w,C){if(_r(m)){var E=!0;Bf(u)}else E=!1;if(il(u,C),u.stateNode===null)ap(l,u),G_(u,m,w),ry(u,m,w,C),w=!0;else if(l===null){var I=u.stateNode,Y=u.memoizedProps;I.props=Y;var ee=I.context,me=m.contextType;typeof me=="object"&&me!==null?me=sa(me):(me=_r(m)?Ki:lr.current,me=el(u,me));var Ce=m.getDerivedStateFromProps,ke=typeof Ce=="function"||typeof I.getSnapshotBeforeUpdate=="function";ke||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(Y!==w||ee!==me)&&Y_(u,I,w,me),fi=!1;var Ne=u.memoizedState;I.state=Ne,Yf(u,w,I,C),ee=u.memoizedState,Y!==w||Ne!==ee||Cr.current||fi?(typeof Ce=="function"&&(ny(u,m,Ce,w),ee=u.memoizedState),(Y=fi||K_(u,m,Y,w,Ne,ee,me))?(ke||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount()),typeof I.componentDidMount=="function"&&(u.flags|=4194308)):(typeof I.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=w,u.memoizedState=ee),I.props=w,I.state=ee,I.context=me,w=Y):(typeof I.componentDidMount=="function"&&(u.flags|=4194308),w=!1)}else{I=u.stateNode,j_(l,u),Y=u.memoizedProps,me=u.type===u.elementType?Y:Ea(u.type,Y),I.props=me,ke=u.pendingProps,Ne=I.context,ee=m.contextType,typeof ee=="object"&&ee!==null?ee=sa(ee):(ee=_r(m)?Ki:lr.current,ee=el(u,ee));var He=m.getDerivedStateFromProps;(Ce=typeof He=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(Y!==ke||Ne!==ee)&&Y_(u,I,w,ee),fi=!1,Ne=u.memoizedState,I.state=Ne,Yf(u,w,I,C);var Ze=u.memoizedState;Y!==ke||Ne!==Ze||Cr.current||fi?(typeof He=="function"&&(ny(u,m,He,w),Ze=u.memoizedState),(me=fi||K_(u,m,me,w,Ne,Ze,ee)||!1)?(Ce||typeof I.UNSAFE_componentWillUpdate!="function"&&typeof I.componentWillUpdate!="function"||(typeof I.componentWillUpdate=="function"&&I.componentWillUpdate(w,Ze,ee),typeof I.UNSAFE_componentWillUpdate=="function"&&I.UNSAFE_componentWillUpdate(w,Ze,ee)),typeof I.componentDidUpdate=="function"&&(u.flags|=4),typeof I.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof I.componentDidUpdate!="function"||Y===l.memoizedProps&&Ne===l.memoizedState||(u.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||Y===l.memoizedProps&&Ne===l.memoizedState||(u.flags|=1024),u.memoizedProps=w,u.memoizedState=Ze),I.props=w,I.state=Ze,I.context=ee,w=me):(typeof I.componentDidUpdate!="function"||Y===l.memoizedProps&&Ne===l.memoizedState||(u.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||Y===l.memoizedProps&&Ne===l.memoizedState||(u.flags|=1024),w=!1)}return oy(l,u,m,w,E,C)}function oy(l,u,m,w,C,E){sA(l,u);var I=(u.flags&128)!==0;if(!w&&!I)return C&&d_(u,m,!1),As(l,u,E);w=u.stateNode,q6.current=u;var Y=I&&typeof m.getDerivedStateFromError!="function"?null:w.render();return u.flags|=1,l!==null&&I?(u.child=al(u,l.child,null,E),u.child=al(u,null,Y,E)):vr(l,u,Y,E),u.memoizedState=w.state,C&&d_(u,m,!0),u.child}function oA(l){var u=l.stateNode;u.pendingContext?c_(l,u.pendingContext,u.pendingContext!==u.context):u.context&&c_(l,u.context,!1),Wg(l,u.containerInfo)}function lA(l,u,m,w,C){return rl(),Dg(C),u.flags|=256,vr(l,u,m,w),u.child}var ly={dehydrated:null,treeContext:null,retryLane:0};function cy(l){return{baseLanes:l,cachePool:null,transitions:null}}function cA(l,u,m){var w=u.pendingProps,C=bn.current,E=!1,I=(u.flags&128)!==0,Y;if((Y=I)||(Y=l!==null&&l.memoizedState===null?!1:(C&2)!==0),Y?(E=!0,u.flags&=-129):(l===null||l.memoizedState!==null)&&(C|=1),nn(bn,C&1),l===null)return $g(u),l=u.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?((u.mode&1)===0?u.lanes=1:l.data==="$!"?u.lanes=8:u.lanes=1073741824,null):(I=w.children,l=w.fallback,E?(w=u.mode,E=u.child,I={mode:"hidden",children:I},(w&1)===0&&E!==null?(E.childLanes=0,E.pendingProps=I):E=vp(I,w,0,null),l=ro(l,w,m,null),E.return=u,l.return=u,E.sibling=l,u.child=E,u.child.memoizedState=cy(m),u.memoizedState=ly,l):uy(u,I));if(C=l.memoizedState,C!==null&&(Y=C.dehydrated,Y!==null))return W6(l,u,I,w,Y,C,m);if(E){E=w.fallback,I=u.mode,C=l.child,Y=C.sibling;var ee={mode:"hidden",children:w.children};return(I&1)===0&&u.child!==C?(w=u.child,w.childLanes=0,w.pendingProps=ee,u.deletions=null):(w=xi(C,ee),w.subtreeFlags=C.subtreeFlags&14680064),Y!==null?E=xi(Y,E):(E=ro(E,I,m,null),E.flags|=2),E.return=u,w.return=u,w.sibling=E,u.child=w,w=E,E=u.child,I=l.child.memoizedState,I=I===null?cy(m):{baseLanes:I.baseLanes|m,cachePool:null,transitions:I.transitions},E.memoizedState=I,E.childLanes=l.childLanes&~m,u.memoizedState=ly,w}return E=l.child,l=E.sibling,w=xi(E,{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 uy(l,u){return u=vp({mode:"visible",children:u},l.mode,0,null),u.return=l,l.child=u}function rp(l,u,m,w){return w!==null&&Dg(w),al(u,l.child,null,m),l=uy(u,u.pendingProps.children),l.flags|=2,u.memoizedState=null,l}function W6(l,u,m,w,C,E,I){if(m)return u.flags&256?(u.flags&=-257,w=ay(Error(n(422))),rp(l,u,I,w)):u.memoizedState!==null?(u.child=l.child,u.flags|=128,null):(E=w.fallback,C=u.mode,w=vp({mode:"visible",children:w.children},C,0,null),E=ro(E,C,I,null),E.flags|=2,w.return=u,E.return=u,w.sibling=E,u.child=w,(u.mode&1)!==0&&al(u,l.child,null,I),u.child.memoizedState=cy(I),u.memoizedState=ly,E);if((u.mode&1)===0)return rp(l,u,I,null);if(C.data==="$!"){if(w=C.nextSibling&&C.nextSibling.dataset,w)var Y=w.dgst;return w=Y,E=Error(n(419)),w=ay(E,w,void 0),rp(l,u,I,w)}if(Y=(I&l.childLanes)!==0,Ar||Y){if(w=Xn,w!==null){switch(I&-I){case 4:C=2;break;case 16:C=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:C=32;break;case 536870912:C=268435456;break;default:C=0}C=(C&(w.suspendedLanes|I))!==0?0:C,C!==0&&C!==E.retryLane&&(E.retryLane=C,Cs(l,C),ka(w,l,C,-1))}return _y(),w=ay(Error(n(421))),rp(l,u,I,w)}return C.data==="$?"?(u.flags|=128,u.child=l.child,u=r7.bind(null,l),C._reactRetry=u,null):(l=E.treeContext,zr=li(C.nextSibling),Br=u,vn=!0,Aa=null,l!==null&&(ra[aa++]=Ss,ra[aa++]=Ns,ra[aa++]=Gi,Ss=l.id,Ns=l.overflow,Gi=u),u=uy(u,w.children),u.flags|=4096,u)}function uA(l,u,m){l.lanes|=u;var w=l.alternate;w!==null&&(w.lanes|=u),zg(l.return,u,m)}function dy(l,u,m,w,C){var E=l.memoizedState;E===null?l.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:w,tail:m,tailMode:C}:(E.isBackwards=u,E.rendering=null,E.renderingStartTime=0,E.last=w,E.tail=m,E.tailMode=C)}function dA(l,u,m){var w=u.pendingProps,C=w.revealOrder,E=w.tail;if(vr(l,u,w.children,m),w=bn.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&&uA(l,m,u);else if(l.tag===19)uA(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(nn(bn,w),(u.mode&1)===0)u.memoizedState=null;else switch(C){case"forwards":for(m=u.child,C=null;m!==null;)l=m.alternate,l!==null&&Xf(l)===null&&(C=m),m=m.sibling;m=C,m===null?(C=u.child,u.child=null):(C=m.sibling,m.sibling=null),dy(u,!1,C,m,E);break;case"backwards":for(m=null,C=u.child,u.child=null;C!==null;){if(l=C.alternate,l!==null&&Xf(l)===null){u.child=C;break}l=C.sibling,C.sibling=m,m=C,C=l}dy(u,!0,m,null,E);break;case"together":dy(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function ap(l,u){(u.mode&1)===0&&l!==null&&(l.alternate=null,u.alternate=null,u.flags|=2)}function As(l,u,m){if(l!==null&&(u.dependencies=l.dependencies),Zi|=u.lanes,(m&u.childLanes)===0)return null;if(l!==null&&u.child!==l.child)throw Error(n(153));if(u.child!==null){for(l=u.child,m=xi(l,l.pendingProps),u.child=m,m.return=u;l.sibling!==null;)l=l.sibling,m=m.sibling=xi(l,l.pendingProps),m.return=u;m.sibling=null}return u.child}function V6(l,u,m){switch(u.tag){case 3:oA(u),rl();break;case 5:C_(u);break;case 1:_r(u.type)&&Bf(u);break;case 4:Wg(u,u.stateNode.containerInfo);break;case 10:var w=u.type._context,C=u.memoizedProps.value;nn(Hf,w._currentValue),w._currentValue=C;break;case 13:if(w=u.memoizedState,w!==null)return w.dehydrated!==null?(nn(bn,bn.current&1),u.flags|=128,null):(m&u.child.childLanes)!==0?cA(l,u,m):(nn(bn,bn.current&1),l=As(l,u,m),l!==null?l.sibling:null);nn(bn,bn.current&1);break;case 19:if(w=(m&u.childLanes)!==0,(l.flags&128)!==0){if(w)return dA(l,u,m);u.flags|=128}if(C=u.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),nn(bn,bn.current),w)break;return null;case 22:case 23:return u.lanes=0,aA(l,u,m)}return As(l,u,m)}var fA,fy,pA,hA;fA=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}},fy=function(){},pA=function(l,u,m,w){var C=l.memoizedProps;if(C!==w){l=u.stateNode,Qi(es.current);var E=null;switch(m){case"input":C=Ae(l,C),w=Ae(l,w),E=[];break;case"select":C=Q({},C,{value:void 0}),w=Q({},w,{value:void 0}),E=[];break;case"textarea":C=Se(l,C),w=Se(l,w),E=[];break;default:typeof C.onClick!="function"&&typeof w.onClick=="function"&&(l.onclick=Df)}Mn(m,w);var I;m=null;for(me in C)if(!w.hasOwnProperty(me)&&C.hasOwnProperty(me)&&C[me]!=null)if(me==="style"){var Y=C[me];for(I in Y)Y.hasOwnProperty(I)&&(m||(m={}),m[I]="")}else me!=="dangerouslySetInnerHTML"&&me!=="children"&&me!=="suppressContentEditableWarning"&&me!=="suppressHydrationWarning"&&me!=="autoFocus"&&(a.hasOwnProperty(me)?E||(E=[]):(E=E||[]).push(me,null));for(me in w){var ee=w[me];if(Y=C?.[me],w.hasOwnProperty(me)&&ee!==Y&&(ee!=null||Y!=null))if(me==="style")if(Y){for(I in Y)!Y.hasOwnProperty(I)||ee&&ee.hasOwnProperty(I)||(m||(m={}),m[I]="");for(I in ee)ee.hasOwnProperty(I)&&Y[I]!==ee[I]&&(m||(m={}),m[I]=ee[I])}else m||(E||(E=[]),E.push(me,m)),m=ee;else me==="dangerouslySetInnerHTML"?(ee=ee?ee.__html:void 0,Y=Y?Y.__html:void 0,ee!=null&&Y!==ee&&(E=E||[]).push(me,ee)):me==="children"?typeof ee!="string"&&typeof ee!="number"||(E=E||[]).push(me,""+ee):me!=="suppressContentEditableWarning"&&me!=="suppressHydrationWarning"&&(a.hasOwnProperty(me)?(ee!=null&&me==="onScroll"&&dn("scroll",l),E||Y===ee||(E=[])):(E=E||[]).push(me,ee))}m&&(E=E||[]).push("style",m);var me=E;(u.updateQueue=me)&&(u.flags|=4)}},hA=function(l,u,m,w){m!==w&&(u.flags|=4)};function gu(l,u){if(!vn)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 ur(l){var u=l.alternate!==null&&l.alternate.child===l.child,m=0,w=0;if(u)for(var C=l.child;C!==null;)m|=C.lanes|C.childLanes,w|=C.subtreeFlags&14680064,w|=C.flags&14680064,C.return=l,C=C.sibling;else for(C=l.child;C!==null;)m|=C.lanes|C.childLanes,w|=C.subtreeFlags,w|=C.flags,C.return=l,C=C.sibling;return l.subtreeFlags|=w,l.childLanes=m,u}function H6(l,u,m){var w=u.pendingProps;switch(Ig(u),u.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ur(u),null;case 1:return _r(u.type)&&Ff(),ur(u),null;case 3:return w=u.stateNode,ol(),fn(Cr),fn(lr),Kg(),w.pendingContext&&(w.context=w.pendingContext,w.pendingContext=null),(l===null||l.child===null)&&(Wf(u)?u.flags|=4:l===null||l.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Aa!==null&&(Sy(Aa),Aa=null))),fy(l,u),ur(u),null;case 5:Vg(u);var C=Qi(fu.current);if(m=u.type,l!==null&&u.stateNode!=null)pA(l,u,m,w,C),l.ref!==u.ref&&(u.flags|=512,u.flags|=2097152);else{if(!w){if(u.stateNode===null)throw Error(n(166));return ur(u),null}if(l=Qi(es.current),Wf(u)){w=u.stateNode,m=u.type;var E=u.memoizedProps;switch(w[Za]=u,w[ou]=E,l=(u.mode&1)!==0,m){case"dialog":dn("cancel",w),dn("close",w);break;case"iframe":case"object":case"embed":dn("load",w);break;case"video":case"audio":for(C=0;C<au.length;C++)dn(au[C],w);break;case"source":dn("error",w);break;case"img":case"image":case"link":dn("error",w),dn("load",w);break;case"details":dn("toggle",w);break;case"input":We(w,E),dn("invalid",w);break;case"select":w._wrapperState={wasMultiple:!!E.multiple},dn("invalid",w);break;case"textarea":Ve(w,E),dn("invalid",w)}Mn(m,E),C=null;for(var I in E)if(E.hasOwnProperty(I)){var Y=E[I];I==="children"?typeof Y=="string"?w.textContent!==Y&&(E.suppressHydrationWarning!==!0&&$f(w.textContent,Y,l),C=["children",Y]):typeof Y=="number"&&w.textContent!==""+Y&&(E.suppressHydrationWarning!==!0&&$f(w.textContent,Y,l),C=["children",""+Y]):a.hasOwnProperty(I)&&Y!=null&&I==="onScroll"&&dn("scroll",w)}switch(m){case"input":Re(w),le(w,E,!0);break;case"textarea":Re(w),xe(w);break;case"select":case"option":break;default:typeof E.onClick=="function"&&(w.onclick=Df)}w=C,u.updateQueue=w,w!==null&&(u.flags|=4)}else{I=C.nodeType===9?C:C.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=ze(m)),l==="http://www.w3.org/1999/xhtml"?m==="script"?(l=I.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof w.is=="string"?l=I.createElement(m,{is:w.is}):(l=I.createElement(m),m==="select"&&(I=l,w.multiple?I.multiple=!0:w.size&&(I.size=w.size))):l=I.createElementNS(l,m),l[Za]=u,l[ou]=w,fA(l,u,!1,!1),u.stateNode=l;e:{switch(I=Mr(m,w),m){case"dialog":dn("cancel",l),dn("close",l),C=w;break;case"iframe":case"object":case"embed":dn("load",l),C=w;break;case"video":case"audio":for(C=0;C<au.length;C++)dn(au[C],l);C=w;break;case"source":dn("error",l),C=w;break;case"img":case"image":case"link":dn("error",l),dn("load",l),C=w;break;case"details":dn("toggle",l),C=w;break;case"input":We(l,w),C=Ae(l,w),dn("invalid",l);break;case"option":C=w;break;case"select":l._wrapperState={wasMultiple:!!w.multiple},C=Q({},w,{value:void 0}),dn("invalid",l);break;case"textarea":Ve(l,w),C=Se(l,w),dn("invalid",l);break;default:C=w}Mn(m,C),Y=C;for(E in Y)if(Y.hasOwnProperty(E)){var ee=Y[E];E==="style"?or(l,ee):E==="dangerouslySetInnerHTML"?(ee=ee?ee.__html:void 0,ee!=null&&Lt(l,ee)):E==="children"?typeof ee=="string"?(m!=="textarea"||ee!=="")&&$t(l,ee):typeof ee=="number"&&$t(l,""+ee):E!=="suppressContentEditableWarning"&&E!=="suppressHydrationWarning"&&E!=="autoFocus"&&(a.hasOwnProperty(E)?ee!=null&&E==="onScroll"&&dn("scroll",l):ee!=null&&_(l,E,ee,I))}switch(m){case"input":Re(l),le(l,w,!1);break;case"textarea":Re(l),xe(l);break;case"option":w.value!=null&&l.setAttribute("value",""+de(w.value));break;case"select":l.multiple=!!w.multiple,E=w.value,E!=null?we(l,!!w.multiple,E,!1):w.defaultValue!=null&&we(l,!!w.multiple,w.defaultValue,!0);break;default:typeof C.onClick=="function"&&(l.onclick=Df)}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 ur(u),null;case 6:if(l&&u.stateNode!=null)hA(l,u,l.memoizedProps,w);else{if(typeof w!="string"&&u.stateNode===null)throw Error(n(166));if(m=Qi(fu.current),Qi(es.current),Wf(u)){if(w=u.stateNode,m=u.memoizedProps,w[Za]=u,(E=w.nodeValue!==m)&&(l=Br,l!==null))switch(l.tag){case 3:$f(w.nodeValue,m,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&$f(w.nodeValue,m,(l.mode&1)!==0)}E&&(u.flags|=4)}else w=(m.nodeType===9?m:m.ownerDocument).createTextNode(w),w[Za]=u,u.stateNode=w}return ur(u),null;case 13:if(fn(bn),w=u.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(vn&&zr!==null&&(u.mode&1)!==0&&(u.flags&128)===0)g_(),rl(),u.flags|=98560,E=!1;else if(E=Wf(u),w!==null&&w.dehydrated!==null){if(l===null){if(!E)throw Error(n(318));if(E=u.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(n(317));E[Za]=u}else rl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;ur(u),E=!1}else Aa!==null&&(Sy(Aa),Aa=null),E=!0;if(!E)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||(bn.current&1)!==0?Bn===0&&(Bn=3):_y())),u.updateQueue!==null&&(u.flags|=4),ur(u),null);case 4:return ol(),fy(l,u),l===null&&su(u.stateNode.containerInfo),ur(u),null;case 10:return Bg(u.type._context),ur(u),null;case 17:return _r(u.type)&&Ff(),ur(u),null;case 19:if(fn(bn),E=u.memoizedState,E===null)return ur(u),null;if(w=(u.flags&128)!==0,I=E.rendering,I===null)if(w)gu(E,!1);else{if(Bn!==0||l!==null&&(l.flags&128)!==0)for(l=u.child;l!==null;){if(I=Xf(l),I!==null){for(u.flags|=128,gu(E,!1),w=I.updateQueue,w!==null&&(u.updateQueue=w,u.flags|=4),u.subtreeFlags=0,w=m,m=u.child;m!==null;)E=m,l=w,E.flags&=14680066,I=E.alternate,I===null?(E.childLanes=0,E.lanes=l,E.child=null,E.subtreeFlags=0,E.memoizedProps=null,E.memoizedState=null,E.updateQueue=null,E.dependencies=null,E.stateNode=null):(E.childLanes=I.childLanes,E.lanes=I.lanes,E.child=I.child,E.subtreeFlags=0,E.deletions=null,E.memoizedProps=I.memoizedProps,E.memoizedState=I.memoizedState,E.updateQueue=I.updateQueue,E.type=I.type,l=I.dependencies,E.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),m=m.sibling;return nn(bn,bn.current&1|2),u.child}l=l.sibling}E.tail!==null&&he()>dl&&(u.flags|=128,w=!0,gu(E,!1),u.lanes=4194304)}else{if(!w)if(l=Xf(I),l!==null){if(u.flags|=128,w=!0,m=l.updateQueue,m!==null&&(u.updateQueue=m,u.flags|=4),gu(E,!0),E.tail===null&&E.tailMode==="hidden"&&!I.alternate&&!vn)return ur(u),null}else 2*he()-E.renderingStartTime>dl&&m!==1073741824&&(u.flags|=128,w=!0,gu(E,!1),u.lanes=4194304);E.isBackwards?(I.sibling=u.child,u.child=I):(m=E.last,m!==null?m.sibling=I:u.child=I,E.last=I)}return E.tail!==null?(u=E.tail,E.rendering=u,E.tail=u.sibling,E.renderingStartTime=he(),u.sibling=null,m=bn.current,nn(bn,w?m&1|2:m&1),u):(ur(u),null);case 22:case 23:return Cy(),w=u.memoizedState!==null,l!==null&&l.memoizedState!==null!==w&&(u.flags|=8192),w&&(u.mode&1)!==0?(Ur&1073741824)!==0&&(ur(u),u.subtreeFlags&6&&(u.flags|=8192)):ur(u),null;case 24:return null;case 25:return null}throw Error(n(156,u.tag))}function K6(l,u){switch(Ig(u),u.tag){case 1:return _r(u.type)&&Ff(),l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 3:return ol(),fn(Cr),fn(lr),Kg(),l=u.flags,(l&65536)!==0&&(l&128)===0?(u.flags=l&-65537|128,u):null;case 5:return Vg(u),null;case 13:if(fn(bn),l=u.memoizedState,l!==null&&l.dehydrated!==null){if(u.alternate===null)throw Error(n(340));rl()}return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 19:return fn(bn),null;case 4:return ol(),null;case 10:return Bg(u.type._context),null;case 22:case 23:return Cy(),null;case 24:return null;default:return null}}var sp=!1,dr=!1,G6=typeof WeakSet=="function"?WeakSet:Set,Xe=null;function cl(l,u){var m=l.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(w){Nn(l,u,w)}else m.current=null}function py(l,u,m){try{m()}catch(w){Nn(l,u,w)}}var mA=!1;function Y6(l,u){if(Cg=Cf,l=KC(),gg(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 C=w.anchorOffset,E=w.focusNode;w=w.focusOffset;try{m.nodeType,E.nodeType}catch{m=null;break e}var I=0,Y=-1,ee=-1,me=0,Ce=0,ke=l,Ne=null;t:for(;;){for(var He;ke!==m||C!==0&&ke.nodeType!==3||(Y=I+C),ke!==E||w!==0&&ke.nodeType!==3||(ee=I+w),ke.nodeType===3&&(I+=ke.nodeValue.length),(He=ke.firstChild)!==null;)Ne=ke,ke=He;for(;;){if(ke===l)break t;if(Ne===m&&++me===C&&(Y=I),Ne===E&&++Ce===w&&(ee=I),(He=ke.nextSibling)!==null)break;ke=Ne,Ne=ke.parentNode}ke=He}m=Y===-1||ee===-1?null:{start:Y,end:ee}}else m=null}m=m||{start:0,end:0}}else m=null;for(_g={focusedElem:l,selectionRange:m},Cf=!1,Xe=u;Xe!==null;)if(u=Xe,l=u.child,(u.subtreeFlags&1028)!==0&&l!==null)l.return=u,Xe=l;else for(;Xe!==null;){u=Xe;try{var Ze=u.alternate;if((u.flags&1024)!==0)switch(u.tag){case 0:case 11:case 15:break;case 1:if(Ze!==null){var et=Ze.memoizedProps,An=Ze.memoizedState,ue=u.stateNode,te=ue.getSnapshotBeforeUpdate(u.elementType===u.type?et:Ea(u.type,et),An);ue.__reactInternalSnapshotBeforeUpdate=te}break;case 3:var fe=u.stateNode.containerInfo;fe.nodeType===1?fe.textContent="":fe.nodeType===9&&fe.documentElement&&fe.removeChild(fe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Me){Nn(u,u.return,Me)}if(l=u.sibling,l!==null){l.return=u.return,Xe=l;break}Xe=u.return}return Ze=mA,mA=!1,Ze}function yu(l,u,m){var w=u.updateQueue;if(w=w!==null?w.lastEffect:null,w!==null){var C=w=w.next;do{if((C.tag&l)===l){var E=C.destroy;C.destroy=void 0,E!==void 0&&py(u,m,E)}C=C.next}while(C!==w)}}function ip(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 hy(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 vA(l){var u=l.alternate;u!==null&&(l.alternate=null,vA(u)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(u=l.stateNode,u!==null&&(delete u[Za],delete u[ou],delete u[Og],delete u[k6],delete u[R6])),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function gA(l){return l.tag===5||l.tag===3||l.tag===4}function yA(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||gA(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 my(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=Df));else if(w!==4&&(l=l.child,l!==null))for(my(l,u,m),l=l.sibling;l!==null;)my(l,u,m),l=l.sibling}function vy(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(vy(l,u,m),l=l.sibling;l!==null;)vy(l,u,m),l=l.sibling}var nr=null,Pa=!1;function hi(l,u,m){for(m=m.child;m!==null;)xA(l,u,m),m=m.sibling}function xA(l,u,m){if(Ln&&typeof Ln.onCommitFiberUnmount=="function")try{Ln.onCommitFiberUnmount(Gt,m)}catch{}switch(m.tag){case 5:dr||cl(m,u);case 6:var w=nr,C=Pa;nr=null,hi(l,u,m),nr=w,Pa=C,nr!==null&&(Pa?(l=nr,m=m.stateNode,l.nodeType===8?l.parentNode.removeChild(m):l.removeChild(m)):nr.removeChild(m.stateNode));break;case 18:nr!==null&&(Pa?(l=nr,m=m.stateNode,l.nodeType===8?Pg(l.parentNode,m):l.nodeType===1&&Pg(l,m),Xc(l)):Pg(nr,m.stateNode));break;case 4:w=nr,C=Pa,nr=m.stateNode.containerInfo,Pa=!0,hi(l,u,m),nr=w,Pa=C;break;case 0:case 11:case 14:case 15:if(!dr&&(w=m.updateQueue,w!==null&&(w=w.lastEffect,w!==null))){C=w=w.next;do{var E=C,I=E.destroy;E=E.tag,I!==void 0&&((E&2)!==0||(E&4)!==0)&&py(m,u,I),C=C.next}while(C!==w)}hi(l,u,m);break;case 1:if(!dr&&(cl(m,u),w=m.stateNode,typeof w.componentWillUnmount=="function"))try{w.props=m.memoizedProps,w.state=m.memoizedState,w.componentWillUnmount()}catch(Y){Nn(m,u,Y)}hi(l,u,m);break;case 21:hi(l,u,m);break;case 22:m.mode&1?(dr=(w=dr)||m.memoizedState!==null,hi(l,u,m),dr=w):hi(l,u,m);break;default:hi(l,u,m)}}function bA(l){var u=l.updateQueue;if(u!==null){l.updateQueue=null;var m=l.stateNode;m===null&&(m=l.stateNode=new G6),u.forEach(function(w){var C=a7.bind(null,l,w);m.has(w)||(m.add(w),w.then(C,C))})}}function Oa(l,u){var m=u.deletions;if(m!==null)for(var w=0;w<m.length;w++){var C=m[w];try{var E=l,I=u,Y=I;e:for(;Y!==null;){switch(Y.tag){case 5:nr=Y.stateNode,Pa=!1;break e;case 3:nr=Y.stateNode.containerInfo,Pa=!0;break e;case 4:nr=Y.stateNode.containerInfo,Pa=!0;break e}Y=Y.return}if(nr===null)throw Error(n(160));xA(E,I,C),nr=null,Pa=!1;var ee=C.alternate;ee!==null&&(ee.return=null),C.return=null}catch(me){Nn(C,u,me)}}if(u.subtreeFlags&12854)for(u=u.child;u!==null;)wA(u,l),u=u.sibling}function wA(l,u){var m=l.alternate,w=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(Oa(u,l),ns(l),w&4){try{yu(3,l,l.return),ip(3,l)}catch(et){Nn(l,l.return,et)}try{yu(5,l,l.return)}catch(et){Nn(l,l.return,et)}}break;case 1:Oa(u,l),ns(l),w&512&&m!==null&&cl(m,m.return);break;case 5:if(Oa(u,l),ns(l),w&512&&m!==null&&cl(m,m.return),l.flags&32){var C=l.stateNode;try{$t(C,"")}catch(et){Nn(l,l.return,et)}}if(w&4&&(C=l.stateNode,C!=null)){var E=l.memoizedProps,I=m!==null?m.memoizedProps:E,Y=l.type,ee=l.updateQueue;if(l.updateQueue=null,ee!==null)try{Y==="input"&&E.type==="radio"&&E.name!=null&&ye(C,E),Mr(Y,I);var me=Mr(Y,E);for(I=0;I<ee.length;I+=2){var Ce=ee[I],ke=ee[I+1];Ce==="style"?or(C,ke):Ce==="dangerouslySetInnerHTML"?Lt(C,ke):Ce==="children"?$t(C,ke):_(C,Ce,ke,me)}switch(Y){case"input":Ee(C,E);break;case"textarea":Ot(C,E);break;case"select":var Ne=C._wrapperState.wasMultiple;C._wrapperState.wasMultiple=!!E.multiple;var He=E.value;He!=null?we(C,!!E.multiple,He,!1):Ne!==!!E.multiple&&(E.defaultValue!=null?we(C,!!E.multiple,E.defaultValue,!0):we(C,!!E.multiple,E.multiple?[]:"",!1))}C[ou]=E}catch(et){Nn(l,l.return,et)}}break;case 6:if(Oa(u,l),ns(l),w&4){if(l.stateNode===null)throw Error(n(162));C=l.stateNode,E=l.memoizedProps;try{C.nodeValue=E}catch(et){Nn(l,l.return,et)}}break;case 3:if(Oa(u,l),ns(l),w&4&&m!==null&&m.memoizedState.isDehydrated)try{Xc(u.containerInfo)}catch(et){Nn(l,l.return,et)}break;case 4:Oa(u,l),ns(l);break;case 13:Oa(u,l),ns(l),C=l.child,C.flags&8192&&(E=C.memoizedState!==null,C.stateNode.isHidden=E,!E||C.alternate!==null&&C.alternate.memoizedState!==null||(xy=he())),w&4&&bA(l);break;case 22:if(Ce=m!==null&&m.memoizedState!==null,l.mode&1?(dr=(me=dr)||Ce,Oa(u,l),dr=me):Oa(u,l),ns(l),w&8192){if(me=l.memoizedState!==null,(l.stateNode.isHidden=me)&&!Ce&&(l.mode&1)!==0)for(Xe=l,Ce=l.child;Ce!==null;){for(ke=Xe=Ce;Xe!==null;){switch(Ne=Xe,He=Ne.child,Ne.tag){case 0:case 11:case 14:case 15:yu(4,Ne,Ne.return);break;case 1:cl(Ne,Ne.return);var Ze=Ne.stateNode;if(typeof Ze.componentWillUnmount=="function"){w=Ne,m=Ne.return;try{u=w,Ze.props=u.memoizedProps,Ze.state=u.memoizedState,Ze.componentWillUnmount()}catch(et){Nn(w,m,et)}}break;case 5:cl(Ne,Ne.return);break;case 22:if(Ne.memoizedState!==null){NA(ke);continue}}He!==null?(He.return=Ne,Xe=He):NA(ke)}Ce=Ce.sibling}e:for(Ce=null,ke=l;;){if(ke.tag===5){if(Ce===null){Ce=ke;try{C=ke.stateNode,me?(E=C.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none"):(Y=ke.stateNode,ee=ke.memoizedProps.style,I=ee!=null&&ee.hasOwnProperty("display")?ee.display:null,Y.style.display=tr("display",I))}catch(et){Nn(l,l.return,et)}}}else if(ke.tag===6){if(Ce===null)try{ke.stateNode.nodeValue=me?"":ke.memoizedProps}catch(et){Nn(l,l.return,et)}}else if((ke.tag!==22&&ke.tag!==23||ke.memoizedState===null||ke===l)&&ke.child!==null){ke.child.return=ke,ke=ke.child;continue}if(ke===l)break e;for(;ke.sibling===null;){if(ke.return===null||ke.return===l)break e;Ce===ke&&(Ce=null),ke=ke.return}Ce===ke&&(Ce=null),ke.sibling.return=ke.return,ke=ke.sibling}}break;case 19:Oa(u,l),ns(l),w&4&&bA(l);break;case 21:break;default:Oa(u,l),ns(l)}}function ns(l){var u=l.flags;if(u&2){try{e:{for(var m=l.return;m!==null;){if(gA(m)){var w=m;break e}m=m.return}throw Error(n(160))}switch(w.tag){case 5:var C=w.stateNode;w.flags&32&&($t(C,""),w.flags&=-33);var E=yA(l);vy(l,E,C);break;case 3:case 4:var I=w.stateNode.containerInfo,Y=yA(l);my(l,Y,I);break;default:throw Error(n(161))}}catch(ee){Nn(l,l.return,ee)}l.flags&=-3}u&4096&&(l.flags&=-4097)}function X6(l,u,m){Xe=l,jA(l)}function jA(l,u,m){for(var w=(l.mode&1)!==0;Xe!==null;){var C=Xe,E=C.child;if(C.tag===22&&w){var I=C.memoizedState!==null||sp;if(!I){var Y=C.alternate,ee=Y!==null&&Y.memoizedState!==null||dr;Y=sp;var me=dr;if(sp=I,(dr=ee)&&!me)for(Xe=C;Xe!==null;)I=Xe,ee=I.child,I.tag===22&&I.memoizedState!==null?CA(C):ee!==null?(ee.return=I,Xe=ee):CA(C);for(;E!==null;)Xe=E,jA(E),E=E.sibling;Xe=C,sp=Y,dr=me}SA(l)}else(C.subtreeFlags&8772)!==0&&E!==null?(E.return=C,Xe=E):SA(l)}}function SA(l){for(;Xe!==null;){var u=Xe;if((u.flags&8772)!==0){var m=u.alternate;try{if((u.flags&8772)!==0)switch(u.tag){case 0:case 11:case 15:dr||ip(5,u);break;case 1:var w=u.stateNode;if(u.flags&4&&!dr)if(m===null)w.componentDidMount();else{var C=u.elementType===u.type?m.memoizedProps:Ea(u.type,m.memoizedProps);w.componentDidUpdate(C,m.memoizedState,w.__reactInternalSnapshotBeforeUpdate)}var E=u.updateQueue;E!==null&&N_(u,E,w);break;case 3:var I=u.updateQueue;if(I!==null){if(m=null,u.child!==null)switch(u.child.tag){case 5:m=u.child.stateNode;break;case 1:m=u.child.stateNode}N_(u,I,m)}break;case 5:var Y=u.stateNode;if(m===null&&u.flags&4){m=Y;var ee=u.memoizedProps;switch(u.type){case"button":case"input":case"select":case"textarea":ee.autoFocus&&m.focus();break;case"img":ee.src&&(m.src=ee.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(u.memoizedState===null){var me=u.alternate;if(me!==null){var Ce=me.memoizedState;if(Ce!==null){var ke=Ce.dehydrated;ke!==null&&Xc(ke)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}dr||u.flags&512&&hy(u)}catch(Ne){Nn(u,u.return,Ne)}}if(u===l){Xe=null;break}if(m=u.sibling,m!==null){m.return=u.return,Xe=m;break}Xe=u.return}}function NA(l){for(;Xe!==null;){var u=Xe;if(u===l){Xe=null;break}var m=u.sibling;if(m!==null){m.return=u.return,Xe=m;break}Xe=u.return}}function CA(l){for(;Xe!==null;){var u=Xe;try{switch(u.tag){case 0:case 11:case 15:var m=u.return;try{ip(4,u)}catch(ee){Nn(u,m,ee)}break;case 1:var w=u.stateNode;if(typeof w.componentDidMount=="function"){var C=u.return;try{w.componentDidMount()}catch(ee){Nn(u,C,ee)}}var E=u.return;try{hy(u)}catch(ee){Nn(u,E,ee)}break;case 5:var I=u.return;try{hy(u)}catch(ee){Nn(u,I,ee)}}}catch(ee){Nn(u,u.return,ee)}if(u===l){Xe=null;break}var Y=u.sibling;if(Y!==null){Y.return=u.return,Xe=Y;break}Xe=u.return}}var Q6=Math.ceil,op=P.ReactCurrentDispatcher,gy=P.ReactCurrentOwner,oa=P.ReactCurrentBatchConfig,Rt=0,Xn=null,Rn=null,rr=0,Ur=0,ul=ci(0),Bn=0,xu=null,Zi=0,lp=0,yy=0,bu=null,Er=null,xy=0,dl=1/0,Es=null,cp=!1,by=null,mi=null,up=!1,vi=null,dp=0,wu=0,wy=null,fp=-1,pp=0;function gr(){return(Rt&6)!==0?he():fp!==-1?fp:fp=he()}function gi(l){return(l.mode&1)===0?1:(Rt&2)!==0&&rr!==0?rr&-rr:I6.transition!==null?(pp===0&&(pp=yC()),pp):(l=qt,l!==0||(l=window.event,l=l===void 0?16:AC(l.type)),l)}function ka(l,u,m,w){if(50<wu)throw wu=0,wy=null,Error(n(185));Vc(l,m,w),((Rt&2)===0||l!==Xn)&&(l===Xn&&((Rt&2)===0&&(lp|=m),Bn===4&&yi(l,rr)),Pr(l,w),m===1&&Rt===0&&(u.mode&1)===0&&(dl=he()+500,zf&&di()))}function Pr(l,u){var m=l.callbackNode;Iz(l,u);var w=jf(l,l===Xn?rr:0);if(w===0)m!==null&&Dn(m),l.callbackNode=null,l.callbackPriority=0;else if(u=w&-w,l.callbackPriority!==u){if(m!=null&&Dn(m),u===1)l.tag===0?T6(AA.bind(null,l)):f_(AA.bind(null,l)),P6(function(){(Rt&6)===0&&di()}),m=null;else{switch(xC(w)){case 1:m=Ie;break;case 4:m=kt;break;case 16:m=_t;break;case 536870912:m=Ja;break;default:m=_t}m=MA(m,_A.bind(null,l))}l.callbackPriority=u,l.callbackNode=m}}function _A(l,u){if(fp=-1,pp=0,(Rt&6)!==0)throw Error(n(327));var m=l.callbackNode;if(fl()&&l.callbackNode!==m)return null;var w=jf(l,l===Xn?rr:0);if(w===0)return null;if((w&30)!==0||(w&l.expiredLanes)!==0||u)u=hp(l,w);else{u=w;var C=Rt;Rt|=2;var E=PA();(Xn!==l||rr!==u)&&(Es=null,dl=he()+500,to(l,u));do try{e7();break}catch(Y){EA(l,Y)}while(!0);Fg(),op.current=E,Rt=C,Rn!==null?u=0:(Xn=null,rr=0,u=Bn)}if(u!==0){if(u===2&&(C=tg(l),C!==0&&(w=C,u=jy(l,C))),u===1)throw m=xu,to(l,0),yi(l,w),Pr(l,he()),m;if(u===6)yi(l,w);else{if(C=l.current.alternate,(w&30)===0&&!J6(C)&&(u=hp(l,w),u===2&&(E=tg(l),E!==0&&(w=E,u=jy(l,E))),u===1))throw m=xu,to(l,0),yi(l,w),Pr(l,he()),m;switch(l.finishedWork=C,l.finishedLanes=w,u){case 0:case 1:throw Error(n(345));case 2:no(l,Er,Es);break;case 3:if(yi(l,w),(w&130023424)===w&&(u=xy+500-he(),10<u)){if(jf(l,0)!==0)break;if(C=l.suspendedLanes,(C&w)!==w){gr(),l.pingedLanes|=l.suspendedLanes&C;break}l.timeoutHandle=Eg(no.bind(null,l,Er,Es),u);break}no(l,Er,Es);break;case 4:if(yi(l,w),(w&4194240)===w)break;for(u=l.eventTimes,C=-1;0<w;){var I=31-Lr(w);E=1<<I,I=u[I],I>C&&(C=I),w&=~E}if(w=C,w=he()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*Q6(w/1960))-w,10<w){l.timeoutHandle=Eg(no.bind(null,l,Er,Es),w);break}no(l,Er,Es);break;case 5:no(l,Er,Es);break;default:throw Error(n(329))}}}return Pr(l,he()),l.callbackNode===m?_A.bind(null,l):null}function jy(l,u){var m=bu;return l.current.memoizedState.isDehydrated&&(to(l,u).flags|=256),l=hp(l,u),l!==2&&(u=Er,Er=m,u!==null&&Sy(u)),l}function Sy(l){Er===null?Er=l:Er.push.apply(Er,l)}function J6(l){for(var u=l;;){if(u.flags&16384){var m=u.updateQueue;if(m!==null&&(m=m.stores,m!==null))for(var w=0;w<m.length;w++){var C=m[w],E=C.getSnapshot;C=C.value;try{if(!_a(E(),C))return!1}catch{return!1}}}if(m=u.child,u.subtreeFlags&16384&&m!==null)m.return=u,u=m;else{if(u===l)break;for(;u.sibling===null;){if(u.return===null||u.return===l)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function yi(l,u){for(u&=~yy,u&=~lp,l.suspendedLanes|=u,l.pingedLanes&=~u,l=l.expirationTimes;0<u;){var m=31-Lr(u),w=1<<m;l[m]=-1,u&=~w}}function AA(l){if((Rt&6)!==0)throw Error(n(327));fl();var u=jf(l,0);if((u&1)===0)return Pr(l,he()),null;var m=hp(l,u);if(l.tag!==0&&m===2){var w=tg(l);w!==0&&(u=w,m=jy(l,w))}if(m===1)throw m=xu,to(l,0),yi(l,u),Pr(l,he()),m;if(m===6)throw Error(n(345));return l.finishedWork=l.current.alternate,l.finishedLanes=u,no(l,Er,Es),Pr(l,he()),null}function Ny(l,u){var m=Rt;Rt|=1;try{return l(u)}finally{Rt=m,Rt===0&&(dl=he()+500,zf&&di())}}function eo(l){vi!==null&&vi.tag===0&&(Rt&6)===0&&fl();var u=Rt;Rt|=1;var m=oa.transition,w=qt;try{if(oa.transition=null,qt=1,l)return l()}finally{qt=w,oa.transition=m,Rt=u,(Rt&6)===0&&di()}}function Cy(){Ur=ul.current,fn(ul)}function to(l,u){l.finishedWork=null,l.finishedLanes=0;var m=l.timeoutHandle;if(m!==-1&&(l.timeoutHandle=-1,E6(m)),Rn!==null)for(m=Rn.return;m!==null;){var w=m;switch(Ig(w),w.tag){case 1:w=w.type.childContextTypes,w!=null&&Ff();break;case 3:ol(),fn(Cr),fn(lr),Kg();break;case 5:Vg(w);break;case 4:ol();break;case 13:fn(bn);break;case 19:fn(bn);break;case 10:Bg(w.type._context);break;case 22:case 23:Cy()}m=m.return}if(Xn=l,Rn=l=xi(l.current,null),rr=Ur=u,Bn=0,xu=null,yy=lp=Zi=0,Er=bu=null,Xi!==null){for(u=0;u<Xi.length;u++)if(m=Xi[u],w=m.interleaved,w!==null){m.interleaved=null;var C=w.next,E=m.pending;if(E!==null){var I=E.next;E.next=C,w.next=I}m.pending=w}Xi=null}return l}function EA(l,u){do{var m=Rn;try{if(Fg(),Qf.current=tp,Jf){for(var w=wn.memoizedState;w!==null;){var C=w.queue;C!==null&&(C.pending=null),w=w.next}Jf=!1}if(Ji=0,Yn=Fn=wn=null,pu=!1,hu=0,gy.current=null,m===null||m.return===null){Bn=1,xu=u,Rn=null;break}e:{var E=l,I=m.return,Y=m,ee=u;if(u=rr,Y.flags|=32768,ee!==null&&typeof ee=="object"&&typeof ee.then=="function"){var me=ee,Ce=Y,ke=Ce.tag;if((Ce.mode&1)===0&&(ke===0||ke===11||ke===15)){var Ne=Ce.alternate;Ne?(Ce.updateQueue=Ne.updateQueue,Ce.memoizedState=Ne.memoizedState,Ce.lanes=Ne.lanes):(Ce.updateQueue=null,Ce.memoizedState=null)}var He=Z_(I);if(He!==null){He.flags&=-257,eA(He,I,Y,E,u),He.mode&1&&J_(E,me,u),u=He,ee=me;var Ze=u.updateQueue;if(Ze===null){var et=new Set;et.add(ee),u.updateQueue=et}else Ze.add(ee);break e}else{if((u&1)===0){J_(E,me,u),_y();break e}ee=Error(n(426))}}else if(vn&&Y.mode&1){var An=Z_(I);if(An!==null){(An.flags&65536)===0&&(An.flags|=256),eA(An,I,Y,E,u),Dg(ll(ee,Y));break e}}E=ee=ll(ee,Y),Bn!==4&&(Bn=2),bu===null?bu=[E]:bu.push(E),E=I;do{switch(E.tag){case 3:E.flags|=65536,u&=-u,E.lanes|=u;var ue=X_(E,ee,u);S_(E,ue);break e;case 1:Y=ee;var te=E.type,fe=E.stateNode;if((E.flags&128)===0&&(typeof te.getDerivedStateFromError=="function"||fe!==null&&typeof fe.componentDidCatch=="function"&&(mi===null||!mi.has(fe)))){E.flags|=65536,u&=-u,E.lanes|=u;var Me=Q_(E,Y,u);S_(E,Me);break e}}E=E.return}while(E!==null)}kA(m)}catch(nt){u=nt,Rn===m&&m!==null&&(Rn=m=m.return);continue}break}while(!0)}function PA(){var l=op.current;return op.current=tp,l===null?tp:l}function _y(){(Bn===0||Bn===3||Bn===2)&&(Bn=4),Xn===null||(Zi&268435455)===0&&(lp&268435455)===0||yi(Xn,rr)}function hp(l,u){var m=Rt;Rt|=2;var w=PA();(Xn!==l||rr!==u)&&(Es=null,to(l,u));do try{Z6();break}catch(C){EA(l,C)}while(!0);if(Fg(),Rt=m,op.current=w,Rn!==null)throw Error(n(261));return Xn=null,rr=0,Bn}function Z6(){for(;Rn!==null;)OA(Rn)}function e7(){for(;Rn!==null&&!tn();)OA(Rn)}function OA(l){var u=IA(l.alternate,l,Ur);l.memoizedProps=l.pendingProps,u===null?kA(l):Rn=u,gy.current=null}function kA(l){var u=l;do{var m=u.alternate;if(l=u.return,(u.flags&32768)===0){if(m=H6(m,u,Ur),m!==null){Rn=m;return}}else{if(m=K6(m,u),m!==null){m.flags&=32767,Rn=m;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{Bn=6,Rn=null;return}}if(u=u.sibling,u!==null){Rn=u;return}Rn=u=l}while(u!==null);Bn===0&&(Bn=5)}function no(l,u,m){var w=qt,C=oa.transition;try{oa.transition=null,qt=1,t7(l,u,m,w)}finally{oa.transition=C,qt=w}return null}function t7(l,u,m,w){do fl();while(vi!==null);if((Rt&6)!==0)throw Error(n(327));m=l.finishedWork;var C=l.finishedLanes;if(m===null)return null;if(l.finishedWork=null,l.finishedLanes=0,m===l.current)throw Error(n(177));l.callbackNode=null,l.callbackPriority=0;var E=m.lanes|m.childLanes;if(Mz(l,E),l===Xn&&(Rn=Xn=null,rr=0),(m.subtreeFlags&2064)===0&&(m.flags&2064)===0||up||(up=!0,MA(_t,function(){return fl(),null})),E=(m.flags&15990)!==0,(m.subtreeFlags&15990)!==0||E){E=oa.transition,oa.transition=null;var I=qt;qt=1;var Y=Rt;Rt|=4,gy.current=null,Y6(l,m),wA(m,l),w6(_g),Cf=!!Cg,_g=Cg=null,l.current=m,X6(m),H(),Rt=Y,qt=I,oa.transition=E}else l.current=m;if(up&&(up=!1,vi=l,dp=C),E=l.pendingLanes,E===0&&(mi=null),xf(m.stateNode),Pr(l,he()),u!==null)for(w=l.onRecoverableError,m=0;m<u.length;m++)C=u[m],w(C.value,{componentStack:C.stack,digest:C.digest});if(cp)throw cp=!1,l=by,by=null,l;return(dp&1)!==0&&l.tag!==0&&fl(),E=l.pendingLanes,(E&1)!==0?l===wy?wu++:(wu=0,wy=l):wu=0,di(),null}function fl(){if(vi!==null){var l=xC(dp),u=oa.transition,m=qt;try{if(oa.transition=null,qt=16>l?16:l,vi===null)var w=!1;else{if(l=vi,vi=null,dp=0,(Rt&6)!==0)throw Error(n(331));var C=Rt;for(Rt|=4,Xe=l.current;Xe!==null;){var E=Xe,I=E.child;if((Xe.flags&16)!==0){var Y=E.deletions;if(Y!==null){for(var ee=0;ee<Y.length;ee++){var me=Y[ee];for(Xe=me;Xe!==null;){var Ce=Xe;switch(Ce.tag){case 0:case 11:case 15:yu(8,Ce,E)}var ke=Ce.child;if(ke!==null)ke.return=Ce,Xe=ke;else for(;Xe!==null;){Ce=Xe;var Ne=Ce.sibling,He=Ce.return;if(vA(Ce),Ce===me){Xe=null;break}if(Ne!==null){Ne.return=He,Xe=Ne;break}Xe=He}}}var Ze=E.alternate;if(Ze!==null){var et=Ze.child;if(et!==null){Ze.child=null;do{var An=et.sibling;et.sibling=null,et=An}while(et!==null)}}Xe=E}}if((E.subtreeFlags&2064)!==0&&I!==null)I.return=E,Xe=I;else e:for(;Xe!==null;){if(E=Xe,(E.flags&2048)!==0)switch(E.tag){case 0:case 11:case 15:yu(9,E,E.return)}var ue=E.sibling;if(ue!==null){ue.return=E.return,Xe=ue;break e}Xe=E.return}}var te=l.current;for(Xe=te;Xe!==null;){I=Xe;var fe=I.child;if((I.subtreeFlags&2064)!==0&&fe!==null)fe.return=I,Xe=fe;else e:for(I=te;Xe!==null;){if(Y=Xe,(Y.flags&2048)!==0)try{switch(Y.tag){case 0:case 11:case 15:ip(9,Y)}}catch(nt){Nn(Y,Y.return,nt)}if(Y===I){Xe=null;break e}var Me=Y.sibling;if(Me!==null){Me.return=Y.return,Xe=Me;break e}Xe=Y.return}}if(Rt=C,di(),Ln&&typeof Ln.onPostCommitFiberRoot=="function")try{Ln.onPostCommitFiberRoot(Gt,l)}catch{}w=!0}return w}finally{qt=m,oa.transition=u}}return!1}function RA(l,u,m){u=ll(m,u),u=X_(l,u,1),l=pi(l,u,1),u=gr(),l!==null&&(Vc(l,1,u),Pr(l,u))}function Nn(l,u,m){if(l.tag===3)RA(l,l,m);else for(;u!==null;){if(u.tag===3){RA(u,l,m);break}else if(u.tag===1){var w=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(mi===null||!mi.has(w))){l=ll(m,l),l=Q_(u,l,1),u=pi(u,l,1),l=gr(),u!==null&&(Vc(u,1,l),Pr(u,l));break}}u=u.return}}function n7(l,u,m){var w=l.pingCache;w!==null&&w.delete(u),u=gr(),l.pingedLanes|=l.suspendedLanes&m,Xn===l&&(rr&m)===m&&(Bn===4||Bn===3&&(rr&130023424)===rr&&500>he()-xy?to(l,0):yy|=m),Pr(l,u)}function TA(l,u){u===0&&((l.mode&1)===0?u=1:(u=wf,wf<<=1,(wf&130023424)===0&&(wf=4194304)));var m=gr();l=Cs(l,u),l!==null&&(Vc(l,u,m),Pr(l,m))}function r7(l){var u=l.memoizedState,m=0;u!==null&&(m=u.retryLane),TA(l,m)}function a7(l,u){var m=0;switch(l.tag){case 13:var w=l.stateNode,C=l.memoizedState;C!==null&&(m=C.retryLane);break;case 19:w=l.stateNode;break;default:throw Error(n(314))}w!==null&&w.delete(u),TA(l,m)}var IA;IA=function(l,u,m){if(l!==null)if(l.memoizedProps!==u.pendingProps||Cr.current)Ar=!0;else{if((l.lanes&m)===0&&(u.flags&128)===0)return Ar=!1,V6(l,u,m);Ar=(l.flags&131072)!==0}else Ar=!1,vn&&(u.flags&1048576)!==0&&p_(u,qf,u.index);switch(u.lanes=0,u.tag){case 2:var w=u.type;ap(l,u),l=u.pendingProps;var C=el(u,lr.current);il(u,m),C=Xg(null,u,w,l,C,m);var E=Qg();return u.flags|=1,typeof C=="object"&&C!==null&&typeof C.render=="function"&&C.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,_r(w)?(E=!0,Bf(u)):E=!1,u.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,qg(u),C.updater=np,u.stateNode=C,C._reactInternals=u,ry(u,w,l,m),u=oy(null,u,w,!0,E,m)):(u.tag=0,vn&&E&&Tg(u),vr(null,u,C,m),u=u.child),u;case 16:w=u.elementType;e:{switch(ap(l,u),l=u.pendingProps,C=w._init,w=C(w._payload),u.type=w,C=u.tag=i7(w),l=Ea(w,l),C){case 0:u=iy(null,u,w,l,m);break e;case 1:u=iA(null,u,w,l,m);break e;case 11:u=tA(null,u,w,l,m);break e;case 14:u=nA(null,u,w,Ea(w.type,l),m);break e}throw Error(n(306,w,""))}return u;case 0:return w=u.type,C=u.pendingProps,C=u.elementType===w?C:Ea(w,C),iy(l,u,w,C,m);case 1:return w=u.type,C=u.pendingProps,C=u.elementType===w?C:Ea(w,C),iA(l,u,w,C,m);case 3:e:{if(oA(u),l===null)throw Error(n(387));w=u.pendingProps,E=u.memoizedState,C=E.element,j_(l,u),Yf(u,w,null,m);var I=u.memoizedState;if(w=I.element,E.isDehydrated)if(E={element:w,isDehydrated:!1,cache:I.cache,pendingSuspenseBoundaries:I.pendingSuspenseBoundaries,transitions:I.transitions},u.updateQueue.baseState=E,u.memoizedState=E,u.flags&256){C=ll(Error(n(423)),u),u=lA(l,u,w,m,C);break e}else if(w!==C){C=ll(Error(n(424)),u),u=lA(l,u,w,m,C);break e}else for(zr=li(u.stateNode.containerInfo.firstChild),Br=u,vn=!0,Aa=null,m=b_(u,null,w,m),u.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(rl(),w===C){u=As(l,u,m);break e}vr(l,u,w,m)}u=u.child}return u;case 5:return C_(u),l===null&&$g(u),w=u.type,C=u.pendingProps,E=l!==null?l.memoizedProps:null,I=C.children,Ag(w,C)?I=null:E!==null&&Ag(w,E)&&(u.flags|=32),sA(l,u),vr(l,u,I,m),u.child;case 6:return l===null&&$g(u),null;case 13:return cA(l,u,m);case 4:return Wg(u,u.stateNode.containerInfo),w=u.pendingProps,l===null?u.child=al(u,null,w,m):vr(l,u,w,m),u.child;case 11:return w=u.type,C=u.pendingProps,C=u.elementType===w?C:Ea(w,C),tA(l,u,w,C,m);case 7:return vr(l,u,u.pendingProps,m),u.child;case 8:return vr(l,u,u.pendingProps.children,m),u.child;case 12:return vr(l,u,u.pendingProps.children,m),u.child;case 10:e:{if(w=u.type._context,C=u.pendingProps,E=u.memoizedProps,I=C.value,nn(Hf,w._currentValue),w._currentValue=I,E!==null)if(_a(E.value,I)){if(E.children===C.children&&!Cr.current){u=As(l,u,m);break e}}else for(E=u.child,E!==null&&(E.return=u);E!==null;){var Y=E.dependencies;if(Y!==null){I=E.child;for(var ee=Y.firstContext;ee!==null;){if(ee.context===w){if(E.tag===1){ee=_s(-1,m&-m),ee.tag=2;var me=E.updateQueue;if(me!==null){me=me.shared;var Ce=me.pending;Ce===null?ee.next=ee:(ee.next=Ce.next,Ce.next=ee),me.pending=ee}}E.lanes|=m,ee=E.alternate,ee!==null&&(ee.lanes|=m),zg(E.return,m,u),Y.lanes|=m;break}ee=ee.next}}else if(E.tag===10)I=E.type===u.type?null:E.child;else if(E.tag===18){if(I=E.return,I===null)throw Error(n(341));I.lanes|=m,Y=I.alternate,Y!==null&&(Y.lanes|=m),zg(I,m,u),I=E.sibling}else I=E.child;if(I!==null)I.return=E;else for(I=E;I!==null;){if(I===u){I=null;break}if(E=I.sibling,E!==null){E.return=I.return,I=E;break}I=I.return}E=I}vr(l,u,C.children,m),u=u.child}return u;case 9:return C=u.type,w=u.pendingProps.children,il(u,m),C=sa(C),w=w(C),u.flags|=1,vr(l,u,w,m),u.child;case 14:return w=u.type,C=Ea(w,u.pendingProps),C=Ea(w.type,C),nA(l,u,w,C,m);case 15:return rA(l,u,u.type,u.pendingProps,m);case 17:return w=u.type,C=u.pendingProps,C=u.elementType===w?C:Ea(w,C),ap(l,u),u.tag=1,_r(w)?(l=!0,Bf(u)):l=!1,il(u,m),G_(u,w,C),ry(u,w,C,m),oy(null,u,w,!0,l,m);case 19:return dA(l,u,m);case 22:return aA(l,u,m)}throw Error(n(156,u.tag))};function MA(l,u){return xn(l,u)}function s7(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 la(l,u,m,w){return new s7(l,u,m,w)}function Ay(l){return l=l.prototype,!(!l||!l.isReactComponent)}function i7(l){if(typeof l=="function")return Ay(l)?1:0;if(l!=null){if(l=l.$$typeof,l===D)return 11;if(l===W)return 14}return 2}function xi(l,u){var m=l.alternate;return m===null?(m=la(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 mp(l,u,m,w,C,E){var I=2;if(w=l,typeof l=="function")Ay(l)&&(I=1);else if(typeof l=="string")I=5;else e:switch(l){case k:return ro(m.children,C,E,u);case R:I=8,C|=8;break;case M:return l=la(12,m,u,C|2),l.elementType=M,l.lanes=E,l;case G:return l=la(13,m,u,C),l.elementType=G,l.lanes=E,l;case U:return l=la(19,m,u,C),l.elementType=U,l.lanes=E,l;case J:return vp(m,C,E,u);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case z:I=10;break e;case B:I=9;break e;case D:I=11;break e;case W:I=14;break e;case X:I=16,w=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return u=la(I,m,u,C),u.elementType=l,u.type=w,u.lanes=E,u}function ro(l,u,m,w){return l=la(7,l,w,u),l.lanes=m,l}function vp(l,u,m,w){return l=la(22,l,w,u),l.elementType=J,l.lanes=m,l.stateNode={isHidden:!1},l}function Ey(l,u,m){return l=la(6,l,null,u),l.lanes=m,l}function Py(l,u,m){return u=la(4,l.children!==null?l.children:[],l.key,u),u.lanes=m,u.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},u}function o7(l,u,m,w,C){this.tag=u,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ng(0),this.expirationTimes=ng(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ng(0),this.identifierPrefix=w,this.onRecoverableError=C,this.mutableSourceEagerHydrationData=null}function Oy(l,u,m,w,C,E,I,Y,ee){return l=new o7(l,u,m,Y,ee),u===1?(u=1,E===!0&&(u|=8)):u=0,E=la(3,null,null,u),l.current=E,E.stateNode=l,E.memoizedState={element:w,isDehydrated:m,cache:null,transitions:null,pendingSuspenseBoundaries:null},qg(E),l}function l7(l,u,m){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:O,key:w==null?null:""+w,children:l,containerInfo:u,implementation:m}}function $A(l){if(!l)return ui;l=l._reactInternals;e:{if(Fe(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(_r(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(_r(m))return u_(l,m,u)}return u}function DA(l,u,m,w,C,E,I,Y,ee){return l=Oy(m,w,!0,l,C,E,I,Y,ee),l.context=$A(null),m=l.current,w=gr(),C=gi(m),E=_s(w,C),E.callback=u??null,pi(m,E,C),l.current.lanes=C,Vc(l,C,w),Pr(l,w),l}function gp(l,u,m,w){var C=u.current,E=gr(),I=gi(C);return m=$A(m),u.context===null?u.context=m:u.pendingContext=m,u=_s(E,I),u.payload={element:l},w=w===void 0?null:w,w!==null&&(u.callback=w),l=pi(C,u,I),l!==null&&(ka(l,C,I,E),Gf(l,C,I)),I}function yp(l){return l=l.current,l.child?(l.child.tag===5,l.child.stateNode):null}function LA(l,u){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var m=l.retryLane;l.retryLane=m!==0&&m<u?m:u}}function ky(l,u){LA(l,u),(l=l.alternate)&&LA(l,u)}function c7(){return null}var FA=typeof reportError=="function"?reportError:function(l){console.error(l)};function Ry(l){this._internalRoot=l}xp.prototype.render=Ry.prototype.render=function(l){var u=this._internalRoot;if(u===null)throw Error(n(409));gp(l,u,null,null)},xp.prototype.unmount=Ry.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var u=l.containerInfo;eo(function(){gp(null,l,null,null)}),u[ws]=null}};function xp(l){this._internalRoot=l}xp.prototype.unstable_scheduleHydration=function(l){if(l){var u=jC();l={blockedOn:null,target:l,priority:u};for(var m=0;m<si.length&&u!==0&&u<si[m].priority;m++);si.splice(m,0,l),m===0&&CC(l)}};function Ty(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function bp(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function BA(){}function u7(l,u,m,w,C){if(C){if(typeof w=="function"){var E=w;w=function(){var me=yp(I);E.call(me)}}var I=DA(u,w,l,0,null,!1,!1,"",BA);return l._reactRootContainer=I,l[ws]=I.current,su(l.nodeType===8?l.parentNode:l),eo(),I}for(;C=l.lastChild;)l.removeChild(C);if(typeof w=="function"){var Y=w;w=function(){var me=yp(ee);Y.call(me)}}var ee=Oy(l,0,!1,null,null,!1,!1,"",BA);return l._reactRootContainer=ee,l[ws]=ee.current,su(l.nodeType===8?l.parentNode:l),eo(function(){gp(u,ee,m,w)}),ee}function wp(l,u,m,w,C){var E=m._reactRootContainer;if(E){var I=E;if(typeof C=="function"){var Y=C;C=function(){var ee=yp(I);Y.call(ee)}}gp(u,I,l,C)}else I=u7(m,u,l,C,w);return yp(I)}bC=function(l){switch(l.tag){case 3:var u=l.stateNode;if(u.current.memoizedState.isDehydrated){var m=Wc(u.pendingLanes);m!==0&&(rg(u,m|1),Pr(u,he()),(Rt&6)===0&&(dl=he()+500,di()))}break;case 13:eo(function(){var w=Cs(l,1);if(w!==null){var C=gr();ka(w,l,1,C)}}),ky(l,1)}},ag=function(l){if(l.tag===13){var u=Cs(l,134217728);if(u!==null){var m=gr();ka(u,l,134217728,m)}ky(l,134217728)}},wC=function(l){if(l.tag===13){var u=gi(l),m=Cs(l,u);if(m!==null){var w=gr();ka(m,l,u,w)}ky(l,u)}},jC=function(){return qt},SC=function(l,u){var m=qt;try{return qt=l,u()}finally{qt=m}},$n=function(l,u,m){switch(u){case"input":if(Ee(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 C=Lf(w);if(!C)throw Error(n(90));re(w),Ee(w,C)}}}break;case"textarea":Ot(l,m);break;case"select":u=m.value,u!=null&&we(l,!!m.multiple,u,!1)}},ot=Ny,gt=eo;var d7={usingClientEntryPoint:!1,Events:[lu,Jo,Lf,ce,Te,Ny]},ju={findFiberByHostInstance:Hi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},f7={bundleType:ju.bundleType,version:ju.version,rendererPackageName:ju.rendererPackageName,rendererConfig:ju.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:P.ReactCurrentDispatcher,findHostInstanceByFiber:function(l){return l=yn(l),l===null?null:l.stateNode},findFiberByHostInstance:ju.findFiberByHostInstance||c7,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var jp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!jp.isDisabled&&jp.supportsFiber)try{Gt=jp.inject(f7),Ln=jp}catch{}}return Or.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=d7,Or.createPortal=function(l,u){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ty(u))throw Error(n(200));return l7(l,u,null,m)},Or.createRoot=function(l,u){if(!Ty(l))throw Error(n(299));var m=!1,w="",C=FA;return u!=null&&(u.unstable_strictMode===!0&&(m=!0),u.identifierPrefix!==void 0&&(w=u.identifierPrefix),u.onRecoverableError!==void 0&&(C=u.onRecoverableError)),u=Oy(l,1,!1,null,null,m,!1,w,C),l[ws]=u.current,su(l.nodeType===8?l.parentNode:l),new Ry(u)},Or.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=yn(u),l=l===null?null:l.stateNode,l},Or.flushSync=function(l){return eo(l)},Or.hydrate=function(l,u,m){if(!bp(u))throw Error(n(200));return wp(null,l,u,!0,m)},Or.hydrateRoot=function(l,u,m){if(!Ty(l))throw Error(n(405));var w=m!=null&&m.hydratedSources||null,C=!1,E="",I=FA;if(m!=null&&(m.unstable_strictMode===!0&&(C=!0),m.identifierPrefix!==void 0&&(E=m.identifierPrefix),m.onRecoverableError!==void 0&&(I=m.onRecoverableError)),u=DA(u,null,l,1,m??null,C,!1,E,I),l[ws]=u.current,su(l),w)for(l=0;l<w.length;l++)m=w[l],C=m._getVersion,C=C(m._source),u.mutableSourceEagerHydrationData==null?u.mutableSourceEagerHydrationData=[m,C]:u.mutableSourceEagerHydrationData.push(m,C);return new xp(u)},Or.render=function(l,u,m){if(!bp(u))throw Error(n(200));return wp(null,l,u,!1,m)},Or.unmountComponentAtNode=function(l){if(!bp(l))throw Error(n(40));return l._reactRootContainer?(eo(function(){wp(null,null,l,!1,function(){l._reactRootContainer=null,l[ws]=null})}),!0):!1},Or.unstable_batchedUpdates=Ny,Or.unstable_renderSubtreeIntoContainer=function(l,u,m,w){if(!bp(m))throw Error(n(200));if(l==null||l._reactInternals===void 0)throw Error(n(38));return wp(l,u,m,!1,w)},Or.version="18.3.1-next-f1338f8080-20240426",Or}var GA;function CM(){if(GA)return $y.exports;GA=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(),$y.exports=b7(),$y.exports}var YA;function w7(){if(YA)return Np;YA=1;var e=CM();return Np.createRoot=e.createRoot,Np.hydrateRoot=e.hydrateRoot,Np}var j7=w7(),v=vS();const q=Vt(v),Sm=h7({__proto__:null,default:q},[v]),S7=1,N7=1e6;let Fy=0;function C7(){return Fy=(Fy+1)%Number.MAX_SAFE_INTEGER,Fy.toString()}const By=new Map,XA=e=>{if(By.has(e))return;const t=setTimeout(()=>{By.delete(e),Wu({type:"REMOVE_TOAST",toastId:e})},N7);By.set(e,t)},_7=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,S7)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?XA(n):e.toasts.forEach(r=>{XA(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)}}},Yp=[];let Xp={toasts:[]};function Wu(e){Xp=_7(Xp,e),Yp.forEach(t=>{t(Xp)})}function Oe({...e}){const t=C7(),n=a=>Wu({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>Wu({type:"DISMISS_TOAST",toastId:t});return Wu({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}}function A7(){const[e,t]=v.useState(Xp);return v.useEffect(()=>(Yp.push(t),()=>{const n=Yp.indexOf(t);n>-1&&Yp.splice(n,1)}),[e]),{...e,toast:Oe,dismiss:n=>Wu({type:"DISMISS_TOAST",toastId:n})}}var wc=CM();const _M=Vt(wc);function Pe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),n===!1||!a.defaultPrevented)return t?.(a)}}function QA(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function jr(...e){return t=>{let n=!1;const r=e.map(a=>{const i=QA(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():QA(e[a],null)}}}}function ft(...e){return v.useCallback(jr(...e),e)}function E7(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 ir(e,t=[]){let n=[];function r(i,o){const c=v.createContext(o),d=n.length;n=[...n,o];const f=p=>{const{scope:y,children:g,...j}=p,b=y?.[e]?.[d]||c,x=v.useMemo(()=>j,Object.values(j));return s.jsx(b.Provider,{value:x,children:g})};f.displayName=i+"Provider";function h(p,y){const g=y?.[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,P7(a,...t)]}function P7(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=r.reduce((c,{useScope:d,scopeName:f})=>{const p=d(i)[`__scope${f}`];return{...c,...p}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function JA(e){const t=O7(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(R7);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function O7(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=I7(a),c=T7(i,a.props);return a.type!==v.Fragment&&(c.ref=r?jr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var k7=Symbol("radix.slottable");function R7(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===k7}function T7(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function I7(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Hd(e){const t=e+"CollectionProvider",[n,r]=ir(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=b=>{const{scope:x,children:S}=b,N=q.useRef(null),_=q.useRef(new Map).current;return s.jsx(a,{scope:x,itemMap:_,collectionRef:N,children:S})};o.displayName=t;const c=e+"CollectionSlot",d=JA(c),f=q.forwardRef((b,x)=>{const{scope:S,children:N}=b,_=i(c,S),P=ft(x,_.collectionRef);return s.jsx(d,{ref:P,children:N})});f.displayName=c;const h=e+"CollectionItemSlot",p="data-radix-collection-item",y=JA(h),g=q.forwardRef((b,x)=>{const{scope:S,children:N,..._}=b,P=q.useRef(null),A=ft(x,P),O=i(h,S);return q.useEffect(()=>(O.itemMap.set(P,{ref:P,..._}),()=>{O.itemMap.delete(P)})),s.jsx(y,{[p]:"",ref:A,children:N})});g.displayName=h;function j(b){const x=i(e+"CollectionConsumer",b);return q.useCallback(()=>{const N=x.collectionRef.current;if(!N)return[];const _=Array.from(N.querySelectorAll(`[${p}]`));return Array.from(x.itemMap.values()).sort((O,k)=>_.indexOf(O.ref.current)-_.indexOf(k.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:o,Slot:f,ItemSlot:g},j,r]}function M7(e){const t=$7(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(L7);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function $7(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=B7(a),c=F7(i,a.props);return a.type!==v.Fragment&&(c.ref=r?jr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var D7=Symbol("radix.slottable");function L7(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===D7}function F7(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function B7(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var z7=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Be=z7.reduce((e,t)=>{const n=M7(`Primitive.${t}`),r=v.forwardRef((a,i)=>{const{asChild:o,...c}=a,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function gS(e,t){e&&wc.flushSync(()=>e.dispatchEvent(t))}function En(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>t.current?.(...n),[])}function U7(e,t=globalThis?.document){const n=En(e);v.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var q7="DismissableLayer",u1="dismissableLayer.update",W7="dismissableLayer.pointerDownOutside",V7="dismissableLayer.focusOutside",ZA,AM=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),To=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:c,...d}=e,f=v.useContext(AM),[h,p]=v.useState(null),y=h?.ownerDocument??globalThis?.document,[,g]=v.useState({}),j=ft(t,k=>p(k)),b=Array.from(f.layers),[x]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),S=b.indexOf(x),N=h?b.indexOf(h):-1,_=f.layersWithOutsidePointerEventsDisabled.size>0,P=N>=S,A=K7(k=>{const R=k.target,M=[...f.branches].some(z=>z.contains(R));!P||M||(a?.(k),o?.(k),k.defaultPrevented||c?.())},y),O=G7(k=>{const R=k.target;[...f.branches].some(z=>z.contains(R))||(i?.(k),o?.(k),k.defaultPrevented||c?.())},y);return U7(k=>{N===f.layers.size-1&&(r?.(k),!k.defaultPrevented&&c&&(k.preventDefault(),c()))},y),v.useEffect(()=>{if(h)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(ZA=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),eE(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=ZA)}},[h,y,n,f]),v.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),eE())},[h,f]),v.useEffect(()=>{const k=()=>g({});return document.addEventListener(u1,k),()=>document.removeEventListener(u1,k)},[]),s.jsx(Be.div,{...d,ref:j,style:{pointerEvents:_?P?"auto":"none":void 0,...e.style},onFocusCapture:Pe(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Pe(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Pe(e.onPointerDownCapture,A.onPointerDownCapture)})});To.displayName=q7;var H7="DismissableLayerBranch",EM=v.forwardRef((e,t)=>{const n=v.useContext(AM),r=v.useRef(null),a=ft(t,r);return v.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),s.jsx(Be.div,{...e,ref:a})});EM.displayName=H7;function K7(e,t=globalThis?.document){const n=En(e),r=v.useRef(!1),a=v.useRef(()=>{});return v.useEffect(()=>{const i=c=>{if(c.target&&!r.current){let d=function(){PM(W7,n,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=d,t.addEventListener("click",a.current,{once:!0})):d()}else t.removeEventListener("click",a.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function G7(e,t=globalThis?.document){const n=En(e),r=v.useRef(!1);return v.useEffect(()=>{const a=i=>{i.target&&!r.current&&PM(V7,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function eE(){const e=new CustomEvent(u1);document.dispatchEvent(e)}function PM(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?gS(a,i):a.dispatchEvent(i)}var Y7=To,X7=EM,Hn=globalThis?.document?v.useLayoutEffect:()=>{},Q7="Portal",jc=v.forwardRef((e,t)=>{const{container:n,...r}=e,[a,i]=v.useState(!1);Hn(()=>i(!0),[]);const o=n||a&&globalThis?.document?.body;return o?_M.createPortal(s.jsx(Be.div,{...r,ref:t}),o):null});jc.displayName=Q7;function J7(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var Kn=e=>{const{present:t,children:n}=e,r=Z7(t),a=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),i=ft(r.ref,eU(a));return typeof n=="function"||r.isPresent?v.cloneElement(a,{ref:i}):null};Kn.displayName="Presence";function Z7(e){const[t,n]=v.useState(),r=v.useRef(null),a=v.useRef(e),i=v.useRef("none"),o=e?"mounted":"unmounted",[c,d]=J7(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const f=Cp(r.current);i.current=c==="mounted"?f:"none"},[c]),Hn(()=>{const f=r.current,h=a.current;if(h!==e){const y=i.current,g=Cp(f);e?d("MOUNT"):g==="none"||f?.display==="none"?d("UNMOUNT"):d(h&&y!==g?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,d]),Hn(()=>{if(t){let f;const h=t.ownerDocument.defaultView??window,p=g=>{const b=Cp(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&b&&(d("ANIMATION_END"),!a.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",f=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},y=g=>{g.target===t&&(i.current=Cp(r.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{h.clearTimeout(f),t.removeEventListener("animationstart",y),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 Cp(e){return e?.animationName||"none"}function eU(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var tU=Sm[" useInsertionEffect ".trim().toString()]||Hn;function na({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,o]=nU({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:a;{const h=v.useRef(e!==void 0);v.useEffect(()=>{const p=h.current;p!==c&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=c},[c,r])}const f=v.useCallback(h=>{if(c){const p=rU(h)?h(e):h;p!==e&&o.current?.(p)}else i(h)},[c,e,i,o]);return[d,f]}function nU({defaultProp:e,onChange:t}){const[n,r]=v.useState(e),a=v.useRef(n),i=v.useRef(t);return tU(()=>{i.current=t},[t]),v.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,r,i]}function rU(e){return typeof e=="function"}var OM=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),aU="VisuallyHidden",Nm=v.forwardRef((e,t)=>s.jsx(Be.span,{...e,ref:t,style:{...OM,...e.style}}));Nm.displayName=aU;var sU=Nm,yS="ToastProvider",[xS,iU,oU]=Hd("Toast"),[kM]=ir("Toast",[oU]),[lU,Cm]=kM(yS),RM=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),y=v.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${yS}\`. Expected non-empty \`string\`.`),s.jsx(xS.Provider,{scope:t,children:s.jsx(lU,{scope:t,label:n,duration:r,swipeDirection:a,swipeThreshold:i,toastCount:f,viewport:c,onViewportChange:d,onToastAdd:v.useCallback(()=>h(g=>g+1),[]),onToastRemove:v.useCallback(()=>h(g=>g-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:y,children:o})})};RM.displayName=yS;var TM="ToastViewport",cU=["F8"],d1="toast.viewportPause",f1="toast.viewportResume",IM=v.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=cU,label:a="Notifications ({hotkey})",...i}=e,o=Cm(TM,n),c=iU(n),d=v.useRef(null),f=v.useRef(null),h=v.useRef(null),p=v.useRef(null),y=ft(t,p,o.onViewportChange),g=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=o.toastCount>0;v.useEffect(()=>{const x=S=>{r.length!==0&&r.every(_=>S[_]||S.code===_)&&p.current?.focus()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]),v.useEffect(()=>{const x=d.current,S=p.current;if(j&&x&&S){const N=()=>{if(!o.isClosePausedRef.current){const O=new CustomEvent(d1);S.dispatchEvent(O),o.isClosePausedRef.current=!0}},_=()=>{if(o.isClosePausedRef.current){const O=new CustomEvent(f1);S.dispatchEvent(O),o.isClosePausedRef.current=!1}},P=O=>{!x.contains(O.relatedTarget)&&_()},A=()=>{x.contains(document.activeElement)||_()};return x.addEventListener("focusin",N),x.addEventListener("focusout",P),x.addEventListener("pointermove",N),x.addEventListener("pointerleave",A),window.addEventListener("blur",N),window.addEventListener("focus",_),()=>{x.removeEventListener("focusin",N),x.removeEventListener("focusout",P),x.removeEventListener("pointermove",N),x.removeEventListener("pointerleave",A),window.removeEventListener("blur",N),window.removeEventListener("focus",_)}}},[j,o.isClosePausedRef]);const b=v.useCallback(({tabbingDirection:x})=>{const N=c().map(_=>{const P=_.ref.current,A=[P,...jU(P)];return x==="forwards"?A:A.reverse()});return(x==="forwards"?N.reverse():N).flat()},[c]);return v.useEffect(()=>{const x=p.current;if(x){const S=N=>{const _=N.altKey||N.ctrlKey||N.metaKey;if(N.key==="Tab"&&!_){const A=document.activeElement,O=N.shiftKey;if(N.target===x&&O){f.current?.focus();return}const M=b({tabbingDirection:O?"backwards":"forwards"}),z=M.findIndex(B=>B===A);zy(M.slice(z+1))?N.preventDefault():O?f.current?.focus():h.current?.focus()}};return x.addEventListener("keydown",S),()=>x.removeEventListener("keydown",S)}},[c,b]),s.jsxs(X7,{ref:d,role:"region","aria-label":a.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:j?void 0:"none"},children:[j&&s.jsx(p1,{ref:f,onFocusFromOutsideViewport:()=>{const x=b({tabbingDirection:"forwards"});zy(x)}}),s.jsx(xS.Slot,{scope:n,children:s.jsx(Be.ol,{tabIndex:-1,...i,ref:y})}),j&&s.jsx(p1,{ref:h,onFocusFromOutsideViewport:()=>{const x=b({tabbingDirection:"backwards"});zy(x)}})]})});IM.displayName=TM;var MM="ToastFocusProxy",p1=v.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,i=Cm(MM,n);return s.jsx(Nm,{tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:o=>{const c=o.relatedTarget;!i.viewport?.contains(c)&&r()}})});p1.displayName=MM;var Kd="Toast",uU="toast.swipeStart",dU="toast.swipeMove",fU="toast.swipeCancel",pU="toast.swipeEnd",$M=v.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:i,...o}=e,[c,d]=na({prop:r,defaultProp:a??!0,onChange:i,caller:Kd});return s.jsx(Kn,{present:n||c,children:s.jsx(vU,{open:c,...o,ref:t,onClose:()=>d(!1),onPause:En(e.onPause),onResume:En(e.onResume),onSwipeStart:Pe(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Pe(e.onSwipeMove,f=>{const{x:h,y:p}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","move"),f.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${h}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${p}px`)}),onSwipeCancel:Pe(e.onSwipeCancel,f=>{f.currentTarget.setAttribute("data-swipe","cancel"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Pe(e.onSwipeEnd,f=>{const{x:h,y:p}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","end"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${h}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${p}px`),d(!1)})})})});$M.displayName=Kd;var[hU,mU]=kM(Kd,{onClose(){}}),vU=v.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:a,open:i,onClose:o,onEscapeKeyDown:c,onPause:d,onResume:f,onSwipeStart:h,onSwipeMove:p,onSwipeCancel:y,onSwipeEnd:g,...j}=e,b=Cm(Kd,n),[x,S]=v.useState(null),N=ft(t,U=>S(U)),_=v.useRef(null),P=v.useRef(null),A=a||b.duration,O=v.useRef(0),k=v.useRef(A),R=v.useRef(0),{onToastAdd:M,onToastRemove:z}=b,B=En(()=>{x?.contains(document.activeElement)&&b.viewport?.focus(),o()}),D=v.useCallback(U=>{!U||U===1/0||(window.clearTimeout(R.current),O.current=new Date().getTime(),R.current=window.setTimeout(B,U))},[B]);v.useEffect(()=>{const U=b.viewport;if(U){const W=()=>{D(k.current),f?.()},X=()=>{const J=new Date().getTime()-O.current;k.current=k.current-J,window.clearTimeout(R.current),d?.()};return U.addEventListener(d1,X),U.addEventListener(f1,W),()=>{U.removeEventListener(d1,X),U.removeEventListener(f1,W)}}},[b.viewport,A,d,f,D]),v.useEffect(()=>{i&&!b.isClosePausedRef.current&&D(A)},[i,A,b.isClosePausedRef,D]),v.useEffect(()=>(M(),()=>z()),[M,z]);const G=v.useMemo(()=>x?qM(x):null,[x]);return b.viewport?s.jsxs(s.Fragment,{children:[G&&s.jsx(gU,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:G}),s.jsx(hU,{scope:n,onClose:B,children:wc.createPortal(s.jsx(xS.ItemSlot,{scope:n,children:s.jsx(Y7,{asChild:!0,onEscapeKeyDown:Pe(c,()=>{b.isFocusedToastEscapeKeyDownRef.current||B(),b.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx(Be.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":b.swipeDirection,...j,ref:N,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Pe(e.onKeyDown,U=>{U.key==="Escape"&&(c?.(U.nativeEvent),U.nativeEvent.defaultPrevented||(b.isFocusedToastEscapeKeyDownRef.current=!0,B()))}),onPointerDown:Pe(e.onPointerDown,U=>{U.button===0&&(_.current={x:U.clientX,y:U.clientY})}),onPointerMove:Pe(e.onPointerMove,U=>{if(!_.current)return;const W=U.clientX-_.current.x,X=U.clientY-_.current.y,J=!!P.current,T=["left","right"].includes(b.swipeDirection),L=["left","up"].includes(b.swipeDirection)?Math.min:Math.max,Q=T?L(0,W):0,F=T?0:L(0,X),$=U.pointerType==="touch"?10:2,Z={x:Q,y:F},ae={originalEvent:U,delta:Z};J?(P.current=Z,_p(dU,p,ae,{discrete:!1})):tE(Z,b.swipeDirection,$)?(P.current=Z,_p(uU,h,ae,{discrete:!1}),U.target.setPointerCapture(U.pointerId)):(Math.abs(W)>$||Math.abs(X)>$)&&(_.current=null)}),onPointerUp:Pe(e.onPointerUp,U=>{const W=P.current,X=U.target;if(X.hasPointerCapture(U.pointerId)&&X.releasePointerCapture(U.pointerId),P.current=null,_.current=null,W){const J=U.currentTarget,T={originalEvent:U,delta:W};tE(W,b.swipeDirection,b.swipeThreshold)?_p(pU,g,T,{discrete:!0}):_p(fU,y,T,{discrete:!0}),J.addEventListener("click",L=>L.preventDefault(),{once:!0})}})})})}),b.viewport)})]}):null}),gU=e=>{const{__scopeToast:t,children:n,...r}=e,a=Cm(Kd,t),[i,o]=v.useState(!1),[c,d]=v.useState(!1);return bU(()=>o(!0)),v.useEffect(()=>{const f=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(f)},[]),c?null:s.jsx(jc,{asChild:!0,children:s.jsx(Nm,{...r,children:i&&s.jsxs(s.Fragment,{children:[a.label," ",n]})})})},yU="ToastTitle",DM=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(Be.div,{...r,ref:t})});DM.displayName=yU;var xU="ToastDescription",LM=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(Be.div,{...r,ref:t})});LM.displayName=xU;var FM="ToastAction",BM=v.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?s.jsx(UM,{altText:n,asChild:!0,children:s.jsx(bS,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${FM}\`. Expected non-empty \`string\`.`),null)});BM.displayName=FM;var zM="ToastClose",bS=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=mU(zM,n);return s.jsx(UM,{asChild:!0,children:s.jsx(Be.button,{type:"button",...r,ref:t,onClick:Pe(e.onClick,a.onClose)})})});bS.displayName=zM;var UM=v.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...a}=e;return s.jsx(Be.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function qM(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),wU(r)){const a=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!a)if(i){const o=r.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...qM(r))}}),t}function _p(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?gS(a,i):a.dispatchEvent(i)}var tE=(e,t,n=0)=>{const r=Math.abs(e.x),a=Math.abs(e.y),i=r>a;return t==="left"||t==="right"?i&&r>n:!i&&a>n};function bU(e=()=>{}){const t=En(e);Hn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function wU(e){return e.nodeType===e.ELEMENT_NODE}function jU(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function zy(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var SU=RM,WM=IM,VM=$M,HM=DM,KM=LM,GM=BM,YM=bS;function XM(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=XM(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function wt(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=XM(e))&&(r&&(r+=" "),r+=t);return r}const nE=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,rE=wt,Io=(e,t)=>n=>{var r;if(t?.variants==null)return rE(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 y=nE(h)||nE(p);return a[f][y]}),c=n&&Object.entries(n).reduce((f,h)=>{let[p,y]=h;return y===void 0||(f[p]=y),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,h)=>{let{class:p,className:y,...g}=h;return Object.entries(g).every(j=>{let[b,x]=j;return Array.isArray(x)?x.includes({...i,...c}[b]):{...i,...c}[b]===x})?[...f,p,y]:f},[]);return rE(e,o,d,n?.class,n?.className)};const NU=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),QM=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var CU={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const _U=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:o,...c},d)=>v.createElement("svg",{ref:d,...CU,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:QM("lucide",a),...c},[...o.map(([f,h])=>v.createElement(f,h)),...Array.isArray(i)?i:[i]]));const it=(e,t)=>{const n=v.forwardRef(({className:r,...a},i)=>v.createElement(_U,{ref:i,iconNode:t,className:QM(`lucide-${NU(e)}`,r),...a}));return n.displayName=`${e}`,n};const JM=it("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 AU=it("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 xo=it("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const ha=it("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 ed=it("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 ql=it("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Wt=it("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const ZM=it("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const is=it("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Pl=it("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);const Uy=it("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 Ol=it("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const EU=it("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 Qp=it("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);const PU=it("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const Gd=it("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Ri=it("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 e$=it("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 ga=it("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 _m=it("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=it("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);const OU=it("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 t$=it("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 aE=it("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 n$=it("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 wS=it("GitCompare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);const kU=it("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 h1=it("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 r$=it("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);const RU=it("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 sr=it("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const a$=it("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]);const TU=it("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 s$=it("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 sh=it("NotepadText",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"16",height:"18",x:"4",y:"4",rx:"2",key:"1u9h20"}],["path",{d:"M8 10h6",key:"3oa6kw"}],["path",{d:"M8 14h8",key:"1fgep2"}],["path",{d:"M8 18h5",key:"17enja"}]]);const IU=it("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);const sE=it("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 iE=it("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 Am=it("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 kl=it("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const us=it("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const i$=it("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 xa=it("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);const MU=it("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);const jS=it("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const o$=it("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 SS=it("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 fa=it("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 Jp=it("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const l$=it("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 ba=it("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 Zp=it("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const $U=it("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 NS=it("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 c$=it("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 Is=it("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 Us=it("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),CS="-",DU=e=>{const t=FU(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const c=o.split(CS);return c[0]===""&&c.length!==1&&c.shift(),u$(c,t)||LU(o)},getConflictingClassGroupIds:(o,c)=>{const d=n[o]||[];return c&&r[o]?[...d,...r[o]]:d}}},u$=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?u$(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(CS);return t.validators.find(({validator:o})=>o(i))?.classGroupId},oE=/^\[(.+)\]$/,LU=e=>{if(oE.test(e)){const t=oE.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},FU=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return zU(Object.entries(e.classGroups),n).forEach(([i,o])=>{m1(o,r,i,t)}),r},m1=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:lE(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(BU(a)){m1(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,o])=>{m1(o,lE(t,i),n,r)})})},lE=(e,t)=>{let n=e;return t.split(CS).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},BU=e=>e.isThemeGetter,zU=(e,t)=>t?e.map(([n,r])=>{const a=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,c])=>[t+o,c])):i);return[n,a]}):e,UU=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return a(i,o),o},set(i,o){n.has(i)?n.set(i,o):a(i,o)}}},d$="!",qU=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,a=t[0],i=t.length,o=c=>{const d=[];let f=0,h=0,p;for(let x=0;x<c.length;x++){let S=c[x];if(f===0){if(S===a&&(r||c.slice(x,x+i)===t)){d.push(c.slice(h,x)),h=x+i;continue}if(S==="/"){p=x;continue}}S==="["?f++:S==="]"&&f--}const y=d.length===0?c:c.substring(h),g=y.startsWith(d$),j=g?y.substring(1):y,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},WU=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},VU=e=>({cache:UU(e.cacheSize),parseClassName:qU(e),...DU(e)}),HU=/\s+/,KU=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],o=e.trim().split(HU);let c="";for(let d=o.length-1;d>=0;d-=1){const f=o[d],{modifiers:h,hasImportantModifier:p,baseClassName:y,maybePostfixModifierPosition:g}=n(f);let j=!!g,b=r(j?y.substring(0,g):y);if(!b){if(!j){c=f+(c.length>0?" "+c:c);continue}if(b=r(y),!b){c=f+(c.length>0?" "+c:c);continue}j=!1}const x=WU(h).join(":"),S=p?x+d$:x,N=S+b;if(i.includes(N))continue;i.push(N);const _=a(b,j);for(let P=0;P<_.length;++P){const A=_[P];i.push(S+A)}c=f+(c.length>0?" "+c:c)}return c};function GU(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=f$(t))&&(r&&(r+=" "),r+=n);return r}const f$=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=f$(e[r]))&&(n&&(n+=" "),n+=t);return n};function YU(e,...t){let n,r,a,i=o;function o(d){const f=t.reduce((h,p)=>p(h),e());return n=VU(f),r=n.cache.get,a=n.cache.set,i=c,c(d)}function c(d){const f=r(d);if(f)return f;const h=KU(d,n);return a(d,h),h}return function(){return i(GU.apply(null,arguments))}}const pn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},p$=/^\[(?:([a-z-]+):)?(.+)\]$/i,XU=/^\d+\/\d+$/,QU=new Set(["px","full","screen"]),JU=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ZU=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,eq=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,tq=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,nq=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ps=e=>Rl(e)||QU.has(e)||XU.test(e),wi=e=>Sc(e,"length",uq),Rl=e=>!!e&&!Number.isNaN(Number(e)),qy=e=>Sc(e,"number",Rl),Nu=e=>!!e&&Number.isInteger(Number(e)),rq=e=>e.endsWith("%")&&Rl(e.slice(0,-1)),St=e=>p$.test(e),ji=e=>JU.test(e),aq=new Set(["length","size","percentage"]),sq=e=>Sc(e,aq,h$),iq=e=>Sc(e,"position",h$),oq=new Set(["image","url"]),lq=e=>Sc(e,oq,fq),cq=e=>Sc(e,"",dq),Cu=()=>!0,Sc=(e,t,n)=>{const r=p$.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},uq=e=>ZU.test(e)&&!eq.test(e),h$=()=>!1,dq=e=>tq.test(e),fq=e=>nq.test(e),pq=()=>{const e=pn("colors"),t=pn("spacing"),n=pn("blur"),r=pn("brightness"),a=pn("borderColor"),i=pn("borderRadius"),o=pn("borderSpacing"),c=pn("borderWidth"),d=pn("contrast"),f=pn("grayscale"),h=pn("hueRotate"),p=pn("invert"),y=pn("gap"),g=pn("gradientColorStops"),j=pn("gradientColorStopPositions"),b=pn("inset"),x=pn("margin"),S=pn("opacity"),N=pn("padding"),_=pn("saturate"),P=pn("scale"),A=pn("sepia"),O=pn("skew"),k=pn("space"),R=pn("translate"),M=()=>["auto","contain","none"],z=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto",St,t],D=()=>[St,t],G=()=>["",Ps,wi],U=()=>["auto",Rl,St],W=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],X=()=>["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"],T=()=>["start","end","center","between","around","evenly","stretch"],L=()=>["","0",St],Q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>[Rl,St];return{cacheSize:500,separator:":",theme:{colors:[Cu],spacing:[Ps,wi],blur:["none","",ji,St],brightness:F(),borderColor:[e],borderRadius:["none","","full",ji,St],borderSpacing:D(),borderWidth:G(),contrast:F(),grayscale:L(),hueRotate:F(),invert:L(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[rq,wi],inset:B(),margin:B(),opacity:F(),padding:D(),saturate:F(),scale:F(),sepia:L(),skew:F(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",St]}],container:["container"],columns:[{columns:[ji]}],"break-after":[{"break-after":Q()}],"break-before":[{"break-before":Q()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...W(),St]}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],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",Nu,St]}],basis:[{basis:B()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",St]}],grow:[{grow:L()}],shrink:[{shrink:L()}],order:[{order:["first","last","none",Nu,St]}],"grid-cols":[{"grid-cols":[Cu]}],"col-start-end":[{col:["auto",{span:["full",Nu,St]},St]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[Cu]}],"row-start-end":[{row:["auto",{span:[Nu,St]},St]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",St]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",St]}],gap:[{gap:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"justify-content":[{justify:["normal",...T()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...T(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...T(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[N]}],px:[{px:[N]}],py:[{py:[N]}],ps:[{ps:[N]}],pe:[{pe:[N]}],pt:[{pt:[N]}],pr:[{pr:[N]}],pb:[{pb:[N]}],pl:[{pl:[N]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",St,t]}],"min-w":[{"min-w":[St,t,"min","max","fit"]}],"max-w":[{"max-w":[St,t,"none","full","min","max","fit","prose",{screen:[ji]},ji]}],h:[{h:[St,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[St,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[St,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[St,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ji,wi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",qy]}],"font-family":[{font:[Cu]}],"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",St]}],"line-clamp":[{"line-clamp":["none",Rl,qy]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ps,St]}],"list-image":[{"list-image":["none",St]}],"list-style-type":[{list:["none","disc","decimal",St]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...X(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ps,wi]}],"underline-offset":[{"underline-offset":["auto",Ps,St]}],"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:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",St]}],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",St]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...W(),iq]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",sq]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},lq]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[j]}],"gradient-via-pos":[{via:[j]}],"gradient-to-pos":[{to:[j]}],"gradient-from":[{from:[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:[...X(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:X()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...X()]}],"outline-offset":[{"outline-offset":[Ps,St]}],"outline-w":[{outline:[Ps,wi]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[Ps,wi]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ji,cq]}],"shadow-color":[{shadow:[Cu]}],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",ji,St]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[p]}],saturate:[{saturate:[_]}],sepia:[{sepia:[A]}],"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":[_]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"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",St]}],duration:[{duration:F()}],ease:[{ease:["linear","in","out","in-out",St]}],delay:[{delay:F()}],animate:[{animate:["none","spin","ping","pulse","bounce",St]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[P]}],"scale-x":[{"scale-x":[P]}],"scale-y":[{"scale-y":[P]}],rotate:[{rotate:[Nu,St]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",St]}],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",St]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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",St]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ps,wi,qy]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},hq=YU(pq);function je(...e){return hq(wt(e))}const mq=SU,m$=v.forwardRef(({className:e,...t},n)=>s.jsx(WM,{ref:n,className:je("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));m$.displayName=WM.displayName;const vq=Io("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"}}),v$=v.forwardRef(({className:e,variant:t,...n},r)=>s.jsx(VM,{ref:r,className:je(vq({variant:t}),e),...n}));v$.displayName=VM.displayName;const gq=v.forwardRef(({className:e,...t},n)=>s.jsx(GM,{ref:n,className:je("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));gq.displayName=GM.displayName;const g$=v.forwardRef(({className:e,...t},n)=>s.jsx(YM,{ref:n,className:je("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:s.jsx(Us,{className:"h-4 w-4"})}));g$.displayName=YM.displayName;const y$=v.forwardRef(({className:e,...t},n)=>s.jsx(HM,{ref:n,className:je("text-sm font-semibold",e),...t}));y$.displayName=HM.displayName;const x$=v.forwardRef(({className:e,...t},n)=>s.jsx(KM,{ref:n,className:je("text-sm opacity-90",e),...t}));x$.displayName=KM.displayName;function yq(){const{toasts:e}=A7();return s.jsxs(mq,{children:[e.map(function({id:t,title:n,description:r,action:a,...i}){return s.jsxs(v$,{...i,children:[s.jsxs("div",{className:"grid gap-1",children:[n&&s.jsx(y$,{children:n}),r&&s.jsx(x$,{children:r})]}),a,s.jsx(g$,{})]},t)}),s.jsx(m$,{})]})}var cE=["light","dark"],xq="(prefers-color-scheme: dark)",bq=v.createContext(void 0),wq={setTheme:e=>{},themes:[]},jq=()=>{var e;return(e=v.useContext(bq))!=null?e:wq};v.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:a,defaultTheme:i,value:o,attrs:c,nonce:d})=>{let f=i==="system",h=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${c.map(j=>`'${j}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,p=a?cE.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",y=(j,b=!1,x=!0)=>{let S=o?o[j]:j,N=b?j+"|| ''":`'${S}'`,_="";return a&&x&&!b&&cE.includes(j)&&(_+=`d.style.colorScheme = '${j}';`),n==="class"?b||S?_+=`c.add(${N})`:_+="null":S&&(_+=`d[s](n,${N})`),_},g=e?`!function(){${h}${y(e)}}()`:r?`!function(){try{${h}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${f})){var t='${xq}',m=window.matchMedia(t);if(m.media!==t||m.matches){${y("dark")}}else{${y("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${y(o?"x[e]":"e",!0)}}${f?"":"else{"+y(i,!1,!1)+"}"}${p}}catch(e){}}()`:`!function(){try{${h}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${y(o?"x[e]":"e",!0)}}else{${y(i,!1,!1)};}${p}}catch(t){}}();`;return v.createElement("script",{nonce:d,dangerouslySetInnerHTML:{__html:g}})});var Sq=e=>{switch(e){case"success":return _q;case"info":return Eq;case"warning":return Aq;case"error":return Pq;default:return null}},Nq=Array(12).fill(0),Cq=({visible:e,className:t})=>q.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},q.createElement("div",{className:"sonner-spinner"},Nq.map((n,r)=>q.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),_q=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},q.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"})),Aq=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},q.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"})),Eq=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},q.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Pq=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},q.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Oq=q.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"},q.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),q.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),kq=()=>{let[e,t]=q.useState(document.hidden);return q.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},v1=1,Rq=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,a=typeof e?.id=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:v1++,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],q.isValidElement(d))a=!1,this.create({id:n,type:"default",message:d});else if(Iq(d)&&!d.ok){a=!1;let f=typeof t.error=="function"?await t.error(`HTTP error! status: ${d.status}`):t.error,h=typeof t.description=="function"?await t.description(`HTTP error! status: ${d.status}`):t.description;this.create({id:n,type:"error",message:f,description:h})}else if(t.success!==void 0){a=!1;let f=typeof t.success=="function"?await t.success(d):t.success,h=typeof t.description=="function"?await t.description(d):t.description;this.create({id:n,type:"success",message:f,description:h})}}).catch(async d=>{if(i=["reject",d],t.error!==void 0){a=!1;let f=typeof t.error=="function"?await t.error(d):t.error,h=typeof t.description=="function"?await t.description(d):t.description;this.create({id:n,type:"error",message:f,description:h})}}).finally(()=>{var d;a&&(this.dismiss(n),n=void 0),(d=t.finally)==null||d.call(t)}),c=()=>new Promise((d,f)=>o.then(()=>i[0]==="reject"?f(i[1]):d(i[1])).catch(f));return typeof n!="string"&&typeof n!="number"?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(e,t)=>{let n=t?.id||v1++;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}},kr=new Rq,Tq=(e,t)=>{let n=t?.id||v1++;return kr.addToast({title:e,...t,id:n}),n},Iq=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Mq=Tq,$q=()=>kr.toasts,Dq=()=>kr.getActiveToasts();Object.assign(Mq,{success:kr.success,info:kr.info,warning:kr.warning,error:kr.error,custom:kr.custom,message:kr.message,promise:kr.promise,dismiss:kr.dismiss,loading:kr.loading},{getHistory:$q,getToasts:Dq});function Lq(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}Lq(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
9
- `);function Ap(e){return e.label!==void 0}var Fq=3,Bq="32px",zq="16px",uE=4e3,Uq=356,qq=14,Wq=20,Vq=200;function Ra(...e){return e.filter(Boolean).join(" ")}function Hq(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var Kq=e=>{var t,n,r,a,i,o,c,d,f,h,p;let{invert:y,toast:g,unstyled:j,interacting:b,setHeights:x,visibleToasts:S,heights:N,index:_,toasts:P,expanded:A,removeToast:O,defaultRichColors:k,closeButton:R,style:M,cancelButtonStyle:z,actionButtonStyle:B,className:D="",descriptionClassName:G="",duration:U,position:W,gap:X,loadingIcon:J,expandByDefault:T,classNames:L,icons:Q,closeButtonAriaLabel:F="Close toast",pauseWhenPageIsHidden:$}=e,[Z,ae]=q.useState(null),[V,ie]=q.useState(null),[ne,de]=q.useState(!1),[oe,ge]=q.useState(!1),[Re,re]=q.useState(!1),[De,Ae]=q.useState(!1),[We,ye]=q.useState(!1),[Ee,le]=q.useState(0),[_e,pe]=q.useState(0),we=q.useRef(g.duration||U||uE),Se=q.useRef(null),Ve=q.useRef(null),Ot=_===0,xe=_+1<=S,ze=g.type,Ge=g.dismissible!==!1,Dt=g.className||"",Lt=g.descriptionClassName||"",$t=q.useMemo(()=>N.findIndex(Te=>Te.toastId===g.id)||0,[N,g.id]),mn=q.useMemo(()=>{var Te;return(Te=g.closeButton)!=null?Te:R},[g.closeButton,R]),_n=q.useMemo(()=>g.duration||U||uE,[g.duration,U]),tr=q.useRef(0),or=q.useRef(0),Ca=q.useRef(0),Mn=q.useRef(null),[Mr,$r]=W.split("-"),hr=q.useMemo(()=>N.reduce((Te,ot,gt)=>gt>=$t?Te:Te+ot.height,0),[N,$t]),$n=kq(),On=g.invert||y,en=ze==="loading";or.current=q.useMemo(()=>$t*X+hr,[$t,hr]),q.useEffect(()=>{we.current=_n},[_n]),q.useEffect(()=>{de(!0)},[]),q.useEffect(()=>{let Te=Ve.current;if(Te){let ot=Te.getBoundingClientRect().height;return pe(ot),x(gt=>[{toastId:g.id,height:ot,position:g.position},...gt]),()=>x(gt=>gt.filter(Ft=>Ft.toastId!==g.id))}},[x,g.id]),q.useLayoutEffect(()=>{if(!ne)return;let Te=Ve.current,ot=Te.style.height;Te.style.height="auto";let gt=Te.getBoundingClientRect().height;Te.style.height=ot,pe(gt),x(Ft=>Ft.find(cn=>cn.toastId===g.id)?Ft.map(cn=>cn.toastId===g.id?{...cn,height:gt}:cn):[{toastId:g.id,height:gt,position:g.position},...Ft])},[ne,g.title,g.description,x,g.id]);let Sn=q.useCallback(()=>{ge(!0),le(or.current),x(Te=>Te.filter(ot=>ot.toastId!==g.id)),setTimeout(()=>{O(g)},Vq)},[g,O,x,or]);q.useEffect(()=>{if(g.promise&&ze==="loading"||g.duration===1/0||g.type==="loading")return;let Te;return A||b||$&&$n?(()=>{if(Ca.current<tr.current){let ot=new Date().getTime()-tr.current;we.current=we.current-ot}Ca.current=new Date().getTime()})():we.current!==1/0&&(tr.current=new Date().getTime(),Te=setTimeout(()=>{var ot;(ot=g.onAutoClose)==null||ot.call(g,g),Sn()},we.current)),()=>clearTimeout(Te)},[A,b,g,ze,$,$n,Sn]),q.useEffect(()=>{g.delete&&Sn()},[Sn,g.delete]);function ce(){var Te,ot,gt;return Q!=null&&Q.loading?q.createElement("div",{className:Ra(L?.loader,(Te=g?.classNames)==null?void 0:Te.loader,"sonner-loader"),"data-visible":ze==="loading"},Q.loading):J?q.createElement("div",{className:Ra(L?.loader,(ot=g?.classNames)==null?void 0:ot.loader,"sonner-loader"),"data-visible":ze==="loading"},J):q.createElement(Cq,{className:Ra(L?.loader,(gt=g?.classNames)==null?void 0:gt.loader),visible:ze==="loading"})}return q.createElement("li",{tabIndex:0,ref:Ve,className:Ra(D,Dt,L?.toast,(t=g?.classNames)==null?void 0:t.toast,L?.default,L?.[ze],(n=g?.classNames)==null?void 0:n[ze]),"data-sonner-toast":"","data-rich-colors":(r=g.richColors)!=null?r:k,"data-styled":!(g.jsx||g.unstyled||j),"data-mounted":ne,"data-promise":!!g.promise,"data-swiped":We,"data-removed":oe,"data-visible":xe,"data-y-position":Mr,"data-x-position":$r,"data-index":_,"data-front":Ot,"data-swiping":Re,"data-dismissible":Ge,"data-type":ze,"data-invert":On,"data-swipe-out":De,"data-swipe-direction":V,"data-expanded":!!(A||T&&ne),style:{"--index":_,"--toasts-before":_,"--z-index":P.length-_,"--offset":`${oe?Ee:or.current}px`,"--initial-height":T?"auto":`${_e}px`,...M,...g.style},onDragEnd:()=>{re(!1),ae(null),Mn.current=null},onPointerDown:Te=>{en||!Ge||(Se.current=new Date,le(or.current),Te.target.setPointerCapture(Te.pointerId),Te.target.tagName!=="BUTTON"&&(re(!0),Mn.current={x:Te.clientX,y:Te.clientY}))},onPointerUp:()=>{var Te,ot,gt,Ft;if(De||!Ge)return;Mn.current=null;let cn=Number(((Te=Ve.current)==null?void 0:Te.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),At=Number(((ot=Ve.current)==null?void 0:ot.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),mr=new Date().getTime()-((gt=Se.current)==null?void 0:gt.getTime()),un=Z==="x"?cn:At,Kt=Math.abs(un)/mr;if(Math.abs(un)>=Wq||Kt>.11){le(or.current),(Ft=g.onDismiss)==null||Ft.call(g,g),ie(Z==="x"?cn>0?"right":"left":At>0?"down":"up"),Sn(),Ae(!0),ye(!1);return}re(!1),ae(null)},onPointerMove:Te=>{var ot,gt,Ft,cn;if(!Mn.current||!Ge||((ot=window.getSelection())==null?void 0:ot.toString().length)>0)return;let At=Te.clientY-Mn.current.y,mr=Te.clientX-Mn.current.x,un=(gt=e.swipeDirections)!=null?gt:Hq(W);!Z&&(Math.abs(mr)>1||Math.abs(At)>1)&&ae(Math.abs(mr)>Math.abs(At)?"x":"y");let Kt={x:0,y:0};Z==="y"?(un.includes("top")||un.includes("bottom"))&&(un.includes("top")&&At<0||un.includes("bottom")&&At>0)&&(Kt.y=At):Z==="x"&&(un.includes("left")||un.includes("right"))&&(un.includes("left")&&mr<0||un.includes("right")&&mr>0)&&(Kt.x=mr),(Math.abs(Kt.x)>0||Math.abs(Kt.y)>0)&&ye(!0),(Ft=Ve.current)==null||Ft.style.setProperty("--swipe-amount-x",`${Kt.x}px`),(cn=Ve.current)==null||cn.style.setProperty("--swipe-amount-y",`${Kt.y}px`)}},mn&&!g.jsx?q.createElement("button",{"aria-label":F,"data-disabled":en,"data-close-button":!0,onClick:en||!Ge?()=>{}:()=>{var Te;Sn(),(Te=g.onDismiss)==null||Te.call(g,g)},className:Ra(L?.closeButton,(a=g?.classNames)==null?void 0:a.closeButton)},(i=Q?.close)!=null?i:Oq):null,g.jsx||v.isValidElement(g.title)?g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title:q.createElement(q.Fragment,null,ze||g.icon||g.promise?q.createElement("div",{"data-icon":"",className:Ra(L?.icon,(o=g?.classNames)==null?void 0:o.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||ce():null,g.type!=="loading"?g.icon||Q?.[ze]||Sq(ze):null):null,q.createElement("div",{"data-content":"",className:Ra(L?.content,(c=g?.classNames)==null?void 0:c.content)},q.createElement("div",{"data-title":"",className:Ra(L?.title,(d=g?.classNames)==null?void 0:d.title)},typeof g.title=="function"?g.title():g.title),g.description?q.createElement("div",{"data-description":"",className:Ra(G,Lt,L?.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&&Ap(g.cancel)?q.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||z,onClick:Te=>{var ot,gt;Ap(g.cancel)&&Ge&&((gt=(ot=g.cancel).onClick)==null||gt.call(ot,Te),Sn())},className:Ra(L?.cancelButton,(h=g?.classNames)==null?void 0:h.cancelButton)},g.cancel.label):null,v.isValidElement(g.action)?g.action:g.action&&Ap(g.action)?q.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||B,onClick:Te=>{var ot,gt;Ap(g.action)&&((gt=(ot=g.action).onClick)==null||gt.call(ot,Te),!Te.defaultPrevented&&Sn())},className:Ra(L?.actionButton,(p=g?.classNames)==null?void 0:p.actionButton)},g.action.label):null))};function dE(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Gq(e,t){let n={};return[e,t].forEach((r,a)=>{let i=a===1,o=i?"--mobile-offset":"--offset",c=i?zq:Bq;function d(f){["top","right","bottom","left"].forEach(h=>{n[`${o}-${h}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?d(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${o}-${f}`]=c:n[`${o}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):d(c)}),n}var Yq=v.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:a=["altKey","KeyT"],expand:i,closeButton:o,className:c,offset:d,mobileOffset:f,theme:h="light",richColors:p,duration:y,style:g,visibleToasts:j=Fq,toastOptions:b,dir:x=dE(),gap:S=qq,loadingIcon:N,icons:_,containerAriaLabel:P="Notifications",pauseWhenPageIsHidden:A}=e,[O,k]=q.useState([]),R=q.useMemo(()=>Array.from(new Set([r].concat(O.filter($=>$.position).map($=>$.position)))),[O,r]),[M,z]=q.useState([]),[B,D]=q.useState(!1),[G,U]=q.useState(!1),[W,X]=q.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),J=q.useRef(null),T=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),L=q.useRef(null),Q=q.useRef(!1),F=q.useCallback($=>{k(Z=>{var ae;return(ae=Z.find(V=>V.id===$.id))!=null&&ae.delete||kr.dismiss($.id),Z.filter(({id:V})=>V!==$.id)})},[]);return q.useEffect(()=>kr.subscribe($=>{if($.dismiss){k(Z=>Z.map(ae=>ae.id===$.id?{...ae,delete:!0}:ae));return}setTimeout(()=>{_M.flushSync(()=>{k(Z=>{let ae=Z.findIndex(V=>V.id===$.id);return ae!==-1?[...Z.slice(0,ae),{...Z[ae],...$},...Z.slice(ae+1)]:[$,...Z]})})})}),[]),q.useEffect(()=>{if(h!=="system"){X(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?X("dark"):X("light")),typeof window>"u")return;let $=window.matchMedia("(prefers-color-scheme: dark)");try{$.addEventListener("change",({matches:Z})=>{X(Z?"dark":"light")})}catch{$.addListener(({matches:ae})=>{try{X(ae?"dark":"light")}catch(V){console.error(V)}})}},[h]),q.useEffect(()=>{O.length<=1&&D(!1)},[O]),q.useEffect(()=>{let $=Z=>{var ae,V;a.every(ie=>Z[ie]||Z.code===ie)&&(D(!0),(ae=J.current)==null||ae.focus()),Z.code==="Escape"&&(document.activeElement===J.current||(V=J.current)!=null&&V.contains(document.activeElement))&&D(!1)};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[a]),q.useEffect(()=>{if(J.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,Q.current=!1)}},[J.current]),q.createElement("section",{ref:t,"aria-label":`${P} ${T}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map(($,Z)=>{var ae;let[V,ie]=$.split("-");return O.length?q.createElement("ol",{key:$,dir:x==="auto"?dE():x,tabIndex:-1,ref:J,className:c,"data-sonner-toaster":!0,"data-theme":W,"data-y-position":V,"data-lifted":B&&O.length>1&&!i,"data-x-position":ie,style:{"--front-toast-height":`${((ae=M[0])==null?void 0:ae.height)||0}px`,"--width":`${Uq}px`,"--gap":`${S}px`,...g,...Gq(d,f)},onBlur:ne=>{Q.current&&!ne.currentTarget.contains(ne.relatedTarget)&&(Q.current=!1,L.current&&(L.current.focus({preventScroll:!0}),L.current=null))},onFocus:ne=>{ne.target instanceof HTMLElement&&ne.target.dataset.dismissible==="false"||Q.current||(Q.current=!0,L.current=ne.relatedTarget)},onMouseEnter:()=>D(!0),onMouseMove:()=>D(!0),onMouseLeave:()=>{G||D(!1)},onDragEnd:()=>D(!1),onPointerDown:ne=>{ne.target instanceof HTMLElement&&ne.target.dataset.dismissible==="false"||U(!0)},onPointerUp:()=>U(!1)},O.filter(ne=>!ne.position&&Z===0||ne.position===$).map((ne,de)=>{var oe,ge;return q.createElement(Kq,{key:ne.id,icons:_,index:de,toast:ne,defaultRichColors:p,duration:(oe=b?.duration)!=null?oe:y,className:b?.className,descriptionClassName:b?.descriptionClassName,invert:n,visibleToasts:j,closeButton:(ge=b?.closeButton)!=null?ge:o,interacting:G,position:$,style:b?.style,unstyled:b?.unstyled,classNames:b?.classNames,cancelButtonStyle:b?.cancelButtonStyle,actionButtonStyle:b?.actionButtonStyle,removeToast:F,toasts:O.filter(Re=>Re.position==ne.position),heights:M.filter(Re=>Re.position==ne.position),setHeights:z,expandByDefault:i,gap:S,loadingIcon:N,expanded:B,pauseWhenPageIsHidden:A,swipeDirections:e.swipeDirections})})):null}))});const Xq=({...e})=>{const{theme:t="system"}=jq();return s.jsx(Yq,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};var Qq=Sm[" useId ".trim().toString()]||(()=>{}),Jq=0;function Vn(e){const[t,n]=v.useState(Qq());return Hn(()=>{n(r=>r??String(Jq++))},[e]),e||(t?`radix-${t}`:"")}const Zq=["top","right","bottom","left"],Ti=Math.min,Kr=Math.max,ih=Math.round,Ep=Math.floor,os=e=>({x:e,y:e}),e9={left:"right",right:"left",bottom:"top",top:"bottom"},t9={start:"end",end:"start"};function g1(e,t,n){return Kr(e,Ti(t,n))}function qs(e,t){return typeof e=="function"?e(t):e}function Ws(e){return e.split("-")[0]}function Nc(e){return e.split("-")[1]}function _S(e){return e==="x"?"y":"x"}function AS(e){return e==="y"?"height":"width"}const n9=new Set(["top","bottom"]);function as(e){return n9.has(Ws(e))?"y":"x"}function ES(e){return _S(as(e))}function r9(e,t,n){n===void 0&&(n=!1);const r=Nc(e),a=ES(e),i=AS(a);let o=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=oh(o)),[o,oh(o)]}function a9(e){const t=oh(e);return[y1(e),t,y1(t)]}function y1(e){return e.replace(/start|end/g,t=>t9[t])}const fE=["left","right"],pE=["right","left"],s9=["top","bottom"],i9=["bottom","top"];function o9(e,t,n){switch(e){case"top":case"bottom":return n?t?pE:fE:t?fE:pE;case"left":case"right":return t?s9:i9;default:return[]}}function l9(e,t,n,r){const a=Nc(e);let i=o9(Ws(e),n==="start",r);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(y1)))),i}function oh(e){return e.replace(/left|right|bottom|top/g,t=>e9[t])}function c9(e){return{top:0,right:0,bottom:0,left:0,...e}}function b$(e){return typeof e!="number"?c9(e):{top:e,right:e,bottom:e,left:e}}function lh(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 hE(e,t,n){let{reference:r,floating:a}=e;const i=as(t),o=ES(t),c=AS(o),d=Ws(t),f=i==="y",h=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2,y=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(Nc(t)){case"start":g[o]-=y*(n&&f?-1:1);break;case"end":g[o]+=y*(n&&f?-1:1);break}return g}async function u9(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:i,rects:o,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:y=!1,padding:g=0}=qs(t,e),j=b$(g),x=c[y?p==="floating"?"reference":"floating":p],S=lh(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:f,rootBoundary:h,strategy:d})),N=p==="floating"?{x:r,y:a,width:o.floating.width,height:o.floating.height}:o.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),P=await(i.isElement==null?void 0:i.isElement(_))?await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1}:{x:1,y:1},A=lh(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:N,offsetParent:_,strategy:d}):N);return{top:(S.top-A.top+j.top)/P.y,bottom:(A.bottom-S.bottom+j.bottom)/P.y,left:(S.left-A.left+j.left)/P.x,right:(A.right-S.right+j.right)/P.x}}const d9=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:o}=n,c=i.filter(Boolean),d=await(o.isRTL==null?void 0:o.isRTL(t));let f=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:h,y:p}=hE(f,r,d),y=r,g={},j=0;for(let x=0;x<c.length;x++){var b;const{name:S,fn:N}=c[x],{x:_,y:P,data:A,reset:O}=await N({x:h,y:p,initialPlacement:r,placement:y,strategy:a,middlewareData:g,rects:f,platform:{...o,detectOverflow:(b=o.detectOverflow)!=null?b:u9},elements:{reference:e,floating:t}});h=_??h,p=P??p,g={...g,[S]:{...g[S],...A}},O&&j<=50&&(j++,typeof O=="object"&&(O.placement&&(y=O.placement),O.rects&&(f=O.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):O.rects),{x:h,y:p}=hE(f,y,d)),x=-1)}return{x:h,y:p,placement:y,strategy:a,middlewareData:g}},f9=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:o,elements:c,middlewareData:d}=t,{element:f,padding:h=0}=qs(e,t)||{};if(f==null)return{};const p=b$(h),y={x:n,y:r},g=ES(a),j=AS(g),b=await o.getDimensions(f),x=g==="y",S=x?"top":"left",N=x?"bottom":"right",_=x?"clientHeight":"clientWidth",P=i.reference[j]+i.reference[g]-y[g]-i.floating[j],A=y[g]-i.reference[g],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(f));let k=O?O[_]:0;(!k||!await(o.isElement==null?void 0:o.isElement(O)))&&(k=c.floating[_]||i.floating[j]);const R=P/2-A/2,M=k/2-b[j]/2-1,z=Ti(p[S],M),B=Ti(p[N],M),D=z,G=k-b[j]-B,U=k/2-b[j]/2+R,W=g1(D,U,G),X=!d.arrow&&Nc(a)!=null&&U!==W&&i.reference[j]/2-(U<D?z:B)-b[j]/2<0,J=X?U<D?U-D:U-G:0;return{[g]:y[g]+J,data:{[g]:W,centerOffset:U-W-J,...X&&{alignmentOffset:J}},reset:X}}}),p9=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:i,rects:o,initialPlacement:c,platform:d,elements:f}=t,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:y,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:b=!0,...x}=qs(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const S=Ws(a),N=as(c),_=Ws(c)===c,P=await(d.isRTL==null?void 0:d.isRTL(f.floating)),A=y||(_||!b?[oh(c)]:a9(c)),O=j!=="none";!y&&O&&A.push(...l9(c,b,j,P));const k=[c,...A],R=await d.detectOverflow(t,x),M=[];let z=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&M.push(R[S]),p){const U=r9(a,o,P);M.push(R[U[0]],R[U[1]])}if(z=[...z,{placement:a,overflows:M}],!M.every(U=>U<=0)){var B,D;const U=(((B=i.flip)==null?void 0:B.index)||0)+1,W=k[U];if(W&&(!(p==="alignment"?N!==as(W):!1)||z.every(T=>as(T.placement)===N?T.overflows[0]>0:!0)))return{data:{index:U,overflows:z},reset:{placement:W}};let X=(D=z.filter(J=>J.overflows[0]<=0).sort((J,T)=>J.overflows[1]-T.overflows[1])[0])==null?void 0:D.placement;if(!X)switch(g){case"bestFit":{var G;const J=(G=z.filter(T=>{if(O){const L=as(T.placement);return L===N||L==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(L=>L>0).reduce((L,Q)=>L+Q,0)]).sort((T,L)=>T[1]-L[1])[0])==null?void 0:G[0];J&&(X=J);break}case"initialPlacement":X=c;break}if(a!==X)return{reset:{placement:X}}}return{}}}};function mE(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function vE(e){return Zq.some(t=>e[t]>=0)}const h9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...i}=qs(e,t);switch(a){case"referenceHidden":{const o=await r.detectOverflow(t,{...i,elementContext:"reference"}),c=mE(o,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:vE(c)}}}case"escaped":{const o=await r.detectOverflow(t,{...i,altBoundary:!0}),c=mE(o,n.floating);return{data:{escapedOffsets:c,escaped:vE(c)}}}default:return{}}}}},w$=new Set(["left","top"]);async function m9(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),o=Ws(n),c=Nc(n),d=as(n)==="y",f=w$.has(o)?-1:1,h=i&&d?-1:1,p=qs(t,e);let{mainAxis:y,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:y*f}:{x:y*f,y:g*h}}const v9=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:o,middlewareData:c}=t,d=await m9(t,e);return o===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:a+d.x,y:i+d.y,data:{...d,placement:o}}}}},g9=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a,platform:i}=t,{mainAxis:o=!0,crossAxis:c=!1,limiter:d={fn:S=>{let{x:N,y:_}=S;return{x:N,y:_}}},...f}=qs(e,t),h={x:n,y:r},p=await i.detectOverflow(t,f),y=as(Ws(a)),g=_S(y);let j=h[g],b=h[y];if(o){const S=g==="y"?"top":"left",N=g==="y"?"bottom":"right",_=j+p[S],P=j-p[N];j=g1(_,j,P)}if(c){const S=y==="y"?"top":"left",N=y==="y"?"bottom":"right",_=b+p[S],P=b-p[N];b=g1(_,b,P)}const x=d.fn({...t,[g]:j,[y]:b});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[g]:o,[y]:c}}}}}},y9=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:i,middlewareData:o}=t,{offset:c=0,mainAxis:d=!0,crossAxis:f=!0}=qs(e,t),h={x:n,y:r},p=as(a),y=_S(p);let g=h[y],j=h[p];const b=qs(c,t),x=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(d){const _=y==="y"?"height":"width",P=i.reference[y]-i.floating[_]+x.mainAxis,A=i.reference[y]+i.reference[_]-x.mainAxis;g<P?g=P:g>A&&(g=A)}if(f){var S,N;const _=y==="y"?"width":"height",P=w$.has(Ws(a)),A=i.reference[p]-i.floating[_]+(P&&((S=o.offset)==null?void 0:S[p])||0)+(P?0:x.crossAxis),O=i.reference[p]+i.reference[_]+(P?0:((N=o.offset)==null?void 0:N[p])||0)-(P?x.crossAxis:0);j<A?j=A:j>O&&(j=O)}return{[y]:g,[p]:j}}}},x9=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:i,platform:o,elements:c}=t,{apply:d=()=>{},...f}=qs(e,t),h=await o.detectOverflow(t,f),p=Ws(a),y=Nc(a),g=as(a)==="y",{width:j,height:b}=i.floating;let x,S;p==="top"||p==="bottom"?(x=p,S=y===(await(o.isRTL==null?void 0:o.isRTL(c.floating))?"start":"end")?"left":"right"):(S=p,x=y==="end"?"top":"bottom");const N=b-h.top-h.bottom,_=j-h.left-h.right,P=Ti(b-h[x],N),A=Ti(j-h[S],_),O=!t.middlewareData.shift;let k=P,R=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=N),O&&!y){const z=Kr(h.left,0),B=Kr(h.right,0),D=Kr(h.top,0),G=Kr(h.bottom,0);g?R=j-2*(z!==0||B!==0?z+B:Kr(h.left,h.right)):k=b-2*(D!==0||G!==0?D+G:Kr(h.top,h.bottom))}await d({...t,availableWidth:R,availableHeight:k});const M=await o.getDimensions(c.floating);return j!==M.width||b!==M.height?{reset:{rects:!0}}:{}}}};function Em(){return typeof window<"u"}function Cc(e){return j$(e)?(e.nodeName||"").toLowerCase():"#document"}function Zr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function hs(e){var t;return(t=(j$(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function j$(e){return Em()?e instanceof Node||e instanceof Zr(e).Node:!1}function Fa(e){return Em()?e instanceof Element||e instanceof Zr(e).Element:!1}function ds(e){return Em()?e instanceof HTMLElement||e instanceof Zr(e).HTMLElement:!1}function gE(e){return!Em()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Zr(e).ShadowRoot}const b9=new Set(["inline","contents"]);function Yd(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Ba(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!b9.has(a)}const w9=new Set(["table","td","th"]);function j9(e){return w9.has(Cc(e))}const S9=[":popover-open",":modal"];function Pm(e){return S9.some(t=>{try{return e.matches(t)}catch{return!1}})}const N9=["transform","translate","scale","rotate","perspective"],C9=["transform","translate","scale","rotate","perspective","filter"],_9=["paint","layout","strict","content"];function PS(e){const t=OS(),n=Fa(e)?Ba(e):e;return N9.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||C9.some(r=>(n.willChange||"").includes(r))||_9.some(r=>(n.contain||"").includes(r))}function A9(e){let t=Ii(e);for(;ds(t)&&!Wl(t);){if(PS(t))return t;if(Pm(t))return null;t=Ii(t)}return null}function OS(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const E9=new Set(["html","body","#document"]);function Wl(e){return E9.has(Cc(e))}function Ba(e){return Zr(e).getComputedStyle(e)}function Om(e){return Fa(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ii(e){if(Cc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||gE(e)&&e.host||hs(e);return gE(t)?t.host:t}function S$(e){const t=Ii(e);return Wl(t)?e.ownerDocument?e.ownerDocument.body:e.body:ds(t)&&Yd(t)?t:S$(t)}function td(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=S$(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),o=Zr(a);if(i){const c=x1(o);return t.concat(o,o.visualViewport||[],Yd(a)?a:[],c&&n?td(c):[])}return t.concat(a,td(a,[],n))}function x1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function N$(e){const t=Ba(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=ds(e),i=a?e.offsetWidth:n,o=a?e.offsetHeight:r,c=ih(n)!==i||ih(r)!==o;return c&&(n=i,r=o),{width:n,height:r,$:c}}function kS(e){return Fa(e)?e:e.contextElement}function Tl(e){const t=kS(e);if(!ds(t))return os(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=N$(t);let o=(i?ih(n.width):n.width)/r,c=(i?ih(n.height):n.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!c||!Number.isFinite(c))&&(c=1),{x:o,y:c}}const P9=os(0);function C$(e){const t=Zr(e);return!OS()||!t.visualViewport?P9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function O9(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Zr(e)?!1:t}function bo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=kS(e);let o=os(1);t&&(r?Fa(r)&&(o=Tl(r)):o=Tl(e));const c=O9(i,n,r)?C$(i):os(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 y=Zr(i),g=r&&Fa(r)?Zr(r):r;let j=y,b=x1(j);for(;b&&r&&g!==j;){const x=Tl(b),S=b.getBoundingClientRect(),N=Ba(b),_=S.left+(b.clientLeft+parseFloat(N.paddingLeft))*x.x,P=S.top+(b.clientTop+parseFloat(N.paddingTop))*x.y;d*=x.x,f*=x.y,h*=x.x,p*=x.y,d+=_,f+=P,j=Zr(b),b=x1(j)}}return lh({width:h,height:p,x:d,y:f})}function km(e,t){const n=Om(e).scrollLeft;return t?t.left+n:bo(hs(e)).left+n}function _$(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-km(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function k9(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",o=hs(r),c=t?Pm(t.floating):!1;if(r===o||c&&i)return n;let d={scrollLeft:0,scrollTop:0},f=os(1);const h=os(0),p=ds(r);if((p||!p&&!i)&&((Cc(r)!=="body"||Yd(o))&&(d=Om(r)),ds(r))){const g=bo(r);f=Tl(r),h.x=g.x+r.clientLeft,h.y=g.y+r.clientTop}const y=o&&!p&&!i?_$(o,d):os(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+h.x+y.x,y:n.y*f.y-d.scrollTop*f.y+h.y+y.y}}function R9(e){return Array.from(e.getClientRects())}function T9(e){const t=hs(e),n=Om(e),r=e.ownerDocument.body,a=Kr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Kr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+km(e);const c=-n.scrollTop;return Ba(r).direction==="rtl"&&(o+=Kr(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:o,y:c}}const yE=25;function I9(e,t){const n=Zr(e),r=hs(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=OS();(!h||h&&t==="fixed")&&(c=a.offsetLeft,d=a.offsetTop)}const f=km(r);if(f<=0){const h=r.ownerDocument,p=h.body,y=getComputedStyle(p),g=h.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,j=Math.abs(r.clientWidth-p.clientWidth-g);j<=yE&&(i-=j)}else f<=yE&&(i+=f);return{width:i,height:o,x:c,y:d}}const M9=new Set(["absolute","fixed"]);function $9(e,t){const n=bo(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=ds(e)?Tl(e):os(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 xE(e,t,n){let r;if(t==="viewport")r=I9(e,n);else if(t==="document")r=T9(hs(e));else if(Fa(t))r=$9(t,n);else{const a=C$(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return lh(r)}function A$(e,t){const n=Ii(e);return n===t||!Fa(n)||Wl(n)?!1:Ba(n).position==="fixed"||A$(n,t)}function D9(e,t){const n=t.get(e);if(n)return n;let r=td(e,[],!1).filter(c=>Fa(c)&&Cc(c)!=="body"),a=null;const i=Ba(e).position==="fixed";let o=i?Ii(e):e;for(;Fa(o)&&!Wl(o);){const c=Ba(o),d=PS(o);!d&&c.position==="fixed"&&(a=null),(i?!d&&!a:!d&&c.position==="static"&&!!a&&M9.has(a.position)||Yd(o)&&!d&&A$(e,o))?r=r.filter(h=>h!==o):a=c,o=Ii(o)}return t.set(e,r),r}function L9(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[...n==="clippingAncestors"?Pm(t)?[]:D9(t,this._c):[].concat(n),r],c=o[0],d=o.reduce((f,h)=>{const p=xE(t,h,a);return f.top=Kr(p.top,f.top),f.right=Ti(p.right,f.right),f.bottom=Ti(p.bottom,f.bottom),f.left=Kr(p.left,f.left),f},xE(t,c,a));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function F9(e){const{width:t,height:n}=N$(e);return{width:t,height:n}}function B9(e,t,n){const r=ds(t),a=hs(t),i=n==="fixed",o=bo(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const d=os(0);function f(){d.x=km(a)}if(r||!r&&!i)if((Cc(t)!=="body"||Yd(a))&&(c=Om(t)),r){const g=bo(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?_$(a,c):os(0),p=o.left+c.scrollLeft-d.x-h.x,y=o.top+c.scrollTop-d.y-h.y;return{x:p,y,width:o.width,height:o.height}}function Wy(e){return Ba(e).position==="static"}function bE(e,t){if(!ds(e)||Ba(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return hs(e)===n&&(n=n.ownerDocument.body),n}function E$(e,t){const n=Zr(e);if(Pm(e))return n;if(!ds(e)){let a=Ii(e);for(;a&&!Wl(a);){if(Fa(a)&&!Wy(a))return a;a=Ii(a)}return n}let r=bE(e,t);for(;r&&j9(r)&&Wy(r);)r=bE(r,t);return r&&Wl(r)&&Wy(r)&&!PS(r)?n:r||A9(e)||n}const z9=async function(e){const t=this.getOffsetParent||E$,n=this.getDimensions,r=await n(e.floating);return{reference:B9(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function U9(e){return Ba(e).direction==="rtl"}const q9={convertOffsetParentRelativeRectToViewportRelativeRect:k9,getDocumentElement:hs,getClippingRect:L9,getOffsetParent:E$,getElementRects:z9,getClientRects:R9,getDimensions:F9,getScale:Tl,isElement:Fa,isRTL:U9};function P$(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function W9(e,t){let n=null,r;const a=hs(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:y,height:g}=f;if(c||t(),!y||!g)return;const j=Ep(p),b=Ep(a.clientWidth-(h+y)),x=Ep(a.clientHeight-(p+g)),S=Ep(h),_={rootMargin:-j+"px "+-b+"px "+-x+"px "+-S+"px",threshold:Kr(0,Ti(1,d))||1};let P=!0;function A(O){const k=O[0].intersectionRatio;if(k!==d){if(!P)return o();k?o(!1,k):r=setTimeout(()=>{o(!1,1e-7)},1e3)}k===1&&!P$(f,e.getBoundingClientRect())&&o(),P=!1}try{n=new IntersectionObserver(A,{..._,root:a.ownerDocument})}catch{n=new IntersectionObserver(A,_)}n.observe(e)}return o(!0),i}function V9(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=kS(e),h=a||i?[...f?td(f):[],...td(t)]:[];h.forEach(S=>{a&&S.addEventListener("scroll",n,{passive:!0}),i&&S.addEventListener("resize",n)});const p=f&&c?W9(f,n):null;let y=-1,g=null;o&&(g=new ResizeObserver(S=>{let[N]=S;N&&N.target===f&&g&&(g.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var _;(_=g)==null||_.observe(t)})),n()}),f&&!d&&g.observe(f),g.observe(t));let j,b=d?bo(e):null;d&&x();function x(){const S=bo(e);b&&!P$(b,S)&&n(),b=S,j=requestAnimationFrame(x)}return n(),()=>{var S;h.forEach(N=>{a&&N.removeEventListener("scroll",n),i&&N.removeEventListener("resize",n)}),p?.(),(S=g)==null||S.disconnect(),g=null,d&&cancelAnimationFrame(j)}}const H9=v9,K9=g9,G9=p9,Y9=x9,X9=h9,wE=f9,Q9=y9,J9=(e,t,n)=>{const r=new Map,a={platform:q9,...n},i={...a.platform,_c:r};return d9(e,t,{...a,platform:i})};var Z9=typeof document<"u",eW=function(){},eh=Z9?v.useLayoutEffect:eW;function ch(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(!ch(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)&&!ch(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function O$(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function jE(e,t){const n=O$(e);return Math.round(t*n)/n}function Vy(e){const t=v.useRef(e);return eh(()=>{t.current=e}),t}function tW(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:o}={},transform:c=!0,whileElementsMounted:d,open:f}=e,[h,p]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,g]=v.useState(r);ch(y,r)||g(r);const[j,b]=v.useState(null),[x,S]=v.useState(null),N=v.useCallback(T=>{T!==O.current&&(O.current=T,b(T))},[]),_=v.useCallback(T=>{T!==k.current&&(k.current=T,S(T))},[]),P=i||j,A=o||x,O=v.useRef(null),k=v.useRef(null),R=v.useRef(h),M=d!=null,z=Vy(d),B=Vy(a),D=Vy(f),G=v.useCallback(()=>{if(!O.current||!k.current)return;const T={placement:t,strategy:n,middleware:y};B.current&&(T.platform=B.current),J9(O.current,k.current,T).then(L=>{const Q={...L,isPositioned:D.current!==!1};U.current&&!ch(R.current,Q)&&(R.current=Q,wc.flushSync(()=>{p(Q)}))})},[y,t,n,B,D]);eh(()=>{f===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,p(T=>({...T,isPositioned:!1})))},[f]);const U=v.useRef(!1);eh(()=>(U.current=!0,()=>{U.current=!1}),[]),eh(()=>{if(P&&(O.current=P),A&&(k.current=A),P&&A){if(z.current)return z.current(P,A,G);G()}},[P,A,G,z,M]);const W=v.useMemo(()=>({reference:O,floating:k,setReference:N,setFloating:_}),[N,_]),X=v.useMemo(()=>({reference:P,floating:A}),[P,A]),J=v.useMemo(()=>{const T={position:n,left:0,top:0};if(!X.floating)return T;const L=jE(X.floating,h.x),Q=jE(X.floating,h.y);return c?{...T,transform:"translate("+L+"px, "+Q+"px)",...O$(X.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:Q}},[n,c,X.floating,h.x,h.y]);return v.useMemo(()=>({...h,update:G,refs:W,elements:X,floatingStyles:J}),[h,G,W,X,J])}const nW=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?wE({element:r.current,padding:a}).fn(n):{}:r?wE({element:r,padding:a}).fn(n):{}}}},rW=(e,t)=>({...H9(e),options:[e,t]}),aW=(e,t)=>({...K9(e),options:[e,t]}),sW=(e,t)=>({...Q9(e),options:[e,t]}),iW=(e,t)=>({...G9(e),options:[e,t]}),oW=(e,t)=>({...Y9(e),options:[e,t]}),lW=(e,t)=>({...X9(e),options:[e,t]}),cW=(e,t)=>({...nW(e),options:[e,t]});var uW="Arrow",k$=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return s.jsx(Be.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"})})});k$.displayName=uW;var dW=k$;function Rm(e){const[t,n]=v.useState(void 0);return Hn(()=>{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 RS="Popper",[R$,$i]=ir(RS),[fW,T$]=R$(RS),I$=e=>{const{__scopePopper:t,children:n}=e,[r,a]=v.useState(null);return s.jsx(fW,{scope:t,anchor:r,onAnchorChange:a,children:n})};I$.displayName=RS;var M$="PopperAnchor",$$=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=T$(M$,n),o=v.useRef(null),c=ft(t,o),d=v.useRef(null);return v.useEffect(()=>{const f=d.current;d.current=r?.current||o.current,f!==d.current&&i.onAnchorChange(d.current)}),r?null:s.jsx(Be.div,{...a,ref:c})});$$.displayName=M$;var TS="PopperContent",[pW,hW]=R$(TS),D$=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:y=!1,updatePositionStrategy:g="optimized",onPlaced:j,...b}=e,x=T$(TS,n),[S,N]=v.useState(null),_=ft(t,ne=>N(ne)),[P,A]=v.useState(null),O=Rm(P),k=O?.width??0,R=O?.height??0,M=r+(i!=="center"?"-"+i:""),z=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},B=Array.isArray(f)?f:[f],D=B.length>0,G={padding:z,boundary:B.filter(vW),altBoundary:D},{refs:U,floatingStyles:W,placement:X,isPositioned:J,middlewareData:T}=tW({strategy:"fixed",placement:M,whileElementsMounted:(...ne)=>V9(...ne,{animationFrame:g==="always"}),elements:{reference:x.anchor},middleware:[rW({mainAxis:a+R,alignmentAxis:o}),d&&aW({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?sW():void 0,...G}),d&&iW({...G}),oW({...G,apply:({elements:ne,rects:de,availableWidth:oe,availableHeight:ge})=>{const{width:Re,height:re}=de.reference,De=ne.floating.style;De.setProperty("--radix-popper-available-width",`${oe}px`),De.setProperty("--radix-popper-available-height",`${ge}px`),De.setProperty("--radix-popper-anchor-width",`${Re}px`),De.setProperty("--radix-popper-anchor-height",`${re}px`)}}),P&&cW({element:P,padding:c}),gW({arrowWidth:k,arrowHeight:R}),y&&lW({strategy:"referenceHidden",...G})]}),[L,Q]=B$(X),F=En(j);Hn(()=>{J&&F?.()},[J,F]);const $=T.arrow?.x,Z=T.arrow?.y,ae=T.arrow?.centerOffset!==0,[V,ie]=v.useState();return Hn(()=>{S&&ie(window.getComputedStyle(S).zIndex)},[S]),s.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:J?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:V,"--radix-popper-transform-origin":[T.transformOrigin?.x,T.transformOrigin?.y].join(" "),...T.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(pW,{scope:n,placedSide:L,onArrowChange:A,arrowX:$,arrowY:Z,shouldHideArrow:ae,children:s.jsx(Be.div,{"data-side":L,"data-align":Q,...b,ref:_,style:{...b.style,animation:J?void 0:"none"}})})})});D$.displayName=TS;var L$="PopperArrow",mW={top:"bottom",right:"left",bottom:"top",left:"right"},F$=v.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=hW(L$,r),o=mW[i.placedSide];return s.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:s.jsx(dW,{...a,ref:n,style:{...a.style,display:"block"}})})});F$.displayName=L$;function vW(e){return e!==null}var gW=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:a}=t,o=a.arrow?.centerOffset!==0,c=o?0:e.arrowWidth,d=o?0:e.arrowHeight,[f,h]=B$(n),p={start:"0%",center:"50%",end:"100%"}[h],y=(a.arrow?.x??0)+c/2,g=(a.arrow?.y??0)+d/2;let j="",b="";return f==="bottom"?(j=o?p:`${y}px`,b=`${-d}px`):f==="top"?(j=o?p:`${y}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 B$(e){const[t,n="center"]=e.split("-");return[t,n]}var Tm=I$,Xd=$$,Im=D$,Mm=F$,yW=Symbol("radix.slottable");function xW(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=yW,t}var[$m]=ir("Tooltip",[$i]),Dm=$i(),z$="TooltipProvider",bW=700,b1="tooltip.open",[wW,IS]=$m(z$),U$=e=>{const{__scopeTooltip:t,delayDuration:n=bW,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=e,o=v.useRef(!0),c=v.useRef(!1),d=v.useRef(0);return v.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),s.jsx(wW,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:v.useCallback(()=>{window.clearTimeout(d.current),o.current=!1},[]),onClose:v.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:v.useCallback(f=>{c.current=f},[]),disableHoverableContent:a,children:i})};U$.displayName=z$;var nd="Tooltip",[jW,Lm]=$m(nd),q$=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:i,disableHoverableContent:o,delayDuration:c}=e,d=IS(nd,e.__scopeTooltip),f=Dm(t),[h,p]=v.useState(null),y=Vn(),g=v.useRef(0),j=o??d.disableHoverableContent,b=c??d.delayDuration,x=v.useRef(!1),[S,N]=na({prop:r,defaultProp:a??!1,onChange:k=>{k?(d.onOpen(),document.dispatchEvent(new CustomEvent(b1))):d.onClose(),i?.(k)},caller:nd}),_=v.useMemo(()=>S?x.current?"delayed-open":"instant-open":"closed",[S]),P=v.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x.current=!1,N(!0)},[N]),A=v.useCallback(()=>{window.clearTimeout(g.current),g.current=0,N(!1)},[N]),O=v.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{x.current=!0,N(!0),g.current=0},b)},[b,N]);return v.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),s.jsx(Tm,{...f,children:s.jsx(jW,{scope:t,contentId:y,open:S,stateAttribute:_,trigger:h,onTriggerChange:p,onTriggerEnter:v.useCallback(()=>{d.isOpenDelayedRef.current?O():P()},[d.isOpenDelayedRef,O,P]),onTriggerLeave:v.useCallback(()=>{j?A():(window.clearTimeout(g.current),g.current=0)},[A,j]),onOpen:P,onClose:A,disableHoverableContent:j,children:n})})};q$.displayName=nd;var w1="TooltipTrigger",W$=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Lm(w1,n),i=IS(w1,n),o=Dm(n),c=v.useRef(null),d=ft(t,c,a.onTriggerChange),f=v.useRef(!1),h=v.useRef(!1),p=v.useCallback(()=>f.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),s.jsx(Xd,{asChild:!0,...o,children:s.jsx(Be.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:d,onPointerMove:Pe(e.onPointerMove,y=>{y.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),h.current=!0)}),onPointerLeave:Pe(e.onPointerLeave,()=>{a.onTriggerLeave(),h.current=!1}),onPointerDown:Pe(e.onPointerDown,()=>{a.open&&a.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Pe(e.onFocus,()=>{f.current||a.onOpen()}),onBlur:Pe(e.onBlur,a.onClose),onClick:Pe(e.onClick,a.onClose)})})});W$.displayName=w1;var SW="TooltipPortal",[Age,NW]=$m(SW,{forceMount:void 0}),Vl="TooltipContent",V$=v.forwardRef((e,t)=>{const n=NW(Vl,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,o=Lm(Vl,e.__scopeTooltip);return s.jsx(Kn,{present:r||o.open,children:o.disableHoverableContent?s.jsx(H$,{side:a,...i,ref:t}):s.jsx(CW,{side:a,...i,ref:t})})}),CW=v.forwardRef((e,t)=>{const n=Lm(Vl,e.__scopeTooltip),r=IS(Vl,e.__scopeTooltip),a=v.useRef(null),i=ft(t,a),[o,c]=v.useState(null),{trigger:d,onClose:f}=n,h=a.current,{onPointerInTransitChange:p}=r,y=v.useCallback(()=>{c(null),p(!1)},[p]),g=v.useCallback((j,b)=>{const x=j.currentTarget,S={x:j.clientX,y:j.clientY},N=OW(S,x.getBoundingClientRect()),_=kW(S,N),P=RW(b.getBoundingClientRect()),A=IW([..._,...P]);c(A),p(!0)},[p]);return v.useEffect(()=>()=>y(),[y]),v.useEffect(()=>{if(d&&h){const j=x=>g(x,h),b=x=>g(x,d);return d.addEventListener("pointerleave",j),h.addEventListener("pointerleave",b),()=>{d.removeEventListener("pointerleave",j),h.removeEventListener("pointerleave",b)}}},[d,h,g,y]),v.useEffect(()=>{if(o){const j=b=>{const x=b.target,S={x:b.clientX,y:b.clientY},N=d?.contains(x)||h?.contains(x),_=!TW(S,o);N?y():_&&(y(),f())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[d,h,o,f,y]),s.jsx(H$,{...e,ref:i})}),[_W,AW]=$m(nd,{isInside:!1}),EW=xW("TooltipContent"),H$=v.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...c}=e,d=Lm(Vl,n),f=Dm(n),{onClose:h}=d;return v.useEffect(()=>(document.addEventListener(b1,h),()=>document.removeEventListener(b1,h)),[h]),v.useEffect(()=>{if(d.trigger){const p=y=>{y.target?.contains(d.trigger)&&h()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,h]),s.jsx(To,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:p=>p.preventDefault(),onDismiss:h,children:s.jsxs(Im,{"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(EW,{children:r}),s.jsx(_W,{scope:n,isInside:!0,children:s.jsx(sU,{id:d.contentId,role:"tooltip",children:a||r})})]})})});V$.displayName=Vl;var K$="TooltipArrow",PW=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Dm(n);return AW(K$,n).isInside?null:s.jsx(Mm,{...a,...r,ref:t})});PW.displayName=K$;function OW(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,a,i)){case i:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function kW(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function RW(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function TW(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const c=t[i],d=t[o],f=c.x,h=c.y,p=d.x,y=d.y;h>r!=y>r&&n<(p-f)*(r-h)/(y-h)+f&&(a=!a)}return a}function IW(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),MW(t)}function MW(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const a=e[r];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var $W=U$,DW=q$,LW=W$,G$=V$;const Y$=$W,X$=DW,Q$=LW,MS=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(G$,{ref:r,sideOffset:t,className:je("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));MS.displayName=G$.displayName;var Fm=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},FW={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},BW=class{#e=FW;#n=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},j1=new BW;function zW(e){setTimeout(e,0)}var Bm=typeof window>"u"||"Deno"in globalThis;function Ma(){}function UW(e,t){return typeof e=="function"?e(t):e}function qW(e){return typeof e=="number"&&e>=0&&e!==1/0}function WW(e,t){return Math.max(e+(t||0)-Date.now(),0)}function S1(e,t){return typeof e=="function"?e(t):e}function VW(e,t){return typeof e=="function"?e(t):e}function SE(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:i,queryKey:o,stale:c}=e;if(o){if(r){if(t.queryHash!==$S(o,t.options))return!1}else if(!ad(t.queryKey,o))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||a&&a!==t.state.fetchStatus||i&&!i(t))}function NE(e,t){const{exact:n,status:r,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(rd(t.options.mutationKey)!==rd(i))return!1}else if(!ad(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function $S(e,t){return(t?.queryKeyHashFn||rd)(e)}function rd(e){return JSON.stringify(e,(t,n)=>N1(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function ad(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>ad(e[n],t[n])):!1}var HW=Object.prototype.hasOwnProperty;function J$(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=CE(e)&&CE(t);if(!r&&!(N1(e)&&N1(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],y=e[p],g=t[p];if(y===g){d[p]=y,(r?h<i:HW.call(e,p))&&f++;continue}if(y===null||g===null||typeof y!="object"||typeof g!="object"){d[p]=g;continue}const j=J$(y,g,n+1);d[p]=j,j===y&&f++}return i===c&&f===i?e:d}function CE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function N1(e){if(!_E(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!_E(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function _E(e){return Object.prototype.toString.call(e)==="[object Object]"}function KW(e){return new Promise(t=>{j1.setTimeout(t,e)})}function GW(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?J$(e,t):t}function YW(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function XW(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var DS=Symbol();function Z$(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===DS?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function QW(e,t,n){let r=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??=t(),r||(r=!0,a.aborted?n():a.addEventListener("abort",n,{once:!0})),a)}),e}var JW=class extends Fm{#e;#n;#t;constructor(){super(),this.#t=e=>{if(!Bm&&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"}},eD=new JW;function ZW(){let e,t;const n=new Promise((a,i)=>{e=a,t=i});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}var eV=zW;function tV(){let e=[],t=0,n=c=>{c()},r=c=>{c()},a=eV;const i=c=>{t?e.push(c):a(()=>{n(c)})},o=()=>{const c=e;e=[],c.length&&a(()=>{r(()=>{c.forEach(d=>{n(d)})})})};return{batch:c=>{let d;t++;try{d=c()}finally{t--,t||o()}return d},batchCalls:c=>(...d)=>{i(()=>{c(...d)})},schedule:i,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{a=c}}}var yr=tV(),nV=class extends Fm{#e=!0;#n;#t;constructor(){super(),this.#t=e=>{if(!Bm&&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}},uh=new nV;function rV(e){return Math.min(1e3*2**e,3e4)}function tD(e){return(e??"online")==="online"?uh.isOnline():!0}var C1=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function nD(e){let t=!1,n=0,r;const a=ZW(),i=()=>a.status!=="pending",o=b=>{if(!i()){const x=new C1(b);y(x),e.onCancel?.(x)}},c=()=>{t=!0},d=()=>{t=!1},f=()=>eD.isFocused()&&(e.networkMode==="always"||uh.isOnline())&&e.canRun(),h=()=>tD(e.networkMode)&&e.canRun(),p=b=>{i()||(r?.(),a.resolve(b))},y=b=>{i()||(r?.(),a.reject(b))},g=()=>new Promise(b=>{r=x=>{(i()||f())&&b(x)},e.onPause?.()}).then(()=>{r=void 0,i()||e.onContinue?.()}),j=()=>{if(i())return;let b;const x=n===0?e.initialPromise:void 0;try{b=x??e.fn()}catch(S){b=Promise.reject(S)}Promise.resolve(b).then(p).catch(S=>{if(i())return;const N=e.retry??(Bm?0:3),_=e.retryDelay??rV,P=typeof _=="function"?_(n,S):_,A=N===!0||typeof N=="number"&&n<N||typeof N=="function"&&N(n,S);if(t||!A){y(S);return}n++,e.onFail?.(n,S),KW(P).then(()=>f()?void 0:g()).then(()=>{t?y(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 rD=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),qW(this.gcTime)&&(this.#e=j1.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Bm?1/0:300*1e3))}clearGcTimeout(){this.#e&&(j1.clearTimeout(this.#e),this.#e=void 0)}},aV=class extends rD{#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=EE(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=EE(this.options);t.data!==void 0&&(this.setState(AE(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#t.remove(this)}setData(e,t){const n=GW(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Ma).catch(Ma):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>VW(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===DS||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>S1(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!WW(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#t.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(d=>d.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,r=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},a=()=>{const c=Z$(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=nD({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:c=>{c instanceof C1&&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 C1){if(c.silent)return this.#r.promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw this.#s({type:"error",error:c}),this.#t.config.onError?.(c,this),this.#t.config.onSettled?.(this.state.data,c,this),c}finally{this.scheduleGc()}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...sV(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...AE(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),yr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#t.notify({query:this,type:"updated",action:e})})}};function sV(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:tD(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function AE(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function EE(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 PE(e){return{onFetch:(t,n)=>{const r=t.options,a=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let c={pages:[],pageParams:[]},d=0;const f=async()=>{let h=!1;const p=j=>{QW(j,()=>t.signal,()=>h=!0)},y=Z$(t.options,t.fetchOptions),g=async(j,b,x)=>{if(h)return Promise.reject();if(b==null&&j.pages.length)return Promise.resolve(j);const N=(()=>{const O={client:t.client,queryKey:t.queryKey,pageParam:b,direction:x?"backward":"forward",meta:t.options.meta};return p(O),O})(),_=await y(N),{maxPages:P}=t.options,A=x?XW:YW;return{pages:A(j.pages,_,P),pageParams:A(j.pageParams,b,P)}};if(a&&i.length){const j=a==="backward",b=j?iV:OE,x={pages:i,pageParams:o},S=b(r,x);c=await g(x,S,j)}else{const j=e??i.length;do{const b=d===0?o[0]??r.initialPageParam:OE(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 OE(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function iV(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var oV=class extends rD{#e;#n;#t;#a;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#n=[],this.state=e.state||lV(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#n.includes(e)||(this.#n.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#n=this.#n.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#n.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#a?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#a=nD({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),yr.batch(()=>{this.#n.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function lV(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var cV=class extends Fm{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#n=new Map,this.#t=0}#e;#n;#t;build(e,t,n){const r=new oV({client:e,mutationCache:this,mutationId:++this.#t,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=Pp(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=Pp(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=Pp(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=Pp(e);return typeof t=="string"?this.#n.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){yr.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=>NE(t,n))}findAll(e={}){return this.getAll().filter(t=>NE(e,t))}notify(e){yr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return yr.batch(()=>Promise.all(e.map(t=>t.continue().catch(Ma))))}};function Pp(e){return e.options.scope?.id}var uV=class extends Fm{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,a=t.queryHash??$S(r,t);let i=this.get(a);return i||(i=new aV({client:e,queryKey:r,queryHash:a,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(i)),i}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){yr.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=>SE(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>SE(e,n)):t}notify(e){yr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){yr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){yr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},dV=class{#e;#n;#t;#a;#r;#i;#o;#s;constructor(e={}){this.#e=e.queryCache||new uV,this.#n=e.mutationCache||new cV,this.#t=e.defaultOptions||{},this.#a=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=eD.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=uh.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(S1(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,o=UW(t,i);if(o!==void 0)return this.#e.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return yr.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;yr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return yr.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=yr.batch(()=>this.#e.findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(Ma).catch(Ma)}invalidateQueries(e,t={}){return yr.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=yr.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(Ma)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ma)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(S1(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ma).catch(Ma)}fetchInfiniteQuery(e){return e.behavior=PE(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ma).catch(Ma)}ensureInfiniteQueryData(e){return e.behavior=PE(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return uh.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(rd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#a.values()],n={};return t.forEach(r=>{ad(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(rd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{ad(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#t.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=$S(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===DS&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#t.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#n.clear()}},fV=v.createContext(void 0),pV=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(fV.Provider,{value:e,children:t}));function sd(){return sd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sd.apply(this,arguments)}var Ai;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ai||(Ai={}));const kE="popstate";function hV(e){e===void 0&&(e={});function t(r,a){let{pathname:i,search:o,hash:c}=r.location;return _1("",{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:dh(a)}return vV(t,n,null,e)}function jn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function LS(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function mV(){return Math.random().toString(36).substr(2,8)}function RE(e,t){return{usr:e.state,key:e.key,idx:t}}function _1(e,t,n,r){return n===void 0&&(n=null),sd({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?_c(t):t,{state:n,key:t&&t.key||r||mV()})}function dh(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 _c(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function vV(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:i=!1}=r,o=a.history,c=Ai.Pop,d=null,f=h();f==null&&(f=0,o.replaceState(sd({},o.state,{idx:f}),""));function h(){return(o.state||{idx:null}).idx}function p(){c=Ai.Pop;let x=h(),S=x==null?null:x-f;f=x,d&&d({action:c,location:b.location,delta:S})}function y(x,S){c=Ai.Push;let N=_1(b.location,x,S);f=h()+1;let _=RE(N,f),P=b.createHref(N);try{o.pushState(_,"",P)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;a.location.assign(P)}i&&d&&d({action:c,location:b.location,delta:1})}function g(x,S){c=Ai.Replace;let N=_1(b.location,x,S);f=h();let _=RE(N,f),P=b.createHref(N);o.replaceState(_,"",P),i&&d&&d({action:c,location:b.location,delta:0})}function j(x){let S=a.location.origin!=="null"?a.location.origin:a.location.href,N=typeof x=="string"?x:dh(x);return N=N.replace(/ $/,"%20"),jn(S,"No window.location.(origin|href) available to create URL for href: "+N),new URL(N,S)}let b={get action(){return c},get location(){return e(a,o)},listen(x){if(d)throw new Error("A history only accepts one active listener");return a.addEventListener(kE,p),d=x,()=>{a.removeEventListener(kE,p),d=null}},createHref(x){return t(a,x)},createURL:j,encodeLocation(x){let S=j(x);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:y,replace:g,go(x){return o.go(x)}};return b}var TE;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(TE||(TE={}));function gV(e,t,n){return n===void 0&&(n="/"),yV(e,t,n)}function yV(e,t,n,r){let a=typeof t=="string"?_c(t):t,i=Hl(a.pathname||"/",n);if(i==null)return null;let o=aD(e);xV(o);let c=null;for(let d=0;c==null&&d<o.length;++d){let f=OV(i);c=EV(o[d],f)}return c}function aD(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let a=(i,o,c)=>{let d={relativePath:c===void 0?i.path||"":c,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};d.relativePath.startsWith("/")&&(jn(d.relativePath.startsWith(r),'Absolute route path "'+d.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),d.relativePath=d.relativePath.slice(r.length));let f=Pi([r,d.relativePath]),h=n.concat(d);i.children&&i.children.length>0&&(jn(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),aD(i.children,t,h,f)),!(i.path==null&&!i.index)&&t.push({path:f,score:_V(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 sD(i.path))a(i,o,d)}),t}function sD(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=sD(r.join("/")),c=[];return c.push(...o.map(d=>d===""?i:[i,d].join("/"))),a&&c.push(...o),c.map(d=>e.startsWith("/")&&d===""?"/":d)}function xV(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:AV(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const bV=/^:[\w-]+$/,wV=3,jV=2,SV=1,NV=10,CV=-2,IE=e=>e==="*";function _V(e,t){let n=e.split("/"),r=n.length;return n.some(IE)&&(r+=CV),t&&(r+=jV),n.filter(a=>!IE(a)).reduce((a,i)=>a+(bV.test(i)?wV:i===""?SV:NV),r)}function AV(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 EV(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=Xt({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},h),y=d.route;if(!p)return null;Object.assign(a,p.params),o.push({params:a,pathname:Pi([i,p.pathname]),pathnameBase:MV(Pi([i,p.pathnameBase])),route:y}),p.pathnameBase!=="/"&&(i=Pi([i,p.pathnameBase]))}return o}function Xt(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=PV(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let i=a[0],o=i.replace(/(.)\/+$/,"$1"),c=a.slice(1);return{params:r.reduce((f,h,p)=>{let{paramName:y,isOptional:g}=h;if(y==="*"){let b=c[p]||"";o=i.slice(0,i.length-b.length).replace(/(.)\/+$/,"$1")}const j=c[p];return g&&!j?f[y]=void 0:f[y]=(j||"").replace(/%2F/g,"/"),f},{}),pathname:i,pathnameBase:o,pattern:e}}function PV(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),LS(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,c,d)=>(r.push({paramName:c,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function OV(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return LS(!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 Hl(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const kV=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,RV=e=>kV.test(e);function TV(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?_c(e):e,i;if(n)if(RV(n))i=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),LS(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?i=ME(n.substring(1),"/"):i=ME(n,t)}else i=t;return{pathname:i,search:$V(r),hash:DV(a)}}function ME(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 Hy(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function IV(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function FS(e,t){let n=IV(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function BS(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=_c(e):(a=sd({},e),jn(!a.pathname||!a.pathname.includes("?"),Hy("?","pathname","search",a)),jn(!a.pathname||!a.pathname.includes("#"),Hy("#","pathname","hash",a)),jn(!a.search||!a.search.includes("#"),Hy("#","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 y=o.split("/");for(;y[0]==="..";)y.shift(),p-=1;a.pathname=y.join("/")}c=p>=0?t[p]:"/"}let d=TV(a,c),f=o&&o!=="/"&&o.endsWith("/"),h=(i||o===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||h)&&(d.pathname+="/"),d}const Pi=e=>e.join("/").replace(/\/\/+/g,"/"),MV=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),$V=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,DV=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function LV(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const iD=["post","put","patch","delete"];new Set(iD);const FV=["get",...iD];new Set(FV);function id(){return id=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},id.apply(this,arguments)}const zm=v.createContext(null),oD=v.createContext(null),Ys=v.createContext(null),Um=v.createContext(null),ms=v.createContext({outlet:null,matches:[],isDataRoute:!1}),lD=v.createContext(null);function BV(e,t){let{relative:n}=t===void 0?{}:t;Ac()||jn(!1);let{basename:r,navigator:a}=v.useContext(Ys),{hash:i,pathname:o,search:c}=qm(e,{relative:n}),d=o;return r!=="/"&&(d=o==="/"?r:Pi([r,o])),a.createHref({pathname:d,search:c,hash:i})}function Ac(){return v.useContext(Um)!=null}function vs(){return Ac()||jn(!1),v.useContext(Um).location}function cD(e){v.useContext(Ys).static||v.useLayoutEffect(e)}function ja(){let{isDataRoute:e}=v.useContext(ms);return e?tH():zV()}function zV(){Ac()||jn(!1);let e=v.useContext(zm),{basename:t,future:n,navigator:r}=v.useContext(Ys),{matches:a}=v.useContext(ms),{pathname:i}=vs(),o=JSON.stringify(FS(a,n.v7_relativeSplatPath)),c=v.useRef(!1);return cD(()=>{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=BS(f,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Pi([t,p.pathname])),(h.replace?r.replace:r.push)(p,h.state,h)},[t,r,o,i,e])}const UV=v.createContext(null);function qV(e){let t=v.useContext(ms).outlet;return t&&v.createElement(UV.Provider,{value:e},t)}function Mo(){let{matches:e}=v.useContext(ms),t=e[e.length-1];return t?t.params:{}}function qm(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=v.useContext(Ys),{matches:a}=v.useContext(ms),{pathname:i}=vs(),o=JSON.stringify(FS(a,r.v7_relativeSplatPath));return v.useMemo(()=>BS(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function WV(e,t){return VV(e,t)}function VV(e,t,n,r){Ac()||jn(!1);let{navigator:a}=v.useContext(Ys),{matches:i}=v.useContext(ms),o=i[i.length-1],c=o?o.params:{};o&&o.pathname;let d=o?o.pathnameBase:"/";o&&o.route;let f=vs(),h;if(t){var p;let x=typeof t=="string"?_c(t):t;d==="/"||(p=x.pathname)!=null&&p.startsWith(d)||jn(!1),h=x}else h=f;let y=h.pathname||"/",g=y;if(d!=="/"){let x=d.replace(/^\//,"").split("/");g="/"+y.replace(/^\//,"").split("/").slice(x.length).join("/")}let j=gV(e,{pathname:g}),b=XV(j&&j.map(x=>Object.assign({},x,{params:Object.assign({},c,x.params),pathname:Pi([d,a.encodeLocation?a.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?d:Pi([d,a.encodeLocation?a.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),i,n,r);return t&&b?v.createElement(Um.Provider,{value:{location:id({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:Ai.Pop}},b):b}function HV(){let e=eH(),t=LV(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:a},n):null,null)}const KV=v.createElement(HV,null);class GV extends v.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?v.createElement(ms.Provider,{value:this.props.routeContext},v.createElement(lD.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function YV(e){let{routeContext:t,match:n,children:r}=e,a=v.useContext(zm);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(ms.Provider,{value:t},r)}function XV(e,t,n,r){var a;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,c=(a=n)==null?void 0:a.errors;if(c!=null){let h=o.findIndex(p=>p.route.id&&c?.[p.route.id]!==void 0);h>=0||jn(!1),o=o.slice(0,Math.min(o.length,h+1))}let d=!1,f=-1;if(n&&r&&r.v7_partialHydration)for(let h=0;h<o.length;h++){let p=o[h];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(f=h),p.route.id){let{loaderData:y,errors:g}=n,j=p.route.loader&&y[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,y)=>{let g,j=!1,b=null,x=null;n&&(g=c&&p.route.id?c[p.route.id]:void 0,b=p.route.errorElement||KV,d&&(f<0&&y===0?(nH("route-fallback"),j=!0,x=null):f===y&&(j=!0,x=p.route.hydrateFallbackElement||null)));let S=t.concat(o.slice(0,y+1)),N=()=>{let _;return g?_=b:j?_=x:p.route.Component?_=v.createElement(p.route.Component,null):p.route.element?_=p.route.element:_=h,v.createElement(YV,{match:p,routeContext:{outlet:h,matches:S,isDataRoute:n!=null},children:_})};return n&&(p.route.ErrorBoundary||p.route.errorElement||y===0)?v.createElement(GV,{location:n.location,revalidation:n.revalidation,component:b,error:g,children:N(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):N()},null)}var uD=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(uD||{}),dD=(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})(dD||{});function QV(e){let t=v.useContext(zm);return t||jn(!1),t}function JV(e){let t=v.useContext(oD);return t||jn(!1),t}function ZV(e){let t=v.useContext(ms);return t||jn(!1),t}function fD(e){let t=ZV(),n=t.matches[t.matches.length-1];return n.route.id||jn(!1),n.route.id}function eH(){var e;let t=v.useContext(lD),n=JV(),r=fD();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function tH(){let{router:e}=QV(uD.UseNavigateStable),t=fD(dD.UseNavigateStable),n=v.useRef(!1);return cD(()=>{n.current=!0}),v.useCallback(function(a,i){i===void 0&&(i={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,id({fromRouteId:t},i)))},[e,t])}const $E={};function nH(e,t,n){$E[e]||($E[e]=!0)}function rH(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function pD(e){let{to:t,replace:n,state:r,relative:a}=e;Ac()||jn(!1);let{future:i,static:o}=v.useContext(Ys),{matches:c}=v.useContext(ms),{pathname:d}=vs(),f=ja(),h=BS(t,FS(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 DE(e){return qV(e.context)}function Yt(e){jn(!1)}function aH(e){let{basename:t="/",children:n=null,location:r,navigationType:a=Ai.Pop,navigator:i,static:o=!1,future:c}=e;Ac()&&jn(!1);let d=t.replace(/^\/*/,"/"),f=v.useMemo(()=>({basename:d,navigator:i,static:o,future:id({v7_relativeSplatPath:!1},c)}),[d,c,i,o]);typeof r=="string"&&(r=_c(r));let{pathname:h="/",search:p="",hash:y="",state:g=null,key:j="default"}=r,b=v.useMemo(()=>{let x=Hl(h,d);return x==null?null:{location:{pathname:x,search:p,hash:y,state:g,key:j},navigationType:a}},[d,h,p,y,g,j,a]);return b==null?null:v.createElement(Ys.Provider,{value:f},v.createElement(Um.Provider,{children:n,value:b}))}function sH(e){let{children:t,location:n}=e;return WV(A1(t),n)}new Promise(()=>{});function A1(e,t){t===void 0&&(t=[]);let n=[];return v.Children.forEach(e,(r,a)=>{if(!v.isValidElement(r))return;let i=[...t,a];if(r.type===v.Fragment){n.push.apply(n,A1(r.props.children,i));return}r.type!==Yt&&jn(!1),!r.props.index||!r.props.children||jn(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=A1(r.props.children,i)),n.push(o)}),n}function fh(){return fh=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},fh.apply(this,arguments)}function hD(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function iH(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function oH(e,t){return e.button===0&&(!t||t==="_self")&&!iH(e)}function E1(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function lH(e,t){let n=E1(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}const cH=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],uH=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],dH="6";try{window.__reactRouterVersion=dH}catch{}const fH=v.createContext({isTransitioning:!1}),pH="startTransition",LE=Sm[pH];function hH(e){let{basename:t,children:n,future:r,window:a}=e,i=v.useRef();i.current==null&&(i.current=hV({window:a,v5Compat:!0}));let o=i.current,[c,d]=v.useState({action:o.action,location:o.location}),{v7_startTransition:f}=r||{},h=v.useCallback(p=>{f&&LE?LE(()=>d(p)):d(p)},[d,f]);return v.useLayoutEffect(()=>o.listen(h),[o,h]),v.useEffect(()=>rH(r),[r]),v.createElement(aH,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:o,future:r})}const mH=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",vH=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yt=v.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:i,replace:o,state:c,target:d,to:f,preventScrollReset:h,viewTransition:p}=t,y=hD(t,cH),{basename:g}=v.useContext(Ys),j,b=!1;if(typeof f=="string"&&vH.test(f)&&(j=f,mH))try{let _=new URL(window.location.href),P=f.startsWith("//")?new URL(_.protocol+f):new URL(f),A=Hl(P.pathname,g);P.origin===_.origin&&A!=null?f=A+P.search+P.hash:b=!0}catch{}let x=BV(f,{relative:a}),S=xH(f,{replace:o,state:c,target:d,preventScrollReset:h,relative:a,viewTransition:p});function N(_){r&&r(_),_.defaultPrevented||S(_)}return v.createElement("a",fh({},y,{href:j||x,onClick:b||i?r:N,ref:n,target:d}))}),gH=v.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:a=!1,className:i="",end:o=!1,style:c,to:d,viewTransition:f,children:h}=t,p=hD(t,uH),y=qm(d,{relative:p.relative}),g=vs(),j=v.useContext(oD),{navigator:b,basename:x}=v.useContext(Ys),S=j!=null&&bH(y)&&f===!0,N=b.encodeLocation?b.encodeLocation(y).pathname:y.pathname,_=g.pathname,P=j&&j.navigation&&j.navigation.location?j.navigation.location.pathname:null;a||(_=_.toLowerCase(),P=P?P.toLowerCase():null,N=N.toLowerCase()),P&&x&&(P=Hl(P,x)||P);const A=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let O=_===N||!o&&_.startsWith(N)&&_.charAt(A)==="/",k=P!=null&&(P===N||!o&&P.startsWith(N)&&P.charAt(N.length)==="/"),R={isActive:O,isPending:k,isTransitioning:S},M=O?r:void 0,z;typeof i=="function"?z=i(R):z=[i,O?"active":null,k?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let B=typeof c=="function"?c(R):c;return v.createElement(yt,fh({},p,{"aria-current":M,className:z,ref:n,style:B,to:d,viewTransition:f}),typeof h=="function"?h(R):h)});var P1;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(P1||(P1={}));var FE;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(FE||(FE={}));function yH(e){let t=v.useContext(zm);return t||jn(!1),t}function xH(e,t){let{target:n,replace:r,state:a,preventScrollReset:i,relative:o,viewTransition:c}=t===void 0?{}:t,d=ja(),f=vs(),h=qm(e,{relative:o});return v.useCallback(p=>{if(oH(p,n)){p.preventDefault();let y=r!==void 0?r:dh(f)===dh(h);d(e,{replace:y,state:a,preventScrollReset:i,relative:o,viewTransition:c})}},[f,d,h,r,a,n,e,i,o,c])}function Ec(e){let t=v.useRef(E1(e)),n=v.useRef(!1),r=vs(),a=v.useMemo(()=>lH(r.search,n.current?null:t.current),[r.search]),i=ja(),o=v.useCallback((c,d)=>{const f=E1(typeof c=="function"?c(a):c);n.current=!0,i("?"+f,d)},[i,a]);return[a,o]}function bH(e,t){t===void 0&&(t={});let n=v.useContext(fH);n==null&&jn(!1);let{basename:r}=yH(P1.useViewTransitionState),a=qm(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Hl(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Hl(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Xt(a.pathname,o)!=null||Xt(a.pathname,i)!=null}var wH=Symbol.for("react.lazy"),ph=Sm[" use ".trim().toString()];function jH(e){return typeof e=="object"&&e!==null&&"then"in e}function mD(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===wH&&"_payload"in e&&jH(e._payload)}function Wm(e){const t=SH(e),n=v.forwardRef((r,a)=>{let{children:i,...o}=r;mD(i)&&typeof ph=="function"&&(i=ph(i._payload));const c=v.Children.toArray(i),d=c.find(CH);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}var Di=Wm("Slot");function SH(e){const t=v.forwardRef((n,r)=>{let{children:a,...i}=n;if(mD(a)&&typeof ph=="function"&&(a=ph(a._payload)),v.isValidElement(a)){const o=AH(a),c=_H(i,a.props);return a.type!==v.Fragment&&(c.ref=r?jr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var NH=Symbol("radix.slottable");function CH(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===NH}function _H(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 AH(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 Ky=768;function EH(){const[e,t]=v.useState(void 0);return v.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Ky-1}px)`),r=()=>{t(window.innerWidth<Ky)};return n.addEventListener("change",r),t(window.innerWidth<Ky),()=>n.removeEventListener("change",r)},[]),!!e}const zS=Io("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"}}),se=v.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},i)=>{const o=r?Di:"button";return s.jsx(o,{className:je(zS({variant:t,size:n,className:e})),ref:i,...a})});se.displayName="Button";const mt=v.forwardRef(({className:e,type:t,...n},r)=>s.jsx("input",{type:t,className:je("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));mt.displayName="Input";var PH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],OH=PH.reduce((e,t)=>{const n=Wm(`Primitive.${t}`),r=v.forwardRef((a,i)=>{const{asChild:o,...c}=a,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),kH="Separator",BE="horizontal",RH=["horizontal","vertical"],vD=v.forwardRef((e,t)=>{const{decorative:n,orientation:r=BE,...a}=e,i=TH(r)?r:BE,c=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return s.jsx(OH.div,{"data-orientation":i,...c,...a,ref:t})});vD.displayName=kH;function TH(e){return RH.includes(e)}var gD=vD;const yD=v.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>s.jsx(gD,{ref:a,decorative:n,orientation:t,className:je("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));yD.displayName=gD.displayName;var Gy="focusScope.autoFocusOnMount",Yy="focusScope.autoFocusOnUnmount",zE={bubbles:!1,cancelable:!0},IH="FocusScope",Qd=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[c,d]=v.useState(null),f=En(a),h=En(i),p=v.useRef(null),y=ft(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(_){if(g.paused||!c)return;const P=_.target;c.contains(P)?p.current=P:Si(p.current,{select:!0})},x=function(_){if(g.paused||!c)return;const P=_.relatedTarget;P!==null&&(c.contains(P)||Si(p.current,{select:!0}))},S=function(_){if(document.activeElement===document.body)for(const A of _)A.removedNodes.length>0&&Si(c)};document.addEventListener("focusin",b),document.addEventListener("focusout",x);const N=new MutationObserver(S);return c&&N.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",x),N.disconnect()}}},[r,c,g.paused]),v.useEffect(()=>{if(c){qE.add(g);const b=document.activeElement;if(!c.contains(b)){const S=new CustomEvent(Gy,zE);c.addEventListener(Gy,f),c.dispatchEvent(S),S.defaultPrevented||(MH(BH(xD(c)),{select:!0}),document.activeElement===b&&Si(c))}return()=>{c.removeEventListener(Gy,f),setTimeout(()=>{const S=new CustomEvent(Yy,zE);c.addEventListener(Yy,h),c.dispatchEvent(S),S.defaultPrevented||Si(b??document.body,{select:!0}),c.removeEventListener(Yy,h),qE.remove(g)},0)}}},[c,f,h,g]);const j=v.useCallback(b=>{if(!n&&!r||g.paused)return;const x=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,S=document.activeElement;if(x&&S){const N=b.currentTarget,[_,P]=$H(N);_&&P?!b.shiftKey&&S===P?(b.preventDefault(),n&&Si(_,{select:!0})):b.shiftKey&&S===_&&(b.preventDefault(),n&&Si(P,{select:!0})):S===N&&b.preventDefault()}},[n,r,g.paused]);return s.jsx(Be.div,{tabIndex:-1,...o,ref:y,onKeyDown:j})});Qd.displayName=IH;function MH(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Si(r,{select:t}),document.activeElement!==n)return}function $H(e){const t=xD(e),n=UE(t,e),r=UE(t.reverse(),e);return[n,r]}function xD(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 UE(e,t){for(const n of e)if(!DH(n,{upTo:t}))return n}function DH(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function LH(e){return e instanceof HTMLInputElement&&"select"in e}function Si(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&LH(e)&&t&&e.select()}}var qE=FH();function FH(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=WE(e,t),e.unshift(t)},remove(t){e=WE(e,t),e[0]?.resume()}}}function WE(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function BH(e){return e.filter(t=>t.tagName!=="A")}var Xy=0;function Vm(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??VE()),document.body.insertAdjacentElement("beforeend",e[1]??VE()),Xy++,()=>{Xy===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Xy--}},[])}function VE(){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 rs=function(){return rs=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},rs.apply(this,arguments)};function bD(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function zH(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,i;r<a;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var th="right-scroll-bar-position",nh="width-before-scroll-bar",UH="with-scroll-bars-hidden",qH="--removed-body-scroll-bar-size";function Qy(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function WH(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var VH=typeof window<"u"?v.useLayoutEffect:v.useEffect,HE=new WeakMap;function HH(e,t){var n=WH(null,function(r){return e.forEach(function(a){return Qy(a,r)})});return VH(function(){var r=HE.get(n);if(r){var a=new Set(r),i=new Set(e),o=n.current;a.forEach(function(c){i.has(c)||Qy(c,null)}),i.forEach(function(c){a.has(c)||Qy(c,o)})}HE.set(n,e)},[e]),n}function KH(e){return e}function GH(e,t){t===void 0&&(t=KH);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var o=t(i,r);return n.push(o),function(){n=n.filter(function(c){return c!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(c){return i(c)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var c=n;n=[],c.forEach(i),o=n}var d=function(){var h=o;o=[],h.forEach(i)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(h){o.push(h),f()},filter:function(h){return o=o.filter(h),n}}}};return a}function YH(e){e===void 0&&(e={});var t=GH(null);return t.options=rs({async:!0,ssr:!1},e),t}var wD=function(e){var t=e.sideCar,n=bD(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,rs({},n))};wD.isSideCarExport=!0;function XH(e,t){return e.useMedium(t),wD}var jD=YH(),Jy=function(){},Hm=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:Jy,onWheelCapture:Jy,onTouchMoveCapture:Jy}),a=r[0],i=r[1],o=e.forwardProps,c=e.children,d=e.className,f=e.removeScrollBar,h=e.enabled,p=e.shards,y=e.sideCar,g=e.noRelative,j=e.noIsolation,b=e.inert,x=e.allowPinchZoom,S=e.as,N=S===void 0?"div":S,_=e.gapMode,P=bD(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=y,O=HH([n,t]),k=rs(rs({},P),a);return v.createElement(v.Fragment,null,h&&v.createElement(A,{sideCar:jD,removeScrollBar:f,shards:p,noRelative:g,noIsolation:j,inert:b,setCallbacks:i,allowPinchZoom:!!x,lockRef:n,gapMode:_}),o?v.cloneElement(v.Children.only(c),rs(rs({},k),{ref:O})):v.createElement(N,rs({},k,{className:d,ref:O}),c))});Hm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Hm.classNames={fullWidth:nh,zeroRight:th};var QH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function JH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=QH();return t&&e.setAttribute("nonce",t),e}function ZH(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function eK(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var tK=function(){var e=0,t=null;return{add:function(n){e==0&&(t=JH())&&(ZH(t,n),eK(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},nK=function(){var e=tK();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},SD=function(){var e=nK(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},rK={left:0,top:0,right:0,gap:0},Zy=function(e){return parseInt(e||"",10)||0},aK=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[Zy(n),Zy(r),Zy(a)]},sK=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return rK;var t=aK(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},iK=SD(),Il="data-scroll-locked",oK=function(e,t,n,r){var a=e.left,i=e.top,o=e.right,c=e.gap;return n===void 0&&(n="margin"),`
10
- .`.concat(UH,` {
11
- overflow: hidden `).concat(r,`;
12
- padding-right: `).concat(c,"px ").concat(r,`;
13
- }
14
- body[`).concat(Il,`] {
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(th,` {
28
- right: `).concat(c,"px ").concat(r,`;
29
- }
30
-
31
- .`).concat(nh,` {
32
- margin-right: `).concat(c,"px ").concat(r,`;
33
- }
34
-
35
- .`).concat(th," .").concat(th,` {
36
- right: 0 `).concat(r,`;
37
- }
38
-
39
- .`).concat(nh," .").concat(nh,` {
40
- margin-right: 0 `).concat(r,`;
41
- }
42
-
43
- body[`).concat(Il,`] {
44
- `).concat(qH,": ").concat(c,`px;
45
- }
46
- `)},KE=function(){var e=parseInt(document.body.getAttribute(Il)||"0",10);return isFinite(e)?e:0},lK=function(){v.useEffect(function(){return document.body.setAttribute(Il,(KE()+1).toString()),function(){var e=KE()-1;e<=0?document.body.removeAttribute(Il):document.body.setAttribute(Il,e.toString())}},[])},cK=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;lK();var i=v.useMemo(function(){return sK(a)},[a]);return v.createElement(iK,{styles:oK(i,!t,a,n?"":"!important")})},O1=!1;if(typeof window<"u")try{var Op=Object.defineProperty({},"passive",{get:function(){return O1=!0,!0}});window.addEventListener("test",Op,Op),window.removeEventListener("test",Op,Op)}catch{O1=!1}var pl=O1?{passive:!1}:!1,uK=function(e){return e.tagName==="TEXTAREA"},ND=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!uK(e)&&n[t]==="visible")},dK=function(e){return ND(e,"overflowY")},fK=function(e){return ND(e,"overflowX")},GE=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=CD(e,r);if(a){var i=_D(e,r),o=i[1],c=i[2];if(o>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},pK=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},hK=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},CD=function(e,t){return e==="v"?dK(t):fK(t)},_D=function(e,t){return e==="v"?pK(t):hK(t)},mK=function(e,t){return e==="h"&&t==="rtl"?-1:1},vK=function(e,t,n,r,a){var i=mK(e,window.getComputedStyle(t).direction),o=i*r,c=n.target,d=t.contains(c),f=!1,h=o>0,p=0,y=0;do{if(!c)break;var g=_D(e,c),j=g[0],b=g[1],x=g[2],S=b-x-i*j;(j||S)&&CD(e,c)&&(p+=S,y+=j);var N=c.parentNode;c=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(h&&Math.abs(p)<1||!h&&Math.abs(y)<1)&&(f=!0),f},kp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},YE=function(e){return[e.deltaX,e.deltaY]},XE=function(e){return e&&"current"in e?e.current:e},gK=function(e,t){return e[0]===t[0]&&e[1]===t[1]},yK=function(e){return`
47
- .block-interactivity-`.concat(e,` {pointer-events: none;}
48
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
49
- `)},xK=0,hl=[];function bK(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),a=v.useState(xK++)[0],i=v.useState(SD)[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=zH([e.lockRef.current],(e.shards||[]).map(XE),!0).filter(Boolean);return b.forEach(function(x){return x.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),b.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var c=v.useCallback(function(b,x){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!o.current.allowPinchZoom;var S=kp(b),N=n.current,_="deltaX"in b?b.deltaX:N[0]-S[0],P="deltaY"in b?b.deltaY:N[1]-S[1],A,O=b.target,k=Math.abs(_)>Math.abs(P)?"h":"v";if("touches"in b&&k==="h"&&O.type==="range")return!1;var R=window.getSelection(),M=R&&R.anchorNode,z=M?M===O||M.contains(O):!1;if(z)return!1;var B=GE(k,O);if(!B)return!0;if(B?A=k:(A=k==="v"?"h":"v",B=GE(k,O)),!B)return!1;if(!r.current&&"changedTouches"in b&&(_||P)&&(r.current=A),!A)return!0;var D=r.current||A;return vK(D,x,b,D==="h"?_:P)},[]),d=v.useCallback(function(b){var x=b;if(!(!hl.length||hl[hl.length-1]!==i)){var S="deltaY"in x?YE(x):kp(x),N=t.current.filter(function(A){return A.name===x.type&&(A.target===x.target||x.target===A.shadowParent)&&gK(A.delta,S)})[0];if(N&&N.should){x.cancelable&&x.preventDefault();return}if(!N){var _=(o.current.shards||[]).map(XE).filter(Boolean).filter(function(A){return A.contains(x.target)}),P=_.length>0?c(x,_[0]):!o.current.noIsolation;P&&x.cancelable&&x.preventDefault()}}},[]),f=v.useCallback(function(b,x,S,N){var _={name:b,delta:x,target:S,should:N,shadowParent:wK(S)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(P){return P!==_})},1)},[]),h=v.useCallback(function(b){n.current=kp(b),r.current=void 0},[]),p=v.useCallback(function(b){f(b.type,YE(b),b.target,c(b,e.lockRef.current))},[]),y=v.useCallback(function(b){f(b.type,kp(b),b.target,c(b,e.lockRef.current))},[]);v.useEffect(function(){return hl.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:y}),document.addEventListener("wheel",d,pl),document.addEventListener("touchmove",d,pl),document.addEventListener("touchstart",h,pl),function(){hl=hl.filter(function(b){return b!==i}),document.removeEventListener("wheel",d,pl),document.removeEventListener("touchmove",d,pl),document.removeEventListener("touchstart",h,pl)}},[]);var g=e.removeScrollBar,j=e.inert;return v.createElement(v.Fragment,null,j?v.createElement(i,{styles:yK(a)}):null,g?v.createElement(cK,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function wK(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const jK=XH(jD,bK);var Jd=v.forwardRef(function(e,t){return v.createElement(Hm,rs({},e,{ref:t,sideCar:jK}))});Jd.classNames=Hm.classNames;var SK=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ml=new WeakMap,Rp=new WeakMap,Tp={},ex=0,AD=function(e){return e&&(e.host||AD(e.parentNode))},NK=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=AD(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},CK=function(e,t,n,r){var a=NK(t,Array.isArray(e)?e:[e]);Tp[n]||(Tp[n]=new WeakMap);var i=Tp[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(y){if(c.has(y))h(y);else try{var g=y.getAttribute(r),j=g!==null&&g!=="false",b=(ml.get(y)||0)+1,x=(i.get(y)||0)+1;ml.set(y,b),i.set(y,x),o.push(y),b===1&&j&&Rp.set(y,!0),x===1&&y.setAttribute(n,"true"),j||y.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",y,S)}})};return h(t),c.clear(),ex++,function(){o.forEach(function(p){var y=ml.get(p)-1,g=i.get(p)-1;ml.set(p,y),i.set(p,g),y||(Rp.has(p)||p.removeAttribute(r),Rp.delete(p)),g||p.removeAttribute(n)}),ex--,ex||(ml=new WeakMap,ml=new WeakMap,Rp=new WeakMap,Tp={})}},Km=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=SK(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),CK(r,a,n,"aria-hidden")):function(){return null}};function _K(e){const t=AK(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(PK);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function AK(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=kK(a),c=OK(i,a.props);return a.type!==v.Fragment&&(c.ref=r?jr(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 EK=Symbol("radix.slottable");function PK(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===EK}function OK(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function kK(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Gm="Dialog",[ED,PD]=ir(Gm),[RK,za]=ED(Gm),OD=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]=na({prop:r,defaultProp:a??!1,onChange:i,caller:Gm});return s.jsx(RK,{scope:t,triggerRef:c,contentRef:d,contentId:Vn(),titleId:Vn(),descriptionId:Vn(),open:f,onOpenChange:h,onOpenToggle:v.useCallback(()=>h(p=>!p),[h]),modal:o,children:n})};OD.displayName=Gm;var kD="DialogTrigger",RD=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=za(kD,n),i=ft(t,a.triggerRef);return s.jsx(Be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":WS(a.open),...r,ref:i,onClick:Pe(e.onClick,a.onOpenToggle)})});RD.displayName=kD;var US="DialogPortal",[TK,TD]=ED(US,{forceMount:void 0}),ID=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=za(US,t);return s.jsx(TK,{scope:t,forceMount:n,children:v.Children.map(r,o=>s.jsx(Kn,{present:n||i.open,children:s.jsx(jc,{asChild:!0,container:a,children:o})}))})};ID.displayName=US;var hh="DialogOverlay",MD=v.forwardRef((e,t)=>{const n=TD(hh,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=za(hh,e.__scopeDialog);return i.modal?s.jsx(Kn,{present:r||i.open,children:s.jsx(MK,{...a,ref:t})}):null});MD.displayName=hh;var IK=_K("DialogOverlay.RemoveScroll"),MK=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=za(hh,n);return s.jsx(Jd,{as:IK,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(Be.div,{"data-state":WS(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),wo="DialogContent",$D=v.forwardRef((e,t)=>{const n=TD(wo,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=za(wo,e.__scopeDialog);return s.jsx(Kn,{present:r||i.open,children:i.modal?s.jsx($K,{...a,ref:t}):s.jsx(DK,{...a,ref:t})})});$D.displayName=wo;var $K=v.forwardRef((e,t)=>{const n=za(wo,e.__scopeDialog),r=v.useRef(null),a=ft(t,n.contentRef,r);return v.useEffect(()=>{const i=r.current;if(i)return Km(i)},[]),s.jsx(DD,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pe(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Pe(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0;(o.button===2||c)&&i.preventDefault()}),onFocusOutside:Pe(e.onFocusOutside,i=>i.preventDefault())})}),DK=v.forwardRef((e,t)=>{const n=za(wo,e.__scopeDialog),r=v.useRef(!1),a=v.useRef(!1);return s.jsx(DD,{...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()}})}),DD=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,c=za(wo,n),d=v.useRef(null),f=ft(t,d);return Vm(),s.jsxs(s.Fragment,{children:[s.jsx(Qd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(To,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":WS(c.open),...o,ref:f,onDismiss:()=>c.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(FK,{titleId:c.titleId}),s.jsx(zK,{contentRef:d,descriptionId:c.descriptionId})]})]})}),qS="DialogTitle",LD=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=za(qS,n);return s.jsx(Be.h2,{id:a.titleId,...r,ref:t})});LD.displayName=qS;var FD="DialogDescription",BD=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=za(FD,n);return s.jsx(Be.p,{id:a.descriptionId,...r,ref:t})});BD.displayName=FD;var zD="DialogClose",UD=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=za(zD,n);return s.jsx(Be.button,{type:"button",...r,ref:t,onClick:Pe(e.onClick,()=>a.onOpenChange(!1))})});UD.displayName=zD;function WS(e){return e?"open":"closed"}var qD="DialogTitleWarning",[LK,WD]=E7(qD,{contentName:wo,titleName:qS,docsSlug:"dialog"}),FK=({titleId:e})=>{const t=WD(qD),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
50
-
51
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
52
-
53
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},BK="DialogDescriptionWarning",zK=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${WD(BK).contentName}}.`;return v.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Ym=OD,UK=RD,Xm=ID,Pc=MD,Oc=$D,Zd=LD,ef=BD,Qm=UD;const VD=Ym,qK=Xm,HD=v.forwardRef(({className:e,...t},n)=>s.jsx(Pc,{className:je("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));HD.displayName=Pc.displayName;const WK=Io("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"}}),VS=v.forwardRef(({side:e="right",className:t,children:n,...r},a)=>s.jsxs(qK,{children:[s.jsx(HD,{}),s.jsxs(Oc,{ref:a,className:je(WK({side:e}),t),...r,children:[n,s.jsxs(Qm,{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(Us,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));VS.displayName=Oc.displayName;const KD=({className:e,...t})=>s.jsx("div",{className:je("flex flex-col space-y-2 text-center sm:text-left",e),...t});KD.displayName="SheetHeader";const GD=v.forwardRef(({className:e,...t},n)=>s.jsx(Zd,{ref:n,className:je("text-lg font-semibold text-foreground",e),...t}));GD.displayName=Zd.displayName;const VK=v.forwardRef(({className:e,...t},n)=>s.jsx(ef,{ref:n,className:je("text-sm text-muted-foreground",e),...t}));VK.displayName=ef.displayName;function QE({className:e,...t}){return s.jsx("div",{className:je("animate-pulse rounded-md bg-muted",e),...t})}const HK="sidebar:state",KK=3600*24*7,GK="16rem",YK="18rem",XK="3rem",QK="b",YD=v.createContext(null);function tf(){const e=v.useContext(YD);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const XD=v.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:i,...o},c)=>{const d=EH(),[f,h]=v.useState(!1),[p,y]=v.useState(e),g=t??p,j=v.useCallback(N=>{const _=typeof N=="function"?N(g):N;n?n(_):y(_),document.cookie=`${HK}=${_}; path=/; max-age=${KK}`},[n,g]),b=v.useCallback(()=>d?h(N=>!N):j(N=>!N),[d,j,h]);v.useEffect(()=>{const N=_=>{_.key===QK&&(_.metaKey||_.ctrlKey)&&(_.preventDefault(),b())};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[b]);const x=g?"expanded":"collapsed",S=v.useMemo(()=>({state:x,open:g,setOpen:j,isMobile:d,openMobile:f,setOpenMobile:h,toggleSidebar:b}),[x,g,j,d,f,h,b]);return s.jsx(YD.Provider,{value:S,children:s.jsx(Y$,{delayDuration:0,children:s.jsx("div",{style:{"--sidebar-width":GK,"--sidebar-width-icon":XK,...a},className:je("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:c,...o,children:i})})})});XD.displayName="SidebarProvider";const QD=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}=tf();return n==="none"?s.jsx("div",{className:je("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",r),ref:o,...i,children:a}):c?s.jsx(VD,{open:f,onOpenChange:h,...i,children:s.jsx(VS,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":YK},side:e,children:s.jsx("div",{className:"flex h-full w-full flex-col",children:a})})}):s.jsxs("div",{ref:o,className:"group peer hidden text-sidebar-foreground md:block","data-state":d,"data-collapsible":d==="collapsed"?n:"","data-variant":t,"data-side":e,children:[s.jsx("div",{className:je("relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),s.jsx("div",{className:je("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...i,children:s.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:a})})]})});QD.displayName="Sidebar";const JD=v.forwardRef(({className:e,onClick:t,...n},r)=>{const{toggleSidebar:a}=tf();return s.jsxs(se,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:je("h-7 w-7",e),onClick:i=>{t?.(i),a()},...n,children:[s.jsx(IU,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});JD.displayName="SidebarTrigger";const JK=v.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=tf();return s.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:je("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] group-data-[side=left]:-right-4 group-data-[side=right]:left-0 hover:after:bg-sidebar-border sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});JK.displayName="SidebarRail";const ZK=v.forwardRef(({className:e,...t},n)=>s.jsx("main",{ref:n,className:je("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));ZK.displayName="SidebarInset";const eG=v.forwardRef(({className:e,...t},n)=>s.jsx(mt,{ref:n,"data-sidebar":"input",className:je("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));eG.displayName="SidebarInput";const ZD=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"header",className:je("flex flex-col gap-2 p-2",e),...t}));ZD.displayName="SidebarHeader";const e3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"footer",className:je("flex flex-col gap-2 p-2",e),...t}));e3.displayName="SidebarFooter";const k1=v.forwardRef(({className:e,...t},n)=>s.jsx(yD,{ref:n,"data-sidebar":"separator",className:je("mx-2 w-auto bg-sidebar-border",e),...t}));k1.displayName="SidebarSeparator";const t3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"content",className:je("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));t3.displayName="SidebarContent";const n3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"group",className:je("relative flex w-full min-w-0 flex-col p-2",e),...t}));n3.displayName="SidebarGroup";const r3=v.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const a=t?Di:"div";return s.jsx(a,{ref:r,"data-sidebar":"group-label",className:je("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...n})});r3.displayName="SidebarGroupLabel";const tG=v.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const a=t?Di:"button";return s.jsx(a,{ref:r,"data-sidebar":"group-action",className:je("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...n})});tG.displayName="SidebarGroupAction";const a3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"group-content",className:je("w-full text-sm",e),...t}));a3.displayName="SidebarGroupContent";const s3=v.forwardRef(({className:e,...t},n)=>s.jsx("ul",{ref:n,"data-sidebar":"menu",className:je("flex w-full min-w-0 flex-col gap-1",e),...t}));s3.displayName="SidebarMenu";const i3=v.forwardRef(({className:e,...t},n)=>s.jsx("li",{ref:n,"data-sidebar":"menu-item",className:je("group/menu-item relative",e),...t}));i3.displayName="SidebarMenuItem";const nG=Io("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"}}),o3=v.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:a,className:i,...o},c)=>{const d=e?Di:"button",{isMobile:f,state:h}=tf(),p=s.jsx(d,{ref:c,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:je(nG({variant:n,size:r}),i),...o});return a?(typeof a=="string"&&(a={children:a}),s.jsxs(X$,{children:[s.jsx(Q$,{asChild:!0,children:p}),s.jsx(MS,{side:"right",align:"center",hidden:h!=="collapsed"||f,...a})]})):p});o3.displayName="SidebarMenuButton";const rG=v.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},a)=>{const i=t?Di:"button";return s.jsx(i,{ref:a,"data-sidebar":"menu-action",className:je("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...r})});rG.displayName="SidebarMenuAction";const aG=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:je("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));aG.displayName="SidebarMenuBadge";const sG=v.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{const a=v.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return s.jsxs("div",{ref:r,"data-sidebar":"menu-skeleton",className:je("flex h-8 items-center gap-2 rounded-md px-2",e),...n,children:[t&&s.jsx(QE,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),s.jsx(QE,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":a}})]})});sG.displayName="SidebarMenuSkeleton";const iG=v.forwardRef(({className:e,...t},n)=>s.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:je("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));iG.displayName="SidebarMenuSub";const oG=v.forwardRef(({...e},t)=>s.jsx("li",{ref:t,...e}));oG.displayName="SidebarMenuSubItem";const lG=v.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...a},i)=>{const o=e?Di:"a";return s.jsx(o,{ref:i,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:je("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),...a})});lG.displayName="SidebarMenuSubButton";const l3=v.forwardRef(({className:e,activeClassName:t,pendingClassName:n,to:r,...a},i)=>s.jsx(gH,{ref:i,to:r,className:({isActive:o,isPending:c})=>je(e,o&&t,c&&n),...a}));l3.displayName="NavLink";function cG({width:e=24,height:t=24,from:n="#53afba",to:r="#76fffb",...a}){const i=`grad-${v.useId().slice(1)}`;return s.jsxs("svg",{className:"inline-block",width:e,height:t,viewBox:"0 0 1648 1648",xmlns:"http://www.w3.org/2000/svg",...a,children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:i,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[s.jsx("stop",{offset:"0%",style:{stopColor:n}}),s.jsx("stop",{offset:"100%",style:{stopColor:r}})]})}),s.jsx("path",{d:"m610 216.654c-66.158 4.092-126.119 35.849-164.917 87.346-8.408 11.16-13.344 19.191-19.983 32.513-12.431 24.946-19.521 50.434-22.11 79.487-1.665 18.687-.854 826.238.841 837.939 7.867 54.284 32.465 101.134 70.706 134.667 16.297 14.291 32.283 24.657 53.963 34.991 16.889 8.05 34.568 13.468 60.5 18.541 9.019 1.764 52.201 1.795 61.5.044 26.487-4.989 43.97-10.341 61-18.675 15.131-7.406 21.53-11.135 60.5-35.267 20.813-12.887 23.095-14.298 29.5-18.24l13-8 13-8c6.901-4.247 12.593-7.767 29.54-18.271 5.796-3.593 12.771-7.863 15.5-9.49 2.728-1.626 8.56-5.19 12.96-7.921 4.4-2.73 72.575-44.711 151.5-93.29s150.925-92.918 160-98.531c9.075-5.612 24.15-14.936 33.5-20.719s23.075-14.234 30.5-18.78c85.169-52.142 120.029-73.942 130.014-81.304 40.974-30.211 68.344-69.764 81.788-118.194 13.864-49.94 8.549-104.847-14.809-153-16.836-34.708-41.252-62.432-74.993-85.154-4.125-2.778-17.625-11.26-30-18.849s-27-16.594-32.5-20.009c-5.5-3.416-109.45-67.427-231-142.246-306.386-188.593-335.221-206.352-350-215.553-30.562-19.028-59.301-29.911-90-34.083-11.697-1.59-30.408-2.514-39.5-1.952m-10.5 77.269c-39.541 6.402-76.013 29.73-97.661 62.467-13.001 19.66-19.718 38.39-22.802 63.584-1.472 12.028-1.434 802.191.04 818.026 1.861 19.998 6.142 35.48 14.415 52.133 17.942 36.114 53.025 64.18 91.508 73.203 3.575.839 8.975 2.118 12 2.844 8.221 1.973 40.343 1.613 49.971-.56 32.301-7.289 65.233-26.686 94.817-55.849 15.26-15.042 22.884-24.803 33.571-42.979 13.939-23.706 20.949-43.36 27.745-77.792 1.004-5.086 1.428-50 1.949-206.5.465-139.686 1.001-201.809 1.777-206 .611-3.3 1.608-9.15 2.217-13 1.672-10.583 4.039-21.117 7.191-32 8.179-28.247 20.714-55.13 37.188-79.751 24.262-36.262 53.189-63.572 93.074-87.872 4.95-3.016 12.825-7.435 17.5-9.82s8.95-4.668 9.5-5.074c3.565-2.63 34.688-13.266 52.465-17.93 6.2-1.627 11.49-3.174 11.754-3.439 1.003-1.002-1.016-2.602-10.967-8.689-5.639-3.449-16.552-10.172-24.252-14.94-13.435-8.319-31.76-19.604-58.5-36.029-6.875-4.222-16.1-9.911-20.5-12.641-7.667-4.758-73.088-45.103-122.5-75.546-75.227-46.348-108.509-66.591-116.5-70.86-9.422-5.033-25.23-10.76-37.043-13.419-7.967-1.794-40.076-2.843-47.957-1.567m473.5 305.564c-5.775.685-11.625 1.491-13 1.792-1.375.3-5.2 1.088-8.5 1.749-7.914 1.587-27.103 7.461-36.5 11.174-38.797 15.33-75.171 44.925-98.829 80.41-11.24 16.86-21.329 38.407-26.167 55.888-2.443 8.825-3.85 14.608-4.866 20-.621 3.3-1.653 8.475-2.292 11.5-.846 4.008-1.345 59.624-1.837 205-.618 182.331-.824 200.361-2.399 209.5-1.629 9.459-4.196 22.506-6.744 34.279-.628 2.903-.881 5.54-.561 5.859.596.596 455.986-279.084 472.195-290.001 17.547-11.819 36.335-33.412 46.291-53.203 3.956-7.863 9.527-23.924 11.597-33.434 4.848-22.272 3.572-48.26-3.506-71.387-6.907-22.572-18.055-40.93-35.316-58.158-12.705-12.681-16.829-15.485-79.066-53.756-7.15-4.397-15.7-9.654-19-11.684-3.3-2.029-8.925-5.504-12.5-7.722-53.826-33.397-67.199-40.611-88.616-47.8-29.343-9.85-61.599-13.421-90.384-10.006m-1066.25 1048.256c3.988.189 10.513.189 14.5 0 3.988-.19.725-.346-7.25-.346s-11.238.156-7.25.346",fill:`url(#${i})`,fillRule:"evenodd"})]})}const uG=[{title:"Home",items:[{title:"Dashboard",url:"/",icon:r$}]},{title:"Lab",items:[{title:"MCP Evaluations",url:"/mcp-evaluations",icon:n$},{title:"Analyze MCP",url:"/tool-analysis",icon:a$}]},{title:"Libraries",items:[{title:"Test Cases",url:"/libraries/test-cases",icon:t$},{title:"Servers",url:"/libraries/servers",icon:e$},{title:"Agents",url:"/libraries/agents",icon:ha}]},{title:"Execution",items:[{title:"Run Evaluation",url:"/run",icon:kl},{title:"Evaluation Results",url:"/results",icon:ed},{title:"Compare Evaluations",url:"/compare",icon:wS},{title:"MCP Analysis Results",url:"/tool-analysis-results",icon:s$},{title:"Custom Reports",url:"/markdown-reports",icon:sh}]},{title:"Workspace",items:[{title:"Settings",url:"/settings",icon:SS}]}];function dG(e={version:null}){const t=e.version??null,{state:n}=tf(),r=n==="collapsed",a=vs(),i=v.useMemo(()=>uG,[]);return s.jsxs(QD,{collapsible:"icon",children:[s.jsx(ZD,{className:`border-b border-sidebar-border py-3 ${r?"px-2":"px-4"}`,children:s.jsxs("div",{className:`flex items-center ${r?"justify-center":"gap-2.5"} overflow-hidden`,children:[s.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-sidebar-accent/50 border border-primary/60",children:s.jsx(cG,{width:22,height:22,from:"#f97316",to:"#fb923c"})}),!r&&s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{className:"text-sm font-semibold text-sidebar-foreground",children:"MCPLab"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"MCP Evaluation Lab"})]})]})}),s.jsx(t3,{children:i.map((o,c)=>s.jsxs("div",{children:[c>0&&!r&&s.jsx(k1,{className:"my-1.5"}),s.jsxs(n3,{className:r?"px-2":"px-3 py-2",children:[!r&&s.jsx(r3,{className:"px-1 pb-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground/90",children:o.title}),s.jsx(a3,{children:s.jsx(s3,{children:o.items.map(d=>s.jsx(i3,{children:s.jsx(o3,{asChild:!0,isActive:d.url==="/"?a.pathname==="/":a.pathname.startsWith(d.url),tooltip:d.title,children:s.jsxs(l3,{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(e3,{className:r?"px-2 py-2":"px-3 py-3",children:[s.jsx(k1,{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(kU,{className:"h-4 w-4 shrink-0"}),!r&&s.jsx("span",{className:"text-xs text-sidebar-foreground/85",children:`v${t??"unknown"}`})]}),!r&&s.jsxs("a",{href:"https://inspectr.dev",target:"_blank",rel:"noreferrer",className:"text-xs text-muted-foreground transition-colors hover:text-sidebar-foreground",children:["Built by ",s.jsx("span",{className:"text-[#00e5ff] hover:text-[#00b8d4]",children:"Inspectr"})]})]})]})]})}const c3=v.forwardRef(({...e},t)=>s.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));c3.displayName="Breadcrumb";const u3=v.forwardRef(({className:e,...t},n)=>s.jsx("ol",{ref:n,className:je("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));u3.displayName="BreadcrumbList";const d3=v.forwardRef(({className:e,...t},n)=>s.jsx("li",{ref:n,className:je("inline-flex items-center gap-1.5",e),...t}));d3.displayName="BreadcrumbItem";const f3=v.forwardRef(({asChild:e,className:t,...n},r)=>{const a=e?Di:"a";return s.jsx(a,{ref:r,className:je("transition-colors hover:text-foreground",t),...n})});f3.displayName="BreadcrumbLink";const p3=v.forwardRef(({className:e,...t},n)=>s.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:je("font-normal text-foreground",e),...t}));p3.displayName="BreadcrumbPage";const h3=({children:e,className:t,...n})=>s.jsx("li",{role:"presentation","aria-hidden":"true",className:je("[&>svg]:size-3.5",t),...n,children:e??s.jsx(ZM,{})});h3.displayName="BreadcrumbSeparator";function fG(e,t){return`${e}-${t+1}`}function bl(e){const t=typeof e.config.name=="string"&&e.config.name.trim().length>0?e.config.name.trim():void 0,n=Array.isArray(e.config.servers)?e.config.servers:[],r=Array.isArray(e.config.agents)?e.config.agents:[],a=new Map,i=[],o=[];for(const p of n){if("ref"in p){const x=String(p.ref||"").trim();if(!x)continue;a.set(x,x),o.push({kind:"referenced",ref:x});continue}const y=String(p.id||p.name||"").trim();if(!y)continue;const g=y;a.set(y,g);const j=p.auth?.type==="bearer"?"bearer":p.auth?.type==="oauth_client_credentials"?"api-key":p.auth?.type==="oauth_authorization_code"?"oauth2":"none",b={id:g,name:String(p.name||y),transport:"streamable-http",url:p.url,authType:j,authValue:p.auth?.type==="bearer"?p.auth.env:void 0,oauthClientId:p.auth?.type==="oauth_authorization_code"?p.auth.client_id:void 0,oauthClientSecret:p.auth?.type==="oauth_authorization_code"?p.auth.client_secret:void 0,oauthRedirectUrl:p.auth?.type==="oauth_authorization_code"?p.auth.redirect_url:void 0,oauthScope:p.auth?.type==="oauth_authorization_code"||p.auth?.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 x=String(p.ref||"").trim();if(!x)continue;d.push({kind:"referenced",ref:x});continue}const y=String(p.id||p.name||"").trim();if(!y)continue;const g=y,j=p.provider==="azure_openai"?"azure":p.provider,b={id:g,name:String(p.name||y),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,y)=>{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||fG("scn",y),name:p.name||p.id||`Scenario ${y+1}`,serverIds:(()=>{if((p.servers??[]).length>0)return p.servers.map(x=>a.get(x)??x).filter(Boolean);const b=p.mcp_servers;return Array.isArray(b)?b.flatMap(x=>{if("ref"in x&&x.ref)return[String(x.ref)];if("id"in x&&x.id){const S=String(x.id);if(!a.has(S)){a.set(S,S);const N=x.auth,_=N?.type==="bearer"?"bearer":N?.type==="oauth_client_credentials"?"api-key":N?.type==="oauth_authorization_code"?"oauth2":"none";i.push({id:S,name:String(x.name||S),transport:"streamable-http",url:String(x.url||""),authType:_,authValue:N?.type==="bearer"?String(N.env||""):void 0,oauthClientId:N?.type==="oauth_authorization_code"?String(N.client_id||""):void 0,oauthClientSecret:N?.type==="oauth_authorization_code"?String(N.client_secret||""):void 0,oauthRedirectUrl:N?.type==="oauth_authorization_code"?String(N.redirect_url||""):void 0,oauthScope:(N?.type==="oauth_authorization_code"||N?.type==="oauth_client_credentials")&&String(N.scope||"")||void 0,oauthTokenUrl:N?.type==="oauth_client_credentials"?String(N.token_url||""):void 0,oauthClientIdEnv:N?.type==="oauth_client_credentials"?String(N.client_id_env||""):void 0,oauthClientSecretEnv:N?.type==="oauth_client_credentials"?String(N.client_secret_env||""):void 0,oauthAudience:N?.type==="oauth_client_credentials"&&String(N.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 pG(e){const t={id:"library",name:"library",path:"library",mtime:new Date(0).toISOString(),config:{servers:Object.entries(e.servers).map(([r,a])=>({id:r,name:a.name||r,transport:a.transport,url:a.url,auth:a.auth})),agents:Object.entries(e.agents).map(([r,a])=>({id:r,name:a.name||r,provider:a.provider,model:a.model,temperature:a.temperature,max_tokens:a.max_tokens,max_turns:a.max_turns,system:a.system})),scenarios:e.scenarios}},n=bl(t);return{servers:n.servers,agents:n.agents,scenarios:n.scenarios}}function JE(e){const t=new Map,n=g=>{const j=g.id,b=g.authType==="bearer"?{type:"bearer",env:g.authValue||"MCP_TOKEN"}: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",...b!==void 0?{auth:b}:{}}},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),x=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 N=t.get(S)??S;return i.get(N)??{ref:N}}):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:x},extract:g.extractRules.map(S=>({name:S.name,from:"final_text",regex:S.pattern}))}},y=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:y,run_defaults:e.runDefaults?.selectedAgentNames&&e.runDefaults.selectedAgentNames.length>0?{selected_agents:[...e.runDefaults.selectedAgentNames]}:void 0,snapshot_eval:e.snapshotEval?{enabled:e.snapshotEval.enabled,mode:e.snapshotEval.mode,baseline_snapshot_id:e.snapshotEval.baselineSnapshotId,baseline_source_run_id:e.snapshotEval.baselineSourceRunId,last_updated_at:e.snapshotEval.lastUpdatedAt}:void 0}}function hG(e){const t=Object.fromEntries((e.servers??[]).map(r=>[r.id,{...r.name&&r.name!==r.id?{name:r.name}:{},transport:"http",url:r.url||"http://localhost:3000/mcp",auth:r.authType==="bearer"?{type:"bearer",env:r.authValue||"MCP_TOKEN"}:r.authType==="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 mG(e,t){if(e)return`${e}::${t??""}`}function Ip(e){return e.type==="text"}function vG(e,t){if(!t)return e.tool_calls.map((a,i)=>({name:a,arguments:{},duration:e.tool_durations_ms[i]??0,timestamp:new Date().toISOString()}));const n=[],r=new Map;for(const a of t.messages)for(const i of a.content)i.type==="tool_use"?n.push({id:i.id,name:i.name,input:i.input??{},ts:a.ts}):i.type==="tool_result"&&r.set(i.tool_use_id,{durationMs:i.duration_ms,tsEnd:i.ts_end});return n.map((a,i)=>{const o=r.get(a.id);return{name:a.name,arguments:a.input,duration:o?.durationMs??e.tool_durations_ms[i]??0,timestamp:o?.tsEnd??a.ts??new Date().toISOString()}})}function gG(e,t){const n=[];if(!e)return n;let r;const a=e.messages??[];for(let i=0;i<a.length;i+=1){const o=a[i];if(o.role==="user"){const c=o.content.filter(Ip);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 y of d.content)y.type==="tool_result"&&(y.tool_use_id?h.set(y.tool_use_id,y):p.push(y));for(const y of c){n.push({id:`tool_call-${n.length}`,kind:"tool_call",text:ZE(y.input??{}),toolName:y.name,timestamp:o.ts});const g=h.get(y.id);if(!g)continue;const j=g.content.filter(Ip).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(y.id)}for(const y of[...h.values(),...p]){const g=y.content.filter(Ip).map(j=>j.text).join(`
55
- `);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:g,toolName:y.name,ok:!y.is_error,durationMs:y.duration_ms,timestamp:y.ts_end??d.ts})}i+=1}else for(const h of c)n.push({id:`tool_call-${n.length}`,kind:"tool_call",text:ZE(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(Ip).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 ZE(e){try{return JSON.stringify(e)}catch{return String(e)}}function eP(e,t=[]){const n=new Map;for(const a of t){const i=mG(a.scenario_id,a.agent);if(!i)continue;const o=n.get(i)??[];o.push(a),n.set(i,o)}const r=e.scenarios.map(a=>{const i=n.get(`${a.scenario_id}::${a.agent}`)??[],o=new Map;for(const h of i)o.set(h.run_index,h);const c=a.runs.map((h,p)=>{const y=o.get(h.run_index)??i[p];return{runIndex:h.run_index,passed:h.pass,toolCalls:vG(h,y),finalAnswer:h.final_text,conversation:gG(y),duration:h.tool_durations_ms.reduce((g,j)=>g+j,0),extractedValues:Object.fromEntries(Object.entries(h.extracted).map(([g,j])=>[g,String(j??"")])),failureReasons:h.failures}}),d=c.length===0?0:Math.round(c.reduce((h,p)=>h+p.duration,0)/c.length),f=c.length===0?0:c.reduce((h,p)=>h+p.toolCalls.length,0)/c.length;return{scenarioId:a.scenario_id,scenarioName:a.scenario_name||a.scenario_id,agentId:a.agent,agentName:a.agent,runs:c,passRate:a.pass_rate,avgToolCalls:f,avgDuration:d}});return{id:e.metadata.run_id,configId:"",configHash:e.metadata.config_hash,timestamp:e.metadata.timestamp,scenarios:r,overallPassRate:e.summary.pass_rate,totalScenarios:e.summary.total_scenarios,totalRuns:e.summary.total_runs,avgToolCalls:e.summary.avg_tool_calls_per_run,avgLatency:Math.round(e.summary.avg_tool_latency_ms??0),snapshotEval:e.metadata.snapshot_eval?{applied:e.metadata.snapshot_eval.applied,mode:e.metadata.snapshot_eval.mode,baselineSnapshotId:e.metadata.snapshot_eval.baseline_snapshot_id,baselineSourceRunId:e.metadata.snapshot_eval.baseline_source_run_id,overallScore:e.metadata.snapshot_eval.overall_score,status:e.metadata.snapshot_eval.status,impactedScenarios:e.metadata.snapshot_eval.impacted_scenarios}:void 0}}function yG(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}const Vu=yG();async function lt(e,t){const n=await fetch(`${Vu}${e}`,{...t,headers:{"content-type":"application/json",...t?.headers||{}}});if(!n.ok){const r=await n.text();throw new Error(`Request failed (${n.status}): ${r}`)}return await n.json()}async function xG(e,t){const n=await fetch(`${Vu}${e}`,{...t,headers:{}});if(!n.ok){const r=await n.text();throw new Error(`Request failed (${n.status}): ${r}`)}return n.text()}const rt={health:()=>lt("/api/health"),getSettings:()=>lt("/api/settings"),updateSettings:e=>lt("/api/settings",{method:"PUT",body:JSON.stringify(e)}),listConfigs:()=>lt("/api/evals"),createConfig:(e,t)=>lt("/api/evals",{method:"POST",body:JSON.stringify({fileName:e,config:t})}),updateConfig:(e,t,n)=>lt(`/api/evals/${e}`,{method:"PUT",body:JSON.stringify({config:t,fileName:n})}),deleteConfig:e=>lt(`/api/evals/${e}`,{method:"DELETE"}),listRuns:()=>lt("/api/runs"),listMarkdownReports:()=>lt("/api/markdown-reports").then(e=>e.items),getMarkdownReport:e=>lt(`/api/markdown-reports/content?path=${encodeURIComponent(e)}`),deleteMarkdownReport:e=>lt(`/api/markdown-reports?path=${encodeURIComponent(e)}`,{method:"DELETE"}).then(()=>{}),getRun:e=>lt(`/api/runs/${e}`),deleteRun:e=>lt(`/api/runs/${e}`,{method:"DELETE"}),getRunTrace:e=>lt(`/api/runs/${e}/trace`),listSnapshots:()=>lt("/api/snapshots"),createSnapshotFromRun:(e,t)=>lt("/api/snapshots",{method:"POST",body:JSON.stringify({runId:e,name:t})}),getSnapshot:e=>lt(`/api/snapshots/${e}`),compareSnapshot:(e,t)=>lt(`/api/snapshots/${e}/compare`,{method:"POST",body:JSON.stringify({runId:t})}),askResultAssistant:(e,t)=>lt(`/api/runs/${encodeURIComponent(e)}/assistant`,{method:"POST",body:JSON.stringify({messages:t})}),applyResultAssistantReport:e=>lt(`/api/runs/${encodeURIComponent(e.runId)}/assistant/apply-report`,{method:"POST",body:JSON.stringify({markdown:e.markdown,outputPath:e.outputPath,overwrite:e.overwrite})}),createResultAssistantSession:e=>lt("/api/result-assistant/sessions",{method:"POST",body:JSON.stringify({runId:e})}),getResultAssistantSession:e=>lt(`/api/result-assistant/sessions/${e}`),sendResultAssistantMessage:(e,t)=>lt(`/api/result-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t})}),approveResultAssistantToolCall:(e,t,n)=>lt(`/api/result-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify(n===void 0?{}:{argumentsOverride:n})}),denyResultAssistantToolCall:(e,t)=>lt(`/api/result-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),closeResultAssistantSession:e=>lt(`/api/result-assistant/sessions/${e}`,{method:"DELETE"}).then(()=>{}),generateSnapshotEvalBaseline:(e,t,n)=>lt("/api/snapshots/generate-eval",{method:"POST",body:JSON.stringify({runId:e,configId:t,name:n})}),updateSnapshotPolicy:(e,t)=>lt(`/api/evals/${e}/snapshot-policy`,{method:"POST",body:JSON.stringify(t)}),getLibraries:()=>lt("/api/libraries"),saveLibraries:e=>lt("/api/libraries",{method:"PUT",body:JSON.stringify(e)}),startRun:e=>lt("/api/runs",{method:"POST",body:JSON.stringify(e)}),listProviderModels:e=>lt(`/api/providers/models?provider=${encodeURIComponent(e)}`),createScenarioAssistantSession:e=>lt("/api/scenario-assistant/sessions",{method:"POST",body:JSON.stringify(e)}),getScenarioAssistantSession:e=>lt(`/api/scenario-assistant/sessions/${e}`),sendScenarioAssistantMessage:(e,t)=>lt(`/api/scenario-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t})}),approveScenarioAssistantToolCall:(e,t)=>lt(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify({})}),denyScenarioAssistantToolCall:(e,t)=>lt(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),approveAllScenarioAssistantToolCalls:e=>lt(`/api/scenario-assistant/sessions/${e}/tool-calls/approve-all`,{method:"POST",body:JSON.stringify({})}),closeScenarioAssistantSession:e=>lt(`/api/scenario-assistant/sessions/${e}`,{method:"DELETE"}),discoverToolsForAnalysis:e=>lt("/api/tool-analysis/discover-tools",{method:"POST",body:JSON.stringify(e)}),startToolAnalysis:e=>lt("/api/tool-analysis/jobs",{method:"POST",body:JSON.stringify(e)}),getToolAnalysisResult:e=>lt(`/api/tool-analysis/jobs/${e}/result`),stopToolAnalysis:e=>lt(`/api/tool-analysis/jobs/${e}/stop`,{method:"POST"}),subscribeToolAnalysisJob:(e,t)=>{const n=new EventSource(`${Vu}/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:()=>lt("/api/tool-analysis-results").then(e=>e.items),getToolAnalysisSavedResult:e=>lt(`/api/tool-analysis-results/${e}`),deleteToolAnalysisSavedResult:e=>lt(`/api/tool-analysis-results/${e}`,{method:"DELETE"}).then(()=>{}),createOAuthDebuggerSession:e=>lt("/api/oauth-debugger/sessions",{method:"POST",body:JSON.stringify(e)}),getOAuthDebuggerSession:e=>lt(`/api/oauth-debugger/sessions/${e}`),startOAuthDebuggerSession:e=>lt(`/api/oauth-debugger/sessions/${e}/start`,{method:"POST",body:JSON.stringify({})}),subscribeOAuthDebuggerSession:(e,t)=>{const n=new EventSource(`${Vu}/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)=>lt(`/api/oauth-debugger/sessions/${e}/manual-callback`,{method:"POST",body:JSON.stringify(t)}),stopOAuthDebuggerSession:e=>lt(`/api/oauth-debugger/sessions/${e}/stop`,{method:"POST",body:JSON.stringify({})}),exportOAuthDebuggerSession:(e,t)=>t==="json"?lt(`/api/oauth-debugger/sessions/${e}/export?format=json`):xG(`/api/oauth-debugger/sessions/${e}/export?format=${t}`),stopRun:e=>lt(`/api/runs/jobs/${e}/stop`,{method:"POST"}),getRunQueue:()=>lt("/api/runs/queue"),removeQueuedRun:e=>lt(`/api/runs/queue/${e}`,{method:"DELETE"}).then(()=>{}),subscribeRunJob:(e,t)=>{const n=new EventSource(`${Vu}/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 bG(e){if(e.sourcePath){const t=e.sourcePath.split("/");return t[t.length-1].replace(/\.(yaml|yml)$/i,"")}return e.name||`config-${Date.now()}`}function wG(e){return e||`config-${Date.now()}`}const jG={async listConfigs(){return(await rt.listConfigs()).map(bl)},async createConfig(e){const t=await rt.createConfig(bG(e),JE(e));return bl(t)},async updateConfig(e){const t=await rt.updateConfig(e.id,JE(e),wG(e.name));return bl(t)},async deleteConfig(e){await rt.deleteConfig(e)},async listResults(){const t=(await rt.listRuns()).map(async n=>{const[{results:r},a]=await Promise.all([rt.getRun(n.runId),rt.getRunTrace(n.runId)]);return eP(r,a.records)});return Promise.all(t)},async getResult(e){try{const[{results:t},n]=await Promise.all([rt.getRun(e),rt.getRunTrace(e)]);return eP(t,n.records)}catch{return}},async deleteResult(e){await rt.deleteRun(e)},async listMarkdownReports(){return rt.listMarkdownReports()},async getMarkdownReport(e){return rt.getMarkdownReport(e)},async deleteMarkdownReport(e){await rt.deleteMarkdownReport(e)},async startRun(e){return rt.startRun(e)},async stopRun(e){await rt.stopRun(e)},async getRunQueue(){return rt.getRunQueue()},async removeQueuedRun(e){await rt.removeQueuedRun(e)},subscribeRunJob(e,t){return rt.subscribeRunJob(e,t)},async listSnapshots(){return rt.listSnapshots()},async createSnapshotFromRun(e,t){return rt.createSnapshotFromRun(e,t)},async getSnapshot(e){try{return await rt.getSnapshot(e)}catch{return}},async compareSnapshot(e,t){return rt.compareSnapshot(e,t)},async askResultAssistant(e,t){return rt.askResultAssistant(e,t)},async applyResultAssistantReport(e){return rt.applyResultAssistantReport(e)},async createResultAssistantSession(e){return rt.createResultAssistantSession(e)},async getResultAssistantSession(e){return rt.getResultAssistantSession(e)},async sendResultAssistantMessage(e,t){return rt.sendResultAssistantMessage(e,t)},async approveResultAssistantToolCall(e,t,n){return rt.approveResultAssistantToolCall(e,t,n)},async denyResultAssistantToolCall(e,t){return rt.denyResultAssistantToolCall(e,t)},async closeResultAssistantSession(e){await rt.closeResultAssistantSession(e)},async generateSnapshotEvalBaseline(e,t,n){const r=await rt.generateSnapshotEvalBaseline(e,t,n);return{snapshot:r.snapshot,config:bl(r.config)}},async updateSnapshotPolicy(e,t){const n=await rt.updateSnapshotPolicy(e,t);return bl(n)},async getLibraries(){const e=await rt.getLibraries();return pG(e)},async saveLibraries(e){await rt.saveLibraries(hG(e))},async listProviderModels(e){return rt.listProviderModels(e)},async getWorkspaceSettings(){return rt.getSettings()},async updateWorkspaceSettings(e){return rt.updateSettings(e)},async createScenarioAssistantSession(e){return rt.createScenarioAssistantSession(e)},async getScenarioAssistantSession(e){return rt.getScenarioAssistantSession(e)},async sendScenarioAssistantMessage(e,t){return rt.sendScenarioAssistantMessage(e,t)},async approveScenarioAssistantToolCall(e,t){return rt.approveScenarioAssistantToolCall(e,t)},async denyScenarioAssistantToolCall(e,t){return rt.denyScenarioAssistantToolCall(e,t)},async approveAllScenarioAssistantToolCalls(e){return rt.approveAllScenarioAssistantToolCalls(e)},async closeScenarioAssistantSession(e){await rt.closeScenarioAssistantSession(e)},async discoverToolsForAnalysis(e){return rt.discoverToolsForAnalysis(e)},async startToolAnalysis(e){return rt.startToolAnalysis(e)},subscribeToolAnalysisJob(e,t){return rt.subscribeToolAnalysisJob(e,t)},async getToolAnalysisResult(e){return rt.getToolAnalysisResult(e)},async stopToolAnalysis(e){return rt.stopToolAnalysis(e)},async listToolAnalysisResults(){return rt.listToolAnalysisResults()},async getToolAnalysisSavedResult(e){return rt.getToolAnalysisSavedResult(e)},async deleteToolAnalysisSavedResult(e){await rt.deleteToolAnalysisSavedResult(e)},async createOAuthDebuggerSession(e){return rt.createOAuthDebuggerSession(e)},async getOAuthDebuggerSession(e){return rt.getOAuthDebuggerSession(e)},async startOAuthDebuggerSession(e){return rt.startOAuthDebuggerSession(e)},subscribeOAuthDebuggerSession(e,t){return rt.subscribeOAuthDebuggerSession(e,t)},async submitOAuthDebuggerManualCallback(e,t){return rt.submitOAuthDebuggerManualCallback(e,t)},async stopOAuthDebuggerSession(e){return rt.stopOAuthDebuggerSession(e)},async exportOAuthDebuggerSession(e,t){return rt.exportOAuthDebuggerSession(e,t)}},m3=v.createContext(null);function SG({children:e}){const t="workspace",[n,r]=v.useState("checking"),[a,i]=v.useState(null);v.useEffect(()=>{r("checking"),rt.health().then(c=>{r("connected"),i(typeof c?.version=="string"?c.version:null)}).catch(()=>{r("disconnected"),i(null)})},[t]);const o=v.useMemo(()=>jG,[]);return s.jsx(m3.Provider,{value:{mode:t,connection:n,version:a,source:o},children:e})}function Pn(){const e=v.useContext(m3);if(!e)throw new Error("useDataSource must be used within DataSourceProvider");return e}const NG=e=>{if(e==="/")return[{label:"Dashboard"}];const t=[{label:"Dashboard",to:"/"}];if(Xt("/mcp-evaluations/:id",e))return t.push({label:"MCP Evaluations",to:"/mcp-evaluations"},{label:"MCP Evaluation"}),t;if(Xt("/mcp-evaluations",e))return t.push({label:"MCP Evaluations"}),t;if(Xt("/settings",e))return t.push({label:"Settings"}),t;if(Xt("/tool-analysis",e))return t.push({label:"Analyze MCP Tools"}),t;if(Xt("/tool-analysis-results/:id",e)){const n=Xt("/tool-analysis-results/:id",e);return t.push({label:"Tool Analysis Results",to:"/tool-analysis-results"},{label:n?.params.id??"Report"}),t}if(Xt("/tool-analysis-results",e))return t.push({label:"Tool Analysis Results"}),t;if(Xt("/markdown-reports/view",e))return t.push({label:"Markdown Reports",to:"/markdown-reports"},{label:"View Report"}),t;if(Xt("/markdown-reports",e))return t.push({label:"Markdown Reports"}),t;if(Xt("/oauth-debugger",e))return t.push({label:"OAuth Debugger"}),t;if(Xt("/results/:id",e))return t.push({label:"Evaluation Results",to:"/results"},{label:"Result"}),t;if(Xt("/results",e))return t.push({label:"Evaluation Results"}),t;if(Xt("/run",e))return t.push({label:"Run Evaluation"}),t;if(Xt("/libraries/servers/:serverId",e)){const n=Xt("/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(Xt("/libraries/servers",e))return t.push({label:"Libraries",to:"/libraries/servers"},{label:"Servers"}),t;if(Xt("/libraries/agents/:agentName",e)){const n=Xt("/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(Xt("/libraries/agents",e))return t.push({label:"Libraries",to:"/libraries/agents"},{label:"Agents"}),t;if(Xt("/libraries/test-cases/:testCaseId",e)){const n=Xt("/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 Xt("/libraries/test-cases",e)?(t.push({label:"Libraries",to:"/libraries/test-cases"},{label:"Test Cases"}),t):Xt("/compare",e)?(t.push({label:"Compare Evaluations"}),t):(Xt("/compare/results",e)&&t.push({label:"Compare Evaluations",to:"/compare"},{label:"Full Result Compare"}),t)};function CG(){const e=vs(),t=new URLSearchParams(e.search).get("embed")==="1",n=NG(e.pathname),{connection:r,version:a}=Pn();return t?s.jsx("main",{className:"min-h-screen overflow-auto bg-background p-4",children:s.jsx(DE,{})}):s.jsx(XD,{children:s.jsxs("div",{className:"flex min-h-screen w-full",children:[s.jsx(dG,{version:a}),s.jsxs("div",{className:"flex flex-1 flex-col",children:[s.jsxs("header",{className:"flex h-12 items-center gap-2 border-b bg-card px-4",children:[s.jsx(JD,{}),s.jsx(c3,{children:s.jsx(u3,{children:n.map((i,o)=>{const c=o===n.length-1;return s.jsxs(v.Fragment,{children:[s.jsx(d3,{children:i.to&&!c?s.jsx(f3,{asChild:!0,children:s.jsx(yt,{to:i.to,children:i.label})}):s.jsx(p3,{children:i.label})}),!c&&s.jsx(h3,{})]},`${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(DE,{})})]})]})})}const v3=v.createContext(null);function _G({children:e}){const{source:t}=Pn(),[n,r]=v.useState([]),[a,i]=v.useState(!0),o=v.useCallback(async()=>{i(!0);try{const y=await t.listConfigs();r(y)}finally{i(!1)}},[t]);v.useEffect(()=>{o()},[o]);const c=v.useCallback(y=>n.find(g=>g.id===y),[n]),d=v.useCallback(async y=>{const g=await t.createConfig(y);return r(j=>[...j,g]),g},[t]),f=v.useCallback(async(y,g)=>{const j=await t.updateConfig({...g,id:y});return r(b=>b.map(x=>x.id===y?j:x)),j},[t]),h=v.useCallback(async y=>{await t.deleteConfig(y),r(g=>g.filter(j=>j.id!==y))},[t]),p=v.useCallback(async y=>{const g=n.find(x=>x.id===y);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(x=>[...x,b]),b},[n,t]);return s.jsx(v3.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(v3);if(!e)throw new Error("useConfigs must be used within ConfigProvider");return e}const g3=v.createContext(null);function AG({children:e}){const{source:t}=Pn(),[n,r]=v.useState({servers:[],agents:[],scenarios:[]}),[a,i]=v.useState(!0),o=async()=>{i(!0);try{const f=await t.getLibraries();r(f)}finally{i(!1)}};v.useEffect(()=>{o()},[t]),v.useEffect(()=>{const f=()=>{o()};return window.addEventListener("focus",f),()=>{window.removeEventListener("focus",f)}},[t]);const c=async f=>{r(f),await t.saveLibraries(f)},d=v.useMemo(()=>({...n,loading:a,setServers:async f=>c({...n,servers:f}),setAgents:async f=>c({...n,agents:f}),setScenarios:async f=>c({...n,scenarios:f}),reload:o}),[n,a]);return s.jsx(g3.Provider,{value:d,children:e})}function Ua(){const e=v.useContext(g3);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:je("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Ue.displayName="Card";const Nt=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:je("flex flex-col space-y-1.5 p-6",e),...t}));Nt.displayName="CardHeader";const Ct=v.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:je("text-2xl font-semibold leading-none tracking-tight",e),...t}));Ct.displayName="CardTitle";const Ds=v.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:je("text-sm text-muted-foreground",e),...t}));Ds.displayName="CardDescription";const qe=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:je("p-6 pt-0",e),...t}));qe.displayName="CardContent";const EG=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:je("flex items-center p-6 pt-0",e),...t}));EG.displayName="CardFooter";const Xr=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:n,className:je("w-full caption-bottom text-sm",e),...t})}));Xr.displayName="Table";const Qr=v.forwardRef(({className:e,...t},n)=>s.jsx("thead",{ref:n,className:je("[&_tr]:border-b",e),...t}));Qr.displayName="TableHeader";const Jr=v.forwardRef(({className:e,...t},n)=>s.jsx("tbody",{ref:n,className:je("[&_tr:last-child]:border-0",e),...t}));Jr.displayName="TableBody";const PG=v.forwardRef(({className:e,...t},n)=>s.jsx("tfoot",{ref:n,className:je("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));PG.displayName="TableFooter";const Ut=v.forwardRef(({className:e,...t},n)=>s.jsx("tr",{ref:n,className:je("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));Ut.displayName="TableRow";const tt=v.forwardRef(({className:e,...t},n)=>s.jsx("th",{ref:n,className:je("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));tt.displayName="TableHead";const Ke=v.forwardRef(({className:e,...t},n)=>s.jsx("td",{ref:n,className:je("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Ke.displayName="TableCell";const OG=v.forwardRef(({className:e,...t},n)=>s.jsx("caption",{ref:n,className:je("mt-4 text-sm text-muted-foreground",e),...t}));OG.displayName="TableCaption";function Ts({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=Io("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 Je({className:e,variant:t,asChild:n,...r}){const a=n?Di:"div";return s.jsx(a,{className:je(kG({variant:t}),e),...r})}function vo({rate:e,className:t}){const n=Math.round(e*100),r=n>=80?"default":n>=50?"secondary":"destructive";return s.jsxs(Je,{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 tx,tP;function Tr(){if(tP)return tx;tP=1;var e=Array.isArray;return tx=e,tx}var nx,nP;function y3(){if(nP)return nx;nP=1;var e=typeof Sp=="object"&&Sp&&Sp.Object===Object&&Sp;return nx=e,nx}var rx,rP;function gs(){if(rP)return rx;rP=1;var e=y3(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return rx=n,rx}var ax,aP;function rf(){if(aP)return ax;aP=1;var e=gs(),t=e.Symbol;return ax=t,ax}var sx,sP;function RG(){if(sP)return sx;sP=1;var e=rf(),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 sx=i,sx}var ix,iP;function TG(){if(iP)return ix;iP=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return ix=n,ix}var ox,oP;function Xs(){if(oP)return ox;oP=1;var e=rf(),t=RG(),n=TG(),r="[object Null]",a="[object Undefined]",i=e?e.toStringTag:void 0;function o(c){return c==null?c===void 0?a:r:i&&i in Object(c)?t(c):n(c)}return ox=o,ox}var lx,lP;function Qs(){if(lP)return lx;lP=1;function e(t){return t!=null&&typeof t=="object"}return lx=e,lx}var cx,cP;function kc(){if(cP)return cx;cP=1;var e=Xs(),t=Qs(),n="[object Symbol]";function r(a){return typeof a=="symbol"||t(a)&&e(a)==n}return cx=r,cx}var ux,uP;function HS(){if(uP)return ux;uP=1;var e=Tr(),t=kc(),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 ux=a,ux}var dx,dP;function Li(){if(dP)return dx;dP=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return dx=e,dx}var fx,fP;function KS(){if(fP)return fx;fP=1;var e=Xs(),t=Li(),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 fx=o,fx}var px,pP;function IG(){if(pP)return px;pP=1;var e=gs(),t=e["__core-js_shared__"];return px=t,px}var hx,hP;function MG(){if(hP)return hx;hP=1;var e=IG(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return hx=n,hx}var mx,mP;function x3(){if(mP)return mx;mP=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 mx=n,mx}var vx,vP;function $G(){if(vP)return vx;vP=1;var e=KS(),t=MG(),n=Li(),r=x3(),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(y){if(!n(y)||t(y))return!1;var g=e(y)?h:i;return g.test(r(y))}return vx=p,vx}var gx,gP;function DG(){if(gP)return gx;gP=1;function e(t,n){return t?.[n]}return gx=e,gx}var yx,yP;function $o(){if(yP)return yx;yP=1;var e=$G(),t=DG();function n(r,a){var i=t(r,a);return e(i)?i:void 0}return yx=n,yx}var xx,xP;function Jm(){if(xP)return xx;xP=1;var e=$o(),t=e(Object,"create");return xx=t,xx}var bx,bP;function LG(){if(bP)return bx;bP=1;var e=Jm();function t(){this.__data__=e?e(null):{},this.size=0}return bx=t,bx}var wx,wP;function FG(){if(wP)return wx;wP=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return wx=e,wx}var jx,jP;function BG(){if(jP)return jx;jP=1;var e=Jm(),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 jx=a,jx}var Sx,SP;function zG(){if(SP)return Sx;SP=1;var e=Jm(),t=Object.prototype,n=t.hasOwnProperty;function r(a){var i=this.__data__;return e?i[a]!==void 0:n.call(i,a)}return Sx=r,Sx}var Nx,NP;function UG(){if(NP)return Nx;NP=1;var e=Jm(),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 Nx=n,Nx}var Cx,CP;function qG(){if(CP)return Cx;CP=1;var e=LG(),t=FG(),n=BG(),r=zG(),a=UG();function i(o){var c=-1,d=o==null?0:o.length;for(this.clear();++c<d;){var f=o[c];this.set(f[0],f[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=a,Cx=i,Cx}var _x,_P;function WG(){if(_P)return _x;_P=1;function e(){this.__data__=[],this.size=0}return _x=e,_x}var Ax,AP;function GS(){if(AP)return Ax;AP=1;function e(t,n){return t===n||t!==t&&n!==n}return Ax=e,Ax}var Ex,EP;function Zm(){if(EP)return Ex;EP=1;var e=GS();function t(n,r){for(var a=n.length;a--;)if(e(n[a][0],r))return a;return-1}return Ex=t,Ex}var Px,PP;function VG(){if(PP)return Px;PP=1;var e=Zm(),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 Px=r,Px}var Ox,OP;function HG(){if(OP)return Ox;OP=1;var e=Zm();function t(n){var r=this.__data__,a=e(r,n);return a<0?void 0:r[a][1]}return Ox=t,Ox}var kx,kP;function KG(){if(kP)return kx;kP=1;var e=Zm();function t(n){return e(this.__data__,n)>-1}return kx=t,kx}var Rx,RP;function GG(){if(RP)return Rx;RP=1;var e=Zm();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 Rx=t,Rx}var Tx,TP;function ev(){if(TP)return Tx;TP=1;var e=WG(),t=VG(),n=HG(),r=KG(),a=GG();function i(o){var c=-1,d=o==null?0:o.length;for(this.clear();++c<d;){var f=o[c];this.set(f[0],f[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=a,Tx=i,Tx}var Ix,IP;function YS(){if(IP)return Ix;IP=1;var e=$o(),t=gs(),n=e(t,"Map");return Ix=n,Ix}var Mx,MP;function YG(){if(MP)return Mx;MP=1;var e=qG(),t=ev(),n=YS();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return Mx=r,Mx}var $x,$P;function XG(){if($P)return $x;$P=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return $x=e,$x}var Dx,DP;function tv(){if(DP)return Dx;DP=1;var e=XG();function t(n,r){var a=n.__data__;return e(r)?a[typeof r=="string"?"string":"hash"]:a.map}return Dx=t,Dx}var Lx,LP;function QG(){if(LP)return Lx;LP=1;var e=tv();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return Lx=t,Lx}var Fx,FP;function JG(){if(FP)return Fx;FP=1;var e=tv();function t(n){return e(this,n).get(n)}return Fx=t,Fx}var Bx,BP;function ZG(){if(BP)return Bx;BP=1;var e=tv();function t(n){return e(this,n).has(n)}return Bx=t,Bx}var zx,zP;function eY(){if(zP)return zx;zP=1;var e=tv();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 zx=t,zx}var Ux,UP;function XS(){if(UP)return Ux;UP=1;var e=YG(),t=QG(),n=JG(),r=ZG(),a=eY();function i(o){var c=-1,d=o==null?0:o.length;for(this.clear();++c<d;){var f=o[c];this.set(f[0],f[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=a,Ux=i,Ux}var qx,qP;function b3(){if(qP)return qx;qP=1;var e=XS(),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,qx=n,qx}var Wx,WP;function tY(){if(WP)return Wx;WP=1;var e=b3(),t=500;function n(r){var a=e(r,function(o){return i.size===t&&i.clear(),o}),i=a.cache;return a}return Wx=n,Wx}var Vx,VP;function nY(){if(VP)return Vx;VP=1;var e=tY(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(t,function(o,c,d,f){i.push(d?f.replace(n,"$1"):c||o)}),i});return Vx=r,Vx}var Hx,HP;function QS(){if(HP)return Hx;HP=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 Hx=e,Hx}var Kx,KP;function rY(){if(KP)return Kx;KP=1;var e=rf(),t=QS(),n=Tr(),r=kc(),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 Kx=o,Kx}var Gx,GP;function w3(){if(GP)return Gx;GP=1;var e=rY();function t(n){return n==null?"":e(n)}return Gx=t,Gx}var Yx,YP;function j3(){if(YP)return Yx;YP=1;var e=Tr(),t=HS(),n=nY(),r=w3();function a(i,o){return e(i)?i:t(i,o)?[i]:n(r(i))}return Yx=a,Yx}var Xx,XP;function nv(){if(XP)return Xx;XP=1;var e=kc();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Xx=t,Xx}var Qx,QP;function JS(){if(QP)return Qx;QP=1;var e=j3(),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 Qx=n,Qx}var Jx,JP;function S3(){if(JP)return Jx;JP=1;var e=JS();function t(n,r,a){var i=n==null?void 0:e(n,r);return i===void 0?a:i}return Jx=t,Jx}var aY=S3();const ea=Vt(aY);var Zx,ZP;function sY(){if(ZP)return Zx;ZP=1;function e(t){return t==null}return Zx=e,Zx}var iY=sY();const bt=Vt(iY);var eb,eO;function oY(){if(eO)return eb;eO=1;var e=Xs(),t=Tr(),n=Qs(),r="[object String]";function a(i){return typeof i=="string"||!t(i)&&n(i)&&e(i)==r}return eb=a,eb}var lY=oY();const jo=Vt(lY);var cY=KS();const xt=Vt(cY);var uY=Li();const Rc=Vt(uY);var tb={exports:{}},Bt={};var tO;function dY(){if(tO)return Bt;tO=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"),y=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),j;j=Symbol.for("react.module.reference");function b(x){if(typeof x=="object"&&x!==null){var S=x.$$typeof;switch(S){case e:switch(x=x.type,x){case n:case a:case r:case f:case h:return x;default:switch(x=x&&x.$$typeof,x){case c:case o:case d:case y:case p:case i:return x;default:return S}}case t:return S}}}return Bt.ContextConsumer=o,Bt.ContextProvider=i,Bt.Element=e,Bt.ForwardRef=d,Bt.Fragment=n,Bt.Lazy=y,Bt.Memo=p,Bt.Portal=t,Bt.Profiler=a,Bt.StrictMode=r,Bt.Suspense=f,Bt.SuspenseList=h,Bt.isAsyncMode=function(){return!1},Bt.isConcurrentMode=function(){return!1},Bt.isContextConsumer=function(x){return b(x)===o},Bt.isContextProvider=function(x){return b(x)===i},Bt.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===e},Bt.isForwardRef=function(x){return b(x)===d},Bt.isFragment=function(x){return b(x)===n},Bt.isLazy=function(x){return b(x)===y},Bt.isMemo=function(x){return b(x)===p},Bt.isPortal=function(x){return b(x)===t},Bt.isProfiler=function(x){return b(x)===a},Bt.isStrictMode=function(x){return b(x)===r},Bt.isSuspense=function(x){return b(x)===f},Bt.isSuspenseList=function(x){return b(x)===h},Bt.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===n||x===a||x===r||x===f||x===h||x===g||typeof x=="object"&&x!==null&&(x.$$typeof===y||x.$$typeof===p||x.$$typeof===i||x.$$typeof===o||x.$$typeof===d||x.$$typeof===j||x.getModuleId!==void 0)},Bt.typeOf=b,Bt}var nO;function fY(){return nO||(nO=1,tb.exports=dY()),tb.exports}var pY=fY(),nb,rO;function N3(){if(rO)return nb;rO=1;var e=Xs(),t=Qs(),n="[object Number]";function r(a){return typeof a=="number"||t(a)&&e(a)==n}return nb=r,nb}var rb,aO;function hY(){if(aO)return rb;aO=1;var e=N3();function t(n){return e(n)&&n!=+n}return rb=t,rb}var mY=hY();const af=Vt(mY);var vY=N3();const gY=Vt(vY);var xr=function(t){return t===0?0:t>0?1:-1},fo=function(t){return jo(t)&&t.indexOf("%")===t.length-1},Le=function(t){return gY(t)&&!af(t)},yY=function(t){return bt(t)},Wn=function(t){return Le(t)||jo(t)},xY=0,Tc=function(t){var n=++xY;return"".concat(t||"").concat(n)},br=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(!Le(t)&&!jo(t))return r;var i;if(fo(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},wl=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},bY=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},a=0;a<n;a++)if(!r[t[a]])r[t[a]]=!0;else return!0;return!1},Gr=function(t,n){return Le(t)&&Le(n)?function(r){return t+r*(n-t)}:function(){return n}};function mh(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):ea(r,t))===n})}var wY=function(t,n){return Le(t)&&Le(n)?t-n:jo(t)&&jo(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function Ml(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 R1(e){"@babel/helpers - typeof";return R1=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},R1(e)}var jY=["viewBox","children"],SY=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],sO=["points","pathLength"],ab={svg:jY,polygon:sO,polyline:sO},ZS=["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"],vh=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(v.isValidElement(t)&&(r=t.props),!Rc(r))return null;var a={};return Object.keys(r).forEach(function(i){ZS.includes(i)&&(a[i]=n||function(o){return r[i](r,o)})}),a},NY=function(t,n,r){return function(a){return t(n,r,a),null}},So=function(t,n,r){if(!Rc(t)||R1(t)!=="object")return null;var a=null;return Object.keys(t).forEach(function(i){var o=t[i];ZS.includes(i)&&typeof o=="function"&&(a||(a={}),a[i]=NY(o,n,r))}),a},CY=["children"],_Y=["children"];function iO(e,t){if(e==null)return{};var n=AY(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 AY(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 T1(e){"@babel/helpers - typeof";return T1=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},T1(e)}var oO={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"},Ls=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},lO=null,sb=null,eN=function e(t){if(t===lO&&Array.isArray(sb))return sb;var n=[];return v.Children.forEach(t,function(r){bt(r)||(pY.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),sb=n,lO=t,n};function ta(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(a){return Ls(a)}):r=[Ls(t)],eN(e).forEach(function(a){var i=ea(a,"type.displayName")||ea(a,"type.name");r.indexOf(i)!==-1&&n.push(a)}),n}function Vr(e,t){var n=ta(e,t);return n&&n[0]}var cO=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,a=n.height;return!(!Le(r)||r<=0||!Le(a)||a<=0)},EY=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],PY=function(t){return t&&t.type&&jo(t.type)&&EY.indexOf(t.type)>=0},OY=function(t){return t&&T1(t)==="object"&&"clipDot"in t},kY=function(t,n,r,a){var i,o=(i=ab?.[a])!==null&&i!==void 0?i:[];return n.startsWith("data-")||!xt(t)&&(a&&o.includes(n)||SY.includes(n))||r&&ZS.includes(n)},pt=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(v.isValidElement(t)&&(a=t.props),!Rc(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},I1=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 uO(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(!uO(i,o))return!1}return!0},uO=function(t,n){if(bt(t)&&bt(n))return!0;if(!bt(t)&&!bt(n)){var r=t.props||{},a=r.children,i=iO(r,CY),o=n.props||{},c=o.children,d=iO(o,_Y);return a&&c?Ml(i,d)&&I1(a,c):!a&&!c?Ml(i,d):!1}return!1},dO=function(t,n){var r=[],a={};return eN(t).forEach(function(i,o){if(PY(i))r.push(i);else if(i){var c=Ls(i.type),d=n[c]||{},f=d.handler,h=d.once;if(f&&(!h||!a[c])){var p=f(i,c,o);r.push(p),a[c]=!0}}}),r},RY=function(t){var n=t&&t.type;return n&&oO[n]?oO[n]:null},TY=function(t,n){return eN(n).indexOf(t)},IY=["children","width","height","viewBox","className","style","title","desc"];function M1(){return M1=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},M1.apply(this,arguments)}function MY(e,t){if(e==null)return{};var n=$Y(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function $Y(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function $1(e){var t=e.children,n=e.width,r=e.height,a=e.viewBox,i=e.className,o=e.style,c=e.title,d=e.desc,f=MY(e,IY),h=a||{width:n,height:r,x:0,y:0},p=wt("recharts-surface",i);return q.createElement("svg",M1({},pt(f,!0,"svg"),{className:p,width:n,height:r,style:o,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),q.createElement("title",null,c),q.createElement("desc",null,d),t)}var DY=["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 LY(e,t){if(e==null)return{};var n=FY(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function FY(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var It=q.forwardRef(function(e,t){var n=e.children,r=e.className,a=LY(e,DY),i=wt("recharts-layer",r);return q.createElement("g",D1({className:i},pt(a,!0),{ref:t}),n)}),Fs=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]},ib,fO;function BY(){if(fO)return ib;fO=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 ib=e,ib}var ob,pO;function zY(){if(pO)return ob;pO=1;var e=BY();function t(n,r,a){var i=n.length;return a=a===void 0?i:a,!r&&a>=i?n:e(n,r,a)}return ob=t,ob}var lb,hO;function C3(){if(hO)return lb;hO=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 lb=d,lb}var cb,mO;function UY(){if(mO)return cb;mO=1;function e(t){return t.split("")}return cb=e,cb}var ub,vO;function qY(){if(vO)return ub;vO=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}",y="[\\ud800-\\udbff][\\udc00-\\udfff]",g="\\u200d",j=f+"?",b="["+i+"]?",x="(?:"+g+"(?:"+[h,p,y].join("|")+")"+b+j+")*",S=b+j+x,N="(?:"+[h+c+"?",c,p,y,o].join("|")+")",_=RegExp(d+"(?="+d+")|"+N+S,"g");function P(A){return A.match(_)||[]}return ub=P,ub}var db,gO;function WY(){if(gO)return db;gO=1;var e=UY(),t=C3(),n=qY();function r(a){return t(a)?n(a):e(a)}return db=r,db}var fb,yO;function VY(){if(yO)return fb;yO=1;var e=zY(),t=C3(),n=WY(),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 pb,xO;function HY(){if(xO)return pb;xO=1;var e=VY(),t=e("toUpperCase");return pb=t,pb}var KY=HY();const rv=Vt(KY);function an(e){return function(){return e}}const _3=Math.cos,gh=Math.sin,qa=Math.sqrt,yh=Math.PI,av=2*yh,L1=Math.PI,F1=2*L1,lo=1e-6,GY=F1-lo;function A3(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function YY(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return A3;const n=10**t;return function(r){this._+=r[0];for(let a=1,i=r.length;a<i;++a)this._+=Math.round(arguments[a]*n)/n+r[a]}}class XY{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?A3:YY(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,a){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+a}`}bezierCurveTo(t,n,r,a,i,o){this._append`C${+t},${+n},${+r},${+a},${this._x1=+i},${this._y1=+o}`}arcTo(t,n,r,a,i){if(t=+t,n=+n,r=+r,a=+a,i=+i,i<0)throw new Error(`negative radius: ${i}`);let o=this._x1,c=this._y1,d=r-t,f=a-n,h=o-t,p=c-n,y=h*h+p*p;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(y>lo)if(!(Math.abs(p*d-f*h)>lo)||!i)this._append`L${this._x1=t},${this._y1=n}`;else{let g=r-o,j=a-c,b=d*d+f*f,x=g*g+j*j,S=Math.sqrt(b),N=Math.sqrt(y),_=i*Math.tan((L1-Math.acos((b+y-x)/(2*S*N)))/2),P=_/N,A=_/S;Math.abs(P-1)>lo&&this._append`L${t+P*h},${n+P*p}`,this._append`A${i},${i},0,0,${+(p*g>h*j)},${this._x1=t+A*d},${this._y1=n+A*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,y=o?a-i:i-a;this._x1===null?this._append`M${f},${h}`:(Math.abs(this._x1-f)>lo||Math.abs(this._y1-h)>lo)&&this._append`L${f},${h}`,r&&(y<0&&(y=y%F1+F1),y>GY?this._append`A${r},${r},0,1,${p},${t-c},${n-d}A${r},${r},0,1,${p},${this._x1=f},${this._y1=h}`:y>lo&&this._append`A${r},${r},0,${+(y>=L1)},${p},${this._x1=t+r*Math.cos(i)},${this._y1=n+r*Math.sin(i)}`)}rect(t,n,r,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+a}h${-r}Z`}toString(){return this._}}function tN(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new XY(t)}function nN(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function E3(e){this._context=e}E3.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 sv(e){return new E3(e)}function P3(e){return e[0]}function O3(e){return e[1]}function k3(e,t){var n=an(!0),r=null,a=sv,i=null,o=tN(c);e=typeof e=="function"?e:e===void 0?P3:an(e),t=typeof t=="function"?t:t===void 0?O3:an(t);function c(d){var f,h=(d=nN(d)).length,p,y=!1,g;for(r==null&&(i=a(g=o())),f=0;f<=h;++f)!(f<h&&n(p=d[f],f,d))===y&&((y=!y)?i.lineStart():i.lineEnd()),y&&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:an(+d),c):e},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:an(+d),c):t},c.defined=function(d){return arguments.length?(n=typeof d=="function"?d:an(!!d),c):n},c.curve=function(d){return arguments.length?(a=d,r!=null&&(i=a(r)),c):a},c.context=function(d){return arguments.length?(d==null?r=i=null:i=a(r=d),c):r},c}function Mp(e,t,n){var r=null,a=an(!0),i=null,o=sv,c=null,d=tN(f);e=typeof e=="function"?e:e===void 0?P3:an(+e),t=typeof t=="function"?t:an(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?O3:an(+n);function f(p){var y,g,j,b=(p=nN(p)).length,x,S=!1,N,_=new Array(b),P=new Array(b);for(i==null&&(c=o(N=d())),y=0;y<=b;++y){if(!(y<b&&a(x=p[y],y,p))===S)if(S=!S)g=y,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),j=y-1;j>=g;--j)c.point(_[j],P[j]);c.lineEnd(),c.areaEnd()}S&&(_[y]=+e(x,y,p),P[y]=+t(x,y,p),c.point(r?+r(x,y,p):_[y],n?+n(x,y,p):P[y]))}if(N)return c=null,N+""||null}function h(){return k3().defined(a).curve(o).context(i)}return f.x=function(p){return arguments.length?(e=typeof p=="function"?p:an(+p),r=null,f):e},f.x0=function(p){return arguments.length?(e=typeof p=="function"?p:an(+p),f):e},f.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:an(+p),f):r},f.y=function(p){return arguments.length?(t=typeof p=="function"?p:an(+p),n=null,f):t},f.y0=function(p){return arguments.length?(t=typeof p=="function"?p:an(+p),f):t},f.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:an(+p),f):n},f.lineX0=f.lineY0=function(){return h().x(e).y(t)},f.lineY1=function(){return h().x(e).y(n)},f.lineX1=function(){return h().x(r).y(t)},f.defined=function(p){return arguments.length?(a=typeof p=="function"?p:an(!!p),f):a},f.curve=function(p){return arguments.length?(o=p,i!=null&&(c=o(i)),f):o},f.context=function(p){return arguments.length?(p==null?i=c=null:c=o(i=p),f):i},f}class R3{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function QY(e){return new R3(e,!0)}function JY(e){return new R3(e,!1)}const rN={draw(e,t){const n=qa(t/yh);e.moveTo(n,0),e.arc(0,0,n,0,av)}},ZY={draw(e,t){const n=qa(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},T3=qa(1/3),eX=T3*2,tX={draw(e,t){const n=qa(t/eX),r=n*T3;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},nX={draw(e,t){const n=qa(t),r=-n/2;e.rect(r,r,n,n)}},rX=.8908130915292852,I3=gh(yh/10)/gh(7*yh/10),aX=gh(av/10)*I3,sX=-_3(av/10)*I3,iX={draw(e,t){const n=qa(t*rX),r=aX*n,a=sX*n;e.moveTo(0,-n),e.lineTo(r,a);for(let i=1;i<5;++i){const o=av*i/5,c=_3(o),d=gh(o);e.lineTo(d*n,-c*n),e.lineTo(c*r-d*a,d*r+c*a)}e.closePath()}},hb=qa(3),oX={draw(e,t){const n=-qa(t/(hb*3));e.moveTo(0,n*2),e.lineTo(-hb*n,-n),e.lineTo(hb*n,-n),e.closePath()}},ca=-.5,ua=qa(3)/2,B1=1/qa(12),lX=(B1/2+1)*3,cX={draw(e,t){const n=qa(t/lX),r=n/2,a=n*B1,i=r,o=n*B1+n,c=-i,d=o;e.moveTo(r,a),e.lineTo(i,o),e.lineTo(c,d),e.lineTo(ca*r-ua*a,ua*r+ca*a),e.lineTo(ca*i-ua*o,ua*i+ca*o),e.lineTo(ca*c-ua*d,ua*c+ca*d),e.lineTo(ca*r+ua*a,ca*a-ua*r),e.lineTo(ca*i+ua*o,ca*o-ua*i),e.lineTo(ca*c+ua*d,ca*d-ua*c),e.closePath()}};function uX(e,t){let n=null,r=tN(a);e=typeof e=="function"?e:an(e||rN),t=typeof t=="function"?t:an(t===void 0?64:+t);function a(){let i;if(n||(n=i=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:an(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:an(+i),a):t},a.context=function(i){return arguments.length?(n=i??null,a):n},a}function xh(){}function bh(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 M3(e){this._context=e}M3.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:bh(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:bh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function dX(e){return new M3(e)}function $3(e){this._context=e}$3.prototype={areaStart:xh,areaEnd:xh,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:bh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function fX(e){return new $3(e)}function D3(e){this._context=e}D3.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:bh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function pX(e){return new D3(e)}function L3(e){this._context=e}L3.prototype={areaStart:xh,areaEnd:xh,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function hX(e){return new L3(e)}function bO(e){return e<0?-1:1}function wO(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(bO(i)+bO(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(c))||0}function jO(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function mb(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 wh(e){this._context=e}wh.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:mb(this,this._t0,jO(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,mb(this,jO(this,n=wO(this,e,t)),n);break;default:mb(this,this._t0,n=wO(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function F3(e){this._context=new B3(e)}(F3.prototype=Object.create(wh.prototype)).point=function(e,t){wh.prototype.point.call(this,t,e)};function B3(e){this._context=e}B3.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,a,i){this._context.bezierCurveTo(t,e,r,n,i,a)}};function mX(e){return new wh(e)}function vX(e){return new F3(e)}function z3(e){this._context=e}z3.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=SO(e),a=SO(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 SO(e){var t,n=e.length-1,r,a=new Array(n),i=new Array(n),o=new Array(n);for(a[0]=0,i[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)a[t]=1,i[t]=4,o[t]=4*e[t]+2*e[t+1];for(a[n-1]=2,i[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=a[t]/i[t-1],i[t]-=r,o[t]-=r*o[t-1];for(a[n-1]=o[n-1]/i[n-1],t=n-2;t>=0;--t)a[t]=(o[t]-a[t+1])/i[t];for(i[n-1]=(e[n]+a[n-1])/2,t=0;t<n-1;++t)i[t]=2*e[t+1]-a[t+1];return[a,i]}function gX(e){return new z3(e)}function iv(e,t){this._context=e,this._t=t}iv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function yX(e){return new iv(e,.5)}function xX(e){return new iv(e,0)}function bX(e){return new iv(e,1)}function Kl(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 z1(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function wX(e,t){return e[t]}function jX(e){const t=[];return t.key=e,t}function SX(){var e=an([]),t=z1,n=Kl,r=wX;function a(i){var o=Array.from(e.apply(this,arguments),jX),c,d=o.length,f=-1,h;for(const p of i)for(c=0,++f;c<d;++c)(o[c][f]=[0,+r(p,o[c].key,f,i)]).data=p;for(c=0,h=nN(t(o));c<d;++c)o[h[c]].index=c;return n(o,h),o}return a.keys=function(i){return arguments.length?(e=typeof i=="function"?i:an(Array.from(i)),a):e},a.value=function(i){return arguments.length?(r=typeof i=="function"?i:an(+i),a):r},a.order=function(i){return arguments.length?(t=i==null?z1:typeof i=="function"?i:an(Array.from(i)),a):t},a.offset=function(i){return arguments.length?(n=i??Kl,a):n},a}function NX(e,t){if((r=e.length)>0){for(var n,r,a=0,i=e[0].length,o;a<i;++a){for(o=n=0;n<r;++n)o+=e[n][a][1]||0;if(o)for(n=0;n<r;++n)e[n][a][1]/=o}Kl(e,t)}}function CX(e,t){if((a=e.length)>0){for(var n=0,r=e[t[0]],a,i=r.length;n<i;++n){for(var o=0,c=0;o<a;++o)c+=e[o][n][1]||0;r[n][1]+=r[n][0]=-c/2}Kl(e,t)}}function _X(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,y=h[r-1][1]||0,g=(p-y)/2,j=0;j<c;++j){var b=e[t[j]],x=b[r][1]||0,S=b[r-1][1]||0;g+=x-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,Kl(e,t)}}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)}var AX=["type","size","sizeType"];function U1(){return U1=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},U1.apply(this,arguments)}function NO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function CO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NO(Object(n),!0).forEach(function(r){EX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function EX(e,t,n){return t=PX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PX(e){var t=OX(e,"string");return od(t)=="symbol"?t:t+""}function OX(e,t){if(od(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(od(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kX(e,t){if(e==null)return{};var n=RX(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function RX(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var U3={symbolCircle:rN,symbolCross:ZY,symbolDiamond:tX,symbolSquare:nX,symbolStar:iX,symbolTriangle:oX,symbolWye:cX},TX=Math.PI/180,IX=function(t){var n="symbol".concat(rv(t));return U3[n]||rN},MX=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*TX;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},$X=function(t,n){U3["symbol".concat(rv(t))]=n},aN=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,AX),f=CO(CO({},d),{},{type:r,size:i,sizeType:c}),h=function(){var x=IX(r),S=uX().type(x).size(MX(i,c,r));return S()},p=f.className,y=f.cx,g=f.cy,j=pt(f,!0);return y===+y&&g===+g&&i===+i?q.createElement("path",U1({},j,{className:wt("recharts-symbols",p),transform:"translate(".concat(y,", ").concat(g,")"),d:h()})):null};aN.registerSymbol=$X;function Gl(e){"@babel/helpers - typeof";return Gl=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},Gl(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 _O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function DX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_O(Object(n),!0).forEach(function(r){ld(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_O(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FX(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,W3(r.key),r)}}function BX(e,t,n){return t&&FX(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function zX(e,t,n){return t=jh(t),UX(e,q3()?Reflect.construct(t,n||[],jh(e).constructor):t.apply(e,n))}function UX(e,t){if(t&&(Gl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qX(e)}function qX(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function q3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(q3=function(){return!!e})()}function jh(e){return jh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},jh(e)}function WX(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&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 ld(e,t,n){return t=W3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W3(e){var t=VX(e,"string");return Gl(t)=="symbol"?t:t+""}function VX(e,t){if(Gl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Gl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var da=32,sN=(function(e){function t(){return LX(this,t),zX(this,t,arguments)}return WX(t,e),BX(t,[{key:"renderIcon",value:function(r){var a=this.props.inactiveColor,i=da/2,o=da/6,c=da/3,d=r.inactive?a:r.color;if(r.type==="plainline")return q.createElement("line",{strokeWidth:4,fill:"none",stroke:d,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:i,x2:da,y2:i,className:"recharts-legend-icon"});if(r.type==="line")return q.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(da,"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 q.createElement("path",{stroke:"none",fill:d,d:"M0,".concat(da/8,"h").concat(da,"v").concat(da*3/4,"h").concat(-da,"z"),className:"recharts-legend-icon"});if(q.isValidElement(r.legendIcon)){var f=DX({},r);return delete f.legendIcon,q.cloneElement(r.legendIcon,f)}return q.createElement(aN,{fill:d,cx:i,cy:i,size:da,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:da,height:da},p={display:c==="horizontal"?"inline-block":"block",marginRight:10},y={display:"inline-block",verticalAlign:"middle",marginRight:4};return i.map(function(g,j){var b=g.formatter||d,x=wt(ld(ld({"recharts-legend-item":!0},"legend-item-".concat(j),!0),"inactive",g.inactive));if(g.type==="none")return null;var S=xt(g.value)?null:g.value;Fs(!xt(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 N=g.inactive?f:g.color;return q.createElement("li",q1({className:x,style:p,key:"legend-item-".concat(j)},So(r.props,g,j)),q.createElement($1,{width:o,height:o,viewBox:h,style:y},r.renderIcon(g)),q.createElement("span",{className:"recharts-legend-item-text",style:{color:N}},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 q.createElement("ul",{className:"recharts-default-legend",style:c},this.renderItems())}}])})(v.PureComponent);ld(sN,"displayName","Legend");ld(sN,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var vb,AO;function HX(){if(AO)return vb;AO=1;var e=ev();function t(){this.__data__=new e,this.size=0}return vb=t,vb}var gb,EO;function KX(){if(EO)return gb;EO=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return gb=e,gb}var yb,PO;function GX(){if(PO)return yb;PO=1;function e(t){return this.__data__.get(t)}return yb=e,yb}var xb,OO;function YX(){if(OO)return xb;OO=1;function e(t){return this.__data__.has(t)}return xb=e,xb}var bb,kO;function XX(){if(kO)return bb;kO=1;var e=ev(),t=YS(),n=XS(),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 bb=a,bb}var wb,RO;function V3(){if(RO)return wb;RO=1;var e=ev(),t=HX(),n=KX(),r=GX(),a=YX(),i=XX();function o(c){var d=this.__data__=new e(c);this.size=d.size}return o.prototype.clear=t,o.prototype.delete=n,o.prototype.get=r,o.prototype.has=a,o.prototype.set=i,wb=o,wb}var jb,TO;function QX(){if(TO)return jb;TO=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return jb=t,jb}var Sb,IO;function JX(){if(IO)return Sb;IO=1;function e(t){return this.__data__.has(t)}return Sb=e,Sb}var Nb,MO;function H3(){if(MO)return Nb;MO=1;var e=XS(),t=QX(),n=JX();function r(a){var i=-1,o=a==null?0:a.length;for(this.__data__=new e;++i<o;)this.add(a[i])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,Nb=r,Nb}var Cb,$O;function K3(){if($O)return Cb;$O=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 Cb=e,Cb}var _b,DO;function G3(){if(DO)return _b;DO=1;function e(t,n){return t.has(n)}return _b=e,_b}var Ab,LO;function Y3(){if(LO)return Ab;LO=1;var e=H3(),t=K3(),n=G3(),r=1,a=2;function i(o,c,d,f,h,p){var y=d&r,g=o.length,j=c.length;if(g!=j&&!(y&&j>g))return!1;var b=p.get(o),x=p.get(c);if(b&&x)return b==c&&x==o;var S=-1,N=!0,_=d&a?new e:void 0;for(p.set(o,c),p.set(c,o);++S<g;){var P=o[S],A=c[S];if(f)var O=y?f(A,P,S,c,o,p):f(P,A,S,o,c,p);if(O!==void 0){if(O)continue;N=!1;break}if(_){if(!t(c,function(k,R){if(!n(_,R)&&(P===k||h(P,k,d,f,p)))return _.push(R)})){N=!1;break}}else if(!(P===A||h(P,A,d,f,p))){N=!1;break}}return p.delete(o),p.delete(c),N}return Ab=i,Ab}var Eb,FO;function ZX(){if(FO)return Eb;FO=1;var e=gs(),t=e.Uint8Array;return Eb=t,Eb}var Pb,BO;function eQ(){if(BO)return Pb;BO=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(a,i){r[++n]=[i,a]}),r}return Pb=e,Pb}var Ob,zO;function iN(){if(zO)return Ob;zO=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(a){r[++n]=a}),r}return Ob=e,Ob}var kb,UO;function tQ(){if(UO)return kb;UO=1;var e=rf(),t=ZX(),n=GS(),r=Y3(),a=eQ(),i=iN(),o=1,c=2,d="[object Boolean]",f="[object Date]",h="[object Error]",p="[object Map]",y="[object Number]",g="[object RegExp]",j="[object Set]",b="[object String]",x="[object Symbol]",S="[object ArrayBuffer]",N="[object DataView]",_=e?e.prototype:void 0,P=_?_.valueOf:void 0;function A(O,k,R,M,z,B,D){switch(R){case N:if(O.byteLength!=k.byteLength||O.byteOffset!=k.byteOffset)return!1;O=O.buffer,k=k.buffer;case S:return!(O.byteLength!=k.byteLength||!B(new t(O),new t(k)));case d:case f:case y:return n(+O,+k);case h:return O.name==k.name&&O.message==k.message;case g:case b:return O==k+"";case p:var G=a;case j:var U=M&o;if(G||(G=i),O.size!=k.size&&!U)return!1;var W=D.get(O);if(W)return W==k;M|=c,D.set(O,k);var X=r(G(O),G(k),M,z,B,D);return D.delete(O),X;case x:if(P)return P.call(O)==P.call(k)}return!1}return kb=A,kb}var Rb,qO;function X3(){if(qO)return Rb;qO=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 Rb=e,Rb}var Tb,WO;function nQ(){if(WO)return Tb;WO=1;var e=X3(),t=Tr();function n(r,a,i){var o=a(r);return t(r)?o:e(o,i(r))}return Tb=n,Tb}var Ib,VO;function rQ(){if(VO)return Ib;VO=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 Ib=e,Ib}var Mb,HO;function aQ(){if(HO)return Mb;HO=1;function e(){return[]}return Mb=e,Mb}var $b,KO;function sQ(){if(KO)return $b;KO=1;var e=rQ(),t=aQ(),n=Object.prototype,r=n.propertyIsEnumerable,a=Object.getOwnPropertySymbols,i=a?function(o){return o==null?[]:(o=Object(o),e(a(o),function(c){return r.call(o,c)}))}:t;return $b=i,$b}var Db,GO;function iQ(){if(GO)return Db;GO=1;function e(t,n){for(var r=-1,a=Array(t);++r<t;)a[r]=n(r);return a}return Db=e,Db}var Lb,YO;function oQ(){if(YO)return Lb;YO=1;var e=Xs(),t=Qs(),n="[object Arguments]";function r(a){return t(a)&&e(a)==n}return Lb=r,Lb}var Fb,XO;function oN(){if(XO)return Fb;XO=1;var e=oQ(),t=Qs(),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 Fb=i,Fb}var Fu={exports:{}},Bb,QO;function lQ(){if(QO)return Bb;QO=1;function e(){return!1}return Bb=e,Bb}Fu.exports;var JO;function Q3(){return JO||(JO=1,(function(e,t){var n=gs(),r=lQ(),a=t&&!t.nodeType&&t,i=a&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===a,c=o?n.Buffer:void 0,d=c?c.isBuffer:void 0,f=d||r;e.exports=f})(Fu,Fu.exports)),Fu.exports}var zb,ZO;function lN(){if(ZO)return zb;ZO=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 zb=n,zb}var Ub,ek;function cN(){if(ek)return Ub;ek=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return Ub=t,Ub}var qb,tk;function cQ(){if(tk)return qb;tk=1;var e=Xs(),t=cN(),n=Qs(),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]",y="[object RegExp]",g="[object Set]",j="[object String]",b="[object WeakMap]",x="[object ArrayBuffer]",S="[object DataView]",N="[object Float32Array]",_="[object Float64Array]",P="[object Int8Array]",A="[object Int16Array]",O="[object Int32Array]",k="[object Uint8Array]",R="[object Uint8ClampedArray]",M="[object Uint16Array]",z="[object Uint32Array]",B={};B[N]=B[_]=B[P]=B[A]=B[O]=B[k]=B[R]=B[M]=B[z]=!0,B[r]=B[a]=B[x]=B[i]=B[S]=B[o]=B[c]=B[d]=B[f]=B[h]=B[p]=B[y]=B[g]=B[j]=B[b]=!1;function D(G){return n(G)&&t(G.length)&&!!B[e(G)]}return qb=D,qb}var Wb,nk;function J3(){if(nk)return Wb;nk=1;function e(t){return function(n){return t(n)}}return Wb=e,Wb}var Bu={exports:{}};Bu.exports;var rk;function uQ(){return rk||(rk=1,(function(e,t){var n=y3(),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})(Bu,Bu.exports)),Bu.exports}var Vb,ak;function Z3(){if(ak)return Vb;ak=1;var e=cQ(),t=J3(),n=uQ(),r=n&&n.isTypedArray,a=r?t(r):e;return Vb=a,Vb}var Hb,sk;function dQ(){if(sk)return Hb;sk=1;var e=iQ(),t=oN(),n=Tr(),r=Q3(),a=lN(),i=Z3(),o=Object.prototype,c=o.hasOwnProperty;function d(f,h){var p=n(f),y=!p&&t(f),g=!p&&!y&&r(f),j=!p&&!y&&!g&&i(f),b=p||y||g||j,x=b?e(f.length,String):[],S=x.length;for(var N in f)(h||c.call(f,N))&&!(b&&(N=="length"||g&&(N=="offset"||N=="parent")||j&&(N=="buffer"||N=="byteLength"||N=="byteOffset")||a(N,S)))&&x.push(N);return x}return Hb=d,Hb}var Kb,ik;function fQ(){if(ik)return Kb;ik=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,a=typeof r=="function"&&r.prototype||e;return n===a}return Kb=t,Kb}var Gb,ok;function e5(){if(ok)return Gb;ok=1;function e(t,n){return function(r){return t(n(r))}}return Gb=e,Gb}var Yb,lk;function pQ(){if(lk)return Yb;lk=1;var e=e5(),t=e(Object.keys,Object);return Yb=t,Yb}var Xb,ck;function hQ(){if(ck)return Xb;ck=1;var e=fQ(),t=pQ(),n=Object.prototype,r=n.hasOwnProperty;function a(i){if(!e(i))return t(i);var o=[];for(var c in Object(i))r.call(i,c)&&c!="constructor"&&o.push(c);return o}return Xb=a,Xb}var Qb,uk;function sf(){if(uk)return Qb;uk=1;var e=KS(),t=cN();function n(r){return r!=null&&t(r.length)&&!e(r)}return Qb=n,Qb}var Jb,dk;function ov(){if(dk)return Jb;dk=1;var e=dQ(),t=hQ(),n=sf();function r(a){return n(a)?e(a):t(a)}return Jb=r,Jb}var Zb,fk;function mQ(){if(fk)return Zb;fk=1;var e=nQ(),t=sQ(),n=ov();function r(a){return e(a,n,t)}return Zb=r,Zb}var e0,pk;function vQ(){if(pk)return e0;pk=1;var e=mQ(),t=1,n=Object.prototype,r=n.hasOwnProperty;function a(i,o,c,d,f,h){var p=c&t,y=e(i),g=y.length,j=e(o),b=j.length;if(g!=b&&!p)return!1;for(var x=g;x--;){var S=y[x];if(!(p?S in o:r.call(o,S)))return!1}var N=h.get(i),_=h.get(o);if(N&&_)return N==o&&_==i;var P=!0;h.set(i,o),h.set(o,i);for(var A=p;++x<g;){S=y[x];var O=i[S],k=o[S];if(d)var R=p?d(k,O,S,o,i,h):d(O,k,S,i,o,h);if(!(R===void 0?O===k||f(O,k,c,d,h):R)){P=!1;break}A||(A=S=="constructor")}if(P&&!A){var M=i.constructor,z=o.constructor;M!=z&&"constructor"in i&&"constructor"in o&&!(typeof M=="function"&&M instanceof M&&typeof z=="function"&&z instanceof z)&&(P=!1)}return h.delete(i),h.delete(o),P}return e0=a,e0}var t0,hk;function gQ(){if(hk)return t0;hk=1;var e=$o(),t=gs(),n=e(t,"DataView");return t0=n,t0}var n0,mk;function yQ(){if(mk)return n0;mk=1;var e=$o(),t=gs(),n=e(t,"Promise");return n0=n,n0}var r0,vk;function t5(){if(vk)return r0;vk=1;var e=$o(),t=gs(),n=e(t,"Set");return r0=n,r0}var a0,gk;function xQ(){if(gk)return a0;gk=1;var e=$o(),t=gs(),n=e(t,"WeakMap");return a0=n,a0}var s0,yk;function bQ(){if(yk)return s0;yk=1;var e=gQ(),t=YS(),n=yQ(),r=t5(),a=xQ(),i=Xs(),o=x3(),c="[object Map]",d="[object Object]",f="[object Promise]",h="[object Set]",p="[object WeakMap]",y="[object DataView]",g=o(e),j=o(t),b=o(n),x=o(r),S=o(a),N=i;return(e&&N(new e(new ArrayBuffer(1)))!=y||t&&N(new t)!=c||n&&N(n.resolve())!=f||r&&N(new r)!=h||a&&N(new a)!=p)&&(N=function(_){var P=i(_),A=P==d?_.constructor:void 0,O=A?o(A):"";if(O)switch(O){case g:return y;case j:return c;case b:return f;case x:return h;case S:return p}return P}),s0=N,s0}var i0,xk;function wQ(){if(xk)return i0;xk=1;var e=V3(),t=Y3(),n=tQ(),r=vQ(),a=bQ(),i=Tr(),o=Q3(),c=Z3(),d=1,f="[object Arguments]",h="[object Array]",p="[object Object]",y=Object.prototype,g=y.hasOwnProperty;function j(b,x,S,N,_,P){var A=i(b),O=i(x),k=A?h:a(b),R=O?h:a(x);k=k==f?p:k,R=R==f?p:R;var M=k==p,z=R==p,B=k==R;if(B&&o(b)){if(!o(x))return!1;A=!0,M=!1}if(B&&!M)return P||(P=new e),A||c(b)?t(b,x,S,N,_,P):n(b,x,k,S,N,_,P);if(!(S&d)){var D=M&&g.call(b,"__wrapped__"),G=z&&g.call(x,"__wrapped__");if(D||G){var U=D?b.value():b,W=G?x.value():x;return P||(P=new e),_(U,W,S,N,P)}}return B?(P||(P=new e),r(b,x,S,N,_,P)):!1}return i0=j,i0}var o0,bk;function uN(){if(bk)return o0;bk=1;var e=wQ(),t=Qs();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 o0=n,o0}var l0,wk;function jQ(){if(wk)return l0;wk=1;var e=V3(),t=uN(),n=1,r=2;function a(i,o,c,d){var f=c.length,h=f,p=!d;if(i==null)return!h;for(i=Object(i);f--;){var y=c[f];if(p&&y[2]?y[1]!==i[y[0]]:!(y[0]in i))return!1}for(;++f<h;){y=c[f];var g=y[0],j=i[g],b=y[1];if(p&&y[2]){if(j===void 0&&!(g in i))return!1}else{var x=new e;if(d)var S=d(j,b,g,i,o,x);if(!(S===void 0?t(b,j,n|r,d,x):S))return!1}}return!0}return l0=a,l0}var c0,jk;function n5(){if(jk)return c0;jk=1;var e=Li();function t(n){return n===n&&!e(n)}return c0=t,c0}var u0,Sk;function SQ(){if(Sk)return u0;Sk=1;var e=n5(),t=ov();function n(r){for(var a=t(r),i=a.length;i--;){var o=a[i],c=r[o];a[i]=[o,c,e(c)]}return a}return u0=n,u0}var d0,Nk;function r5(){if(Nk)return d0;Nk=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return d0=e,d0}var f0,Ck;function NQ(){if(Ck)return f0;Ck=1;var e=jQ(),t=SQ(),n=r5();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 p0,_k;function CQ(){if(_k)return p0;_k=1;function e(t,n){return t!=null&&n in Object(t)}return p0=e,p0}var h0,Ak;function _Q(){if(Ak)return h0;Ak=1;var e=j3(),t=oN(),n=Tr(),r=lN(),a=cN(),i=nv();function o(c,d,f){d=e(d,c);for(var h=-1,p=d.length,y=!1;++h<p;){var g=i(d[h]);if(!(y=c!=null&&f(c,g)))break;c=c[g]}return y||++h!=p?y:(p=c==null?0:c.length,!!p&&a(p)&&r(g,p)&&(n(c)||t(c)))}return h0=o,h0}var m0,Ek;function AQ(){if(Ek)return m0;Ek=1;var e=CQ(),t=_Q();function n(r,a){return r!=null&&t(r,a,e)}return m0=n,m0}var v0,Pk;function EQ(){if(Pk)return v0;Pk=1;var e=uN(),t=S3(),n=AQ(),r=HS(),a=n5(),i=r5(),o=nv(),c=1,d=2;function f(h,p){return r(h)&&a(p)?i(o(h),p):function(y){var g=t(y,h);return g===void 0&&g===p?n(y,h):e(p,g,c|d)}}return v0=f,v0}var g0,Ok;function Ic(){if(Ok)return g0;Ok=1;function e(t){return t}return g0=e,g0}var y0,kk;function PQ(){if(kk)return y0;kk=1;function e(t){return function(n){return n?.[t]}}return y0=e,y0}var x0,Rk;function OQ(){if(Rk)return x0;Rk=1;var e=JS();function t(n){return function(r){return e(r,n)}}return x0=t,x0}var b0,Tk;function kQ(){if(Tk)return b0;Tk=1;var e=PQ(),t=OQ(),n=HS(),r=nv();function a(i){return n(i)?e(r(i)):t(i)}return b0=a,b0}var w0,Ik;function ys(){if(Ik)return w0;Ik=1;var e=NQ(),t=EQ(),n=Ic(),r=Tr(),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 w0=i,w0}var j0,Mk;function a5(){if(Mk)return j0;Mk=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 j0=e,j0}var S0,$k;function RQ(){if($k)return S0;$k=1;function e(t){return t!==t}return S0=e,S0}var N0,Dk;function TQ(){if(Dk)return N0;Dk=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 N0=e,N0}var C0,Lk;function IQ(){if(Lk)return C0;Lk=1;var e=a5(),t=RQ(),n=TQ();function r(a,i,o){return i===i?n(a,i,o):e(a,t,o)}return C0=r,C0}var _0,Fk;function MQ(){if(Fk)return _0;Fk=1;var e=IQ();function t(n,r){var a=n==null?0:n.length;return!!a&&e(n,r,0)>-1}return _0=t,_0}var A0,Bk;function $Q(){if(Bk)return A0;Bk=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 A0=e,A0}var E0,zk;function DQ(){if(zk)return E0;zk=1;function e(){}return E0=e,E0}var P0,Uk;function LQ(){if(Uk)return P0;Uk=1;var e=t5(),t=DQ(),n=iN(),r=1/0,a=e&&1/n(new e([,-0]))[1]==r?function(i){return new e(i)}:t;return P0=a,P0}var O0,qk;function FQ(){if(qk)return O0;qk=1;var e=H3(),t=MQ(),n=$Q(),r=G3(),a=LQ(),i=iN(),o=200;function c(d,f,h){var p=-1,y=t,g=d.length,j=!0,b=[],x=b;if(h)j=!1,y=n;else if(g>=o){var S=f?null:a(d);if(S)return i(S);j=!1,y=r,x=new e}else x=f?[]:b;e:for(;++p<g;){var N=d[p],_=f?f(N):N;if(N=h||N!==0?N:0,j&&_===_){for(var P=x.length;P--;)if(x[P]===_)continue e;f&&x.push(_),b.push(N)}else y(x,_,h)||(x!==b&&x.push(_),b.push(N))}return b}return O0=c,O0}var k0,Wk;function BQ(){if(Wk)return k0;Wk=1;var e=ys(),t=FQ();function n(r,a){return r&&r.length?t(r,e(a,2)):[]}return k0=n,k0}var zQ=BQ();const Vk=Vt(zQ);function s5(e,t,n){return t===!0?Vk(e,n):xt(t)?Vk(e,t):e}function Yl(e){"@babel/helpers - typeof";return Yl=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},Yl(e)}var UQ=["ref"];function Hk(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 Os(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Hk(Object(n),!0).forEach(function(r){lv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Kk(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,o5(r.key),r)}}function WQ(e,t,n){return t&&Kk(e.prototype,t),n&&Kk(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function VQ(e,t,n){return t=Sh(t),HQ(e,i5()?Reflect.construct(t,n||[],Sh(e).constructor):t.apply(e,n))}function HQ(e,t){if(t&&(Yl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return KQ(e)}function KQ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(i5=function(){return!!e})()}function Sh(e){return Sh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Sh(e)}function GQ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&V1(e,t)}function V1(e,t){return V1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},V1(e,t)}function lv(e,t,n){return t=o5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o5(e){var t=YQ(e,"string");return Yl(t)=="symbol"?t:t+""}function YQ(e,t){if(Yl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Yl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function XQ(e,t){if(e==null)return{};var n=QQ(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function QQ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function JQ(e){return e.value}function ZQ(e,t){if(q.isValidElement(e))return q.cloneElement(e,t);if(typeof e=="function")return q.createElement(e,t);t.ref;var n=XQ(t,UQ);return q.createElement(sN,n)}var Gk=1,$l=(function(e){function t(){var n;qQ(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=VQ(this,t,[].concat(a)),lv(n,"lastBoundingBox",{width:-1,height:-1}),n}return GQ(t,e),WQ(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,a=this.getBBox();a?(Math.abs(a.width-this.lastBoundingBox.width)>Gk||Math.abs(a.height-this.lastBoundingBox.height)>Gk)&&(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?Os({},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,y;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();y={top:((h||0)-j.height)/2}}else y=c==="bottom"?{bottom:d&&d.bottom||0}:{top:d&&d.top||0};return Os(Os({},p),y)}},{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=Os(Os({position:"absolute",width:o||"auto",height:c||"auto"},this.getDefaultPosition(d)),d);return q.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(g){r.wrapperNode=g}},ZQ(i,Os(Os({},this.props),{},{payload:s5(h,f,JQ)})))}}],[{key:"getWithHeight",value:function(r,a){var i=Os(Os({},this.defaultProps),r.props),o=i.layout;return o==="vertical"&&Le(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||a}:null}}])})(v.PureComponent);lv($l,"displayName","Legend");lv($l,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var R0,Yk;function eJ(){if(Yk)return R0;Yk=1;var e=rf(),t=oN(),n=Tr(),r=e?e.isConcatSpreadable:void 0;function a(i){return n(i)||t(i)||!!(r&&i&&i[r])}return R0=a,R0}var T0,Xk;function l5(){if(Xk)return T0;Xk=1;var e=X3(),t=eJ();function n(r,a,i,o,c){var d=-1,f=r.length;for(i||(i=t),c||(c=[]);++d<f;){var h=r[d];a>0&&i(h)?a>1?n(h,a-1,i,o,c):e(c,h):o||(c[c.length]=h)}return c}return T0=n,T0}var I0,Qk;function tJ(){if(Qk)return I0;Qk=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 I0=e,I0}var M0,Jk;function nJ(){if(Jk)return M0;Jk=1;var e=tJ(),t=e();return M0=t,M0}var $0,Zk;function c5(){if(Zk)return $0;Zk=1;var e=nJ(),t=ov();function n(r,a){return r&&e(r,a,t)}return $0=n,$0}var D0,eR;function rJ(){if(eR)return D0;eR=1;var e=sf();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 D0=t,D0}var L0,tR;function dN(){if(tR)return L0;tR=1;var e=c5(),t=rJ(),n=t(e);return L0=n,L0}var F0,nR;function u5(){if(nR)return F0;nR=1;var e=dN(),t=sf();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 F0=n,F0}var B0,rR;function aJ(){if(rR)return B0;rR=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return B0=e,B0}var z0,aR;function sJ(){if(aR)return z0;aR=1;var e=kc();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 z0=t,z0}var U0,sR;function iJ(){if(sR)return U0;sR=1;var e=sJ();function t(n,r,a){for(var i=-1,o=n.criteria,c=r.criteria,d=o.length,f=a.length;++i<d;){var h=e(o[i],c[i]);if(h){if(i>=f)return h;var p=a[i];return h*(p=="desc"?-1:1)}}return n.index-r.index}return U0=t,U0}var q0,iR;function oJ(){if(iR)return q0;iR=1;var e=QS(),t=JS(),n=ys(),r=u5(),a=aJ(),i=J3(),o=iJ(),c=Ic(),d=Tr();function f(h,p,y){p.length?p=e(p,function(b){return d(b)?function(x){return t(x,b.length===1?b[0]:b)}:b}):p=[c];var g=-1;p=e(p,i(n));var j=r(h,function(b,x,S){var N=e(p,function(_){return _(b)});return{criteria:N,index:++g,value:b}});return a(j,function(b,x){return o(b,x,y)})}return q0=f,q0}var W0,oR;function lJ(){if(oR)return W0;oR=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 W0=e,W0}var V0,lR;function cJ(){if(lR)return V0;lR=1;var e=lJ(),t=Math.max;function n(r,a,i){return a=t(a===void 0?r.length-1:a,0),function(){for(var o=arguments,c=-1,d=t(o.length-a,0),f=Array(d);++c<d;)f[c]=o[a+c];c=-1;for(var h=Array(a+1);++c<a;)h[c]=o[c];return h[a]=i(f),e(r,this,h)}}return V0=n,V0}var H0,cR;function uJ(){if(cR)return H0;cR=1;function e(t){return function(){return t}}return H0=e,H0}var K0,uR;function d5(){if(uR)return K0;uR=1;var e=$o(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return K0=t,K0}var G0,dR;function dJ(){if(dR)return G0;dR=1;var e=uJ(),t=d5(),n=Ic(),r=t?function(a,i){return t(a,"toString",{configurable:!0,enumerable:!1,value:e(i),writable:!0})}:n;return G0=r,G0}var Y0,fR;function fJ(){if(fR)return Y0;fR=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 Y0=r,Y0}var X0,pR;function pJ(){if(pR)return X0;pR=1;var e=dJ(),t=fJ(),n=t(e);return X0=n,X0}var Q0,hR;function hJ(){if(hR)return Q0;hR=1;var e=Ic(),t=cJ(),n=pJ();function r(a,i){return n(t(a,i,e),a+"")}return Q0=r,Q0}var J0,mR;function cv(){if(mR)return J0;mR=1;var e=GS(),t=sf(),n=lN(),r=Li();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 J0=a,J0}var Z0,vR;function mJ(){if(vR)return Z0;vR=1;var e=l5(),t=oJ(),n=hJ(),r=cv(),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 Z0=a,Z0}var vJ=mJ();const fN=Vt(vJ);function cd(e){"@babel/helpers - typeof";return cd=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},cd(e)}function H1(){return H1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},H1.apply(this,arguments)}function gJ(e,t){return wJ(e)||bJ(e,t)||xJ(e,t)||yJ()}function yJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
60
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xJ(e,t){if(e){if(typeof e=="string")return gR(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 gR(e,t)}}function gR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function bJ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function wJ(e){if(Array.isArray(e))return e}function yR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ew(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yR(Object(n),!0).forEach(function(r){jJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jJ(e,t,n){return t=SJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SJ(e){var t=NJ(e,"string");return cd(t)=="symbol"?t:t+""}function NJ(e,t){if(cd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(cd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function CJ(e){return Array.isArray(e)&&Wn(e[0])&&Wn(e[1])?e.join(" ~ "):e}var _J=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,y=t.itemSorter,g=t.wrapperClassName,j=t.labelClassName,b=t.label,x=t.labelFormatter,S=t.accessibilityLayer,N=S===void 0?!1:S,_=function(){if(h&&h.length){var D={padding:0,margin:0},G=(y?fN(h,y):h).map(function(U,W){if(U.type==="none")return null;var X=ew({display:"block",paddingTop:4,paddingBottom:4,color:U.color||"#000"},c),J=U.formatter||p||CJ,T=U.value,L=U.name,Q=T,F=L;if(J&&Q!=null&&F!=null){var $=J(T,L,U,W,h);if(Array.isArray($)){var Z=gJ($,2);Q=Z[0],F=Z[1]}else Q=$}return q.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(W),style:X},Wn(F)?q.createElement("span",{className:"recharts-tooltip-item-name"},F):null,Wn(F)?q.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,q.createElement("span",{className:"recharts-tooltip-item-value"},Q),q.createElement("span",{className:"recharts-tooltip-item-unit"},U.unit||""))});return q.createElement("ul",{className:"recharts-tooltip-item-list",style:D},G)}return null},P=ew({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),A=ew({margin:0},f),O=!bt(b),k=O?b:"",R=wt("recharts-default-tooltip",g),M=wt("recharts-tooltip-label",j);O&&x&&h!==void 0&&h!==null&&(k=x(b,h));var z=N?{role:"status","aria-live":"assertive"}:{};return q.createElement("div",H1({className:R,style:P},z),q.createElement("p",{className:M,style:A},q.isValidElement(k)?k:"".concat(k)),_())};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 $p(e,t,n){return t=AJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AJ(e){var t=EJ(e,"string");return ud(t)=="symbol"?t:t+""}function EJ(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 _u="recharts-tooltip-wrapper",PJ={visibility:"hidden"};function OJ(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return wt(_u,$p($p($p($p({},"".concat(_u,"-right"),Le(n)&&t&&Le(t.x)&&n>=t.x),"".concat(_u,"-left"),Le(n)&&t&&Le(t.x)&&n<t.x),"".concat(_u,"-bottom"),Le(r)&&t&&Le(t.y)&&r>=t.y),"".concat(_u,"-top"),Le(r)&&t&&Le(t.y)&&r<t.y))}function xR(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&&Le(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 y=h,g=d[r];return y<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 RJ(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,a=e.position,i=e.reverseDirection,o=e.tooltipBox,c=e.useTranslate3d,d=e.viewBox,f,h,p;return o.height>0&&o.width>0&&n?(h=xR({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:o.width,viewBox:d,viewBoxDimension:d.width}),p=xR({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:o.height,viewBox:d,viewBoxDimension:d.height}),f=kJ({translateX:h,translateY:p,useTranslate3d:c})):f=PJ,{cssProperties:f,cssClasses:OJ({translateX:h,translateY:p,coordinate:n})}}function Xl(e){"@babel/helpers - typeof";return Xl=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},Xl(e)}function bR(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 wR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bR(Object(n),!0).forEach(function(r){G1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function IJ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,p5(r.key),r)}}function MJ(e,t,n){return t&&IJ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function $J(e,t,n){return t=Nh(t),DJ(e,f5()?Reflect.construct(t,n||[],Nh(e).constructor):t.apply(e,n))}function DJ(e,t){if(t&&(Xl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return LJ(e)}function LJ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(f5=function(){return!!e})()}function Nh(e){return Nh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Nh(e)}function FJ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&K1(e,t)}function K1(e,t){return K1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},K1(e,t)}function G1(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=BJ(e,"string");return Xl(t)=="symbol"?t:t+""}function BJ(e,t){if(Xl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Xl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var jR=1,zJ=(function(e){function t(){var n;TJ(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=$J(this,t,[].concat(a)),G1(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),G1(n,"handleKeyDown",function(o){if(o.key==="Escape"){var c,d,f,h;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(c=(d=n.props.coordinate)===null||d===void 0?void 0:d.x)!==null&&c!==void 0?c:0,y:(f=(h=n.props.coordinate)===null||h===void 0?void 0:h.y)!==null&&f!==void 0?f:0}})}}),n}return FJ(t,e),MJ(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>jR||Math.abs(r.height-this.state.lastBoundingBox.height)>jR)&&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,y=a.isAnimationActive,g=a.offset,j=a.position,b=a.reverseDirection,x=a.useTranslate3d,S=a.viewBox,N=a.wrapperStyle,_=RJ({allowEscapeViewBox:o,coordinate:h,offsetTopLeft:g,position:j,reverseDirection:b,tooltipBox:this.state.lastBoundingBox,useTranslate3d:x,viewBox:S}),P=_.cssClasses,A=_.cssProperties,O=wR(wR({transition:y&&i?"transform ".concat(c,"ms ").concat(d):void 0},A),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&p?"visible":"hidden",position:"absolute",top:0,left:0},N);return q.createElement("div",{tabIndex:-1,className:P,style:O,ref:function(R){r.wrapperNode=R}},f)}}])})(v.PureComponent),UJ=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Do={isSsr:UJ()};function Ql(e){"@babel/helpers - typeof";return Ql=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},Ql(e)}function SR(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 NR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SR(Object(n),!0).forEach(function(r){pN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WJ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,m5(r.key),r)}}function VJ(e,t,n){return t&&WJ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function HJ(e,t,n){return t=Ch(t),KJ(e,h5()?Reflect.construct(t,n||[],Ch(e).constructor):t.apply(e,n))}function KJ(e,t){if(t&&(Ql(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return GJ(e)}function GJ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(h5=function(){return!!e})()}function Ch(e){return Ch=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ch(e)}function YJ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&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 pN(e,t,n){return t=m5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m5(e){var t=XJ(e,"string");return Ql(t)=="symbol"?t:t+""}function XJ(e,t){if(Ql(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ql(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function QJ(e){return e.dataKey}function JJ(e,t){return q.isValidElement(e)?q.cloneElement(e,t):typeof e=="function"?q.createElement(e,t):q.createElement(_J,t)}var Hr=(function(e){function t(){return qJ(this,t),HJ(this,t,arguments)}return YJ(t,e),VJ(t,[{key:"render",value:function(){var r=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,c=a.animationDuration,d=a.animationEasing,f=a.content,h=a.coordinate,p=a.filterNull,y=a.isAnimationActive,g=a.offset,j=a.payload,b=a.payloadUniqBy,x=a.position,S=a.reverseDirection,N=a.useTranslate3d,_=a.viewBox,P=a.wrapperStyle,A=j??[];p&&A.length&&(A=s5(j.filter(function(k){return k.value!=null&&(k.hide!==!0||r.props.includeHidden)}),b,QJ));var O=A.length>0;return q.createElement(zJ,{allowEscapeViewBox:o,animationDuration:c,animationEasing:d,isAnimationActive:y,active:i,coordinate:h,hasPayload:O,offset:g,position:x,reverseDirection:S,useTranslate3d:N,viewBox:_,wrapperStyle:P},JJ(f,NR(NR({},this.props),{},{payload:A})))}}])})(v.PureComponent);pN(Hr,"displayName","Tooltip");pN(Hr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Do.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 tw,CR;function ZJ(){if(CR)return tw;CR=1;var e=gs(),t=function(){return e.Date.now()};return tw=t,tw}var nw,_R;function eZ(){if(_R)return nw;_R=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return nw=t,nw}var rw,AR;function tZ(){if(AR)return rw;AR=1;var e=eZ(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return rw=n,rw}var aw,ER;function v5(){if(ER)return aw;ER=1;var e=tZ(),t=Li(),n=kc(),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 aw=d,aw}var sw,PR;function nZ(){if(PR)return sw;PR=1;var e=Li(),t=ZJ(),n=v5(),r="Expected a function",a=Math.max,i=Math.min;function o(c,d,f){var h,p,y,g,j,b,x=0,S=!1,N=!1,_=!0;if(typeof c!="function")throw new TypeError(r);d=n(d)||0,e(f)&&(S=!!f.leading,N="maxWait"in f,y=N?a(n(f.maxWait)||0,d):y,_="trailing"in f?!!f.trailing:_);function P(G){var U=h,W=p;return h=p=void 0,x=G,g=c.apply(W,U),g}function A(G){return x=G,j=setTimeout(R,d),S?P(G):g}function O(G){var U=G-b,W=G-x,X=d-U;return N?i(X,y-W):X}function k(G){var U=G-b,W=G-x;return b===void 0||U>=d||U<0||N&&W>=y}function R(){var G=t();if(k(G))return M(G);j=setTimeout(R,O(G))}function M(G){return j=void 0,_&&h?P(G):(h=p=void 0,g)}function z(){j!==void 0&&clearTimeout(j),x=0,h=b=p=j=void 0}function B(){return j===void 0?g:M(t())}function D(){var G=t(),U=k(G);if(h=arguments,p=this,b=G,U){if(j===void 0)return A(b);if(N)return clearTimeout(j),j=setTimeout(R,d),P(b)}return j===void 0&&(j=setTimeout(R,d)),g}return D.cancel=z,D.flush=B,D}return sw=o,sw}var iw,OR;function rZ(){if(OR)return iw;OR=1;var e=nZ(),t=Li(),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 iw=r,iw}var aZ=rZ();const g5=Vt(aZ);function dd(e){"@babel/helpers - typeof";return dd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dd(e)}function kR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Dp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kR(Object(n),!0).forEach(function(r){sZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sZ(e,t,n){return t=iZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iZ(e){var t=oZ(e,"string");return dd(t)=="symbol"?t:t+""}function oZ(e,t){if(dd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(dd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lZ(e,t){return fZ(e)||dZ(e,t)||uZ(e,t)||cZ()}function cZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
61
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uZ(e,t){if(e){if(typeof e=="string")return RR(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 RR(e,t)}}function RR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function dZ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function fZ(e){if(Array.isArray(e))return e}var X1=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,y=e.maxHeight,g=e.children,j=e.debounce,b=j===void 0?0:j,x=e.id,S=e.className,N=e.onResize,_=e.style,P=_===void 0?{}:_,A=v.useRef(null),O=v.useRef();O.current=N,v.useImperativeHandle(t,function(){return Object.defineProperty(A.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),A.current},configurable:!0})});var k=v.useState({containerWidth:a.width,containerHeight:a.height}),R=lZ(k,2),M=R[0],z=R[1],B=v.useCallback(function(G,U){z(function(W){var X=Math.round(G),J=Math.round(U);return W.containerWidth===X&&W.containerHeight===J?W:{containerWidth:X,containerHeight:J}})},[]);v.useEffect(function(){var G=function(L){var Q,F=L[0].contentRect,$=F.width,Z=F.height;B($,Z),(Q=O.current)===null||Q===void 0||Q.call(O,$,Z)};b>0&&(G=g5(G,b,{trailing:!0,leading:!1}));var U=new ResizeObserver(G),W=A.current.getBoundingClientRect(),X=W.width,J=W.height;return B(X,J),U.observe(A.current),function(){U.disconnect()}},[B,b]);var D=v.useMemo(function(){var G=M.containerWidth,U=M.containerHeight;if(G<0||U<0)return null;Fs(fo(o)||fo(d),`The width(%s) and height(%s) are both fixed numbers,
62
- maybe you don't need to use a ResponsiveContainer.`,o,d),Fs(!n||n>0,"The aspect(%s) must be greater than zero.",n);var W=fo(o)?G:o,X=fo(d)?U:d;n&&n>0&&(W?X=W/n:X&&(W=X*n),y&&X>y&&(X=y)),Fs(W>0||X>0,`The width(%s) and height(%s) of chart should be greater than 0,
63
- please check the style of container, or the props width(%s) and height(%s),
64
- or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
65
- height and width.`,W,X,o,d,h,p,n);var J=!Array.isArray(g)&&Ls(g.type).endsWith("Chart");return q.Children.map(g,function(T){return q.isValidElement(T)?v.cloneElement(T,Dp({width:W,height:X},J?{style:Dp({height:"100%",width:"100%",maxHeight:X,maxWidth:W},T.props.style)}:{})):T})},[n,g,d,y,p,h,M,o]);return q.createElement("div",{id:x?"".concat(x):void 0,className:wt("recharts-responsive-container",S),style:Dp(Dp({},P),{},{width:o,height:d,minWidth:h,minHeight:p,maxHeight:y}),ref:A},D)}),uv=function(t){return null};uv.displayName="Cell";function fd(e){"@babel/helpers - typeof";return fd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fd(e)}function TR(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 Q1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TR(Object(n),!0).forEach(function(r){pZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pZ(e,t,n){return t=hZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hZ(e){var t=mZ(e,"string");return fd(t)=="symbol"?t:t+""}function mZ(e,t){if(fd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(fd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var vl={widthCache:{},cacheCount:0},vZ=2e3,gZ={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},IR="recharts_measurement_span";function yZ(e){var t=Q1({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var Hu=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Do.isSsr)return{width:0,height:0};var r=yZ(n),a=JSON.stringify({text:t,copyStyle:r});if(vl.widthCache[a])return vl.widthCache[a];try{var i=document.getElementById(IR);i||(i=document.createElement("span"),i.setAttribute("id",IR),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=Q1(Q1({},gZ),r);Object.assign(i.style,o),i.textContent="".concat(t);var c=i.getBoundingClientRect(),d={width:c.width,height:c.height};return vl.widthCache[a]=d,++vl.cacheCount>vZ&&(vl.cacheCount=0,vl.widthCache={}),d}catch{return{width:0,height:0}}},xZ=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function pd(e){"@babel/helpers - typeof";return pd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pd(e)}function _h(e,t){return SZ(e)||jZ(e,t)||wZ(e,t)||bZ()}function bZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
66
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wZ(e,t){if(e){if(typeof e=="string")return MR(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 MR(e,t)}}function MR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function jZ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;d=!1}else for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function SZ(e){if(Array.isArray(e))return e}function NZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $R(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,_Z(r.key),r)}}function CZ(e,t,n){return t&&$R(e.prototype,t),n&&$R(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _Z(e){var t=AZ(e,"string");return pd(t)=="symbol"?t:t+""}function AZ(e,t){if(pd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(pd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var DR=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,LR=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,EZ=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,PZ=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,y5={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},OZ=Object.keys(y5),Nl="NaN";function kZ(e,t){return e*y5[t]}var Lp=(function(){function e(t,n){NZ(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!EZ.test(n)&&(this.num=NaN,this.unit=""),OZ.includes(n)&&(this.num=kZ(t,n),this.unit="px")}return CZ(e,[{key:"add",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num/n.num,this.unit||n.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(n){var r,a=(r=PZ.exec(n))!==null&&r!==void 0?r:[],i=_h(a,3),o=i[1],c=i[2];return new e(parseFloat(o),c??"")}}])})();function x5(e){if(e.includes(Nl))return Nl;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=DR.exec(t))!==null&&n!==void 0?n:[],a=_h(r,4),i=a[1],o=a[2],c=a[3],d=Lp.parse(i??""),f=Lp.parse(c??""),h=o==="*"?d.multiply(f):d.divide(f);if(h.isNaN())return Nl;t=t.replace(DR,h.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var p,y=(p=LR.exec(t))!==null&&p!==void 0?p:[],g=_h(y,4),j=g[1],b=g[2],x=g[3],S=Lp.parse(j??""),N=Lp.parse(x??""),_=b==="+"?S.add(N):S.subtract(N);if(_.isNaN())return Nl;t=t.replace(LR,_.toString())}return t}var FR=/\(([^()]*)\)/;function RZ(e){for(var t=e;t.includes("(");){var n=FR.exec(t),r=_h(n,2),a=r[1];t=t.replace(FR,x5(a))}return t}function TZ(e){var t=e.replace(/\s+/g,"");return t=RZ(t),t=x5(t),t}function IZ(e){try{return TZ(e)}catch{return Nl}}function ow(e){var t=IZ(e.slice(5,-1));return t===Nl?"":t}var MZ=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],$Z=["dx","dy","angle","className","breakAll"];function J1(){return J1=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},J1.apply(this,arguments)}function BR(e,t){if(e==null)return{};var n=DZ(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function DZ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function zR(e,t){return zZ(e)||BZ(e,t)||FZ(e,t)||LZ()}function LZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
67
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FZ(e,t){if(e){if(typeof e=="string")return UR(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 UR(e,t)}}function UR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function BZ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;d=!1}else for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function zZ(e){if(Array.isArray(e))return e}var b5=/[ \f\n\r\t\v\u2028\u2029]+/,w5=function(t){var n=t.children,r=t.breakAll,a=t.style;try{var i=[];bt(n)||(r?i=n.toString().split(""):i=n.toString().split(b5));var o=i.map(function(d){return{word:d,width:Hu(d,a).width}}),c=r?0:Hu(" ",a).width;return{wordsWithComputedWidth:o,spaceWidth:c}}catch{return null}},UZ=function(t,n,r,a,i){var o=t.maxLines,c=t.children,d=t.style,f=t.breakAll,h=Le(o),p=c,y=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return W.reduce(function(X,J){var T=J.word,L=J.width,Q=X[X.length-1];if(Q&&(a==null||i||Q.width+L+r<Number(a)))Q.words.push(T),Q.width+=L+r;else{var F={words:[T],width:L};X.push(F)}return X},[])},g=y(n),j=function(W){return W.reduce(function(X,J){return X.width>J.width?X:J})};if(!h)return g;for(var b="…",x=function(W){var X=p.slice(0,W),J=w5({breakAll:f,style:d,children:X+b}).wordsWithComputedWidth,T=y(J),L=T.length>o||j(T).width>Number(a);return[L,T]},S=0,N=p.length-1,_=0,P;S<=N&&_<=p.length-1;){var A=Math.floor((S+N)/2),O=A-1,k=x(O),R=zR(k,2),M=R[0],z=R[1],B=x(A),D=zR(B,1),G=D[0];if(!M&&!G&&(S=A+1),M&&G&&(N=A-1),!M&&G){P=z;break}_++}return P||g},qR=function(t){var n=bt(t)?[]:t.toString().split(b5);return[{words:n}]},qZ=function(t){var n=t.width,r=t.scaleToFit,a=t.children,i=t.style,o=t.breakAll,c=t.maxLines;if((n||r)&&!Do.isSsr){var d,f,h=w5({breakAll:o,children:a,style:i});if(h){var p=h.wordsWithComputedWidth,y=h.spaceWidth;d=p,f=y}else return qR(a);return UZ({breakAll:o,children:a,maxLines:c,style:i},d,f,n,r)}return qR(a)},WR="#808080",No=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,y=t.textAnchor,g=y===void 0?"start":y,j=t.verticalAnchor,b=j===void 0?"end":j,x=t.fill,S=x===void 0?WR:x,N=BR(t,MZ),_=v.useMemo(function(){return qZ({breakAll:N.breakAll,children:N.children,maxLines:N.maxLines,scaleToFit:p,style:N.style,width:N.width})},[N.breakAll,N.children,N.maxLines,p,N.style,N.width]),P=N.dx,A=N.dy,O=N.angle,k=N.className,R=N.breakAll,M=BR(N,$Z);if(!Wn(r)||!Wn(i))return null;var z=r+(Le(P)?P:0),B=i+(Le(A)?A:0),D;switch(b){case"start":D=ow("calc(".concat(f,")"));break;case"middle":D=ow("calc(".concat((_.length-1)/2," * -").concat(c," + (").concat(f," / 2))"));break;default:D=ow("calc(".concat(_.length-1," * -").concat(c,")"));break}var G=[];if(p){var U=_[0].width,W=N.width;G.push("scale(".concat((Le(W)?W/U:1)/U,")"))}return O&&G.push("rotate(".concat(O,", ").concat(z,", ").concat(B,")")),G.length&&(M.transform=G.join(" ")),q.createElement("text",J1({},pt(M,!0),{x:z,y:B,className:wt("recharts-text",k),textAnchor:g,fill:S.includes("url")?WR:S}),_.map(function(X,J){var T=X.words.join(R?"":" ");return q.createElement("tspan",{x:z,dy:J===0?D:c,key:"".concat(T,"-").concat(J)},T)}))};function Oi(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function WZ(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function hN(e){let t,n,r;e.length!==2?(t=Oi,n=(c,d)=>Oi(e(c),d),r=(c,d)=>e(c)-d):(t=e===Oi||e===WZ?e:VZ,n=e,r=e);function a(c,d,f=0,h=c.length){if(f<h){if(t(d,d)!==0)return h;do{const p=f+h>>>1;n(c[p],d)<0?f=p+1:h=p}while(f<h)}return f}function i(c,d,f=0,h=c.length){if(f<h){if(t(d,d)!==0)return h;do{const p=f+h>>>1;n(c[p],d)<=0?f=p+1:h=p}while(f<h)}return f}function o(c,d,f=0,h=c.length){const p=a(c,d,f,h-1);return p>f&&r(c[p-1],d)>-r(c[p],d)?p-1:p}return{left:a,center:o,right:i}}function VZ(){return 0}function j5(e){return e===null?NaN:+e}function*HZ(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const KZ=hN(Oi),of=KZ.right;hN(j5).center;class VR extends Map{constructor(t,n=XZ){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,a]of t)this.set(r,a)}get(t){return super.get(HR(this,t))}has(t){return super.has(HR(this,t))}set(t,n){return super.set(GZ(this,t),n)}delete(t){return super.delete(YZ(this,t))}}function HR({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function GZ({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function YZ({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function XZ(e){return e!==null&&typeof e=="object"?e.valueOf():e}function QZ(e=Oi){if(e===Oi)return S5;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 S5(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const JZ=Math.sqrt(50),ZZ=Math.sqrt(10),eee=Math.sqrt(2);function Ah(e,t,n){const r=(t-e)/Math.max(0,n),a=Math.floor(Math.log10(r)),i=r/Math.pow(10,a),o=i>=JZ?10:i>=ZZ?5:i>=eee?2:1;let c,d,f;return a<0?(f=Math.pow(10,-a)/o,c=Math.round(e*f),d=Math.round(t*f),c/f<e&&++c,d/f>t&&--d,f=-f):(f=Math.pow(10,a)*o,c=Math.round(e/f),d=Math.round(t/f),c*f<e&&++c,d*f>t&&--d),d<c&&.5<=n&&n<2?Ah(e,t,n*2):[c,d,f]}function Z1(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?Ah(t,e,n):Ah(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 ej(e,t,n){return t=+t,e=+e,n=+n,Ah(e,t,n)[2]}function tj(e,t,n){t=+t,e=+e,n=+n;const r=t<e,a=r?ej(t,e,n):ej(e,t,n);return(r?-1:1)*(a<0?1/-a:a)}function KR(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 N5(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?S5:QZ(a);r>n;){if(r-n>600){const d=r-n+1,f=t-n+1,h=Math.log(d),p=.5*Math.exp(2*h/3),y=.5*Math.sqrt(h*p*(d-p)/d)*(f-d/2<0?-1:1),g=Math.max(n,Math.floor(t-f*p/d+y)),j=Math.min(r,Math.floor(t+(d-f)*p/d+y));N5(e,t,g,j,a)}const i=e[t];let o=n,c=r;for(Au(e,n,t),a(e[r],i)>0&&Au(e,n,r);o<c;){for(Au(e,o,c),++o,--c;a(e[o],i)<0;)++o;for(;a(e[c],i)>0;)--c}a(e[n],i)===0?Au(e,n,c):(++c,Au(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function Au(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function tee(e,t,n){if(e=Float64Array.from(HZ(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return GR(e);if(t>=1)return KR(e);var r,a=(r-1)*t,i=Math.floor(a),o=KR(N5(e,i).subarray(0,i+1)),c=GR(e.subarray(i+1));return o+(c-o)*(a-i)}}function nee(e,t,n=j5){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,a=(r-1)*t,i=Math.floor(a),o=+n(e[i],i,e),c=+n(e[i+1],i+1,e);return o+(c-o)*(a-i)}}function ree(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(a);++r<a;)i[r]=e+r*n;return i}function Sa(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Js(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 nj=Symbol("implicit");function mN(){var e=new VR,t=[],n=[],r=nj;function a(i){let o=e.get(i);if(o===void 0){if(r!==nj)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 VR;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 mN(t,n).unknown(r)},Sa.apply(a,arguments),a}function hd(){var e=mN().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 y=t().length,g=a<r,j=g?a:r,b=g?r:a;i=(b-j)/Math.max(1,y-d+f*2),c&&(i=Math.floor(i)),j+=(b-j-i*(y-d))*h,o=i*(1-d),c&&(j=Math.round(j),o=Math.round(o));var x=ree(y).map(function(S){return j+i*S});return n(g?x.reverse():x)}return e.domain=function(y){return arguments.length?(t(y),p()):t()},e.range=function(y){return arguments.length?([r,a]=y,r=+r,a=+a,p()):[r,a]},e.rangeRound=function(y){return[r,a]=y,r=+r,a=+a,c=!0,p()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(y){return arguments.length?(c=!!y,p()):c},e.padding=function(y){return arguments.length?(d=Math.min(1,f=+y),p()):d},e.paddingInner=function(y){return arguments.length?(d=Math.min(1,y),p()):d},e.paddingOuter=function(y){return arguments.length?(f=+y,p()):f},e.align=function(y){return arguments.length?(h=Math.max(0,Math.min(1,y)),p()):h},e.copy=function(){return hd(t(),[r,a]).round(c).paddingInner(d).paddingOuter(f).align(h)},Sa.apply(p(),arguments)}function C5(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return C5(t())},e}function Ku(){return C5(hd.apply(null,arguments).paddingInner(1))}function vN(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function _5(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function lf(){}var md=.7,Eh=1/md,Dl="\\s*([+-]?\\d+)\\s*",vd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ls="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",aee=/^#([0-9a-f]{3,8})$/,see=new RegExp(`^rgb\\(${Dl},${Dl},${Dl}\\)$`),iee=new RegExp(`^rgb\\(${ls},${ls},${ls}\\)$`),oee=new RegExp(`^rgba\\(${Dl},${Dl},${Dl},${vd}\\)$`),lee=new RegExp(`^rgba\\(${ls},${ls},${ls},${vd}\\)$`),cee=new RegExp(`^hsl\\(${vd},${ls},${ls}\\)$`),uee=new RegExp(`^hsla\\(${vd},${ls},${ls},${vd}\\)$`),YR={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};vN(lf,gd,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:XR,formatHex:XR,formatHex8:dee,formatHsl:fee,formatRgb:QR,toString:QR});function XR(){return this.rgb().formatHex()}function dee(){return this.rgb().formatHex8()}function fee(){return A5(this).formatHsl()}function QR(){return this.rgb().formatRgb()}function gd(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=aee.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?JR(t):n===3?new Rr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Fp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Fp(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=see.exec(e))?new Rr(t[1],t[2],t[3],1):(t=iee.exec(e))?new Rr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=oee.exec(e))?Fp(t[1],t[2],t[3],t[4]):(t=lee.exec(e))?Fp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=cee.exec(e))?t2(t[1],t[2]/100,t[3]/100,1):(t=uee.exec(e))?t2(t[1],t[2]/100,t[3]/100,t[4]):YR.hasOwnProperty(e)?JR(YR[e]):e==="transparent"?new Rr(NaN,NaN,NaN,0):null}function JR(e){return new Rr(e>>16&255,e>>8&255,e&255,1)}function Fp(e,t,n,r){return r<=0&&(e=t=n=NaN),new Rr(e,t,n,r)}function pee(e){return e instanceof lf||(e=gd(e)),e?(e=e.rgb(),new Rr(e.r,e.g,e.b,e.opacity)):new Rr}function rj(e,t,n,r){return arguments.length===1?pee(e):new Rr(e,t,n,r??1)}function Rr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}vN(Rr,rj,_5(lf,{brighter(e){return e=e==null?Eh:Math.pow(Eh,e),new Rr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?md:Math.pow(md,e),new Rr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Rr(go(this.r),go(this.g),go(this.b),Ph(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:ZR,formatHex:ZR,formatHex8:hee,formatRgb:e2,toString:e2}));function ZR(){return`#${po(this.r)}${po(this.g)}${po(this.b)}`}function hee(){return`#${po(this.r)}${po(this.g)}${po(this.b)}${po((isNaN(this.opacity)?1:this.opacity)*255)}`}function e2(){const e=Ph(this.opacity);return`${e===1?"rgb(":"rgba("}${go(this.r)}, ${go(this.g)}, ${go(this.b)}${e===1?")":`, ${e})`}`}function Ph(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function go(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function po(e){return e=go(e),(e<16?"0":"")+e.toString(16)}function t2(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new La(e,t,n,r)}function A5(e){if(e instanceof La)return new La(e.h,e.s,e.l,e.opacity);if(e instanceof lf||(e=gd(e)),!e)return new La;if(e instanceof La)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 La(o,c,d,e.opacity)}function mee(e,t,n,r){return arguments.length===1?A5(e):new La(e,t,n,r??1)}function La(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}vN(La,mee,_5(lf,{brighter(e){return e=e==null?Eh:Math.pow(Eh,e),new La(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?md:Math.pow(md,e),new La(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 Rr(lw(e>=240?e-240:e+120,a,r),lw(e,a,r),lw(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new La(n2(this.h),Bp(this.s),Bp(this.l),Ph(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=Ph(this.opacity);return`${e===1?"hsl(":"hsla("}${n2(this.h)}, ${Bp(this.s)*100}%, ${Bp(this.l)*100}%${e===1?")":`, ${e})`}`}}));function n2(e){return e=(e||0)%360,e<0?e+360:e}function Bp(e){return Math.max(0,Math.min(1,e||0))}function lw(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 gN=e=>()=>e;function vee(e,t){return function(n){return e+n*t}}function gee(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function yee(e){return(e=+e)==1?E5:function(t,n){return n-t?gee(t,n,e):gN(isNaN(t)?n:t)}}function E5(e,t){var n=t-e;return n?vee(e,n):gN(isNaN(e)?t:e)}const r2=(function e(t){var n=yee(t);function r(a,i){var o=n((a=rj(a)).r,(i=rj(i)).r),c=n(a.g,i.g),d=n(a.b,i.b),f=E5(a.opacity,i.opacity);return function(h){return a.r=o(h),a.g=c(h),a.b=d(h),a.opacity=f(h),a+""}}return r.gamma=e,r})(1);function xee(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(i){for(a=0;a<n;++a)r[a]=e[a]*(1-i)+t[a]*i;return r}}function bee(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function wee(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,a=new Array(r),i=new Array(n),o;for(o=0;o<r;++o)a[o]=Mc(e[o],t[o]);for(;o<n;++o)i[o]=t[o];return function(c){for(o=0;o<r;++o)i[o]=a[o](c);return i}}function jee(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Oh(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function See(e,t){var n={},r={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=Mc(e[a],t[a]):r[a]=t[a];return function(i){for(a in n)r[a]=n[a](i);return r}}var aj=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,cw=new RegExp(aj.source,"g");function Nee(e){return function(){return e}}function Cee(e){return function(t){return e(t)+""}}function _ee(e,t){var n=aj.lastIndex=cw.lastIndex=0,r,a,i,o=-1,c=[],d=[];for(e=e+"",t=t+"";(r=aj.exec(e))&&(a=cw.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:Oh(r,a)})),n=cw.lastIndex;return n<t.length&&(i=t.slice(n),c[o]?c[o]+=i:c[++o]=i),c.length<2?d[0]?Cee(d[0].x):Nee(t):(t=d.length,function(f){for(var h=0,p;h<t;++h)c[(p=d[h]).i]=p.x(f);return c.join("")})}function Mc(e,t){var n=typeof t,r;return t==null||n==="boolean"?gN(t):(n==="number"?Oh:n==="string"?(r=gd(t))?(t=r,r2):_ee:t instanceof gd?r2:t instanceof Date?jee:bee(t)?xee:Array.isArray(t)?wee:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?See:Oh)(e,t)}function yN(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Aee(e,t){t===void 0&&(t=e,e=Mc);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 Eee(e){return function(){return e}}function kh(e){return+e}var a2=[0,1];function wr(e){return e}function sj(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Eee(isNaN(t)?NaN:.5)}function Pee(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Oee(e,t,n){var r=e[0],a=e[1],i=t[0],o=t[1];return a<r?(r=sj(a,r),i=n(o,i)):(r=sj(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]=sj(e[o],e[o+1]),i[o]=n(t[o],t[o+1]);return function(c){var d=of(e,c,1,r)-1;return i[d](a[d](c))}}function cf(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function dv(){var e=a2,t=a2,n=Mc,r,a,i,o=wr,c,d,f;function h(){var y=Math.min(e.length,t.length);return o!==wr&&(o=Pee(e[0],e[y-1])),c=y>2?kee:Oee,d=f=null,p}function p(y){return y==null||isNaN(y=+y)?i:(d||(d=c(e.map(r),t,n)))(r(o(y)))}return p.invert=function(y){return o(a((f||(f=c(t,e.map(r),Oh)))(y)))},p.domain=function(y){return arguments.length?(e=Array.from(y,kh),h()):e.slice()},p.range=function(y){return arguments.length?(t=Array.from(y),h()):t.slice()},p.rangeRound=function(y){return t=Array.from(y),n=yN,h()},p.clamp=function(y){return arguments.length?(o=y?!0:wr,h()):o!==wr},p.interpolate=function(y){return arguments.length?(n=y,h()):n},p.unknown=function(y){return arguments.length?(i=y,p):i},function(y,g){return r=y,a=g,h()}}function xN(){return dv()(wr,wr)}function Ree(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Rh(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 Jl(e){return e=Rh(Math.abs(e)),e?e[1]:NaN}function Tee(e,t){return function(n,r){for(var a=n.length,i=[],o=0,c=e[0],d=0;a>0&&c>0&&(d+c+1>r&&(c=Math.max(1,r-d)),i.push(n.substring(a-=c,a+c)),!((d+=c+1)>r));)c=e[o=(o+1)%e.length];return i.reverse().join(t)}}function Iee(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Mee=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function yd(e){if(!(t=Mee.exec(e)))throw new Error("invalid format: "+e);var t;return new bN({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]})}yd.prototype=bN.prototype;function bN(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+""}bN.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function $ee(e){e:for(var t=e.length,n=1,r=-1,a;n<t;++n)switch(e[n]){case".":r=a=n;break;case"0":r===0&&(r=n),a=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(a+1):e}var Th;function Dee(e,t){var n=Rh(e,t);if(!n)return Th=void 0,e.toPrecision(t);var r=n[0],a=n[1],i=a-(Th=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")+Rh(e,Math.max(0,t+i-1))[0]}function s2(e,t){var n=Rh(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 i2={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Ree,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>s2(e*100,t),r:s2,s:Dee,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function o2(e){return e}var l2=Array.prototype.map,c2=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Lee(e){var t=e.grouping===void 0||e.thousands===void 0?o2:Tee(l2.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?o2:Iee(l2.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,y){p=yd(p);var g=p.fill,j=p.align,b=p.sign,x=p.symbol,S=p.zero,N=p.width,_=p.comma,P=p.precision,A=p.trim,O=p.type;O==="n"?(_=!0,O="g"):i2[O]||(P===void 0&&(P=12),A=!0,O="g"),(S||g==="0"&&j==="=")&&(S=!0,g="0",j="=");var k=(y&&y.prefix!==void 0?y.prefix:"")+(x==="$"?n:x==="#"&&/[boxX]/.test(O)?"0"+O.toLowerCase():""),R=(x==="$"?r:/[%p]/.test(O)?o:"")+(y&&y.suffix!==void 0?y.suffix:""),M=i2[O],z=/[defgprs%]/.test(O);P=P===void 0?6:/[gprs]/.test(O)?Math.max(1,Math.min(21,P)):Math.max(0,Math.min(20,P));function B(D){var G=k,U=R,W,X,J;if(O==="c")U=M(D)+U,D="";else{D=+D;var T=D<0||1/D<0;if(D=isNaN(D)?d:M(Math.abs(D),P),A&&(D=$ee(D)),T&&+D==0&&b!=="+"&&(T=!1),G=(T?b==="("?b:c:b==="-"||b==="("?"":b)+G,U=(O==="s"&&!isNaN(D)&&Th!==void 0?c2[8+Th/3]:"")+U+(T&&b==="("?")":""),z){for(W=-1,X=D.length;++W<X;)if(J=D.charCodeAt(W),48>J||J>57){U=(J===46?a+D.slice(W+1):D.slice(W))+U,D=D.slice(0,W);break}}}_&&!S&&(D=t(D,1/0));var L=G.length+D.length+U.length,Q=L<N?new Array(N-L+1).join(g):"";switch(_&&S&&(D=t(Q+D,Q.length?N-U.length:1/0),Q=""),j){case"<":D=G+D+U+Q;break;case"=":D=G+Q+D+U;break;case"^":D=Q.slice(0,L=Q.length>>1)+G+D+U+Q.slice(L);break;default:D=Q+G+D+U;break}return i(D)}return B.toString=function(){return p+""},B}function h(p,y){var g=Math.max(-8,Math.min(8,Math.floor(Jl(y)/3)))*3,j=Math.pow(10,-g),b=f((p=yd(p),p.type="f",p),{suffix:c2[8+g/3]});return function(x){return b(j*x)}}return{format:f,formatPrefix:h}}var zp,wN,P5;Fee({thousands:",",grouping:[3],currency:["$",""]});function Fee(e){return zp=Lee(e),wN=zp.format,P5=zp.formatPrefix,zp}function Bee(e){return Math.max(0,-Jl(Math.abs(e)))}function zee(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Jl(t)/3)))*3-Jl(Math.abs(e)))}function Uee(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Jl(t)-Jl(e))+1}function O5(e,t,n,r){var a=tj(e,t,n),i;switch(r=yd(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(i=zee(a,o))&&(r.precision=i),P5(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=Uee(a,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=Bee(a))&&(r.precision=i-(r.type==="%")*2);break}}return wN(r)}function Fi(e){var t=e.domain;return e.ticks=function(n){var r=t();return Z1(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var a=t();return O5(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=ej(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 Ih(){var e=xN();return e.copy=function(){return cf(e,Ih())},Sa.apply(e,arguments),Fi(e)}function k5(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,kh),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return k5(e).unknown(t)},e=arguments.length?Array.from(e,kh):[0,1],Fi(n)}function R5(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 u2(e){return Math.log(e)}function d2(e){return Math.exp(e)}function qee(e){return-Math.log(-e)}function Wee(e){return-Math.exp(-e)}function Vee(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Hee(e){return e===10?Vee:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Kee(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function f2(e){return(t,n)=>-e(-t,n)}function jN(e){const t=e(u2,d2),n=t.domain;let r=10,a,i;function o(){return a=Kee(r),i=Hee(r),n()[0]<0?(a=f2(a),i=f2(i),e(qee,Wee)):e(u2,d2),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 y=a(f),g=a(h),j,b;const x=c==null?10:+c;let S=[];if(!(r%1)&&g-y<x){if(y=Math.floor(y),g=Math.ceil(g),f>0){for(;y<=g;++y)for(j=1;j<r;++j)if(b=y<0?j/i(-y):j*i(y),!(b<f)){if(b>h)break;S.push(b)}}else for(;y<=g;++y)for(j=r-1;j>=1;--j)if(b=y>0?j/i(-y):j*i(y),!(b<f)){if(b>h)break;S.push(b)}S.length*2<x&&(S=Z1(f,h,x))}else S=Z1(y,g,Math.min(g-y,x)).map(i);return p?S.reverse():S},t.tickFormat=(c,d)=>{if(c==null&&(c=10),d==null&&(d=r===10?"s":","),typeof d!="function"&&(!(r%1)&&(d=yd(d)).precision==null&&(d.trim=!0),d=wN(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(R5(n(),{floor:c=>i(Math.floor(a(c))),ceil:c=>i(Math.ceil(a(c)))})),t}function T5(){const e=jN(dv()).domain([1,10]);return e.copy=()=>cf(e,T5()).base(e.base()),Sa.apply(e,arguments),e}function p2(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function h2(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function SN(e){var t=1,n=e(p2(t),h2(t));return n.constant=function(r){return arguments.length?e(p2(t=+r),h2(t)):t},Fi(n)}function I5(){var e=SN(dv());return e.copy=function(){return cf(e,I5()).constant(e.constant())},Sa.apply(e,arguments)}function m2(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Gee(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Yee(e){return e<0?-e*e:e*e}function NN(e){var t=e(wr,wr),n=1;function r(){return n===1?e(wr,wr):n===.5?e(Gee,Yee):e(m2(n),m2(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,r()):n},Fi(t)}function CN(){var e=NN(dv());return e.copy=function(){return cf(e,CN()).exponent(e.exponent())},Sa.apply(e,arguments),e}function Xee(){return CN.apply(null,arguments).exponent(.5)}function v2(e){return Math.sign(e)*e*e}function Qee(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function M5(){var e=xN(),t=[0,1],n=!1,r;function a(i){var o=Qee(e(i));return isNaN(o)?r:n?Math.round(o):o}return a.invert=function(i){return e.invert(v2(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,kh)).map(v2)),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 M5(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Sa.apply(a,arguments),Fi(a)}function $5(){var e=[],t=[],n=[],r;function a(){var o=0,c=Math.max(1,t.length);for(n=new Array(c-1);++o<c;)n[o-1]=nee(e,o/c);return i}function i(o){return o==null||isNaN(o=+o)?r:t[of(n,o)]}return i.invertExtent=function(o){var c=t.indexOf(o);return c<0?[NaN,NaN]:[c>0?n[c-1]:e[0],c<n.length?n[c]:e[e.length-1]]},i.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let c of o)c!=null&&!isNaN(c=+c)&&e.push(c);return e.sort(Oi),a()},i.range=function(o){return arguments.length?(t=Array.from(o),a()):t.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.quantiles=function(){return n.slice()},i.copy=function(){return $5().domain(e).range(t).unknown(r)},Sa.apply(i,arguments)}function D5(){var e=0,t=1,n=1,r=[.5],a=[0,1],i;function o(d){return d!=null&&d<=d?a[of(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 D5().domain([e,t]).range(a).unknown(i)},Sa.apply(Fi(o),arguments)}function L5(){var e=[.5],t=[0,1],n,r=1;function a(i){return i!=null&&i<=i?t[of(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 L5().domain(e).range(t).unknown(n)},Sa.apply(a,arguments)}const uw=new Date,dw=new Date;function Gn(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=>Gn(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)=>(uw.setTime(+i),dw.setTime(+o),e(uw),e(dw),Math.floor(n(uw,dw))),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 Mh=Gn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Mh.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Gn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Mh);Mh.range;const Ms=1e3,ma=Ms*60,$s=ma*60,Vs=$s*24,_N=Vs*7,g2=Vs*30,fw=Vs*365,ho=Gn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ms)},(e,t)=>(t-e)/Ms,e=>e.getUTCSeconds());ho.range;const AN=Gn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ms)},(e,t)=>{e.setTime(+e+t*ma)},(e,t)=>(t-e)/ma,e=>e.getMinutes());AN.range;const EN=Gn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ma)},(e,t)=>(t-e)/ma,e=>e.getUTCMinutes());EN.range;const PN=Gn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ms-e.getMinutes()*ma)},(e,t)=>{e.setTime(+e+t*$s)},(e,t)=>(t-e)/$s,e=>e.getHours());PN.range;const ON=Gn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*$s)},(e,t)=>(t-e)/$s,e=>e.getUTCHours());ON.range;const uf=Gn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ma)/Vs,e=>e.getDate()-1);uf.range;const fv=Gn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Vs,e=>e.getUTCDate()-1);fv.range;const F5=Gn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Vs,e=>Math.floor(e/Vs));F5.range;function Lo(e){return Gn(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())*ma)/_N)}const pv=Lo(0),$h=Lo(1),Jee=Lo(2),Zee=Lo(3),Zl=Lo(4),ete=Lo(5),tte=Lo(6);pv.range;$h.range;Jee.range;Zee.range;Zl.range;ete.range;tte.range;function Fo(e){return Gn(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/_N)}const hv=Fo(0),Dh=Fo(1),nte=Fo(2),rte=Fo(3),ec=Fo(4),ate=Fo(5),ste=Fo(6);hv.range;Dh.range;nte.range;rte.range;ec.range;ate.range;ste.range;const kN=Gn(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());kN.range;const RN=Gn(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());RN.range;const Hs=Gn(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());Hs.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Gn(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)});Hs.range;const Ks=Gn(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());Ks.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Gn(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)});Ks.range;function B5(e,t,n,r,a,i){const o=[[ho,1,Ms],[ho,5,5*Ms],[ho,15,15*Ms],[ho,30,30*Ms],[i,1,ma],[i,5,5*ma],[i,15,15*ma],[i,30,30*ma],[a,1,$s],[a,3,3*$s],[a,6,6*$s],[a,12,12*$s],[r,1,Vs],[r,2,2*Vs],[n,1,_N],[t,1,g2],[t,3,3*g2],[e,1,fw]];function c(f,h,p){const y=h<f;y&&([f,h]=[h,f]);const g=p&&typeof p.range=="function"?p:d(f,h,p),j=g?g.range(f,+h+1):[];return y?j.reverse():j}function d(f,h,p){const y=Math.abs(h-f)/p,g=hN(([,,x])=>x).right(o,y);if(g===o.length)return e.every(tj(f/fw,h/fw,p));if(g===0)return Mh.every(Math.max(tj(f,h,p),1));const[j,b]=o[y/o[g-1][2]<o[g][2]/y?g-1:g];return j.every(b)}return[c,d]}const[ite,ote]=B5(Ks,RN,hv,F5,ON,EN),[lte,cte]=B5(Hs,kN,pv,uf,PN,AN);function pw(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 hw(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 Eu(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function ute(e){var t=e.dateTime,n=e.date,r=e.time,a=e.periods,i=e.days,o=e.shortDays,c=e.months,d=e.shortMonths,f=Pu(a),h=Ou(a),p=Pu(i),y=Ou(i),g=Pu(o),j=Ou(o),b=Pu(c),x=Ou(c),S=Pu(d),N=Ou(d),_={a:J,A:T,b:L,B:Q,c:null,d:S2,e:S2,f:Tte,g:qte,G:Vte,H:Ote,I:kte,j:Rte,L:z5,m:Ite,M:Mte,p:F,q:$,Q:_2,s:A2,S:$te,u:Dte,U:Lte,V:Fte,w:Bte,W:zte,x:null,X:null,y:Ute,Y:Wte,Z:Hte,"%":C2},P={a:Z,A:ae,b:V,B:ie,c:null,d:N2,e:N2,f:Xte,g:ine,G:lne,H:Kte,I:Gte,j:Yte,L:q5,m:Qte,M:Jte,p:ne,q:de,Q:_2,s:A2,S:Zte,u:ene,U:tne,V:nne,w:rne,W:ane,x:null,X:null,y:sne,Y:one,Z:cne,"%":C2},A={a:z,A:B,b:D,B:G,c:U,d:w2,e:w2,f:_te,g:b2,G:x2,H:j2,I:j2,j:jte,L:Cte,m:wte,M:Ste,p:M,q:bte,Q:Ete,s:Pte,S:Nte,u:mte,U:vte,V:gte,w:hte,W:yte,x:W,X,y:b2,Y:x2,Z:xte,"%":Ate};_.x=O(n,_),_.X=O(r,_),_.c=O(t,_),P.x=O(n,P),P.X=O(r,P),P.c=O(t,P);function O(oe,ge){return function(Re){var re=[],De=-1,Ae=0,We=oe.length,ye,Ee,le;for(Re instanceof Date||(Re=new Date(+Re));++De<We;)oe.charCodeAt(De)===37&&(re.push(oe.slice(Ae,De)),(Ee=y2[ye=oe.charAt(++De)])!=null?ye=oe.charAt(++De):Ee=ye==="e"?" ":"0",(le=ge[ye])&&(ye=le(Re,Ee)),re.push(ye),Ae=De+1);return re.push(oe.slice(Ae,De)),re.join("")}}function k(oe,ge){return function(Re){var re=Eu(1900,void 0,1),De=R(re,oe,Re+="",0),Ae,We;if(De!=Re.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(ge&&!("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?(Ae=hw(Eu(re.y,0,1)),We=Ae.getUTCDay(),Ae=We>4||We===0?Dh.ceil(Ae):Dh(Ae),Ae=fv.offset(Ae,(re.V-1)*7),re.y=Ae.getUTCFullYear(),re.m=Ae.getUTCMonth(),re.d=Ae.getUTCDate()+(re.w+6)%7):(Ae=pw(Eu(re.y,0,1)),We=Ae.getDay(),Ae=We>4||We===0?$h.ceil(Ae):$h(Ae),Ae=uf.offset(Ae,(re.V-1)*7),re.y=Ae.getFullYear(),re.m=Ae.getMonth(),re.d=Ae.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),We="Z"in re?hw(Eu(re.y,0,1)).getUTCDay():pw(Eu(re.y,0,1)).getDay(),re.m=0,re.d="W"in re?(re.w+6)%7+re.W*7-(We+5)%7:re.w+re.U*7-(We+6)%7);return"Z"in re?(re.H+=re.Z/100|0,re.M+=re.Z%100,hw(re)):pw(re)}}function R(oe,ge,Re,re){for(var De=0,Ae=ge.length,We=Re.length,ye,Ee;De<Ae;){if(re>=We)return-1;if(ye=ge.charCodeAt(De++),ye===37){if(ye=ge.charAt(De++),Ee=A[ye in y2?ge.charAt(De++):ye],!Ee||(re=Ee(oe,Re,re))<0)return-1}else if(ye!=Re.charCodeAt(re++))return-1}return re}function M(oe,ge,Re){var re=f.exec(ge.slice(Re));return re?(oe.p=h.get(re[0].toLowerCase()),Re+re[0].length):-1}function z(oe,ge,Re){var re=g.exec(ge.slice(Re));return re?(oe.w=j.get(re[0].toLowerCase()),Re+re[0].length):-1}function B(oe,ge,Re){var re=p.exec(ge.slice(Re));return re?(oe.w=y.get(re[0].toLowerCase()),Re+re[0].length):-1}function D(oe,ge,Re){var re=S.exec(ge.slice(Re));return re?(oe.m=N.get(re[0].toLowerCase()),Re+re[0].length):-1}function G(oe,ge,Re){var re=b.exec(ge.slice(Re));return re?(oe.m=x.get(re[0].toLowerCase()),Re+re[0].length):-1}function U(oe,ge,Re){return R(oe,t,ge,Re)}function W(oe,ge,Re){return R(oe,n,ge,Re)}function X(oe,ge,Re){return R(oe,r,ge,Re)}function J(oe){return o[oe.getDay()]}function T(oe){return i[oe.getDay()]}function L(oe){return d[oe.getMonth()]}function Q(oe){return c[oe.getMonth()]}function F(oe){return a[+(oe.getHours()>=12)]}function $(oe){return 1+~~(oe.getMonth()/3)}function Z(oe){return o[oe.getUTCDay()]}function ae(oe){return i[oe.getUTCDay()]}function V(oe){return d[oe.getUTCMonth()]}function ie(oe){return c[oe.getUTCMonth()]}function ne(oe){return a[+(oe.getUTCHours()>=12)]}function de(oe){return 1+~~(oe.getUTCMonth()/3)}return{format:function(oe){var ge=O(oe+="",_);return ge.toString=function(){return oe},ge},parse:function(oe){var ge=k(oe+="",!1);return ge.toString=function(){return oe},ge},utcFormat:function(oe){var ge=O(oe+="",P);return ge.toString=function(){return oe},ge},utcParse:function(oe){var ge=k(oe+="",!0);return ge.toString=function(){return oe},ge}}}var y2={"-":"",_:" ",0:"0"},er=/^\s*\d+/,dte=/^%/,fte=/[\\^$*+?|[\]().{}]/g;function Mt(e,t,n){var r=e<0?"-":"",a=(r?-e:e)+"",i=a.length;return r+(i<n?new Array(n-i+1).join(t)+a:a)}function pte(e){return e.replace(fte,"\\$&")}function Pu(e){return new RegExp("^(?:"+e.map(pte).join("|")+")","i")}function Ou(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function hte(e,t,n){var r=er.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function mte(e,t,n){var r=er.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function vte(e,t,n){var r=er.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function gte(e,t,n){var r=er.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function yte(e,t,n){var r=er.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function x2(e,t,n){var r=er.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function b2(e,t,n){var r=er.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function xte(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function bte(e,t,n){var r=er.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function wte(e,t,n){var r=er.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function w2(e,t,n){var r=er.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function jte(e,t,n){var r=er.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function j2(e,t,n){var r=er.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Ste(e,t,n){var r=er.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Nte(e,t,n){var r=er.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Cte(e,t,n){var r=er.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function _te(e,t,n){var r=er.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Ate(e,t,n){var r=dte.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Ete(e,t,n){var r=er.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Pte(e,t,n){var r=er.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function S2(e,t){return Mt(e.getDate(),t,2)}function Ote(e,t){return Mt(e.getHours(),t,2)}function kte(e,t){return Mt(e.getHours()%12||12,t,2)}function Rte(e,t){return Mt(1+uf.count(Hs(e),e),t,3)}function z5(e,t){return Mt(e.getMilliseconds(),t,3)}function Tte(e,t){return z5(e,t)+"000"}function Ite(e,t){return Mt(e.getMonth()+1,t,2)}function Mte(e,t){return Mt(e.getMinutes(),t,2)}function $te(e,t){return Mt(e.getSeconds(),t,2)}function Dte(e){var t=e.getDay();return t===0?7:t}function Lte(e,t){return Mt(pv.count(Hs(e)-1,e),t,2)}function U5(e){var t=e.getDay();return t>=4||t===0?Zl(e):Zl.ceil(e)}function Fte(e,t){return e=U5(e),Mt(Zl.count(Hs(e),e)+(Hs(e).getDay()===4),t,2)}function Bte(e){return e.getDay()}function zte(e,t){return Mt($h.count(Hs(e)-1,e),t,2)}function Ute(e,t){return Mt(e.getFullYear()%100,t,2)}function qte(e,t){return e=U5(e),Mt(e.getFullYear()%100,t,2)}function Wte(e,t){return Mt(e.getFullYear()%1e4,t,4)}function Vte(e,t){var n=e.getDay();return e=n>=4||n===0?Zl(e):Zl.ceil(e),Mt(e.getFullYear()%1e4,t,4)}function Hte(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Mt(t/60|0,"0",2)+Mt(t%60,"0",2)}function N2(e,t){return Mt(e.getUTCDate(),t,2)}function Kte(e,t){return Mt(e.getUTCHours(),t,2)}function Gte(e,t){return Mt(e.getUTCHours()%12||12,t,2)}function Yte(e,t){return Mt(1+fv.count(Ks(e),e),t,3)}function q5(e,t){return Mt(e.getUTCMilliseconds(),t,3)}function Xte(e,t){return q5(e,t)+"000"}function Qte(e,t){return Mt(e.getUTCMonth()+1,t,2)}function Jte(e,t){return Mt(e.getUTCMinutes(),t,2)}function Zte(e,t){return Mt(e.getUTCSeconds(),t,2)}function ene(e){var t=e.getUTCDay();return t===0?7:t}function tne(e,t){return Mt(hv.count(Ks(e)-1,e),t,2)}function W5(e){var t=e.getUTCDay();return t>=4||t===0?ec(e):ec.ceil(e)}function nne(e,t){return e=W5(e),Mt(ec.count(Ks(e),e)+(Ks(e).getUTCDay()===4),t,2)}function rne(e){return e.getUTCDay()}function ane(e,t){return Mt(Dh.count(Ks(e)-1,e),t,2)}function sne(e,t){return Mt(e.getUTCFullYear()%100,t,2)}function ine(e,t){return e=W5(e),Mt(e.getUTCFullYear()%100,t,2)}function one(e,t){return Mt(e.getUTCFullYear()%1e4,t,4)}function lne(e,t){var n=e.getUTCDay();return e=n>=4||n===0?ec(e):ec.ceil(e),Mt(e.getUTCFullYear()%1e4,t,4)}function cne(){return"+0000"}function C2(){return"%"}function _2(e){return+e}function A2(e){return Math.floor(+e/1e3)}var gl,V5,H5;une({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function une(e){return gl=ute(e),V5=gl.format,gl.parse,H5=gl.utcFormat,gl.utcParse,gl}function dne(e){return new Date(e)}function fne(e){return e instanceof Date?+e:+new Date(+e)}function TN(e,t,n,r,a,i,o,c,d,f){var h=xN(),p=h.invert,y=h.domain,g=f(".%L"),j=f(":%S"),b=f("%I:%M"),x=f("%I %p"),S=f("%a %d"),N=f("%b %d"),_=f("%B"),P=f("%Y");function A(O){return(d(O)<O?g:c(O)<O?j:o(O)<O?b:i(O)<O?x:r(O)<O?a(O)<O?S:N:n(O)<O?_:P)(O)}return h.invert=function(O){return new Date(p(O))},h.domain=function(O){return arguments.length?y(Array.from(O,fne)):y().map(dne)},h.ticks=function(O){var k=y();return e(k[0],k[k.length-1],O??10)},h.tickFormat=function(O,k){return k==null?A:f(k)},h.nice=function(O){var k=y();return(!O||typeof O.range!="function")&&(O=t(k[0],k[k.length-1],O??10)),O?y(R5(k,O)):h},h.copy=function(){return cf(h,TN(e,t,n,r,a,i,o,c,d,f))},h}function pne(){return Sa.apply(TN(lte,cte,Hs,kN,pv,uf,PN,AN,ho,V5).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function hne(){return Sa.apply(TN(ite,ote,Ks,RN,hv,fv,ON,EN,ho,H5).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function mv(){var e=0,t=1,n,r,a,i,o=wr,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(y){var g,j;return arguments.length?([g,j]=y,o=p(g,j),f):[o(0),o(1)]}}return f.range=h(Mc),f.rangeRound=h(yN),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 Bi(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function K5(){var e=Fi(mv()(wr));return e.copy=function(){return Bi(e,K5())},Js.apply(e,arguments)}function G5(){var e=jN(mv()).domain([1,10]);return e.copy=function(){return Bi(e,G5()).base(e.base())},Js.apply(e,arguments)}function Y5(){var e=SN(mv());return e.copy=function(){return Bi(e,Y5()).constant(e.constant())},Js.apply(e,arguments)}function IN(){var e=NN(mv());return e.copy=function(){return Bi(e,IN()).exponent(e.exponent())},Js.apply(e,arguments)}function mne(){return IN.apply(null,arguments).exponent(.5)}function X5(){var e=[],t=wr;function n(r){if(r!=null&&!isNaN(r=+r))return t((of(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let a of r)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(Oi),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,a)=>t(a/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(a,i)=>tee(e,i/r))},n.copy=function(){return X5(t).domain(e)},Js.apply(n,arguments)}function vv(){var e=0,t=.5,n=1,r=1,a,i,o,c,d,f=wr,h,p=!1,y;function g(b){return isNaN(b=+b)?y:(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(x){var S,N,_;return arguments.length?([S,N,_]=x,f=Aee(b,[S,N,_]),g):[f(0),f(.5),f(1)]}}return g.range=j(Mc),g.rangeRound=j(yN),g.unknown=function(b){return arguments.length?(y=b,g):y},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 Q5(){var e=Fi(vv()(wr));return e.copy=function(){return Bi(e,Q5())},Js.apply(e,arguments)}function J5(){var e=jN(vv()).domain([.1,1,10]);return e.copy=function(){return Bi(e,J5()).base(e.base())},Js.apply(e,arguments)}function Z5(){var e=SN(vv());return e.copy=function(){return Bi(e,Z5()).constant(e.constant())},Js.apply(e,arguments)}function MN(){var e=NN(vv());return e.copy=function(){return Bi(e,MN()).exponent(e.exponent())},Js.apply(e,arguments)}function vne(){return MN.apply(null,arguments).exponent(.5)}const E2=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:hd,scaleDiverging:Q5,scaleDivergingLog:J5,scaleDivergingPow:MN,scaleDivergingSqrt:vne,scaleDivergingSymlog:Z5,scaleIdentity:k5,scaleImplicit:nj,scaleLinear:Ih,scaleLog:T5,scaleOrdinal:mN,scalePoint:Ku,scalePow:CN,scaleQuantile:$5,scaleQuantize:D5,scaleRadial:M5,scaleSequential:K5,scaleSequentialLog:G5,scaleSequentialPow:IN,scaleSequentialQuantile:X5,scaleSequentialSqrt:mne,scaleSequentialSymlog:Y5,scaleSqrt:Xee,scaleSymlog:I5,scaleThreshold:L5,scaleTime:pne,scaleUtc:hne,tickFormat:O5},Symbol.toStringTag,{value:"Module"}));var mw,P2;function gv(){if(P2)return mw;P2=1;var e=kc();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 mw=t,mw}var vw,O2;function eL(){if(O2)return vw;O2=1;function e(t,n){return t>n}return vw=e,vw}var gw,k2;function gne(){if(k2)return gw;k2=1;var e=gv(),t=eL(),n=Ic();function r(a){return a&&a.length?e(a,n,t):void 0}return gw=r,gw}var yne=gne();const yv=Vt(yne);var yw,R2;function tL(){if(R2)return yw;R2=1;function e(t,n){return t<n}return yw=e,yw}var xw,T2;function xne(){if(T2)return xw;T2=1;var e=gv(),t=tL(),n=Ic();function r(a){return a&&a.length?e(a,n,t):void 0}return xw=r,xw}var bne=xne();const xv=Vt(bne);var bw,I2;function wne(){if(I2)return bw;I2=1;var e=QS(),t=ys(),n=u5(),r=Tr();function a(i,o){var c=r(i)?e:n;return c(i,t(o,3))}return bw=a,bw}var ww,M2;function jne(){if(M2)return ww;M2=1;var e=l5(),t=wne();function n(r,a){return e(t(r,a),1)}return ww=n,ww}var Sne=jne();const Nne=Vt(Sne);var jw,$2;function Cne(){if($2)return jw;$2=1;var e=uN();function t(n,r){return e(n,r)}return jw=t,jw}var _ne=Cne();const df=Vt(_ne);var $c=1e9,Ane={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},DN,gn=!0,wa="[DecimalError] ",yo=wa+"Invalid argument: ",$N=wa+"Exponent out of range: ",Dc=Math.floor,co=Math.pow,Ene=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Yr,Jn=1e7,hn=7,nL=9007199254740991,Lh=Dc(nL/hn),Qe={};Qe.absoluteValue=Qe.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Qe.comparedTo=Qe.cmp=function(e){var t,n,r,a,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(r=i.d.length,a=e.d.length,t=0,n=r<a?r:a;t<n;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return r===a?0:r>a^i.s<0?1:-1};Qe.decimalPlaces=Qe.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*hn;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Qe.dividedBy=Qe.div=function(e){return Bs(this,new this.constructor(e))};Qe.dividedToIntegerBy=Qe.idiv=function(e){var t=this,n=t.constructor;return Zt(Bs(t,new n(e),0,1),n.precision)};Qe.equals=Qe.eq=function(e){return!this.cmp(e)};Qe.exponent=function(){return In(this)};Qe.greaterThan=Qe.gt=function(e){return this.cmp(e)>0};Qe.greaterThanOrEqualTo=Qe.gte=function(e){return this.cmp(e)>=0};Qe.isInteger=Qe.isint=function(){return this.e>this.d.length-2};Qe.isNegative=Qe.isneg=function(){return this.s<0};Qe.isPositive=Qe.ispos=function(){return this.s>0};Qe.isZero=function(){return this.s===0};Qe.lessThan=Qe.lt=function(e){return this.cmp(e)<0};Qe.lessThanOrEqualTo=Qe.lte=function(e){return this.cmp(e)<1};Qe.logarithm=Qe.log=function(e){var t,n=this,r=n.constructor,a=r.precision,i=a+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Yr))throw Error(wa+"NaN");if(n.s<1)throw Error(wa+(n.s?"NaN":"-Infinity"));return n.eq(Yr)?new r(0):(gn=!1,t=Bs(xd(n,i),xd(e,i),i),gn=!0,Zt(t,a))};Qe.minus=Qe.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?sL(t,e):rL(t,(e.s=-e.s,e))};Qe.modulo=Qe.mod=function(e){var t,n=this,r=n.constructor,a=r.precision;if(e=new r(e),!e.s)throw Error(wa+"NaN");return n.s?(gn=!1,t=Bs(n,e,0,1).times(e),gn=!0,n.minus(t)):Zt(new r(n),a)};Qe.naturalExponential=Qe.exp=function(){return aL(this)};Qe.naturalLogarithm=Qe.ln=function(){return xd(this)};Qe.negated=Qe.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Qe.plus=Qe.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?rL(t,e):sL(t,(e.s=-e.s,e))};Qe.precision=Qe.sd=function(e){var t,n,r,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(yo+e);if(t=In(a)+1,r=a.d.length-1,n=r*hn+1,r=a.d[r],r){for(;r%10==0;r/=10)n--;for(r=a.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Qe.squareRoot=Qe.sqrt=function(){var e,t,n,r,a,i,o,c=this,d=c.constructor;if(c.s<1){if(!c.s)return new d(0);throw Error(wa+"NaN")}for(e=In(c),gn=!1,a=Math.sqrt(+c),a==0||a==1/0?(t=ss(c.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=Dc((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(Bs(c,i,o+2)).times(.5),ss(i.d).slice(0,o)===(t=ss(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),a==o&&t=="4999"){if(Zt(i,n+1,0),i.times(i).eq(c)){r=i;break}}else if(t!="9999")break;o+=4}return gn=!0,Zt(r,n)};Qe.times=Qe.mul=function(e){var t,n,r,a,i,o,c,d,f,h=this,p=h.constructor,y=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=y.length,f=g.length,d<f&&(i=y,y=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]*y[a-r-1]+t,i[a--]=c%Jn|0,t=c/Jn|0;i[a]=(i[a]+t)%Jn|0}for(;!i[--o];)i.pop();return t?++n:i.shift(),e.d=i,e.e=n,gn?Zt(e,p.precision):e};Qe.toDecimalPlaces=Qe.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(fs(e,0,$c),t===void 0?t=r.rounding:fs(t,0,8),Zt(n,e+In(n)+1,t))};Qe.toExponential=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=Co(r,!0):(fs(e,0,$c),t===void 0?t=a.rounding:fs(t,0,8),r=Zt(new a(r),e+1,t),n=Co(r,!0,e+1)),n};Qe.toFixed=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?Co(a):(fs(e,0,$c),t===void 0?t=i.rounding:fs(t,0,8),r=Zt(new i(a),e+In(a)+1,t),n=Co(r.abs(),!1,e+In(r)+1),a.isneg()&&!a.isZero()?"-"+n:n)};Qe.toInteger=Qe.toint=function(){var e=this,t=e.constructor;return Zt(new t(e),In(e)+1,t.rounding)};Qe.toNumber=function(){return+this};Qe.toPower=Qe.pow=function(e){var t,n,r,a,i,o,c=this,d=c.constructor,f=12,h=+(e=new d(e));if(!e.s)return new d(Yr);if(c=new d(c),!c.s){if(e.s<1)throw Error(wa+"Infinity");return c}if(c.eq(Yr))return c;if(r=d.precision,e.eq(Yr))return Zt(c,r);if(t=e.e,n=e.d.length-1,o=t>=n,i=c.s,o){if((n=h<0?-h:h)<=nL){for(a=new d(Yr),t=Math.ceil(r/hn+4),gn=!1;n%2&&(a=a.times(c),L2(a.d,t)),n=Dc(n/2),n!==0;)c=c.times(c),L2(c.d,t);return gn=!0,e.s<0?new d(Yr).div(a):Zt(a,r)}}else if(i<0)throw Error(wa+"NaN");return i=i<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,gn=!1,a=e.times(xd(c,r+f)),gn=!0,a=aL(a),a.s=i,a};Qe.toPrecision=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?(n=In(a),r=Co(a,n<=i.toExpNeg||n>=i.toExpPos)):(fs(e,1,$c),t===void 0?t=i.rounding:fs(t,0,8),a=Zt(new i(a),e,t),n=In(a),r=Co(a,e<=n||n<=i.toExpNeg,e)),r};Qe.toSignificantDigits=Qe.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(fs(e,1,$c),t===void 0?t=r.rounding:fs(t,0,8)),Zt(new r(n),e,t)};Qe.toString=Qe.valueOf=Qe.val=Qe.toJSON=Qe[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=In(e),n=e.constructor;return Co(e,t<=n.toExpNeg||t>=n.toExpPos)};function rL(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?Zt(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/hn),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)/Jn|0,d[i]%=Jn;for(n&&(d.unshift(n),++a),c=d.length;d[--c]==0;)d.pop();return t.d=d,t.e=a,gn?Zt(t,p):t}function fs(e,t,n){if(e!==~~e||e<t||e>n)throw Error(yo+e)}function ss(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=hn-r.length,n&&(i+=Ni(n)),i+=r;o=e[t],r=o+"",n=hn-r.length,n&&(i+=Ni(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var Bs=(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%Jn|0,o=i/Jn|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*Jn+r[i]-a[i];for(;!r[0]&&r.length>1;)r.shift()}return function(r,a,i,o){var c,d,f,h,p,y,g,j,b,x,S,N,_,P,A,O,k,R,M=r.constructor,z=r.s==a.s?1:-1,B=r.d,D=a.d;if(!r.s)return new M(r);if(!a.s)throw Error(wa+"Division by zero");for(d=r.e-a.e,k=D.length,A=B.length,g=new M(z),j=g.d=[],f=0;D[f]==(B[f]||0);)++f;if(D[f]>(B[f]||0)&&--d,i==null?N=i=M.precision:o?N=i+(In(r)-In(a))+1:N=i,N<0)return new M(0);if(N=N/hn+2|0,f=0,k==1)for(h=0,D=D[0],N++;(f<A||h)&&N--;f++)_=h*Jn+(B[f]||0),j[f]=_/D|0,h=_%D|0;else{for(h=Jn/(D[0]+1)|0,h>1&&(D=e(D,h),B=e(B,h),k=D.length,A=B.length),P=k,b=B.slice(0,k),x=b.length;x<k;)b[x++]=0;R=D.slice(),R.unshift(0),O=D[0],D[1]>=Jn/2&&++O;do h=0,c=t(D,b,k,x),c<0?(S=b[0],k!=x&&(S=S*Jn+(b[1]||0)),h=S/O|0,h>1?(h>=Jn&&(h=Jn-1),p=e(D,h),y=p.length,x=b.length,c=t(p,b,y,x),c==1&&(h--,n(p,k<y?R:D,y))):(h==0&&(c=h=1),p=D.slice()),y=p.length,y<x&&p.unshift(0),n(b,p,x),c==-1&&(x=b.length,c=t(D,b,k,x),c<1&&(h++,n(b,k<x?R:D,x))),x=b.length):c===0&&(h++,b=[0]),j[f++]=h,c&&b[0]?b[x++]=B[P]||0:(b=[B[P]],x=1);while((P++<A||b[0]!==void 0)&&N--)}return j[0]||j.shift(),g.e=d,Zt(g,o?i+In(g)+1:i)}})();function aL(e,t){var n,r,a,i,o,c,d=0,f=0,h=e.constructor,p=h.precision;if(In(e)>16)throw Error($N+In(e));if(!e.s)return new h(Yr);for(gn=!1,c=p,o=new h(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(r=Math.log(co(2,f))/Math.LN10*2+5|0,c+=r,n=a=i=new h(Yr),h.precision=c;;){if(a=Zt(a.times(e),c),n=n.times(++d),o=i.plus(Bs(a,n,c)),ss(o.d).slice(0,c)===ss(i.d).slice(0,c)){for(;f--;)i=Zt(i.times(i),c);return h.precision=p,t==null?(gn=!0,Zt(i,p)):i}i=o}}function In(e){for(var t=e.e*hn,n=e.d[0];n>=10;n/=10)t++;return t}function Sw(e,t,n){if(t>e.LN10.sd())throw gn=!0,n&&(e.precision=n),Error(wa+"LN10 precision limit exceeded");return Zt(new e(e.LN10),t)}function Ni(e){for(var t="";e--;)t+="0";return t}function xd(e,t){var n,r,a,i,o,c,d,f,h,p=1,y=10,g=e,j=g.d,b=g.constructor,x=b.precision;if(g.s<1)throw Error(wa+(g.s?"NaN":"-Infinity"));if(g.eq(Yr))return new b(0);if(t==null?(gn=!1,f=x):f=t,g.eq(10))return t==null&&(gn=!0),Sw(b,f);if(f+=y,b.precision=f,n=ss(j),r=n.charAt(0),i=In(g),Math.abs(i)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=ss(g.d),r=n.charAt(0),p++;i=In(g),r>1?(g=new b("0."+n),i++):g=new b(r+"."+n.slice(1))}else return d=Sw(b,f+2,x).times(i+""),g=xd(new b(r+"."+n.slice(1)),f-y).plus(d),b.precision=x,t==null?(gn=!0,Zt(g,x)):g;for(c=o=g=Bs(g.minus(Yr),g.plus(Yr),f),h=Zt(g.times(g),f),a=3;;){if(o=Zt(o.times(h),f),d=c.plus(Bs(o,new b(a),f)),ss(d.d).slice(0,f)===ss(c.d).slice(0,f))return c=c.times(2),i!==0&&(c=c.plus(Sw(b,f+2,x).times(i+""))),c=Bs(c,new b(p),f),b.precision=x,t==null?(gn=!0,Zt(c,x)):c;c=d,a+=2}}function D2(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=Dc(n/hn),e.d=[],r=(n+1)%hn,n<0&&(r+=hn),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=hn;r<a;)e.d.push(+t.slice(r,r+=hn));t=t.slice(r),r=hn-t.length}else r-=a;for(;r--;)t+="0";if(e.d.push(+t),gn&&(e.e>Lh||e.e<-Lh))throw Error($N+n)}else e.s=0,e.e=0,e.d=[0];return e}function Zt(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+=hn,a=t,f=p[h=0];else{if(h=Math.ceil((r+1)/hn),i=p.length,h>=i)return e;for(f=i=p[h],o=1;i>=10;i/=10)o++;r%=hn,a=r-hn+o}if(n!==void 0&&(i=co(10,o-a-1),c=f/i%10|0,d=t<0||p[h+1]!==void 0||f%i,d=n<4?(c||d)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||d||n==6&&(r>0?a>0?f/co(10,o-a):0:p[h-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return d?(i=In(e),p.length=1,t=t-i-1,p[0]=co(10,(hn-t%hn)%hn),e.e=Dc(-t/hn)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(r==0?(p.length=h,i=1,h--):(p.length=h+1,i=co(10,hn-r),p[h]=a>0?(f/co(10,o-a)%co(10,a)|0)*i:0),d)for(;;)if(h==0){(p[0]+=i)==Jn&&(p[0]=1,++e.e);break}else{if(p[h]+=i,p[h]!=Jn)break;p[h--]=0,i=1}for(r=p.length;p[--r]===0;)p.pop();if(gn&&(e.e>Lh||e.e<-Lh))throw Error($N+In(e));return e}function sL(e,t){var n,r,a,i,o,c,d,f,h,p,y=e.constructor,g=y.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new y(e),gn?Zt(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/hn),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]=Jn-1;--d[i],d[a]+=Jn}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?Zt(t,g):t):new y(0)}function Co(e,t,n){var r,a=In(e),i=ss(e.d),o=i.length;return t?(n&&(r=n-o)>0?i=i.charAt(0)+"."+i.slice(1)+Ni(r):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+Ni(-a-1)+i,n&&(r=n-o)>0&&(i+=Ni(r))):a>=o?(i+=Ni(a+1-o),n&&(r=n-a-1)>0&&(i=i+"."+Ni(r))):((r=a+1)<o&&(i=i.slice(0,r)+"."+i.slice(r)),n&&(r=n-o)>0&&(a+1===o&&(i+="."),i+=Ni(r))),e.s<0?"-"+i:i}function L2(e,t){if(e.length>t)return e.length=t,!0}function iL(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(yo+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 D2(o,i.toString())}else if(typeof i!="string")throw Error(yo+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,Ene.test(i))D2(o,i);else throw Error(yo+i)}if(a.prototype=Qe,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=iL,a.config=a.set=Pne,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return a.config(e),a}function Pne(e){if(!e||typeof e!="object")throw Error(wa+"Object expected");var t,n,r,a=["precision",1,$c,"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(Dc(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(yo+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(yo+n+": "+r);return this}var DN=iL(Ane);Yr=new DN(1);const Ht=DN;function One(e){return Ine(e)||Tne(e)||Rne(e)||kne()}function kne(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
68
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rne(e,t){if(e){if(typeof e=="string")return ij(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 ij(e,t)}}function Tne(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Ine(e){if(Array.isArray(e))return ij(e)}function ij(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Mne=function(t){return t},oL={},lL=function(t){return t===oL},F2=function(t){return function n(){return arguments.length===0||arguments.length===1&&lL(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},$ne=function e(t,n){return t===1?n:F2(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!==oL}).length;return o>=t?n.apply(void 0,a):e(t-o,F2(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 lL(p)?d.shift():p});return n.apply(void 0,One(h).concat(d))}))})},bv=function(t){return $ne(t.length,t)},oj=function(t,n){for(var r=[],a=t;a<n;++a)r[a-t]=a;return r},Dne=bv(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),Lne=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return Mne;var a=n.reverse(),i=a[0],o=a.slice(1);return function(){return o.reduce(function(c,d){return d(c)},i.apply(void 0,arguments))}},lj=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},cL=function(t){var n=null,r=null;return function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return n&&i.every(function(c,d){return c===n[d]})||(n=i,r=t.apply(void 0,i)),r}};function Fne(e){var t;return e===0?t=1:t=Math.floor(new Ht(e).abs().log(10).toNumber())+1,t}function Bne(e,t,n){for(var r=new Ht(e),a=0,i=[];r.lt(t)&&a<1e5;)i.push(r.toNumber()),r=r.add(n),a++;return i}var zne=bv(function(e,t,n){var r=+e,a=+t;return r+n*(a-r)}),Une=bv(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),qne=bv(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const wv={rangeStep:Bne,getDigitCount:Fne,interpolateNumber:zne,uninterpolateNumber:Une,uninterpolateTruncation:qne};function cj(e){return Hne(e)||Vne(e)||uL(e)||Wne()}function Wne(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
69
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vne(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Hne(e){if(Array.isArray(e))return uj(e)}function bd(e,t){return Yne(e)||Gne(e,t)||uL(e,t)||Kne()}function Kne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
70
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uL(e,t){if(e){if(typeof e=="string")return uj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uj(e,t)}}function uj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Gne(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,a=!1,i=void 0;try{for(var o=e[Symbol.iterator](),c;!(r=(c=o.next()).done)&&(n.push(c.value),!(t&&n.length===t));r=!0);}catch(d){a=!0,i=d}finally{try{!r&&o.return!=null&&o.return()}finally{if(a)throw i}}return n}}function Yne(e){if(Array.isArray(e))return e}function dL(e){var t=bd(e,2),n=t[0],r=t[1],a=n,i=r;return n>r&&(a=r,i=n),[a,i]}function fL(e,t,n){if(e.lte(0))return new Ht(0);var r=wv.getDigitCount(e.toNumber()),a=new Ht(10).pow(r),i=e.div(a),o=r!==1?.05:.1,c=new Ht(Math.ceil(i.div(o).toNumber())).add(n).mul(o),d=c.mul(a);return t?d:new Ht(Math.ceil(d))}function Xne(e,t,n){var r=1,a=new Ht(e);if(!a.isint()&&n){var i=Math.abs(e);i<1?(r=new Ht(10).pow(wv.getDigitCount(e)-1),a=new Ht(Math.floor(a.div(r).toNumber())).mul(r)):i>1&&(a=new Ht(Math.floor(e)))}else e===0?a=new Ht(Math.floor((t-1)/2)):n||(a=new Ht(Math.floor(e)));var o=Math.floor((t-1)/2),c=Lne(Dne(function(d){return a.add(new Ht(d-o).mul(r)).toNumber()}),oj);return c(0,t)}function pL(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 Ht(0),tickMin:new Ht(0),tickMax:new Ht(0)};var i=fL(new Ht(t).sub(e).div(n-1),r,a),o;e<=0&&t>=0?o=new Ht(0):(o=new Ht(e).add(t).div(2),o=o.sub(new Ht(o).mod(i)));var c=Math.ceil(o.sub(e).div(i).toNumber()),d=Math.ceil(new Ht(t).sub(o).div(i).toNumber()),f=c+d+1;return f>n?pL(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 Ht(c).mul(i)),tickMax:o.add(new Ht(d).mul(i))})}function Qne(e){var t=bd(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=dL([n,r]),d=bd(c,2),f=d[0],h=d[1];if(f===-1/0||h===1/0){var p=h===1/0?[f].concat(cj(oj(0,a-1).map(function(){return 1/0}))):[].concat(cj(oj(0,a-1).map(function(){return-1/0})),[h]);return n>r?lj(p):p}if(f===h)return Xne(f,a,i);var y=pL(f,h,o,i),g=y.step,j=y.tickMin,b=y.tickMax,x=wv.rangeStep(j,b.add(new Ht(.1).mul(g)),g);return n>r?lj(x):x}function Jne(e,t){var n=bd(e,2),r=n[0],a=n[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=dL([r,a]),c=bd(o,2),d=c[0],f=c[1];if(d===-1/0||f===1/0)return[r,a];if(d===f)return[d];var h=Math.max(t,2),p=fL(new Ht(f).sub(d).div(h-1),i,0),y=[].concat(cj(wv.rangeStep(new Ht(d),new Ht(f).sub(new Ht(.99).mul(p)),p)),[f]);return r>a?lj(y):y}var Zne=cL(Qne),ere=cL(Jne),tre="Invariant failed";function _o(e,t){throw new Error(tre)}var nre=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function tc(e){"@babel/helpers - typeof";return tc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tc(e)}function Fh(){return Fh=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},Fh.apply(this,arguments)}function rre(e,t){return ore(e)||ire(e,t)||sre(e,t)||are()}function are(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
71
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sre(e,t){if(e){if(typeof e=="string")return 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 ire(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function ore(e){if(Array.isArray(e))return e}function lre(e,t){if(e==null)return{};var n=cre(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function cre(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ure(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dre(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,vL(r.key),r)}}function fre(e,t,n){return t&&dre(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pre(e,t,n){return t=Bh(t),hre(e,hL()?Reflect.construct(t,n||[],Bh(e).constructor):t.apply(e,n))}function hre(e,t){if(t&&(tc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mre(e)}function mre(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(hL=function(){return!!e})()}function Bh(e){return Bh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Bh(e)}function vre(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dj(e,t)}function dj(e,t){return dj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},dj(e,t)}function mL(e,t,n){return t=vL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vL(e){var t=gre(e,"string");return tc(t)=="symbol"?t:t+""}function gre(e,t){if(tc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(tc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ff=(function(e){function t(){return ure(this,t),pre(this,t,arguments)}return vre(t,e),fre(t,[{key:"render",value:function(){var r=this.props,a=r.offset,i=r.layout,o=r.width,c=r.dataKey,d=r.data,f=r.dataPointFormatter,h=r.xAxis,p=r.yAxis,y=lre(r,nre),g=pt(y,!1);this.props.direction==="x"&&h.type!=="number"&&_o();var j=d.map(function(b){var x=f(b,c),S=x.x,N=x.y,_=x.value,P=x.errorVal;if(!P)return null;var A=[],O,k;if(Array.isArray(P)){var R=rre(P,2);O=R[0],k=R[1]}else O=k=P;if(i==="vertical"){var M=h.scale,z=N+a,B=z+o,D=z-o,G=M(_-O),U=M(_+k);A.push({x1:U,y1:B,x2:U,y2:D}),A.push({x1:G,y1:z,x2:U,y2:z}),A.push({x1:G,y1:B,x2:G,y2:D})}else if(i==="horizontal"){var W=p.scale,X=S+a,J=X-o,T=X+o,L=W(_-O),Q=W(_+k);A.push({x1:J,y1:Q,x2:T,y2:Q}),A.push({x1:X,y1:L,x2:X,y2:Q}),A.push({x1:J,y1:L,x2:T,y2:L})}return q.createElement(It,Fh({className:"recharts-errorBar",key:"bar-".concat(A.map(function(F){return"".concat(F.x1,"-").concat(F.x2,"-").concat(F.y1,"-").concat(F.y2)}))},g),A.map(function(F){return q.createElement("line",Fh({},F,{key:"line-".concat(F.x1,"-").concat(F.x2,"-").concat(F.y1,"-").concat(F.y2)}))}))});return q.createElement(It,{className:"recharts-errorBars"},j)}}])})(q.Component);mL(ff,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});mL(ff,"displayName","ErrorBar");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 z2(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 ao(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?z2(Object(n),!0).forEach(function(r){yre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yre(e,t,n){return t=xre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xre(e){var t=bre(e,"string");return wd(t)=="symbol"?t:t+""}function bre(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)}var gL=function(t){var n=t.children,r=t.formattedGraphicalItems,a=t.legendWidth,i=t.legendContent,o=Vr(n,$l);if(!o)return null;var c=$l.defaultProps,d=c!==void 0?ao(ao({},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 y=p.item,g=p.props,j=g.sectors||g.data||[];return h.concat(j.map(function(b){return{type:o.props.iconType||y.props.legendType,value:b.name,color:b.fill,payload:b}}))},[]):f=(r||[]).map(function(h){var p=h.item,y=p.type.defaultProps,g=y!==void 0?ao(ao({},y),p.props):{},j=g.dataKey,b=g.name,x=g.legendType,S=g.hide;return{inactive:S,dataKey:j,type:d.iconType||x||"square",color:LN(p),value:b||j,payload:g}}),ao(ao(ao({},d),$l.getWithHeight(o,a)),{},{payload:f,item:o})};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 U2(e){return Nre(e)||Sre(e)||jre(e)||wre()}function wre(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
72
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jre(e,t){if(e){if(typeof e=="string")return fj(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 fj(e,t)}}function Sre(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Nre(e){if(Array.isArray(e))return fj(e)}function fj(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 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 Cn(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){Ll(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 Ll(e,t,n){return t=Cre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cre(e){var t=_re(e,"string");return jd(t)=="symbol"?t:t+""}function _re(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)}function qn(e,t,n){return bt(e)||bt(t)?n:Wn(t)?ea(e,t,n):xt(t)?t(e):n}function Gu(e,t,n,r){var a=Nne(e,function(c){return qn(c,t)});if(n==="number"){var i=a.filter(function(c){return Le(c)||parseFloat(c)});return i.length?[xv(i),yv(i)]:[1/0,-1/0]}var o=r?a.filter(function(c){return!bt(c)}):a;return o.map(function(c){return Wn(c)||c instanceof Date?c:""})}var Are=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,y=f>=c-1?a[0].coordinate:a[f+1].coordinate,g=void 0;if(xr(p-h)!==xr(y-p)){var j=[];if(xr(y-p)===xr(d[1]-d[0])){g=y;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 x=y+d[1]-d[0];j[0]=Math.min(p,(x+p)/2),j[1]=Math.max(p,(x+p)/2)}var S=[Math.min(p,(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 N=Math.min(h,y),_=Math.max(h,y);if(t>(N+p)/2&&t<=(_+p)/2){o=a[f].index;break}}}else for(var P=0;P<c;P++)if(P===0&&t<=(r[P].coordinate+r[P+1].coordinate)/2||P>0&&P<c-1&&t>(r[P].coordinate+r[P-1].coordinate)/2&&t<=(r[P].coordinate+r[P+1].coordinate)/2||P===c-1&&t>(r[P].coordinate+r[P-1].coordinate)/2){o=r[P].index;break}return o},LN=function(t){var n,r=t,a=r.type.displayName,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Cn(Cn({},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},Ere=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),y=0,g=p.length;y<g;y++){var j=h[p[y]],b=j.items,x=j.cateAxisId,S=b.filter(function(k){return Ls(k.type).indexOf("Bar")>=0});if(S&&S.length){var N=S[0].type.defaultProps,_=N!==void 0?Cn(Cn({},N),S[0].props):S[0].props,P=_.barSize,A=_[x];o[A]||(o[A]=[]);var O=bt(P)?n:P;o[A].push({item:S[0],stackList:S.slice(1),barSize:bt(O)?void 0:br(O,r,0)})}}return o},Pre=function(t){var n=t.barGap,r=t.barCategoryGap,a=t.bandSize,i=t.sizeList,o=i===void 0?[]:i,c=t.maxBarSize,d=o.length;if(d<1)return null;var f=br(n,a,0,!0),h,p=[];if(o[0].barSize===+o[0].barSize){var y=!1,g=a/d,j=o.reduce(function(P,A){return P+A.barSize||0},0);j+=(d-1)*f,j>=a&&(j-=(d-1)*f,f=0),j>=a&&g>0&&(y=!0,g*=.9,j=d*g);var b=(a-j)/2>>0,x={offset:b-f,size:0};h=o.reduce(function(P,A){var O={item:A.item,position:{offset:x.offset+x.size+f,size:y?g:A.barSize}},k=[].concat(U2(P),[O]);return x=k[k.length-1].position,A.stackList&&A.stackList.length&&A.stackList.forEach(function(R){k.push({item:R,position:x})}),k},p)}else{var S=br(r,a,0,!0);a-2*S-(d-1)*f<=0&&(f=0);var N=(a-2*S-(d-1)*f)/d;N>1&&(N>>=0);var _=c===+c?Math.min(N,c):N;h=o.reduce(function(P,A,O){var k=[].concat(U2(P),[{item:A.item,position:{offset:S+(N+f)*O+(N-_)/2,size:_}}]);return A.stackList&&A.stackList.length&&A.stackList.forEach(function(R){k.push({item:R,position:k[k.length-1].position})}),k},p)}return h},Ore=function(t,n,r,a){var i=r.children,o=r.width,c=r.margin,d=o-(c.left||0)-(c.right||0),f=gL({children:i,legendWidth:d});if(f){var h=a||{},p=h.width,y=h.height,g=f.align,j=f.verticalAlign,b=f.layout;if((b==="vertical"||b==="horizontal"&&j==="middle")&&g!=="center"&&Le(t[g]))return Cn(Cn({},t),{},Ll({},g,t[g]+(p||0)));if((b==="horizontal"||b==="vertical"&&g==="center")&&j!=="middle"&&Le(t[j]))return Cn(Cn({},t),{},Ll({},j,t[j]+(y||0)))}return t},kre=function(t,n,r){return bt(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},yL=function(t,n,r,a,i){var o=n.props.children,c=ta(o,ff).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=qn(h,r);if(bt(p))return f;var y=Array.isArray(p)?[xv(p),yv(p)]:[p,p],g=d.reduce(function(j,b){var x=qn(h,b,0),S=y[0]-Math.abs(Array.isArray(x)?x[0]:x),N=y[1]+Math.abs(Array.isArray(x)?x[1]:x);return[Math.min(S,j[0]),Math.max(N,j[1])]},[1/0,-1/0]);return[Math.min(g[0],f[0]),Math.max(g[1],f[1])]},[1/0,-1/0])}return null},Rre=function(t,n,r,a,i){var o=n.map(function(c){return yL(t,c,r,i,a)}).filter(function(c){return!bt(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},xL=function(t,n,r,a,i){var o=n.map(function(d){var f=d.props.dataKey;return r==="number"&&f&&yL(t,d,f,a)||Gu(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},[])},bL=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},mo=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?xr(c[0]-c[1])*2*f:f,n&&(t.ticks||t.niceTicks)){var h=(t.ticks||t.niceTicks).map(function(p){var y=i?i.indexOf(p):p;return{coordinate:a(y)+f,value:p,offset:f}});return h.filter(function(p){return!af(p.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(p,y){return{coordinate:a(p)+f,value:p,index:y,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,y){return{coordinate:a(p)+f,value:i?i[p]:p,index:y,offset:f}})},Nw=new WeakMap,Up=function(t,n){if(typeof n!="function")return t;Nw.has(t)||Nw.set(t,new WeakMap);var r=Nw.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:hd(),realScaleType:"band"}:o==="radial"&&c==="angleAxis"?{scale:Ih(),realScaleType:"linear"}:i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:Ku(),realScaleType:"point"}:i==="category"?{scale:hd(),realScaleType:"band"}:{scale:Ih(),realScaleType:"linear"};if(jo(a)){var d="scale".concat(rv(a));return{scale:(E2[d]||Ku)(),realScaleType:E2[d]?d:"point"}}return xt(a)?{scale:a}:{scale:Ku(),realScaleType:"point"}},W2=1e-4,jL=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])-W2,o=Math.max(a[0],a[1])+W2,c=t(n[0]),d=t(n[r-1]);(c<i||c>o||d<i||d>o)&&t.domain([n[0],n[r-1]])}},Tre=function(t,n){if(!t)return null;for(var r=0,a=t.length;r<a;r++)if(t[r].item===n)return t[r].position;return null},Ire=function(t,n){if(!n||n.length!==2||!Le(n[0])||!Le(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(!Le(t[0])||t[0]<r)&&(i[0]=r),(!Le(t[1])||t[1]>a)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]<r&&(i[1]=r),i},Mre=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r<a;++r)for(var i=0,o=0,c=0;c<n;++c){var d=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])}},$re=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r<a;++r)for(var i=0,o=0;o<n;++o){var c=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)}},Dre={sign:Mre,expand:NX,none:Kl,silhouette:CX,wiggle:_X,positive:$re},Lre=function(t,n,r){var a=n.map(function(c){return c.props.dataKey}),i=Dre[r],o=SX().keys(a).value(function(c,d){return+qn(c,d,0)}).order(z1).offset(i);return o(t)},Fre=function(t,n,r,a,i,o){if(!t)return null;var c=o?n.reverse():n,d={},f=c.reduce(function(p,y){var g,j=(g=y.type)!==null&&g!==void 0&&g.defaultProps?Cn(Cn({},y.type.defaultProps),y.props):y.props,b=j.stackId,x=j.hide;if(x)return p;var S=j[r],N=p[S]||{hasStack:!1,stackGroups:{}};if(Wn(b)){var _=N.stackGroups[b]||{numericAxisId:r,cateAxisId:a,items:[]};_.items.push(y),N.hasStack=!0,N.stackGroups[b]=_}else N.stackGroups[Tc("_stackId_")]={numericAxisId:r,cateAxisId:a,items:[y]};return Cn(Cn({},p),{},Ll({},S,N))},d),h={};return Object.keys(f).reduce(function(p,y){var g=f[y];if(g.hasStack){var j={};g.stackGroups=Object.keys(g.stackGroups).reduce(function(b,x){var S=g.stackGroups[x];return Cn(Cn({},b),{},Ll({},x,{numericAxisId:r,cateAxisId:a,items:S.items,stackedData:Lre(t,S.items,i)}))},j)}return Cn(Cn({},p),{},Ll({},y,g))},h)},SL=function(t,n){var r=n.realScaleType,a=n.type,i=n.tickCount,o=n.originalDomain,c=n.allowDecimals,d=r||n.scale;if(d!=="auto"&&d!=="linear")return null;if(i&&a==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var f=t.domain();if(!f.length)return null;var h=Zne(f,i,c);return t.domain([xv(h),yv(h)]),{niceTicks:h}}if(i&&a==="number"){var p=t.domain(),y=ere(p,i,c);return{niceTicks:y}}return null};function V2(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&&!bt(a[t.dataKey])){var c=mh(n,"value",a[t.dataKey]);if(c)return c.coordinate+r/2}return n[i]?n[i].coordinate+r/2:null}var d=qn(a,bt(o)?t.dataKey:o);return bt(d)?null:t.scale(d)}var H2=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=qn(o,n.dataKey,n.domain[c]);return bt(d)?null:n.scale(d)-i/2+a},Bre=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var a=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return a<=0&&i>=0?0:i<0?i:a}return r[0]},zre=function(t,n){var r,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Cn(Cn({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(Wn(i)){var o=n[i];if(o){var c=o.items.indexOf(t);return c>=0?o.stackedData[c]:null}}return null},Ure=function(t){return t.reduce(function(n,r){return[xv(r.concat([n[0]]).filter(Le)),yv(r.concat([n[1]]).filter(Le))]},[1/0,-1/0])},NL=function(t,n,r){return Object.keys(t).reduce(function(a,i){var o=t[i],c=o.stackedData,d=c.reduce(function(f,h){var p=Ure(h.slice(n,r+1));return[Math.min(f[0],p[0]),Math.max(f[1],p[1])]},[1/0,-1/0]);return[Math.min(d[0],a[0]),Math.max(d[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},K2=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,G2=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,pj=function(t,n,r){if(xt(t))return t(n,r);if(!Array.isArray(t))return n;var a=[];if(Le(t[0]))a[0]=r?t[0]:Math.min(t[0],n[0]);else if(K2.test(t[0])){var i=+K2.exec(t[0])[1];a[0]=n[0]-i}else xt(t[0])?a[0]=t[0](n[0]):a[0]=n[0];if(Le(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 xt(t[1])?a[1]=t[1](n[1]):a[1]=n[1];return a},zh=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},Y2=function(t,n,r){return!t||!t.length||df(t,ea(r,"type.defaultProps.domain"))?n:t},CL=function(t,n){var r=t.type.defaultProps?Cn(Cn({},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 Cn(Cn({},pt(t,!1)),{},{dataKey:a,unit:o,formatter:c,name:i||a,color:LN(t),value:qn(n,a),type:d,payload:n,chartType:f,hide:h})};function Sd(e){"@babel/helpers - typeof";return Sd=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},Sd(e)}function X2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ks(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?X2(Object(n),!0).forEach(function(r){_L(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _L(e,t,n){return t=qre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qre(e){var t=Wre(e,"string");return Sd(t)=="symbol"?t:t+""}function Wre(e,t){if(Sd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Sd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vre(e,t){return Yre(e)||Gre(e,t)||Kre(e,t)||Hre()}function Hre(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
73
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kre(e,t){if(e){if(typeof e=="string")return Q2(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 Q2(e,t)}}function Q2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Gre(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function Yre(e){if(Array.isArray(e))return e}var Uh=Math.PI/180,Xre=function(t){return t*180/Math.PI},ln=function(t,n,r,a){return{x:t+Math.cos(-Uh*a)*r,y:n+Math.sin(-Uh*a)*r}},AL=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},Qre=function(t,n,r,a,i){var o=t.width,c=t.height,d=t.startAngle,f=t.endAngle,h=br(t.cx,o,o/2),p=br(t.cy,c,c/2),y=AL(o,c,r),g=br(t.innerRadius,y,0),j=br(t.outerRadius,y,y*.8),b=Object.keys(n);return b.reduce(function(x,S){var N=n[S],_=N.domain,P=N.reversed,A;if(bt(N.range))a==="angleAxis"?A=[d,f]:a==="radiusAxis"&&(A=[g,j]),P&&(A=[A[1],A[0]]);else{A=N.range;var O=A,k=Vre(O,2);d=k[0],f=k[1]}var R=wL(N,i),M=R.realScaleType,z=R.scale;z.domain(_).range(A),jL(z);var B=SL(z,ks(ks({},N),{},{realScaleType:M})),D=ks(ks(ks({},N),B),{},{range:A,radius:j,realScaleType:M,scale:z,cx:h,cy:p,innerRadius:g,outerRadius:j,startAngle:d,endAngle:f});return ks(ks({},x),{},_L({},S,D))},{})},Jre=function(t,n){var r=t.x,a=t.y,i=n.x,o=n.y;return Math.sqrt(Math.pow(r-i,2)+Math.pow(a-o,2))},Zre=function(t,n){var r=t.x,a=t.y,i=n.cx,o=n.cy,c=Jre({x:r,y:a},{x:i,y:o});if(c<=0)return{radius:c};var d=(r-i)/c,f=Math.acos(d);return a>o&&(f=2*Math.PI-f),{radius:c,angle:Xre(f),angleInRadian:f}},eae=function(t){var n=t.startAngle,r=t.endAngle,a=Math.floor(n/360),i=Math.floor(r/360),o=Math.min(a,i);return{startAngle:n-o*360,endAngle:r-o*360}},tae=function(t,n){var r=n.startAngle,a=n.endAngle,i=Math.floor(r/360),o=Math.floor(a/360),c=Math.min(i,o);return t+c*360},J2=function(t,n){var r=t.x,a=t.y,i=Zre({x:r,y:a},n),o=i.radius,c=i.angle,d=n.innerRadius,f=n.outerRadius;if(o<d||o>f)return!1;if(o===0)return!0;var h=eae(n),p=h.startAngle,y=h.endAngle,g=c,j;if(p<=y){for(;g>y;)g-=360;for(;g<p;)g+=360;j=g>=p&&g<=y}else{for(;g>p;)g-=360;for(;g<y;)g+=360;j=g>=y&&g<=p}return j?ks(ks({},n),{},{radius:o,angle:tae(g,n)}):null},EL=function(t){return!v.isValidElement(t)&&!xt(t)&&typeof t!="boolean"?t.className:""};function Nd(e){"@babel/helpers - typeof";return Nd=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},Nd(e)}var nae=["offset"];function rae(e){return oae(e)||iae(e)||sae(e)||aae()}function aae(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
74
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sae(e,t){if(e){if(typeof e=="string")return hj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hj(e,t)}}function iae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function oae(e){if(Array.isArray(e))return hj(e)}function hj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function lae(e,t){if(e==null)return{};var n=cae(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function cae(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Z2(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 Un(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Z2(Object(n),!0).forEach(function(r){uae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uae(e,t,n){return t=dae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dae(e){var t=fae(e,"string");return Nd(t)=="symbol"?t:t+""}function fae(e,t){if(Nd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Nd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cd(){return Cd=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},Cd.apply(this,arguments)}var pae=function(t){var n=t.value,r=t.formatter,a=bt(t.children)?n:t.children;return xt(r)?r(a):a},hae=function(t,n){var r=xr(n-t),a=Math.min(Math.abs(n-t),360);return r*a},mae=function(t,n,r){var a=t.position,i=t.viewBox,o=t.offset,c=t.className,d=i,f=d.cx,h=d.cy,p=d.innerRadius,y=d.outerRadius,g=d.startAngle,j=d.endAngle,b=d.clockWise,x=(p+y)/2,S=hae(g,j),N=S>=0?1:-1,_,P;a==="insideStart"?(_=g+N*o,P=b):a==="insideEnd"?(_=j-N*o,P=!b):a==="end"&&(_=j+N*o,P=b),P=S<=0?P:!P;var A=ln(f,h,x,_),O=ln(f,h,x,_+(P?1:-1)*359),k="M".concat(A.x,",").concat(A.y,`
75
- A`).concat(x,",").concat(x,",0,1,").concat(P?0:1,`,
76
- `).concat(O.x,",").concat(O.y),R=bt(t.id)?Tc("recharts-radial-line-"):t.id;return q.createElement("text",Cd({},r,{dominantBaseline:"central",className:wt("recharts-radial-bar-label",c)}),q.createElement("defs",null,q.createElement("path",{id:R,d:k})),q.createElement("textPath",{xlinkHref:"#".concat(R)},n))},vae=function(t){var n=t.viewBox,r=t.offset,a=t.position,i=n,o=i.cx,c=i.cy,d=i.innerRadius,f=i.outerRadius,h=i.startAngle,p=i.endAngle,y=(h+p)/2;if(a==="outside"){var g=ln(o,c,f+r,y),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 x=(d+f)/2,S=ln(o,c,x,y),N=S.x,_=S.y;return{x:N,y:_,textAnchor:"middle",verticalAnchor:"middle"}},gae=function(t){var n=t.viewBox,r=t.parentViewBox,a=t.offset,i=t.position,o=n,c=o.x,d=o.y,f=o.width,h=o.height,p=h>=0?1:-1,y=p*a,g=p>0?"end":"start",j=p>0?"start":"end",b=f>=0?1:-1,x=b*a,S=b>0?"end":"start",N=b>0?"start":"end";if(i==="top"){var _={x:c+f/2,y:d-p*a,textAnchor:"middle",verticalAnchor:g};return Un(Un({},_),r?{height:Math.max(d-r.y,0),width:f}:{})}if(i==="bottom"){var P={x:c+f/2,y:d+h+y,textAnchor:"middle",verticalAnchor:j};return Un(Un({},P),r?{height:Math.max(r.y+r.height-(d+h),0),width:f}:{})}if(i==="left"){var A={x:c-x,y:d+h/2,textAnchor:S,verticalAnchor:"middle"};return Un(Un({},A),r?{width:Math.max(A.x-r.x,0),height:h}:{})}if(i==="right"){var O={x:c+f+x,y:d+h/2,textAnchor:N,verticalAnchor:"middle"};return Un(Un({},O),r?{width:Math.max(r.x+r.width-O.x,0),height:h}:{})}var k=r?{width:f,height:h}:{};return i==="insideLeft"?Un({x:c+x,y:d+h/2,textAnchor:N,verticalAnchor:"middle"},k):i==="insideRight"?Un({x:c+f-x,y:d+h/2,textAnchor:S,verticalAnchor:"middle"},k):i==="insideTop"?Un({x:c+f/2,y:d+y,textAnchor:"middle",verticalAnchor:j},k):i==="insideBottom"?Un({x:c+f/2,y:d+h-y,textAnchor:"middle",verticalAnchor:g},k):i==="insideTopLeft"?Un({x:c+x,y:d+y,textAnchor:N,verticalAnchor:j},k):i==="insideTopRight"?Un({x:c+f-x,y:d+y,textAnchor:S,verticalAnchor:j},k):i==="insideBottomLeft"?Un({x:c+x,y:d+h-y,textAnchor:N,verticalAnchor:g},k):i==="insideBottomRight"?Un({x:c+f-x,y:d+h-y,textAnchor:S,verticalAnchor:g},k):Rc(i)&&(Le(i.x)||fo(i.x))&&(Le(i.y)||fo(i.y))?Un({x:c+br(i.x,f),y:d+br(i.y,h),textAnchor:"end",verticalAnchor:"end"},k):Un({x:c+f/2,y:d+h/2,textAnchor:"middle",verticalAnchor:"middle"},k)},yae=function(t){return"cx"in t&&Le(t.cx)};function Zn(e){var t=e.offset,n=t===void 0?5:t,r=lae(e,nae),a=Un({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,y=a.textBreakAll;if(!i||bt(c)&&bt(d)&&!v.isValidElement(f)&&!xt(f))return null;if(v.isValidElement(f))return v.cloneElement(f,a);var g;if(xt(f)){if(g=v.createElement(f,a),v.isValidElement(g))return g}else g=pae(a);var j=yae(i),b=pt(a,!0);if(j&&(o==="insideStart"||o==="insideEnd"||o==="end"))return mae(a,g,b);var x=j?vae(a):gae(a);return q.createElement(No,Cd({className:wt("recharts-label",p)},b,x,{breakAll:y}),g)}Zn.displayName="Label";var PL=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,y=t.y,g=t.top,j=t.left,b=t.width,x=t.height,S=t.clockWise,N=t.labelViewBox;if(N)return N;if(Le(b)&&Le(x)){if(Le(p)&&Le(y))return{x:p,y,width:b,height:x};if(Le(g)&&Le(j))return{x:g,y:j,width:b,height:x}}return Le(p)&&Le(y)?{x:p,y,width:0,height:0}:Le(n)&&Le(r)?{cx:n,cy:r,startAngle:i||a||0,endAngle:o||a||0,innerRadius:f||0,outerRadius:h||d||c||0,clockWise:S}:t.viewBox?t.viewBox:{}},xae=function(t,n){return t?t===!0?q.createElement(Zn,{key:"label-implicit",viewBox:n}):Wn(t)?q.createElement(Zn,{key:"label-implicit",viewBox:n,value:t}):v.isValidElement(t)?t.type===Zn?v.cloneElement(t,{key:"label-implicit",viewBox:n}):q.createElement(Zn,{key:"label-implicit",content:t,viewBox:n}):xt(t)?q.createElement(Zn,{key:"label-implicit",content:t,viewBox:n}):Rc(t)?q.createElement(Zn,Cd({viewBox:n},t,{key:"label-implicit"})):null:null},bae=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var a=t.children,i=PL(t),o=ta(a,Zn).map(function(d,f){return v.cloneElement(d,{viewBox:n||i,key:"label-".concat(f)})});if(!r)return o;var c=xae(t.label,n||i);return[c].concat(rae(o))};Zn.parseViewBox=PL;Zn.renderCallByParent=bae;var Cw,eT;function wae(){if(eT)return Cw;eT=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return Cw=e,Cw}var jae=wae();const Sae=Vt(jae);function _d(e){"@babel/helpers - typeof";return _d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_d(e)}var Nae=["valueAccessor"],Cae=["data","dataKey","clockWise","id","textBreakAll"];function _ae(e){return Oae(e)||Pae(e)||Eae(e)||Aae()}function Aae(){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 Eae(e,t){if(e){if(typeof e=="string")return mj(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 mj(e,t)}}function Pae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Oae(e){if(Array.isArray(e))return mj(e)}function mj(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 qh(){return qh=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},qh.apply(this,arguments)}function tT(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 nT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tT(Object(n),!0).forEach(function(r){kae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kae(e,t,n){return t=Rae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rae(e){var t=Tae(e,"string");return _d(t)=="symbol"?t:t+""}function Tae(e,t){if(_d(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(_d(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rT(e,t){if(e==null)return{};var n=Iae(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Iae(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Mae=function(t){return Array.isArray(t.value)?Sae(t.value):t.value};function zs(e){var t=e.valueAccessor,n=t===void 0?Mae:t,r=rT(e,Nae),a=r.data,i=r.dataKey,o=r.clockWise,c=r.id,d=r.textBreakAll,f=rT(r,Cae);return!a||!a.length?null:q.createElement(It,{className:"recharts-label-list"},a.map(function(h,p){var y=bt(i)?n(h,p):qn(h&&h.payload,i),g=bt(c)?{}:{id:"".concat(c,"-").concat(p)};return q.createElement(Zn,qh({},pt(h,!0),f,g,{parentViewBox:h.parentViewBox,value:y,textBreakAll:d,viewBox:Zn.parseViewBox(bt(o)?h:nT(nT({},h),{},{clockWise:o})),key:"label-".concat(p),index:p}))}))}zs.displayName="LabelList";function $ae(e,t){return e?e===!0?q.createElement(zs,{key:"labelList-implicit",data:t}):q.isValidElement(e)||xt(e)?q.createElement(zs,{key:"labelList-implicit",data:t,content:e}):Rc(e)?q.createElement(zs,qh({data:t},e,{key:"labelList-implicit"})):null:null}function Dae(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,a=ta(r,zs).map(function(o,c){return v.cloneElement(o,{data:t,key:"labelList-".concat(c)})});if(!n)return a;var i=$ae(e.label,t);return[i].concat(_ae(a))}zs.renderCallByParent=Dae;function Ad(e){"@babel/helpers - typeof";return Ad=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},Ad(e)}function vj(){return vj=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},vj.apply(this,arguments)}function aT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function sT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aT(Object(n),!0).forEach(function(r){Lae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lae(e,t,n){return t=Fae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fae(e){var t=Bae(e,"string");return Ad(t)=="symbol"?t:t+""}function Bae(e,t){if(Ad(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ad(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var zae=function(t,n){var r=xr(n-t),a=Math.min(Math.abs(n-t),359.999);return r*a},qp=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)/Uh,y=f?i:i+o*p,g=ln(n,r,h,y),j=ln(n,r,a,y),b=f?i-o*p:i,x=ln(n,r,h*Math.cos(p*Uh),b);return{center:g,circleTangency:j,lineTangency:x,theta:p}},OL=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.startAngle,c=t.endAngle,d=zae(o,c),f=o+d,h=ln(n,r,i,o),p=ln(n,r,i,f),y="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=ln(n,r,a,o),j=ln(n,r,a,f);y+="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 y+="L ".concat(n,",").concat(r," Z");return y},Uae=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.cornerRadius,c=t.forceCornerRadius,d=t.cornerIsExternal,f=t.startAngle,h=t.endAngle,p=xr(h-f),y=qp({cx:n,cy:r,radius:i,angle:f,sign:p,cornerRadius:o,cornerIsExternal:d}),g=y.circleTangency,j=y.lineTangency,b=y.theta,x=qp({cx:n,cy:r,radius:i,angle:h,sign:-p,cornerRadius:o,cornerIsExternal:d}),S=x.circleTangency,N=x.lineTangency,_=x.theta,P=d?Math.abs(f-h):Math.abs(f-h)-b-_;if(P<0)return c?"M ".concat(j.x,",").concat(j.y,`
85
- a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0
86
- a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0
87
- `):OL({cx:n,cy:r,innerRadius:a,outerRadius:i,startAngle:f,endAngle:h});var A="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(+(P>180),",").concat(+(p<0),",").concat(S.x,",").concat(S.y,`
90
- A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(N.x,",").concat(N.y,`
91
- `);if(a>0){var O=qp({cx:n,cy:r,radius:a,angle:f,sign:p,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),k=O.circleTangency,R=O.lineTangency,M=O.theta,z=qp({cx:n,cy:r,radius:a,angle:h,sign:-p,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),B=z.circleTangency,D=z.lineTangency,G=z.theta,U=d?Math.abs(f-h):Math.abs(f-h)-M-G;if(U<0&&o===0)return"".concat(A,"L").concat(n,",").concat(r,"Z");A+="L".concat(D.x,",").concat(D.y,`
92
- A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(B.x,",").concat(B.y,`
93
- A`).concat(a,",").concat(a,",0,").concat(+(U>180),",").concat(+(p>0),",").concat(k.x,",").concat(k.y,`
94
- A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(R.x,",").concat(R.y,"Z")}else A+="L".concat(n,",").concat(r,"Z");return A},qae={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},kL=function(t){var n=sT(sT({},qae),t),r=n.cx,a=n.cy,i=n.innerRadius,o=n.outerRadius,c=n.cornerRadius,d=n.forceCornerRadius,f=n.cornerIsExternal,h=n.startAngle,p=n.endAngle,y=n.className;if(o<i||h===p)return null;var g=wt("recharts-sector",y),j=o-i,b=br(c,j,0,!0),x;return b>0&&Math.abs(h-p)<360?x=Uae({cx:r,cy:a,innerRadius:i,outerRadius:o,cornerRadius:Math.min(b,j/2),forceCornerRadius:d,cornerIsExternal:f,startAngle:h,endAngle:p}):x=OL({cx:r,cy:a,innerRadius:i,outerRadius:o,startAngle:h,endAngle:p}),q.createElement("path",vj({},pt(n,!0),{className:g,d:x,role:"img"}))};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)}function gj(){return gj=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},gj.apply(this,arguments)}function iT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function oT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iT(Object(n),!0).forEach(function(r){Wae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wae(e,t,n){return t=Vae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vae(e){var t=Hae(e,"string");return Ed(t)=="symbol"?t:t+""}function Hae(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)}var lT={curveBasisClosed:fX,curveBasisOpen:pX,curveBasis:dX,curveBumpX:QY,curveBumpY:JY,curveLinearClosed:hX,curveLinear:sv,curveMonotoneX:mX,curveMonotoneY:vX,curveNatural:gX,curveStep:yX,curveStepAfter:bX,curveStepBefore:xX},Wp=function(t){return t.x===+t.x&&t.y===+t.y},ku=function(t){return t.x},Ru=function(t){return t.y},Kae=function(t,n){if(xt(t))return t;var r="curve".concat(rv(t));return(r==="curveMonotone"||r==="curveBump")&&n?lT["".concat(r).concat(n==="vertical"?"Y":"X")]:lT[r]||sv},Gae=function(t){var n=t.type,r=n===void 0?"linear":n,a=t.points,i=a===void 0?[]:a,o=t.baseLine,c=t.layout,d=t.connectNulls,f=d===void 0?!1:d,h=Kae(r,c),p=f?i.filter(function(b){return Wp(b)}):i,y;if(Array.isArray(o)){var g=f?o.filter(function(b){return Wp(b)}):o,j=p.map(function(b,x){return oT(oT({},b),{},{base:g[x]})});return c==="vertical"?y=Mp().y(Ru).x1(ku).x0(function(b){return b.base.x}):y=Mp().x(ku).y1(Ru).y0(function(b){return b.base.y}),y.defined(Wp).curve(h),y(j)}return c==="vertical"&&Le(o)?y=Mp().y(Ru).x1(ku).x0(o):Le(o)?y=Mp().x(ku).y1(Ru).y0(o):y=k3().x(ku).y(Ru),y.defined(Wp).curve(h),y(p)},Wh=function(t){var n=t.className,r=t.points,a=t.path,i=t.pathRef;if((!r||!r.length)&&!a)return null;var o=r&&r.length?Gae(t):a;return v.createElement("path",gj({},pt(t,!1),vh(t),{className:wt("recharts-curve",n),d:o,ref:i}))},_w={exports:{}},Aw,cT;function Yae(){if(cT)return Aw;cT=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Aw=e,Aw}var Ew,uT;function Xae(){if(uT)return Ew;uT=1;var e=Yae();function t(){}function n(){}return n.resetWarningCache=t,Ew=function(){function r(o,c,d,f,h,p){if(p!==e){var y=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 y.name="Invariant Violation",y}}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},Ew}var dT;function Qae(){return dT||(dT=1,_w.exports=Xae()()),_w.exports}var Jae=Qae();const zt=Vt(Jae),{getOwnPropertyNames:Zae,getOwnPropertySymbols:ese}=Object,{hasOwnProperty:tse}=Object.prototype;function Pw(e,t){return function(r,a,i){return e(r,a,i)&&t(r,a,i)}}function Vp(e){return function(n,r,a){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,a);const{cache:i}=a,o=i.get(n),c=i.get(r);if(o&&c)return o===r&&c===n;i.set(n,r),i.set(r,n);const d=e(n,r,a);return i.delete(n),i.delete(r),d}}function nse(e){return e?.[Symbol.toStringTag]}function fT(e){return Zae(e).concat(ese(e))}const rse=Object.hasOwn||((e,t)=>tse.call(e,t));function Bo(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const ase="__v",sse="__o",ise="_owner",{getOwnPropertyDescriptor:pT,keys:hT}=Object;function ose(e,t){return e.byteLength===t.byteLength&&Vh(new Uint8Array(e),new Uint8Array(t))}function lse(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function cse(e,t){return e.byteLength===t.byteLength&&Vh(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function use(e,t){return Bo(e.getTime(),t.getTime())}function dse(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function fse(e,t){return e===t}function mT(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 y=o.value,g=c.value;if(n.equals(y[0],g[0],d,p,e,t,n)&&n.equals(y[1],g[1],y[0],g[0],e,t,n)){h=a[p]=!0;break}p++}if(!h)return!1;d++}return!0}const pse=Bo;function hse(e,t,n){const r=hT(e);let a=r.length;if(hT(t).length!==a)return!1;for(;a-- >0;)if(!RL(e,t,n,r[a]))return!1;return!0}function Tu(e,t,n){const r=fT(e);let a=r.length;if(fT(t).length!==a)return!1;let i,o,c;for(;a-- >0;)if(i=r[a],!RL(e,t,n,i)||(o=pT(e,i),c=pT(t,i),(o||c)&&(!o||!c||o.configurable!==c.configurable||o.enumerable!==c.enumerable||o.writable!==c.writable)))return!1;return!0}function mse(e,t){return Bo(e.valueOf(),t.valueOf())}function vse(e,t){return e.source===t.source&&e.flags===t.flags}function vT(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 Vh(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function gse(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function RL(e,t,n,r){return(r===ise||r===sse||r===ase)&&(e.$$typeof||t.$$typeof)?!0:rse(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const yse="[object ArrayBuffer]",xse="[object Arguments]",bse="[object Boolean]",wse="[object DataView]",jse="[object Date]",Sse="[object Error]",Nse="[object Map]",Cse="[object Number]",_se="[object Object]",Ase="[object RegExp]",Ese="[object Set]",Pse="[object String]",Ose={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},kse="[object URL]",Rse=Object.prototype.toString;function Tse({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:a,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:c,areObjectsEqual:d,arePrimitiveWrappersEqual:f,areRegExpsEqual:h,areSetsEqual:p,areTypedArraysEqual:y,areUrlsEqual:g,unknownTagComparators:j}){return function(x,S,N){if(x===S)return!0;if(x==null||S==null)return!1;const _=typeof x;if(_!==typeof S)return!1;if(_!=="object")return _==="number"?c(x,S,N):_==="function"?i(x,S,N):!1;const P=x.constructor;if(P!==S.constructor)return!1;if(P===Object)return d(x,S,N);if(Array.isArray(x))return t(x,S,N);if(P===Date)return r(x,S,N);if(P===RegExp)return h(x,S,N);if(P===Map)return o(x,S,N);if(P===Set)return p(x,S,N);const A=Rse.call(x);if(A===jse)return r(x,S,N);if(A===Ase)return h(x,S,N);if(A===Nse)return o(x,S,N);if(A===Ese)return p(x,S,N);if(A===_se)return typeof x.then!="function"&&typeof S.then!="function"&&d(x,S,N);if(A===kse)return g(x,S,N);if(A===Sse)return a(x,S,N);if(A===xse)return d(x,S,N);if(Ose[A])return y(x,S,N);if(A===yse)return e(x,S,N);if(A===wse)return n(x,S,N);if(A===bse||A===Cse||A===Pse)return f(x,S,N);if(j){let O=j[A];if(!O){const k=nse(x);k&&(O=j[k])}if(O)return O(x,S,N)}return!1}}function Ise({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:ose,areArraysEqual:n?Tu:lse,areDataViewsEqual:cse,areDatesEqual:use,areErrorsEqual:dse,areFunctionsEqual:fse,areMapsEqual:n?Pw(mT,Tu):mT,areNumbersEqual:pse,areObjectsEqual:n?Tu:hse,arePrimitiveWrappersEqual:mse,areRegExpsEqual:vse,areSetsEqual:n?Pw(vT,Tu):vT,areTypedArraysEqual:n?Pw(Vh,Tu):Vh,areUrlsEqual:gse,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const a=Vp(r.areArraysEqual),i=Vp(r.areMapsEqual),o=Vp(r.areObjectsEqual),c=Vp(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:c})}return r}function Mse(e){return function(t,n,r,a,i,o,c){return e(t,n,c)}}function $se({circular:e,comparator:t,createState:n,equals:r,strict:a}){if(n)return function(c,d){const{cache:f=e?new WeakMap:void 0,meta:h}=n();return t(c,d,{cache:f,equals:r,meta:h,strict:a})};if(e)return function(c,d){return t(c,d,{cache:new WeakMap,equals:r,meta:void 0,strict:a})};const i={cache:void 0,equals:r,meta:void 0,strict:a};return function(c,d){return t(c,d,i)}}const Dse=zi();zi({strict:!0});zi({circular:!0});zi({circular:!0,strict:!0});zi({createInternalComparator:()=>Bo});zi({strict:!0,createInternalComparator:()=>Bo});zi({circular:!0,createInternalComparator:()=>Bo});zi({circular:!0,createInternalComparator:()=>Bo,strict:!0});function zi(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:a=!1}=e,i=Ise(e),o=Tse(i),c=n?n(o):Mse(o);return $se({circular:t,comparator:o,createState:r,equals:c,strict:a})}function Lse(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function gT(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function a(i){n<0&&(n=i),i-n>t?(e(i),n=-1):Lse(a)};requestAnimationFrame(r)}function yj(e){"@babel/helpers - typeof";return yj=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},yj(e)}function Fse(e){return qse(e)||Use(e)||zse(e)||Bse()}function Bse(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
95
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zse(e,t){if(e){if(typeof e=="string")return yT(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 yT(e,t)}}function yT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Use(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function qse(e){if(Array.isArray(e))return e}function Wse(){var e={},t=function(){return null},n=!1,r=function a(i){if(!n){if(Array.isArray(i)){if(!i.length)return;var o=i,c=Fse(o),d=c[0],f=c.slice(1);if(typeof d=="number"){gT(a.bind(null,f),d);return}a(d),gT(a.bind(null,f));return}yj(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 Pd(e){"@babel/helpers - typeof";return Pd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pd(e)}function xT(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 bT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xT(Object(n),!0).forEach(function(r){TL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TL(e,t,n){return t=Vse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vse(e){var t=Hse(e,"string");return Pd(t)==="symbol"?t:String(t)}function Hse(e,t){if(Pd(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Pd(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Kse=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,a){return r.filter(function(i){return a.includes(i)})})},Gse=function(t){return t},Yse=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},Yu=function(t,n){return Object.keys(n).reduce(function(r,a){return bT(bT({},r),{},TL({},a,t(a,n[a])))},{})},wT=function(t,n,r){return t.map(function(a){return"".concat(Yse(a)," ").concat(n,"ms ").concat(r)}).join(",")};function Xse(e,t){return Zse(e)||Jse(e,t)||IL(e,t)||Qse()}function Qse(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
96
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jse(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function Zse(e){if(Array.isArray(e))return e}function eie(e){return rie(e)||nie(e)||IL(e)||tie()}function tie(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
97
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function IL(e,t){if(e){if(typeof e=="string")return xj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xj(e,t)}}function nie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function rie(e){if(Array.isArray(e))return xj(e)}function xj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Hh=1e-4,ML=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},$L=function(t,n){return t.map(function(r,a){return r*Math.pow(n,a)}).reduce(function(r,a){return r+a})},jT=function(t,n){return function(r){var a=ML(t,n);return $L(a,r)}},aie=function(t,n){return function(r){var a=ML(t,n),i=[].concat(eie(a.map(function(o,c){return o*c}).slice(1)),[0]);return $L(i,r)}},ST=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0],i=n[1],o=n[2],c=n[3];if(n.length===1)switch(n[0]){case"linear":a=0,i=0,o=1,c=1;break;case"ease":a=.25,i=.1,o=.25,c=1;break;case"ease-in":a=.42,i=0,o=1,c=1;break;case"ease-out":a=.42,i=0,o=.58,c=1;break;case"ease-in-out":a=0,i=0,o=.58,c=1;break;default:{var d=n[0].split("(");if(d[0]==="cubic-bezier"&&d[1].split(")")[0].split(",").length===4){var f=d[1].split(")")[0].split(",").map(function(x){return parseFloat(x)}),h=Xse(f,4);a=h[0],i=h[1],o=h[2],c=h[3]}}}var p=jT(a,o),y=jT(i,c),g=aie(a,o),j=function(S){return S>1?1:S<0?0:S},b=function(S){for(var N=S>1?1:S,_=N,P=0;P<8;++P){var A=p(_)-N,O=g(_);if(Math.abs(A-N)<Hh||O<Hh)return y(_);_=j(_-A/O)}return y(_)};return b.isStepper=!1,b},sie=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,a=t.damping,i=a===void 0?8:a,o=t.dt,c=o===void 0?17:o,d=function(h,p,y){var g=-(h-p)*r,j=y*i,b=y+(g-j)*c/1e3,x=y*c/1e3+h;return Math.abs(x-p)<Hh&&Math.abs(b)<Hh?[p,0]:[x,b]};return d.isStepper=!0,d.dt=c,d},iie=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0];if(typeof a=="string")switch(a){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return ST(a);case"spring":return sie();default:if(a.split("(")[0]==="cubic-bezier")return ST(a)}return typeof a=="function"?a:null};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 NT(e){return cie(e)||lie(e)||DL(e)||oie()}function oie(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
98
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function cie(e){if(Array.isArray(e))return wj(e)}function CT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ar(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CT(Object(n),!0).forEach(function(r){bj(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bj(e,t,n){return t=uie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uie(e){var t=die(e,"string");return Od(t)==="symbol"?t:String(t)}function die(e,t){if(Od(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Od(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fie(e,t){return mie(e)||hie(e,t)||DL(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 DL(e,t){if(e){if(typeof e=="string")return wj(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 wj(e,t)}}function wj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function hie(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function mie(e){if(Array.isArray(e))return e}var Kh=function(t,n,r){return t+(n-t)*r},jj=function(t){var n=t.from,r=t.to;return n!==r},vie=function e(t,n,r){var a=Yu(function(i,o){if(jj(o)){var c=t(o.from,o.to,o.velocity),d=fie(c,2),f=d[0],h=d[1];return ar(ar({},o),{},{from:f,velocity:h})}return o},n);return r<1?Yu(function(i,o){return jj(o)?ar(ar({},o),{},{velocity:Kh(o.velocity,a[i].velocity,r),from:Kh(o.from,a[i].from,r)}):o},n):e(t,a,r-1)};const gie=(function(e,t,n,r,a){var i=Kse(e,t),o=i.reduce(function(x,S){return ar(ar({},x),{},bj({},S,[e[S],t[S]]))},{}),c=i.reduce(function(x,S){return ar(ar({},x),{},bj({},S,{from:e[S],velocity:0,to:t[S]}))},{}),d=-1,f,h,p=function(){return null},y=function(){return Yu(function(S,N){return N.from},c)},g=function(){return!Object.values(c).filter(jj).length},j=function(S){f||(f=S);var N=S-f,_=N/n.dt;c=vie(n,c,_),a(ar(ar(ar({},e),t),y())),f=S,g()||(d=requestAnimationFrame(p))},b=function(S){h||(h=S);var N=(S-h)/r,_=Yu(function(A,O){return Kh.apply(void 0,NT(O).concat([n(N)]))},o);if(a(ar(ar(ar({},e),t),_)),N<1)d=requestAnimationFrame(p);else{var P=Yu(function(A,O){return Kh.apply(void 0,NT(O).concat([n(1)]))},o);a(ar(ar(ar({},e),t),P))}};return p=n.isStepper?j:b,function(){return requestAnimationFrame(p),function(){cancelAnimationFrame(d)}}});function nc(e){"@babel/helpers - typeof";return nc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nc(e)}var yie=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function xie(e,t){if(e==null)return{};var n=bie(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function bie(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function Ow(e){return Nie(e)||Sie(e)||jie(e)||wie()}function wie(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
100
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jie(e,t){if(e){if(typeof e=="string")return Sj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sj(e,t)}}function Sie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Nie(e){if(Array.isArray(e))return Sj(e)}function Sj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ta(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_T(Object(n),!0).forEach(function(r){zu(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_T(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zu(e,t,n){return t=LL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _ie(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,LL(r.key),r)}}function Aie(e,t,n){return t&&_ie(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function LL(e){var t=Eie(e,"string");return nc(t)==="symbol"?t:String(t)}function Eie(e,t){if(nc(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(nc(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Pie(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nj(e,t)}function Nj(e,t){return Nj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Nj(e,t)}function Oie(e){var t=kie();return function(){var r=Gh(e),a;if(t){var i=Gh(this).constructor;a=Reflect.construct(r,arguments,i)}else a=r.apply(this,arguments);return Cj(this,a)}}function Cj(e,t){if(t&&(nc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _j(e)}function _j(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 Gh(e){return Gh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Gh(e)}var ps=(function(e){Pie(n,e);var t=Oie(n);function n(r,a){var i;Cie(this,n),i=t.call(this,r,a);var o=i.props,c=o.isActive,d=o.attributeName,f=o.from,h=o.to,p=o.steps,y=o.children,g=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind(_j(i)),i.changeStyle=i.changeStyle.bind(_j(i)),!c||g<=0)return i.state={style:{}},typeof y=="function"&&(i.state={style:h}),Cj(i);if(p&&p.length)i.state={style:p[0].style};else if(f){if(typeof y=="function")return i.state={style:f},Cj(i);i.state={style:d?zu({},d,f):f}}else i.state={style:{}};return i}return Aie(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,y=this.state.style;if(c){if(!o){var g={style:d?zu({},d,h):h};this.state&&y&&(d&&y[d]!==h||!d&&y!==h)&&this.setState(g);return}if(!(Dse(a.to,h)&&a.canBegin&&a.isActive)){var j=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var b=j||f?p:a.to;if(this.state&&y){var x={style:d?zu({},d,b):b};(d&&y[d]!==b||!d&&y!==b)&&this.setState(x)}this.runAnimation(Ta(Ta({},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,y=a.onAnimationStart,g=gie(o,c,iie(f),d,this.changeStyle),j=function(){i.stopJSAnimation=g()};this.manager.start([y,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,y=p===void 0?0:p,g=function(b,x,S){if(S===0)return b;var N=x.duration,_=x.easing,P=_===void 0?"ease":_,A=x.style,O=x.properties,k=x.onAnimationEnd,R=S>0?o[S-1]:x,M=O||Object.keys(A);if(typeof P=="function"||P==="spring")return[].concat(Ow(b),[i.runJSAnimation.bind(i,{from:R.style,to:A,duration:N,easing:P}),N]);var z=wT(M,N,P),B=Ta(Ta(Ta({},R.style),A),{},{transition:z});return[].concat(Ow(b),[B,N,k]).filter(Gse)};return this.manager.start([d].concat(Ow(o.reduce(g,[h,Math.max(y,c)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=Wse());var i=a.begin,o=a.duration,c=a.attributeName,d=a.to,f=a.easing,h=a.onAnimationStart,p=a.onAnimationEnd,y=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(y.length>1){this.runStepAnimation(a);return}var b=c?zu({},c,d):d,x=wT(Object.keys(b),o,f);j.start([h,i,Ta(Ta({},b),{},{transition:x}),o,p])}},{key:"render",value:function(){var a=this.props,i=a.children;a.begin;var o=a.duration;a.attributeName,a.easing;var c=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var d=xie(a,yie),f=v.Children.count(i),h=this.state.style;if(typeof i=="function")return i(h);if(!c||f===0||o<=0)return i;var p=function(g){var j=g.props,b=j.style,x=b===void 0?{}:b,S=j.className,N=v.cloneElement(g,Ta(Ta({},d),{},{style:Ta(Ta({},x),h),className:S}));return N};return f===1?p(v.Children.only(i)):q.createElement("div",null,v.Children.map(i,function(y){return p(y)}))}}]),n})(v.PureComponent);ps.displayName="Animate";ps.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};ps.propTypes={from:zt.oneOfType([zt.object,zt.string]),to:zt.oneOfType([zt.object,zt.string]),attributeName:zt.string,duration:zt.number,begin:zt.number,easing:zt.oneOfType([zt.string,zt.func]),steps:zt.arrayOf(zt.shape({duration:zt.number.isRequired,style:zt.object.isRequired,easing:zt.oneOfType([zt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),zt.func]),properties:zt.arrayOf("string"),onAnimationEnd:zt.func})),children:zt.oneOfType([zt.node,zt.func]),isActive:zt.bool,canBegin:zt.bool,onAnimationEnd:zt.func,shouldReAnimate:zt.bool,onAnimationStart:zt.func,onAnimationReStart:zt.func};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 Yh(){return Yh=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},Yh.apply(this,arguments)}function Rie(e,t){return $ie(e)||Mie(e,t)||Iie(e,t)||Tie()}function Tie(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
101
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Iie(e,t){if(e){if(typeof e=="string")return AT(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 AT(e,t)}}function AT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Mie(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function $ie(e){if(Array.isArray(e))return e}function ET(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 PT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ET(Object(n),!0).forEach(function(r){Die(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ET(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Die(e,t,n){return t=Lie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lie(e){var t=Fie(e,"string");return kd(t)=="symbol"?t:t+""}function Fie(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)}var OT=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],y=0,g=4;y<g;y++)p[y]=i[y]>o?o:i[y];h="M".concat(t,",").concat(n+c*p[0]),p[0]>0&&(h+="A ".concat(p[0],",").concat(p[0],",0,0,").concat(f,",").concat(t+d*p[0],",").concat(n)),h+="L ".concat(t+r-d*p[1],",").concat(n),p[1]>0&&(h+="A ".concat(p[1],",").concat(p[1],",0,0,").concat(f,`,
102
- `).concat(t+r,",").concat(n+c*p[1])),h+="L ".concat(t+r,",").concat(n+a-c*p[2]),p[2]>0&&(h+="A ".concat(p[2],",").concat(p[2],",0,0,").concat(f,`,
103
- `).concat(t+r-d*p[2],",").concat(n+a)),h+="L ".concat(t+d*p[3],",").concat(n+a),p[3]>0&&(h+="A ".concat(p[3],",").concat(p[3],",0,0,").concat(f,`,
104
- `).concat(t,",").concat(n+a-c*p[3])),h+="Z"}else if(o>0&&i===+i&&i>0){var j=Math.min(o,i);h="M ".concat(t,",").concat(n+c*j,`
105
- A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+d*j,",").concat(n,`
106
- L `).concat(t+r-d*j,",").concat(n,`
107
- A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+r,",").concat(n+c*j,`
108
- L `).concat(t+r,",").concat(n+a-c*j,`
109
- A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+r-d*j,",").concat(n+a,`
110
- L `).concat(t+d*j,",").concat(n+a,`
111
- A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t,",").concat(n+a-c*j," Z")}else h="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(a," h ").concat(-r," Z");return h},Bie=function(t,n){if(!t||!n)return!1;var r=t.x,a=t.y,i=n.x,o=n.y,c=n.width,d=n.height;if(Math.abs(c)>0&&Math.abs(d)>0){var f=Math.min(i,i+c),h=Math.max(i,i+c),p=Math.min(o,o+d),y=Math.max(o,o+d);return r>=f&&r<=h&&a>=p&&a<=y}return!1},zie={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},FN=function(t){var n=PT(PT({},zie),t),r=v.useRef(),a=v.useState(-1),i=Rie(a,2),o=i[0],c=i[1];v.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var P=r.current.getTotalLength();P&&c(P)}catch{}},[]);var d=n.x,f=n.y,h=n.width,p=n.height,y=n.radius,g=n.className,j=n.animationEasing,b=n.animationDuration,x=n.animationBegin,S=n.isAnimationActive,N=n.isUpdateAnimationActive;if(d!==+d||f!==+f||h!==+h||p!==+p||h===0||p===0)return null;var _=wt("recharts-rectangle",g);return N?q.createElement(ps,{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:N},function(P){var A=P.width,O=P.height,k=P.x,R=P.y;return q.createElement(ps,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:b,isActive:S,easing:j},q.createElement("path",Yh({},pt(n,!0),{className:_,d:OT(k,R,A,O,y),ref:r})))}):q.createElement("path",Yh({},pt(n,!0),{className:_,d:OT(d,f,h,p,y)}))},Uie=["points","className","baseLinePoints","connectNulls"];function Cl(){return Cl=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},Cl.apply(this,arguments)}function qie(e,t){if(e==null)return{};var n=Wie(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Wie(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function kT(e){return Gie(e)||Kie(e)||Hie(e)||Vie()}function Vie(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
112
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hie(e,t){if(e){if(typeof e=="string")return Aj(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 Aj(e,t)}}function Kie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Gie(e){if(Array.isArray(e))return Aj(e)}function Aj(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 RT=function(t){return t&&t.x===+t.x&&t.y===+t.y},Yie=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){RT(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),RT(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},Xu=function(t,n){var r=Yie(t);n&&(r=[r.reduce(function(i,o){return[].concat(kT(i),kT(o))},[])]);var a=r.map(function(i){return i.reduce(function(o,c,d){return"".concat(o).concat(d===0?"M":"L").concat(c.x,",").concat(c.y)},"")}).join("");return r.length===1?"".concat(a,"Z"):a},Xie=function(t,n,r){var a=Xu(t,r);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(Xu(n.reverse(),r).slice(1))},Qie=function(t){var n=t.points,r=t.className,a=t.baseLinePoints,i=t.connectNulls,o=qie(t,Uie);if(!n||!n.length)return null;var c=wt("recharts-polygon",r);if(a&&a.length){var d=o.stroke&&o.stroke!=="none",f=Xie(n,a,i);return q.createElement("g",{className:c},q.createElement("path",Cl({},pt(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:f})),d?q.createElement("path",Cl({},pt(o,!0),{fill:"none",d:Xu(n,i)})):null,d?q.createElement("path",Cl({},pt(o,!0),{fill:"none",d:Xu(a,i)})):null)}var h=Xu(n,i);return q.createElement("path",Cl({},pt(o,!0),{fill:h.slice(-1)==="Z"?o.fill:"none",className:c,d:h}))};function Ej(){return Ej=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},Ej.apply(this,arguments)}var jv=function(t){var n=t.cx,r=t.cy,a=t.r,i=t.className,o=wt("recharts-dot",i);return n===+n&&r===+r&&a===+a?v.createElement("circle",Ej({},pt(t,!1),vh(t),{className:o,cx:n,cy:r,r:a})):null};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)}var Jie=["x","y","top","left","width","height","className"];function Pj(){return Pj=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},Pj.apply(this,arguments)}function TT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Zie(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TT(Object(n),!0).forEach(function(r){eoe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eoe(e,t,n){return t=toe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function toe(e){var t=noe(e,"string");return Rd(t)=="symbol"?t:t+""}function noe(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)}function roe(e,t){if(e==null)return{};var n=aoe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function aoe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var soe=function(t,n,r,a,i,o){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(o,",").concat(n,"h").concat(r)},ioe=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,i=a===void 0?0:a,o=t.top,c=o===void 0?0:o,d=t.left,f=d===void 0?0:d,h=t.width,p=h===void 0?0:h,y=t.height,g=y===void 0?0:y,j=t.className,b=roe(t,Jie),x=Zie({x:r,y:i,top:c,left:f,width:p,height:g},b);return!Le(r)||!Le(i)||!Le(p)||!Le(g)||!Le(c)||!Le(f)?null:q.createElement("path",Pj({},pt(x,!0),{className:wt("recharts-cross",j),d:soe(r,i,p,g,c,f)}))},kw,IT;function ooe(){if(IT)return kw;IT=1;var e=gv(),t=eL(),n=ys();function r(a,i){return a&&a.length?e(a,n(i,2),t):void 0}return kw=r,kw}var loe=ooe();const coe=Vt(loe);var Rw,MT;function uoe(){if(MT)return Rw;MT=1;var e=gv(),t=ys(),n=tL();function r(a,i){return a&&a.length?e(a,t(i,2),n):void 0}return Rw=r,Rw}var doe=uoe();const foe=Vt(doe);var poe=["cx","cy","angle","ticks","axisLine"],hoe=["ticks","tick","angle","tickFormatter","stroke"];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 Qu(){return Qu=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},Qu.apply(this,arguments)}function $T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function so(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$T(Object(n),!0).forEach(function(r){Sv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$T(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function DT(e,t){if(e==null)return{};var n=moe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function moe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function voe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LT(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,BL(r.key),r)}}function goe(e,t,n){return t&&LT(e.prototype,t),n&&LT(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function yoe(e,t,n){return t=Xh(t),xoe(e,FL()?Reflect.construct(t,n||[],Xh(e).constructor):t.apply(e,n))}function xoe(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 boe(e)}function boe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function FL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(FL=function(){return!!e})()}function Xh(e){return Xh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Xh(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&&Oj(e,t)}function Oj(e,t){return Oj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Oj(e,t)}function Sv(e,t,n){return t=BL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BL(e){var t=joe(e,"string");return rc(t)=="symbol"?t:t+""}function joe(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(t==="string"?String:Number)(e)}var Nv=(function(e){function t(){return voe(this,t),yoe(this,t,arguments)}return woe(t,e),goe(t,[{key:"getTickValueCoord",value:function(r){var a=r.coordinate,i=this.props,o=i.angle,c=i.cx,d=i.cy;return ln(c,d,a,o)}},{key:"getTickTextAnchor",value:function(){var r=this.props.orientation,a;switch(r){case"left":a="end";break;case"right":a="start";break;default:a="middle";break}return a}},{key:"getViewBox",value:function(){var r=this.props,a=r.cx,i=r.cy,o=r.angle,c=r.ticks,d=coe(c,function(h){return h.coordinate||0}),f=foe(c,function(h){return h.coordinate||0});return{cx:a,cy:i,startAngle:o,endAngle:o,innerRadius:f.coordinate||0,outerRadius:d.coordinate||0}}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.cx,i=r.cy,o=r.angle,c=r.ticks,d=r.axisLine,f=DT(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=ln(a,i,h[0],o),y=ln(a,i,h[1],o),g=so(so(so({},pt(f,!1)),{},{fill:"none"},pt(d,!1)),{},{x1:p.x,y1:p.y,x2:y.x,y2:y.y});return q.createElement("line",Qu({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=DT(a,hoe),p=this.getTickTextAnchor(),y=pt(h,!1),g=pt(o,!1),j=i.map(function(b,x){var S=r.getTickValueCoord(b),N=so(so(so(so({textAnchor:p,transform:"rotate(".concat(90-c,", ").concat(S.x,", ").concat(S.y,")")},y),{},{stroke:"none",fill:f},g),{},{index:x},S),{},{payload:b});return q.createElement(It,Qu({className:wt("recharts-polar-radius-axis-tick",EL(o)),key:"tick-".concat(b.coordinate)},So(r.props,b,x)),t.renderTickItem(o,N,d?d(b.value,x):b.value))});return q.createElement(It,{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:q.createElement(It,{className:wt("recharts-polar-radius-axis",this.props.className)},i&&this.renderAxisLine(),o&&this.renderTicks(),Zn.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,a,i){var o;return q.isValidElement(r)?o=q.cloneElement(r,a):xt(r)?o=r(a):o=q.createElement(No,Qu({},a,{className:"recharts-polar-radius-axis-tick-value"}),i),o}}])})(v.PureComponent);Sv(Nv,"displayName","PolarRadiusAxis");Sv(Nv,"axisType","radiusAxis");Sv(Nv,"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 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 uo(){return uo=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},uo.apply(this,arguments)}function FT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function io(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FT(Object(n),!0).forEach(function(r){Cv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Soe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function BT(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,UL(r.key),r)}}function Noe(e,t,n){return t&&BT(e.prototype,t),n&&BT(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Coe(e,t,n){return t=Qh(t),_oe(e,zL()?Reflect.construct(t,n||[],Qh(e).constructor):t.apply(e,n))}function _oe(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 Aoe(e)}function Aoe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(zL=function(){return!!e})()}function Qh(e){return Qh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Qh(e)}function Eoe(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&&kj(e,t)}function kj(e,t){return kj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},kj(e,t)}function Cv(e,t,n){return t=UL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UL(e){var t=Poe(e,"string");return ac(t)=="symbol"?t:t+""}function Poe(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(t==="string"?String:Number)(e)}var Ooe=Math.PI/180,zT=1e-5,_v=(function(e){function t(){return Soe(this,t),Coe(this,t,arguments)}return Eoe(t,e),Noe(t,[{key:"getTickLineCoord",value:function(r){var a=this.props,i=a.cx,o=a.cy,c=a.radius,d=a.orientation,f=a.tickSize,h=f||8,p=ln(i,o,c,r.coordinate),y=ln(i,o,c+(d==="inner"?-1:1)*h,r.coordinate);return{x1:p.x,y1:p.y,x2:y.x,y2:y.y}}},{key:"getTickTextAnchor",value:function(r){var a=this.props.orientation,i=Math.cos(-r.coordinate*Ooe),o;return i>zT?o=a==="outer"?"start":"end":i<-zT?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=io(io({},pt(this.props,!1)),{},{fill:"none"},pt(c,!1));if(d==="circle")return q.createElement(jv,uo({className:"recharts-polar-angle-axis-line"},f,{cx:a,cy:i,r:o}));var h=this.props.ticks,p=h.map(function(y){return ln(a,i,o,y.coordinate)});return q.createElement(Qie,uo({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=pt(this.props,!1),p=pt(o,!1),y=io(io({},h),{},{fill:"none"},pt(c,!1)),g=i.map(function(j,b){var x=r.getTickLineCoord(j),S=r.getTickTextAnchor(j),N=io(io(io({textAnchor:S},h),{},{stroke:"none",fill:f},p),{},{index:b,payload:j,x:x.x2,y:x.y2});return q.createElement(It,uo({className:wt("recharts-polar-angle-axis-tick",EL(o)),key:"tick-".concat(j.coordinate)},So(r.props,j,b)),c&&q.createElement("line",uo({className:"recharts-polar-angle-axis-tick-line"},y,x)),o&&t.renderTickItem(o,N,d?d(j.value,b):j.value))});return q.createElement(It,{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:q.createElement(It,{className:wt("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,a,i){var o;return q.isValidElement(r)?o=q.cloneElement(r,a):xt(r)?o=r(a):o=q.createElement(No,uo({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])})(v.PureComponent);Cv(_v,"displayName","PolarAngleAxis");Cv(_v,"axisType","angleAxis");Cv(_v,"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 Tw,UT;function koe(){if(UT)return Tw;UT=1;var e=e5(),t=e(Object.getPrototypeOf,Object);return Tw=t,Tw}var Iw,qT;function Roe(){if(qT)return Iw;qT=1;var e=Xs(),t=koe(),n=Qs(),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 y=c.call(p,"constructor")&&p.constructor;return typeof y=="function"&&y instanceof y&&o.call(y)==d}return Iw=f,Iw}var Toe=Roe();const Ioe=Vt(Toe);var Mw,WT;function Moe(){if(WT)return Mw;WT=1;var e=Xs(),t=Qs(),n="[object Boolean]";function r(a){return a===!0||a===!1||t(a)&&e(a)==n}return Mw=r,Mw}var $oe=Moe();const Doe=Vt($oe);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 Jh(){return Jh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jh.apply(this,arguments)}function Loe(e,t){return Uoe(e)||zoe(e,t)||Boe(e,t)||Foe()}function Foe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
113
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Boe(e,t){if(e){if(typeof e=="string")return VT(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 VT(e,t)}}function VT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zoe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function Uoe(e){if(Array.isArray(e))return e}function 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){qoe(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 qoe(e,t,n){return t=Woe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Woe(e){var t=Voe(e,"string");return Td(t)=="symbol"?t:t+""}function Voe(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)}var GT=function(t,n,r,a,i){var o=r-a,c;return c="M ".concat(t,",").concat(n),c+="L ".concat(t+r,",").concat(n),c+="L ".concat(t+r-o/2,",").concat(n+i),c+="L ".concat(t+r-o/2-a,",").concat(n+i),c+="L ".concat(t,",").concat(n," Z"),c},Hoe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Koe=function(t){var n=KT(KT({},Hoe),t),r=v.useRef(),a=v.useState(-1),i=Loe(a,2),o=i[0],c=i[1];v.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var _=r.current.getTotalLength();_&&c(_)}catch{}},[]);var d=n.x,f=n.y,h=n.upperWidth,p=n.lowerWidth,y=n.height,g=n.className,j=n.animationEasing,b=n.animationDuration,x=n.animationBegin,S=n.isUpdateAnimationActive;if(d!==+d||f!==+f||h!==+h||p!==+p||y!==+y||h===0&&p===0||y===0)return null;var N=wt("recharts-trapezoid",g);return S?q.createElement(ps,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:y,x:d,y:f},to:{upperWidth:h,lowerWidth:p,height:y,x:d,y:f},duration:b,animationEasing:j,isActive:S},function(_){var P=_.upperWidth,A=_.lowerWidth,O=_.height,k=_.x,R=_.y;return q.createElement(ps,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:b,easing:j},q.createElement("path",Jh({},pt(n,!0),{className:N,d:GT(k,R,P,A,O),ref:r})))}):q.createElement("g",null,q.createElement("path",Jh({},pt(n,!0),{className:N,d:GT(d,f,h,p,y)})))},Goe=["option","shapeType","propTransformer","activeClassName","isActive"];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 Yoe(e,t){if(e==null)return{};var n=Xoe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Xoe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function YT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Zh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YT(Object(n),!0).forEach(function(r){Qoe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qoe(e,t,n){return t=Joe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Joe(e){var t=Zoe(e,"string");return Id(t)=="symbol"?t:t+""}function Zoe(e,t){if(Id(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Id(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ele(e,t){return Zh(Zh({},t),e)}function tle(e,t){return e==="symbols"}function XT(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return q.createElement(FN,n);case"trapezoid":return q.createElement(Koe,n);case"sector":return q.createElement(kL,n);case"symbols":if(tle(t))return q.createElement(aN,n);break;default:return null}}function nle(e){return v.isValidElement(e)?e.props:e}function qL(e){var t=e.option,n=e.shapeType,r=e.propTransformer,a=r===void 0?ele:r,i=e.activeClassName,o=i===void 0?"recharts-active-shape":i,c=e.isActive,d=Yoe(e,Goe),f;if(v.isValidElement(t))f=v.cloneElement(t,Zh(Zh({},d),nle(t)));else if(xt(t))f=t(d);else if(Ioe(t)&&!Doe(t)){var h=a(t,d);f=q.createElement(XT,{shapeType:n,elementProps:h})}else{var p=d;f=q.createElement(XT,{shapeType:n,elementProps:p})}return c?q.createElement(It,{className:o},f):f}function Av(e,t){return t!=null&&"trapezoids"in e.props}function Ev(e,t){return t!=null&&"sectors"in e.props}function Md(e,t){return t!=null&&"points"in e.props}function rle(e,t){var n,r,a=e.x===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.x)||e.x===t.x,i=e.y===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.y)||e.y===t.y;return a&&i}function ale(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function sle(e,t){var n=e.x===t.x,r=e.y===t.y,a=e.z===t.z;return n&&r&&a}function ile(e,t){var n;return Av(e,t)?n=rle:Ev(e,t)?n=ale:Md(e,t)&&(n=sle),n}function ole(e,t){var n;return Av(e,t)?n="trapezoids":Ev(e,t)?n="sectors":Md(e,t)&&(n="points"),n}function lle(e,t){if(Av(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(Ev(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 Md(e,t)?t.payload:{}}function cle(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,a=ole(n,t),i=lle(n,t),o=r.filter(function(d,f){var h=df(i,d),p=n.props[a].filter(function(j){var b=ile(n,t);return b(j,t)}),y=n.props[a].indexOf(p[p.length-1]),g=f===y;return h&&g}),c=r.indexOf(o[o.length-1]);return c}var rh;function sc(e){"@babel/helpers - typeof";return sc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sc(e)}function _l(){return _l=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},_l.apply(this,arguments)}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 rn(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){pa(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 ule(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function JT(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,VL(r.key),r)}}function dle(e,t,n){return t&&JT(e.prototype,t),n&&JT(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fle(e,t,n){return t=em(t),ple(e,WL()?Reflect.construct(t,n||[],em(e).constructor):t.apply(e,n))}function ple(e,t){if(t&&(sc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hle(e)}function hle(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function WL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(WL=function(){return!!e})()}function em(e){return em=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},em(e)}function mle(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Rj(e,t)}function Rj(e,t){return Rj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Rj(e,t)}function pa(e,t,n){return t=VL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VL(e){var t=vle(e,"string");return sc(t)=="symbol"?t:t+""}function vle(e,t){if(sc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(sc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Zs=(function(e){function t(n){var r;return ule(this,t),r=fle(this,t,[n]),pa(r,"pieRef",null),pa(r,"sectorRefs",[]),pa(r,"id",Tc("recharts-pie-")),pa(r,"handleAnimationEnd",function(){var a=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),xt(a)&&a()}),pa(r,"handleAnimationStart",function(){var a=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),xt(a)&&a()}),r.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},r}return mle(t,e),dle(t,[{key:"isActiveIndex",value:function(r){var a=this.props.activeIndex;return Array.isArray(a)?a.indexOf(r)!==-1:r===a}},{key:"hasActiveIndex",value:function(){var r=this.props.activeIndex;return Array.isArray(r)?r.length!==0:r||r===0}},{key:"renderLabels",value:function(r){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.label,c=i.labelLine,d=i.dataKey,f=i.valueKey,h=pt(this.props,!1),p=pt(o,!1),y=pt(c,!1),g=o&&o.offsetRadius||20,j=r.map(function(b,x){var S=(b.startAngle+b.endAngle)/2,N=ln(b.cx,b.cy,b.outerRadius+g,S),_=rn(rn(rn(rn({},h),b),{},{stroke:"none"},p),{},{index:x,textAnchor:t.getTextAnchor(N.x,b.cx)},N),P=rn(rn(rn(rn({},h),b),{},{fill:"none",stroke:b.fill},y),{},{index:x,points:[ln(b.cx,b.cy,b.outerRadius,S),N]}),A=d;return bt(d)&&bt(f)?A="value":bt(d)&&(A=f),q.createElement(It,{key:"label-".concat(b.startAngle,"-").concat(b.endAngle,"-").concat(b.midAngle,"-").concat(x)},c&&t.renderLabelLineItem(c,P,"line"),t.renderLabelItem(o,_,qn(b,A)))});return q.createElement(It,{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),y=d&&a.hasActiveIndex()?d:null,g=p?o:y,j=rn(rn({},f),{},{stroke:c?f.fill:f.stroke,tabIndex:-1});return q.createElement(It,_l({ref:function(x){x&&!a.sectorRefs.includes(x)&&a.sectorRefs.push(x)},tabIndex:-1,className:"recharts-pie-sector"},So(a.props,f,h),{key:"sector-".concat(f?.startAngle,"-").concat(f?.endAngle,"-").concat(f.midAngle,"-").concat(h)}),q.createElement(qL,_l({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,y=p.prevSectors,g=p.prevIsAnimationActive;return q.createElement(ps,{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,x=[],S=i&&i[0],N=S.startAngle;return i.forEach(function(_,P){var A=y&&y[P],O=P>0?ea(_,"paddingAngle",0):0;if(A){var k=Gr(A.endAngle-A.startAngle,_.endAngle-_.startAngle),R=rn(rn({},_),{},{startAngle:N+O,endAngle:N+k(b)+O});x.push(R),N=R.endAngle}else{var M=_.endAngle,z=_.startAngle,B=Gr(0,M-z),D=B(b),G=rn(rn({},_),{},{startAngle:N+O,endAngle:N+D+O});x.push(G),N=G.endAngle}}),q.createElement(It,null,r.renderSectorsStatically(x))})}},{key:"attachKeyboardHandlers",value:function(r){var a=this;r.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var o=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[o].focus(),a.setState({sectorToFocus:o});break}case"ArrowRight":{var c=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[c].focus(),a.setState({sectorToFocus:c});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,a=r.sectors,i=r.isAnimationActive,o=this.state.prevSectors;return i&&a&&a.length&&(!o||!df(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,y=a.outerRadius,g=a.isAnimationActive,j=this.state.isAnimationFinished;if(i||!o||!o.length||!Le(f)||!Le(h)||!Le(p)||!Le(y))return null;var b=wt("recharts-pie",c);return q.createElement(It,{tabIndex:this.props.rootTabIndex,className:b,ref:function(S){r.pieRef=S}},this.renderSectors(),d&&this.renderLabels(o),Zn.renderCallByParent(this.props,null,!1),(!g||j)&&zs.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return a.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:r.sectors!==a.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,a){return r>a?"start":r<a?"end":"middle"}},{key:"renderLabelLineItem",value:function(r,a,i){if(q.isValidElement(r))return q.cloneElement(r,a);if(xt(r))return r(a);var o=wt("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return q.createElement(Wh,_l({},a,{key:i,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(r,a,i){if(q.isValidElement(r))return q.cloneElement(r,a);var o=i;if(xt(r)&&(o=r(a),q.isValidElement(o)))return o;var c=wt("recharts-pie-label-text",typeof r!="boolean"&&!xt(r)?r.className:"");return q.createElement(No,_l({},a,{alignmentBaseline:"middle",className:c}),o)}}])})(v.PureComponent);rh=Zs;pa(Zs,"displayName","Pie");pa(Zs,"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:!Do.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});pa(Zs,"parseDeltaAngle",function(e,t){var n=xr(t-e),r=Math.min(Math.abs(t-e),360);return n*r});pa(Zs,"getRealPieData",function(e){var t=e.data,n=e.children,r=pt(e,!1),a=ta(n,uv);return t&&t.length?t.map(function(i,o){return rn(rn(rn({payload:i},r),i),a&&a[o]&&a[o].props)}):a&&a.length?a.map(function(i){return rn(rn({},r),i.props)}):[]});pa(Zs,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,a=t.width,i=t.height,o=AL(a,i),c=r+br(e.cx,a,a/2),d=n+br(e.cy,i,i/2),f=br(e.innerRadius,o,0),h=br(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}});pa(Zs,"getComposedData",function(e){var t=e.item,n=e.offset,r=t.type.defaultProps!==void 0?rn(rn({},t.type.defaultProps),t.props):t.props,a=rh.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,y=r.tooltipType,g=Math.abs(r.minAngle),j=rh.parseCoordinateOfPie(r,n),b=rh.parseDeltaAngle(o,c),x=Math.abs(b),S=f;bt(f)&&bt(p)?(Fs(!1,`Use "dataKey" to specify the value of pie,
114
- the props "valueKey" will be deprecated in 1.1.0`),S="value"):bt(f)&&(Fs(!1,`Use "dataKey" to specify the value of pie,
115
- the props "valueKey" will be deprecated in 1.1.0`),S=p);var N=a.filter(function(R){return qn(R,S,0)!==0}).length,_=(x>=360?N:N-1)*d,P=x-N*g-_,A=a.reduce(function(R,M){var z=qn(M,S,0);return R+(Le(z)?z:0)},0),O;if(A>0){var k;O=a.map(function(R,M){var z=qn(R,S,0),B=qn(R,h,M),D=(Le(z)?z:0)/A,G;M?G=k.endAngle+xr(b)*d*(z!==0?1:0):G=o;var U=G+xr(b)*((z!==0?g:0)+D*P),W=(G+U)/2,X=(j.innerRadius+j.outerRadius)/2,J=[{name:B,value:z,payload:R,dataKey:S,type:y}],T=ln(j.cx,j.cy,X,W);return k=rn(rn(rn({percent:D,cornerRadius:i,name:B,tooltipPayload:J,midAngle:W,middleRadius:X,tooltipPosition:T},R),j),{},{value:qn(R,S),startAngle:G,endAngle:U,payload:R,paddingAngle:xr(b)*d}),k})}return rn(rn({},j),{},{sectors:O,data:a})});var $w,ZT;function gle(){if(ZT)return $w;ZT=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 $w=n,$w}var Dw,eI;function HL(){if(eI)return Dw;eI=1;var e=v5(),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 Dw=r,Dw}var Lw,tI;function yle(){if(tI)return Lw;tI=1;var e=gle(),t=cv(),n=HL();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 Lw=r,Lw}var Fw,nI;function xle(){if(nI)return Fw;nI=1;var e=yle(),t=e();return Fw=t,Fw}var ble=xle();const tm=Vt(ble);function $d(e){"@babel/helpers - typeof";return $d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$d(e)}function rI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function aI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rI(Object(n),!0).forEach(function(r){KL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function KL(e,t,n){return t=wle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wle(e){var t=jle(e,"string");return $d(t)=="symbol"?t:t+""}function jle(e,t){if($d(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if($d(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Sle=["Webkit","Moz","O","ms"],Nle=function(t,n){var r=t.replace(/(\w)/,function(i){return i.toUpperCase()}),a=Sle.reduce(function(i,o){return aI(aI({},i),{},KL({},o+r,n))},{});return a[t]=n,a};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 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 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 Bw(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){Wr(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 Cle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,YL(r.key),r)}}function _le(e,t,n){return t&&iI(e.prototype,t),n&&iI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ale(e,t,n){return t=rm(t),Ele(e,GL()?Reflect.construct(t,n||[],rm(e).constructor):t.apply(e,n))}function Ele(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 Ple(e)}function Ple(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function GL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(GL=function(){return!!e})()}function rm(e){return rm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},rm(e)}function 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&&Tj(e,t)}function Tj(e,t){return Tj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Tj(e,t)}function Wr(e,t,n){return t=YL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YL(e){var t=kle(e,"string");return ic(t)=="symbol"?t:t+""}function kle(e,t){if(ic(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ic(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Rle=function(t){var n=t.data,r=t.startIndex,a=t.endIndex,i=t.x,o=t.width,c=t.travellerWidth;if(!n||!n.length)return{};var d=n.length,f=Ku().domain(tm(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}},oI=function(t){return t.changedTouches&&!!t.changedTouches.length},oc=(function(e){function t(n){var r;return Cle(this,t),r=Ale(this,t,[n]),Wr(r,"handleDrag",function(a){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(a):r.state.isSlideMoving&&r.handleSlideDrag(a)}),Wr(r,"handleTouchMove",function(a){a.changedTouches!=null&&a.changedTouches.length>0&&r.handleDrag(a.changedTouches[0])}),Wr(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()}),Wr(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Wr(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Wr(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Wr(r,"handleSlideDragStart",function(a){var i=oI(a)?a.changedTouches[0]:a;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return Ole(t,e),_le(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),y=Math.max(a,i),g=t.getIndexInRange(o,p),j=t.getIndexInRange(o,y);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=qn(i[r],c,r);return xt(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,y=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 x=this.getIndex({startX:o+b,endX:c+b});(x.startIndex!==y||x.endIndex!==g)&&j&&j(x),this.setState({startX:o+b,endX:c+b,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,a){var i=oI(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,y=h.width,g=h.travellerWidth,j=h.onChange,b=h.gap,x=h.data,S={startX:this.state.startX,endX:this.state.endX},N=r.pageX-i;N>0?N=Math.min(N,p+y-g-f):N<0&&(N=Math.max(N,p-f)),S[o]=f+N;var _=this.getIndex(S),P=_.startIndex,A=_.endIndex,O=function(){var R=x.length-1;return o==="startX"&&(c>d?P%b===0:A%b===0)||c<d&&A===R||o==="endX"&&(c>d?A%b===0:P%b===0)||c>d&&A===R};this.setState(Wr(Wr({},o,f+N),"brushMoveStartX",r.pageX),function(){j&&O()&&j(_)})}},{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 y=p+r;if(!(y===-1||y>=c.length)){var g=c[y];a==="startX"&&g>=f||a==="endX"&&g<=d||this.setState(Wr({},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 q.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?q.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,y=d.traveller,g=d.ariaLabel,j=d.data,b=d.startIndex,x=d.endIndex,S=Math.max(r,this.props.x),N=Bw(Bw({},pt(this.props,!1)),{},{x:S,y:f,width:h,height:p}),_=g||"Min value: ".concat((i=j[b])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=j[x])===null||o===void 0?void 0:o.name);return q.createElement(It,{tabIndex:0,role:"slider","aria-label":_,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(A){["ArrowLeft","ArrowRight"].includes(A.key)&&(A.preventDefault(),A.stopPropagation(),c.handleTravellerMoveKeyboard(A.key==="ArrowRight"?1:-1,a))},onFocus:function(){c.setState({isTravellerFocused:!0})},onBlur:function(){c.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(y,N))}},{key:"renderSlide",value:function(r,a){var i=this.props,o=i.y,c=i.height,d=i.stroke,f=i.travellerWidth,h=Math.min(r,a)+f,p=Math.max(Math.abs(a-r)-f,0);return q.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,y=h.endX,g=5,j={pointerEvents:"none",fill:f};return q.createElement(It,{className:"recharts-brush-texts"},q.createElement(No,nm({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,y)-g,y:o+c/2},j),this.getTextOfTick(a)),q.createElement(No,nm({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,y)+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,y=this.state,g=y.startX,j=y.endX,b=y.isTextActive,x=y.isSlideMoving,S=y.isTravellerMoving,N=y.isTravellerFocused;if(!a||!a.length||!Le(c)||!Le(d)||!Le(f)||!Le(h)||f<=0||h<=0)return null;var _=wt("recharts-brush",i),P=q.Children.count(o)===1,A=Nle("userSelect","none");return q.createElement(It,{className:_,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:A},this.renderBackground(),P&&this.renderPanorama(),this.renderSlide(g,j),this.renderTravellerLayer(g,"startX"),this.renderTravellerLayer(j,"endX"),(b||x||S||N||p)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var a=r.x,i=r.y,o=r.width,c=r.height,d=r.stroke,f=Math.floor(i+c/2)-1;return q.createElement(q.Fragment,null,q.createElement("rect",{x:a,y:i,width:o,height:c,fill:d,stroke:"none"}),q.createElement("line",{x1:a+1,y1:f,x2:a+o-1,y2:f,fill:"none",stroke:"#fff"}),q.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 q.isValidElement(r)?i=q.cloneElement(r,a):xt(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 Bw({prevData:i,prevTravellerWidth:d,prevUpdateId:f,prevX:c,prevWidth:o},i&&i.length?Rle({data:i,width:o,x:c,travellerWidth:d,startIndex:h,endIndex:p}):{scale:null,scaleValues:null});if(a.scale&&(o!==a.prevWidth||c!==a.prevX||d!==a.prevTravellerWidth)){a.scale.range([c,c+o-d]);var y=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:y}}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);Wr(oc,"displayName","Brush");Wr(oc,"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 zw,lI;function Tle(){if(lI)return zw;lI=1;var e=dN();function t(n,r){var a;return e(n,function(i,o,c){return a=r(i,o,c),!a}),!!a}return zw=t,zw}var Uw,cI;function Ile(){if(cI)return Uw;cI=1;var e=K3(),t=ys(),n=Tle(),r=Tr(),a=cv();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 Uw=i,Uw}var Mle=Ile();const $le=Vt(Mle);var cs=function(t,n){var r=t.alwaysShow,a=t.ifOverflow;return r&&(a="extendDomain"),a===n},qw,uI;function Dle(){if(uI)return qw;uI=1;var e=d5();function t(n,r,a){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):n[r]=a}return qw=t,qw}var Ww,dI;function Lle(){if(dI)return Ww;dI=1;var e=Dle(),t=c5(),n=ys();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 Ww=r,Ww}var Fle=Lle();const Ble=Vt(Fle);var Vw,fI;function zle(){if(fI)return Vw;fI=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 Vw=e,Vw}var Hw,pI;function Ule(){if(pI)return Hw;pI=1;var e=dN();function t(n,r){var a=!0;return e(n,function(i,o,c){return a=!!r(i,o,c),a}),a}return Hw=t,Hw}var Kw,hI;function qle(){if(hI)return Kw;hI=1;var e=zle(),t=Ule(),n=ys(),r=Tr(),a=cv();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 Kw=i,Kw}var Wle=qle();const Vle=Vt(Wle);var Hle=["x","y"];function Dd(e){"@babel/helpers - typeof";return Dd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dd(e)}function Ij(){return Ij=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},Ij.apply(this,arguments)}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 Iu(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){Kle(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 Kle(e,t,n){return t=Gle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gle(e){var t=Yle(e,"string");return Dd(t)=="symbol"?t:t+""}function Yle(e,t){if(Dd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Dd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xle(e,t){if(e==null)return{};var n=Qle(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Qle(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Jle(e,t){var n=e.x,r=e.y,a=Xle(e,Hle),i="".concat(n),o=parseInt(i,10),c="".concat(r),d=parseInt(c,10),f="".concat(t.height||a.height),h=parseInt(f,10),p="".concat(t.width||a.width),y=parseInt(p,10);return Iu(Iu(Iu(Iu(Iu({},t),a),o?{x:o}:{}),d?{y:d}:{}),{},{height:h,width:y,name:t.name,radius:t.radius})}function vI(e){return q.createElement(qL,Ij({shapeType:"rectangle",propTransformer:Jle,activeClassName:"recharts-active-bar"},e))}var Zle=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,a){if(typeof t=="number")return t;var i=Le(r)||yY(r);return i?t(r,a):(i||_o(),n)}},ece=["value","background"],XL;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 tce(e,t){if(e==null)return{};var n=nce(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function nce(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function 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 gI(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 Tn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gI(Object(n),!0).forEach(function(r){Ei(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yI(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,JL(r.key),r)}}function ace(e,t,n){return t&&yI(e.prototype,t),n&&yI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function sce(e,t,n){return t=sm(t),ice(e,QL()?Reflect.construct(t,n||[],sm(e).constructor):t.apply(e,n))}function ice(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 oce(e)}function oce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function QL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(QL=function(){return!!e})()}function sm(e){return sm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},sm(e)}function lce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Mj(e,t)}function Mj(e,t){return Mj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Mj(e,t)}function Ei(e,t,n){return t=JL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JL(e){var t=cce(e,"string");return lc(t)=="symbol"?t:t+""}function cce(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 zo=(function(e){function t(){var n;rce(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=sce(this,t,[].concat(a)),Ei(n,"state",{isAnimationFinished:!1}),Ei(n,"id",Tc("recharts-bar-")),Ei(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),Ei(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return lce(t,e),ace(t,[{key:"renderRectanglesStatically",value:function(r){var a=this,i=this.props,o=i.shape,c=i.dataKey,d=i.activeIndex,f=i.activeBar,h=pt(this.props,!1);return r&&r.map(function(p,y){var g=y===d,j=g?f:o,b=Tn(Tn(Tn({},h),p),{},{isActive:g,option:j,index:y,dataKey:c,onAnimationStart:a.handleAnimationStart,onAnimationEnd:a.handleAnimationEnd});return q.createElement(It,am({className:"recharts-bar-rectangle"},So(a.props,p,y),{key:"rectangle-".concat(p?.x,"-").concat(p?.y,"-").concat(p?.value,"-").concat(y)}),q.createElement(vI,b))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,a=this.props,i=a.data,o=a.layout,c=a.isAnimationActive,d=a.animationBegin,f=a.animationDuration,h=a.animationEasing,p=a.animationId,y=this.state.prevData;return q.createElement(ps,{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(x,S){var N=y&&y[S];if(N){var _=Gr(N.x,x.x),P=Gr(N.y,x.y),A=Gr(N.width,x.width),O=Gr(N.height,x.height);return Tn(Tn({},x),{},{x:_(j),y:P(j),width:A(j),height:O(j)})}if(o==="horizontal"){var k=Gr(0,x.height),R=k(j);return Tn(Tn({},x),{},{y:x.y+x.height-R,height:R})}var M=Gr(0,x.width),z=M(j);return Tn(Tn({},x),{},{width:z})});return q.createElement(It,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||!df(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=pt(this.props.background,!1);return i.map(function(f,h){f.value;var p=f.background,y=tce(f,ece);if(!p)return null;var g=Tn(Tn(Tn(Tn(Tn({},y),{},{fill:"#eee"},p),d),So(r.props,f,h)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:h,className:"recharts-bar-background-rectangle"});return q.createElement(vI,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=ta(h,ff);if(!p)return null;var y=f==="vertical"?o[0].height/2:o[0].width/2,g=function(x,S){var N=Array.isArray(x.value)?x.value[1]:x.value;return{x:x.x,y:x.y,value:N,errorVal:qn(x,S)}},j={clipPath:r?"url(#clipPath-".concat(a,")"):null};return q.createElement(It,j,p.map(function(b){return q.cloneElement(b,{key:"error-bar-".concat(a,"-").concat(b.props.dataKey),data:o,xAxis:c,yAxis:d,layout:f,offset:y,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,y=r.height,g=r.isAnimationActive,j=r.background,b=r.id;if(a||!i||!i.length)return null;var x=this.state.isAnimationFinished,S=wt("recharts-bar",o),N=c&&c.allowDataOverflow,_=d&&d.allowDataOverflow,P=N||_,A=bt(b)?this.id:b;return q.createElement(It,{className:S},N||_?q.createElement("defs",null,q.createElement("clipPath",{id:"clipPath-".concat(A)},q.createElement("rect",{x:N?f:f-p/2,y:_?h:h-y/2,width:N?p:p*2,height:_?y:y*2}))):null,q.createElement(It,{className:"recharts-bar-rectangles",clipPath:P?"url(#clipPath-".concat(A,")"):null},j?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(P,A),(!g||x)&&zs.renderCallByParent(this.props,i))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:a.curData}:r.data!==a.curData?{curData:r.data}:null}}])})(v.PureComponent);XL=zo;Ei(zo,"displayName","Bar");Ei(zo,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!Do.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Ei(zo,"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,y=e.offset,g=Tre(r,n);if(!g)return null;var j=t.layout,b=n.type.defaultProps,x=b!==void 0?Tn(Tn({},b),n.props):n.props,S=x.dataKey,N=x.children,_=x.minPointSize,P=j==="horizontal"?o:i,A=f?P.scale.domain():null,O=Bre({numericAxis:P}),k=ta(N,uv),R=p.map(function(M,z){var B,D,G,U,W,X;f?B=Ire(f[h+z],A):(B=qn(M,S),Array.isArray(B)||(B=[O,B]));var J=Zle(_,XL.defaultProps.minPointSize)(B[1],z);if(j==="horizontal"){var T,L=[o.scale(B[0]),o.scale(B[1])],Q=L[0],F=L[1];D=H2({axis:i,ticks:c,bandSize:a,offset:g.offset,entry:M,index:z}),G=(T=F??Q)!==null&&T!==void 0?T:void 0,U=g.size;var $=Q-F;if(W=Number.isNaN($)?0:$,X={x:D,y:o.y,width:U,height:o.height},Math.abs(J)>0&&Math.abs(W)<Math.abs(J)){var Z=xr(W||J)*(Math.abs(J)-Math.abs(W));G-=Z,W+=Z}}else{var ae=[i.scale(B[0]),i.scale(B[1])],V=ae[0],ie=ae[1];if(D=V,G=H2({axis:o,ticks:d,bandSize:a,offset:g.offset,entry:M,index:z}),U=ie-V,W=g.size,X={x:i.x,y:G,width:i.width,height:W},Math.abs(J)>0&&Math.abs(U)<Math.abs(J)){var ne=xr(U||J)*(Math.abs(J)-Math.abs(U));U+=ne}}return Tn(Tn(Tn({},M),{},{x:D,y:G,width:U,height:W,value:f?B:B[1],payload:M,background:X},k&&k[z]&&k[z].props),{},{tooltipPayload:[CL(n,M)],tooltipPosition:{x:D+U/2,y:G+W/2}})});return Tn({data:R,layout:j},y)});function Ld(e){"@babel/helpers - typeof";return Ld=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ld(e)}function uce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ZL(r.key),r)}}function dce(e,t,n){return t&&xI(e.prototype,t),n&&xI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}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 $a(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){Pv(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 Pv(e,t,n){return t=ZL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZL(e){var t=fce(e,"string");return Ld(t)=="symbol"?t:t+""}function fce(e,t){if(Ld(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ld(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var e4=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},y=!!Vr(f,zo);return h.reduce(function(g,j){var b=n[j],x=b.orientation,S=b.domain,N=b.padding,_=N===void 0?{}:N,P=b.mirror,A=b.reversed,O="".concat(x).concat(P?"Mirror":""),k,R,M,z,B;if(b.type==="number"&&(b.padding==="gap"||b.padding==="no-gap")){var D=S[1]-S[0],G=1/0,U=b.categoricalDomain.sort(wY);if(U.forEach(function(ae,V){V>0&&(G=Math.min((ae||0)-(U[V-1]||0),G))}),Number.isFinite(G)){var W=G/D,X=b.layout==="vertical"?r.height:r.width;if(b.padding==="gap"&&(k=W*X/2),b.padding==="no-gap"){var J=br(t.barCategoryGap,W*X),T=W*X/2;k=T-J-(T-J)/X*J}}}a==="xAxis"?R=[r.left+(_.left||0)+(k||0),r.left+r.width-(_.right||0)-(k||0)]:a==="yAxis"?R=d==="horizontal"?[r.top+r.height-(_.bottom||0),r.top+(_.top||0)]:[r.top+(_.top||0)+(k||0),r.top+r.height-(_.bottom||0)-(k||0)]:R=b.range,A&&(R=[R[1],R[0]]);var L=wL(b,i,y),Q=L.scale,F=L.realScaleType;Q.domain(S).range(R),jL(Q);var $=SL(Q,$a($a({},b),{},{realScaleType:F}));a==="xAxis"?(B=x==="top"&&!P||x==="bottom"&&P,M=r.left,z=p[O]-B*b.height):a==="yAxis"&&(B=x==="left"&&!P||x==="right"&&P,M=p[O]-B*b.width,z=r.top);var Z=$a($a($a({},b),$),{},{realScaleType:F,x:M,y:z,scale:Q,width:a==="xAxis"?r.width:b.width,height:a==="yAxis"?r.height:b.height});return Z.bandSize=zh(Z,$),!b.hide&&a==="xAxis"?p[O]+=(B?-1:1)*Z.height:b.hide||(p[O]+=(B?-1:1)*Z.width),$a($a({},g),{},Pv({},j,Z))},{})},t4=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 t4({x:n,y:r},{x:a,y:i})},n4=(function(){function e(t){uce(this,e),this.scale=t}return dce(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.bandAware,i=r.position;if(n!==void 0){if(i)switch(i){case"start":return this.scale(n);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+o}case"end":{var c=this.bandwidth?this.bandwidth():0;return this.scale(n)+c}default:return this.scale(n)}if(a){var d=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+d}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),a=r[0],i=r[r.length-1];return a<=i?n>=a&&n<=i:n>=i&&n<=a}}],[{key:"create",value:function(n){return new e(n)}}])})();Pv(n4,"EPS",1e-4);var BN=function(t){var n=Object.keys(t).reduce(function(r,a){return $a($a({},r),{},Pv({},a,n4.create(t[a])))},{});return $a($a({},n),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,c=i.position;return Ble(a,function(d,f){return n[f].apply(d,{bandAware:o,position:c})})},isInRange:function(a){return Vle(a,function(i,o){return n[o].isInRange(i)})}})};function hce(e){return(e%180+180)%180}var mce=function(t){var n=t.width,r=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=hce(a),o=i*Math.PI/180,c=Math.atan(r/n),d=o>c&&o<Math.PI-c?r/Math.sin(o):n/Math.cos(o);return Math.abs(d)},Gw,wI;function vce(){if(wI)return Gw;wI=1;var e=ys(),t=sf(),n=ov();function r(a){return function(i,o,c){var d=Object(i);if(!t(i)){var f=e(o,3);i=n(i),o=function(p){return f(d[p],p,d)}}var h=a(i,o,c);return h>-1?d[f?i[h]:h]:void 0}}return Gw=r,Gw}var Yw,jI;function gce(){if(jI)return Yw;jI=1;var e=HL();function t(n){var r=e(n),a=r%1;return r===r?a?r-a:r:0}return Yw=t,Yw}var Xw,SI;function yce(){if(SI)return Xw;SI=1;var e=a5(),t=ys(),n=gce(),r=Math.max;function a(i,o,c){var d=i==null?0:i.length;if(!d)return-1;var f=c==null?0:n(c);return f<0&&(f=r(d+f,0)),e(i,t(o,3),f)}return Xw=a,Xw}var Qw,NI;function xce(){if(NI)return Qw;NI=1;var e=vce(),t=yce(),n=e(t);return Qw=n,Qw}xce();var bce=b3();const wce=Vt(bce);var jce=wce(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),r4=v.createContext(void 0),a4=v.createContext(void 0),s4=v.createContext(void 0),Sce=v.createContext({}),i4=v.createContext(void 0),o4=v.createContext(0),l4=v.createContext(0),CI=function(t){var n=t.state,r=n.xAxisMap,a=n.yAxisMap,i=n.offset,o=t.clipPathId,c=t.children,d=t.width,f=t.height,h=jce(i);return q.createElement(r4.Provider,{value:r},q.createElement(a4.Provider,{value:a},q.createElement(Sce.Provider,{value:i},q.createElement(s4.Provider,{value:h},q.createElement(i4.Provider,{value:o},q.createElement(o4.Provider,{value:f},q.createElement(l4.Provider,{value:d},c)))))))},Nce=function(){return v.useContext(i4)},c4=function(t){var n=v.useContext(r4);n==null&&_o();var r=n[t];return r==null&&_o(),r},u4=function(t){var n=v.useContext(a4);n==null&&_o();var r=n[t];return r==null&&_o(),r},Cce=function(){var t=v.useContext(s4);return t},d4=function(){return v.useContext(l4)},f4=function(){return v.useContext(o4)};function cc(e){"@babel/helpers - typeof";return cc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cc(e)}function _ce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ace(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 Ece(e,t,n){return t&&Ace(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pce(e,t,n){return t=im(t),Oce(e,p4()?Reflect.construct(t,n||[],im(e).constructor):t.apply(e,n))}function Oce(e,t){if(t&&(cc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return 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 p4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(p4=function(){return!!e})()}function im(e){return im=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},im(e)}function Rce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$j(e,t)}function $j(e,t){return $j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},$j(e,t)}function _I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function AI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_I(Object(n),!0).forEach(function(r){zN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_I(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zN(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=Tce(e,"string");return cc(t)=="symbol"?t:t+""}function Tce(e,t){if(cc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(cc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Ice(e,t){return Lce(e)||Dce(e,t)||$ce(e,t)||Mce()}function Mce(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
116
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $ce(e,t){if(e){if(typeof e=="string")return EI(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 EI(e,t)}}function EI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Dce(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function Lce(e){if(Array.isArray(e))return e}function Dj(){return Dj=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},Dj.apply(this,arguments)}var Fce=function(t,n){var r;return q.isValidElement(t)?r=q.cloneElement(t,n):xt(t)?r=t(n):r=q.createElement("line",Dj({},n,{className:"recharts-reference-line-line"})),r},Bce=function(t,n,r,a,i,o,c,d,f){var h=i.x,p=i.y,y=i.width,g=i.height;if(r){var j=f.y,b=t.y.apply(j,{position:o});if(cs(f,"discard")&&!t.y.isInRange(b))return null;var x=[{x:h+y,y:b},{x:h,y:b}];return d==="left"?x.reverse():x}if(n){var S=f.x,N=t.x.apply(S,{position:o});if(cs(f,"discard")&&!t.x.isInRange(N))return null;var _=[{x:N,y:p+g},{x:N,y:p}];return c==="top"?_.reverse():_}if(a){var P=f.segment,A=P.map(function(O){return t.apply(O,{position:o})});return cs(f,"discard")&&$le(A,function(O){return!t.isInRange(O)})?null:A}return null};function zce(e){var t=e.x,n=e.y,r=e.segment,a=e.xAxisId,i=e.yAxisId,o=e.shape,c=e.className,d=e.alwaysShow,f=Nce(),h=c4(a),p=u4(i),y=Cce();if(!f||!y)return null;Fs(d===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var g=BN({x:h.scale,y:p.scale}),j=Wn(t),b=Wn(n),x=r&&r.length===2,S=Bce(g,j,b,x,y,e.position,h.orientation,p.orientation,e);if(!S)return null;var N=Ice(S,2),_=N[0],P=_.x,A=_.y,O=N[1],k=O.x,R=O.y,M=cs(e,"hidden")?"url(#".concat(f,")"):void 0,z=AI(AI({clipPath:M},pt(e,!0)),{},{x1:P,y1:A,x2:k,y2:R});return q.createElement(It,{className:wt("recharts-reference-line",c)},Fce(o,z),Zn.renderCallByParent(e,pce({x1:P,y1:A,x2:k,y2:R})))}var UN=(function(e){function t(){return _ce(this,t),Pce(this,t,arguments)}return Rce(t,e),Ece(t,[{key:"render",value:function(){return q.createElement(zce,this.props)}}])})(q.Component);zN(UN,"displayName","ReferenceLine");zN(UN,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function Lj(){return Lj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lj.apply(this,arguments)}function uc(e){"@babel/helpers - typeof";return uc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uc(e)}function PI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function OI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PI(Object(n),!0).forEach(function(r){Ov(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function 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,v4(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=om(t),Hce(e,m4()?Reflect.construct(t,n||[],om(e).constructor):t.apply(e,n))}function Hce(e,t){if(t&&(uc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return 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 m4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(m4=function(){return!!e})()}function om(e){return om=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},om(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&&Fj(e,t)}function Fj(e,t){return Fj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Fj(e,t)}function Ov(e,t,n){return t=v4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v4(e){var t=Yce(e,"string");return uc(t)=="symbol"?t:t+""}function Yce(e,t){if(uc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(uc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Xce=function(t){var n=t.x,r=t.y,a=t.xAxis,i=t.yAxis,o=BN({x:a.scale,y:i.scale}),c=o.apply({x:n,y:r},{bandAware:!0});return cs(t,"discard")&&!o.isInRange(c)?null:c},kv=(function(e){function t(){return Uce(this,t),Vce(this,t,arguments)}return Gce(t,e),Wce(t,[{key:"render",value:function(){var r=this.props,a=r.x,i=r.y,o=r.r,c=r.alwaysShow,d=r.clipPathId,f=Wn(a),h=Wn(i);if(Fs(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!f||!h)return null;var p=Xce(this.props);if(!p)return null;var y=p.x,g=p.y,j=this.props,b=j.shape,x=j.className,S=cs(this.props,"hidden")?"url(#".concat(d,")"):void 0,N=OI(OI({clipPath:S},pt(this.props,!0)),{},{cx:y,cy:g});return q.createElement(It,{className:wt("recharts-reference-dot",x)},t.renderDot(b,N),Zn.renderCallByParent(this.props,{x:y-o,y:g-o,width:2*o,height:2*o}))}}])})(q.Component);Ov(kv,"displayName","ReferenceDot");Ov(kv,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Ov(kv,"renderDot",function(e,t){var n;return q.isValidElement(e)?n=q.cloneElement(e,t):xt(e)?n=e(t):n=q.createElement(jv,Lj({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function Bj(){return Bj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bj.apply(this,arguments)}function 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 kI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function RI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kI(Object(n),!0).forEach(function(r){Rv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jce(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,y4(r.key),r)}}function Zce(e,t,n){return t&&Jce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function eue(e,t,n){return t=lm(t),tue(e,g4()?Reflect.construct(t,n||[],lm(e).constructor):t.apply(e,n))}function tue(e,t){if(t&&(dc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nue(e)}function nue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(g4=function(){return!!e})()}function lm(e){return lm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},lm(e)}function rue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zj(e,t)}function zj(e,t){return zj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},zj(e,t)}function Rv(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=aue(e,"string");return dc(t)=="symbol"?t:t+""}function aue(e,t){if(dc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(dc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var sue=function(t,n,r,a,i){var o=i.x1,c=i.x2,d=i.y1,f=i.y2,h=i.xAxis,p=i.yAxis;if(!h||!p)return null;var y=BN({x:h.scale,y:p.scale}),g={x:t?y.x.apply(o,{position:"start"}):y.x.rangeMin,y:r?y.y.apply(d,{position:"start"}):y.y.rangeMin},j={x:n?y.x.apply(c,{position:"end"}):y.x.rangeMax,y:a?y.y.apply(f,{position:"end"}):y.y.rangeMax};return cs(i,"discard")&&(!y.isInRange(g)||!y.isInRange(j))?null:t4(g,j)},Tv=(function(e){function t(){return Qce(this,t),eue(this,t,arguments)}return rue(t,e),Zce(t,[{key:"render",value:function(){var r=this.props,a=r.x1,i=r.x2,o=r.y1,c=r.y2,d=r.className,f=r.alwaysShow,h=r.clipPathId;Fs(f===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=Wn(a),y=Wn(i),g=Wn(o),j=Wn(c),b=this.props.shape;if(!p&&!y&&!g&&!j&&!b)return null;var x=sue(p,y,g,j,this.props);if(!x&&!b)return null;var S=cs(this.props,"hidden")?"url(#".concat(h,")"):void 0;return q.createElement(It,{className:wt("recharts-reference-area",d)},t.renderRect(b,RI(RI({clipPath:S},pt(this.props,!0)),x)),Zn.renderCallByParent(this.props,x))}}])})(q.Component);Rv(Tv,"displayName","ReferenceArea");Rv(Tv,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});Rv(Tv,"renderRect",function(e,t){var n;return q.isValidElement(e)?n=q.cloneElement(e,t):xt(e)?n=e(t):n=q.createElement(FN,Bj({},t,{className:"recharts-reference-area-rect"})),n});function x4(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],a=0;a<e.length;a+=t)r.push(e[a]);return r}function iue(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return mce(r,n)}function oue(e,t,n){var r=n==="width",a=e.x,i=e.y,o=e.width,c=e.height;return t===1?{start:r?a:i,end:r?a+o:i+c}:{start:r?a+o:i+c,end:r?a:i}}function cm(e,t,n,r,a){if(e*t<e*r||e*t>e*a)return!1;var i=n();return e*(t-e*i/2-r)>=0&&e*(t+e*i/2-a)<=0}function lue(e,t){return x4(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:x4(r,f)};var b=d,x,S=function(){return x===void 0&&(x=n(j,b)),x},N=j.coordinate,_=d===0||cm(e,N,S,h,c);_||(d=0,h=o,f+=1),_&&(h=N+e*(S()/2+a),d+=f)},y;f<=i.length;)if(y=p(),y)return y.v;return[]}function Fd(e){"@babel/helpers - typeof";return Fd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fd(e)}function TI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function fr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TI(Object(n),!0).forEach(function(r){uue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uue(e,t,n){return t=due(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function due(e){var t=fue(e,"string");return Fd(t)=="symbol"?t:t+""}function fue(e,t){if(Fd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Fd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pue(e,t,n,r,a){for(var i=(r||[]).slice(),o=i.length,c=t.start,d=t.end,f=function(y){var g=i[y],j,b=function(){return j===void 0&&(j=n(g,y)),j};if(y===o-1){var x=e*(g.coordinate+e*b()/2-d);i[y]=g=fr(fr({},g),{},{tickCoord:x>0?g.coordinate-x*e:g.coordinate})}else i[y]=g=fr(fr({},g),{},{tickCoord:g.coordinate});var S=cm(e,g.tickCoord,b,c,d);S&&(d=g.tickCoord-e*(b()/2+a),i[y]=fr(fr({},g),{},{isShow:!0}))},h=o-1;h>=0;h--)f(h);return i}function hue(e,t,n,r,a,i){var o=(r||[]).slice(),c=o.length,d=t.start,f=t.end;if(i){var h=r[c-1],p=n(h,c-1),y=e*(h.coordinate+e*p/2-f);o[c-1]=h=fr(fr({},h),{},{tickCoord:y>0?h.coordinate-y*e:h.coordinate});var g=cm(e,h.tickCoord,function(){return p},d,f);g&&(f=h.tickCoord-e*(p/2+a),o[c-1]=fr(fr({},h),{},{isShow:!0}))}for(var j=i?c-1:c,b=function(N){var _=o[N],P,A=function(){return P===void 0&&(P=n(_,N)),P};if(N===0){var O=e*(_.coordinate-e*A()/2-d);o[N]=_=fr(fr({},_),{},{tickCoord:O<0?_.coordinate-O*e:_.coordinate})}else o[N]=_=fr(fr({},_),{},{tickCoord:_.coordinate});var k=cm(e,_.tickCoord,A,d,f);k&&(d=_.tickCoord+e*(A()/2+a),o[N]=fr(fr({},_),{},{isShow:!0}))},x=0;x<j;x++)b(x);return o}function mue(e,t,n){var r=e.tick,a=e.ticks,i=e.viewBox,o=e.minTickGap,c=e.orientation,d=e.interval,f=e.tickFormatter,h=e.unit,p=e.angle;if(!a||!a.length||!r)return[];if(Le(d)||Do.isSsr)return lue(a,typeof d=="number"&&Le(d)?d:0);var y=[],g=c==="top"||c==="bottom"?"width":"height",j=h&&g==="width"?Hu(h,{fontSize:t,letterSpacing:n}):{width:0,height:0},b=function(_,P){var A=xt(f)?f(_.value,P):_.value;return g==="width"?iue(Hu(A,{fontSize:t,letterSpacing:n}),j,p):Hu(A,{fontSize:t,letterSpacing:n})[g]},x=a.length>=2?xr(a[1].coordinate-a[0].coordinate):1,S=oue(i,x,g);return d==="equidistantPreserveStart"?cue(x,S,b,a,o):(d==="preserveStart"||d==="preserveStartEnd"?y=hue(x,S,b,a,o,d==="preserveStartEnd"):y=pue(x,S,b,a,o),y.filter(function(N){return N.isShow}))}var vue=["viewBox"],gue=["viewBox"],yue=["ticks"];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 Al(){return Al=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},Al.apply(this,arguments)}function II(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function zn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?II(Object(n),!0).forEach(function(r){qN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):II(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jw(e,t){if(e==null)return{};var n=xue(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function xue(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function bue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,w4(r.key),r)}}function wue(e,t,n){return t&&MI(e.prototype,t),n&&MI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function jue(e,t,n){return t=um(t),Sue(e,b4()?Reflect.construct(t,n||[],um(e).constructor):t.apply(e,n))}function Sue(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 Nue(e)}function Nue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(b4=function(){return!!e})()}function um(e){return um=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},um(e)}function Cue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Uj(e,t)}function Uj(e,t){return Uj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Uj(e,t)}function qN(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=_ue(e,"string");return fc(t)=="symbol"?t:t+""}function _ue(e,t){if(fc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(fc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Iv=(function(e){function t(n){var r;return bue(this,t),r=jue(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return Cue(t,e),wue(t,[{key:"shouldComponentUpdate",value:function(r,a){var i=r.viewBox,o=Jw(r,vue),c=this.props,d=c.viewBox,f=Jw(c,gue);return!Ml(i,d)||!Ml(o,f)||!Ml(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,y=a.tickMargin,g,j,b,x,S,N,_=p?-1:1,P=r.tickSize||h,A=Le(r.tickCoord)?r.tickCoord:r.coordinate;switch(f){case"top":g=j=r.coordinate,x=o+ +!p*d,b=x-_*P,N=b-_*y,S=A;break;case"left":b=x=r.coordinate,j=i+ +!p*c,g=j-_*P,S=g-_*y,N=A;break;case"right":b=x=r.coordinate,j=i+ +p*c,g=j+_*P,S=g+_*y,N=A;break;default:g=j=r.coordinate,x=o+ +p*d,b=x+_*P,N=b+_*y,S=A;break}return{line:{x1:g,y1:b,x2:j,y2:x},tick:{x:S,y:N}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,a=r.orientation,i=r.mirror,o;switch(a){case"left":o=i?"start":"end";break;case"right":o=i?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,a=r.orientation,i=r.mirror,o="end";switch(a){case"left":case"right":o="middle";break;case"top":o=i?"start":"end";break;default:o=i?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.x,i=r.y,o=r.width,c=r.height,d=r.orientation,f=r.mirror,h=r.axisLine,p=zn(zn(zn({},pt(this.props,!1)),pt(h,!1)),{},{fill:"none"});if(d==="top"||d==="bottom"){var y=+(d==="top"&&!f||d==="bottom"&&f);p=zn(zn({},p),{},{x1:a,y1:i+y*c,x2:a+o,y2:i+y*c})}else{var g=+(d==="left"&&!f||d==="right"&&f);p=zn(zn({},p),{},{x1:a+g*o,y1:i,x2:a+g*o,y2:i+c})}return q.createElement("line",Al({},p,{className:wt("recharts-cartesian-axis-line",ea(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,y=c.unit,g=mue(zn(zn({},this.props),{},{ticks:r}),a,i),j=this.getTickTextAnchor(),b=this.getTickVerticalAnchor(),x=pt(this.props,!1),S=pt(h,!1),N=zn(zn({},x),{},{fill:"none"},pt(d,!1)),_=g.map(function(P,A){var O=o.getTickLineCoord(P),k=O.line,R=O.tick,M=zn(zn(zn(zn({textAnchor:j,verticalAnchor:b},x),{},{stroke:"none",fill:f},S),R),{},{index:A,payload:P,visibleTicksCount:g.length,tickFormatter:p});return q.createElement(It,Al({className:"recharts-cartesian-axis-tick",key:"tick-".concat(P.value,"-").concat(P.coordinate,"-").concat(P.tickCoord)},So(o.props,P,A)),d&&q.createElement("line",Al({},N,k,{className:wt("recharts-cartesian-axis-tick-line",ea(d,"className"))})),h&&t.renderTickItem(h,M,"".concat(xt(p)?p(P.value,A):P.value).concat(y||"")))});return q.createElement("g",{className:"recharts-cartesian-axis-ticks"},_)}},{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,y=p.ticks,g=Jw(p,yue),j=y;return xt(d)&&(j=y&&y.length>0?d(this.props):d(g)),o<=0||c<=0||!j||!j.length?null:q.createElement(It,{className:wt("recharts-cartesian-axis",f),ref:function(x){r.layerReference=x}},i&&this.renderAxisLine(),this.renderTicks(j,this.state.fontSize,this.state.letterSpacing),Zn.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,a,i){var o,c=wt(a.className,"recharts-cartesian-axis-tick-value");return q.isValidElement(r)?o=q.cloneElement(r,zn(zn({},a),{},{className:c})):xt(r)?o=r(zn(zn({},a),{},{className:c})):o=q.createElement(No,Al({},a,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])})(v.Component);qN(Iv,"displayName","CartesianAxis");qN(Iv,"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 Aue=["type","layout","connectNulls","ref"],Eue=["key"];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 $I(e,t){if(e==null)return{};var n=Pue(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Pue(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Ju(){return Ju=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},Ju.apply(this,arguments)}function DI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function qr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DI(Object(n),!0).forEach(function(r){Da(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yl(e){return Tue(e)||Rue(e)||kue(e)||Oue()}function Oue(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
117
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kue(e,t){if(e){if(typeof e=="string")return qj(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 qj(e,t)}}function Rue(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Tue(e){if(Array.isArray(e))return qj(e)}function qj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Iue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,S4(r.key),r)}}function Mue(e,t,n){return t&&LI(e.prototype,t),n&&LI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function $ue(e,t,n){return t=dm(t),Due(e,j4()?Reflect.construct(t,n||[],dm(e).constructor):t.apply(e,n))}function Due(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 Lue(e)}function Lue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function j4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(j4=function(){return!!e})()}function dm(e){return dm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},dm(e)}function Fue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wj(e,t)}function Wj(e,t){return Wj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Wj(e,t)}function Da(e,t,n){return t=S4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S4(e){var t=Bue(e,"string");return pc(t)=="symbol"?t:t+""}function Bue(e,t){if(pc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(pc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var hc=(function(e){function t(){var n;Iue(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=$ue(this,t,[].concat(a)),Da(n,"state",{isAnimationFinished:!0,totalLength:0}),Da(n,"generateSimpleStrokeDasharray",function(o,c){return"".concat(c,"px ").concat(o-c,"px")}),Da(n,"getStrokeDasharray",function(o,c,d){var f=d.reduce(function(S,N){return S+N});if(!f)return n.generateSimpleStrokeDasharray(c,o);for(var h=Math.floor(o/f),p=o%f,y=c-o,g=[],j=0,b=0;j<d.length;b+=d[j],++j)if(b+d[j]>p){g=[].concat(yl(d.slice(0,j)),[p-b]);break}var x=g.length%2===0?[0,y]:[y];return[].concat(yl(t.repeat(d,h)),yl(g),x).map(function(S){return"".concat(S,"px")}).join(", ")}),Da(n,"id",Tc("recharts-line-")),Da(n,"pathRef",function(o){n.mainCurve=o}),Da(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Da(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return Fue(t,e),Mue(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.points,c=i.xAxis,d=i.yAxis,f=i.layout,h=i.children,p=ta(h,ff);if(!p)return null;var y=function(b,x){return{x:b.x,y:b.y,value:b.value,errorVal:qn(b.payload,x)}},g={clipPath:r?"url(#clipPath-".concat(a,")"):null};return q.createElement(It,g,p.map(function(j){return q.cloneElement(j,{key:"bar-".concat(j.props.dataKey),data:o,xAxis:c,yAxis:d,layout:f,dataPointFormatter:y})}))}},{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=pt(this.props,!1),y=pt(d,!0),g=f.map(function(b,x){var S=qr(qr(qr({key:"dot-".concat(x),r:3},p),y),{},{index:x,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 q.createElement(It,Ju({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=$I(c,Aue),y=qr(qr(qr({},pt(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 q.createElement(Wh,Ju({},y,{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,y=o.animationEasing,g=o.animationId,j=o.animateNewValues,b=o.width,x=o.height,S=this.state,N=S.prevPoints,_=S.totalLength;return q.createElement(ps,{begin:h,duration:p,isActive:f,easing:y,from:{t:0},to:{t:1},key:"line-".concat(g),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(P){var A=P.t;if(N){var O=N.length/c.length,k=c.map(function(D,G){var U=Math.floor(G*O);if(N[U]){var W=N[U],X=Gr(W.x,D.x),J=Gr(W.y,D.y);return qr(qr({},D),{},{x:X(A),y:J(A)})}if(j){var T=Gr(b*2,D.x),L=Gr(x/2,D.y);return qr(qr({},D),{},{x:T(A),y:L(A)})}return qr(qr({},D),{},{x:D.x,y:D.y})});return i.renderCurveStatically(k,r,a)}var R=Gr(0,_),M=R(A),z;if(d){var B="".concat(d).split(/[,\s]+/gim).map(function(D){return parseFloat(D)});z=i.getStrokeDasharray(M,_,B)}else z=i.generateSimpleStrokeDasharray(_,M);return i.renderCurveStatically(c,r,a,{strokeDasharray:z})})}},{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||!df(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,y=a.left,g=a.width,j=a.height,b=a.isAnimationActive,x=a.id;if(i||!c||!c.length)return null;var S=this.state.isAnimationFinished,N=c.length===1,_=wt("recharts-line",d),P=f&&f.allowDataOverflow,A=h&&h.allowDataOverflow,O=P||A,k=bt(x)?this.id:x,R=(r=pt(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},M=R.r,z=M===void 0?3:M,B=R.strokeWidth,D=B===void 0?2:B,G=OY(o)?o:{},U=G.clipDot,W=U===void 0?!0:U,X=z*2+D;return q.createElement(It,{className:_},P||A?q.createElement("defs",null,q.createElement("clipPath",{id:"clipPath-".concat(k)},q.createElement("rect",{x:P?y:y-g/2,y:A?p:p-j/2,width:P?g:g*2,height:A?j:j*2})),!W&&q.createElement("clipPath",{id:"clipPath-dots-".concat(k)},q.createElement("rect",{x:y-X/2,y:p-X/2,width:g+X,height:j+X}))):null,!N&&this.renderCurve(O,k),this.renderErrorBar(O,k),(N||o)&&this.renderDots(O,W,k),(!b||S)&&zs.renderCallByParent(this.props,c))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:a.curPoints}:r.points!==a.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,a){for(var i=r.length%2!==0?[].concat(yl(r),[0]):r,o=[],c=0;c<a;++c)o=[].concat(yl(o),yl(i));return o}},{key:"renderDotItem",value:function(r,a){var i;if(q.isValidElement(r))i=q.cloneElement(r,a);else if(xt(r))i=r(a);else{var o=a.key,c=$I(a,Eue),d=wt("recharts-line-dot",typeof r!="boolean"?r.className:"");i=q.createElement(jv,Ju({key:o},c,{className:d}))}return i}}])})(v.PureComponent);Da(hc,"displayName","Line");Da(hc,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!Do.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Da(hc,"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(y,g){var j=qn(y,o);return h==="horizontal"?{x:V2({axis:n,ticks:a,bandSize:c,entry:y,index:g}),y:bt(j)?null:r.scale(j),value:j,payload:y}:{x:bt(j)?null:n.scale(j),y:V2({axis:r,ticks:i,bandSize:c,entry:y,index:g}),value:j,payload:y}});return qr({points:p,layout:h},f)});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 zue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Uue(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_4(r.key),r)}}function que(e,t,n){return t&&Uue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Wue(e,t,n){return t=fm(t),Vue(e,N4()?Reflect.construct(t,n||[],fm(e).constructor):t.apply(e,n))}function Vue(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 Hue(e)}function Hue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function N4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(N4=function(){return!!e})()}function fm(e){return fm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},fm(e)}function Kue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vj(e,t)}function Vj(e,t){return Vj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Vj(e,t)}function C4(e,t,n){return t=_4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _4(e){var t=Gue(e,"string");return mc(t)=="symbol"?t:t+""}function Gue(e,t){if(mc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(mc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Hj(){return Hj=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},Hj.apply(this,arguments)}function Yue(e){var t=e.xAxisId,n=d4(),r=f4(),a=c4(t);return a==null?null:v.createElement(Iv,Hj({},a,{className:wt("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return mo(o,!0)}}))}var Ao=(function(e){function t(){return zue(this,t),Wue(this,t,arguments)}return Kue(t,e),que(t,[{key:"render",value:function(){return v.createElement(Yue,this.props)}}])})(v.Component);C4(Ao,"displayName","XAxis");C4(Ao,"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 vc(e){"@babel/helpers - typeof";return vc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vc(e)}function Xue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Que(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,P4(r.key),r)}}function Jue(e,t,n){return t&&Que(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zue(e,t,n){return t=pm(t),ede(e,A4()?Reflect.construct(t,n||[],pm(e).constructor):t.apply(e,n))}function ede(e,t){if(t&&(vc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tde(e)}function tde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function A4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(A4=function(){return!!e})()}function pm(e){return pm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},pm(e)}function nde(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Kj(e,t)}function Kj(e,t){return Kj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Kj(e,t)}function E4(e,t,n){return t=P4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P4(e){var t=rde(e,"string");return vc(t)=="symbol"?t:t+""}function rde(e,t){if(vc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(vc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Gj(){return Gj=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},Gj.apply(this,arguments)}var ade=function(t){var n=t.yAxisId,r=d4(),a=f4(),i=u4(n);return i==null?null:v.createElement(Iv,Gj({},i,{className:wt("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:a},ticksGenerator:function(c){return mo(c,!0)}}))},Eo=(function(e){function t(){return Xue(this,t),Zue(this,t,arguments)}return nde(t,e),Jue(t,[{key:"render",value:function(){return v.createElement(ade,this.props)}}])})(v.Component);E4(Eo,"displayName","YAxis");E4(Eo,"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 FI(e){return lde(e)||ode(e)||ide(e)||sde()}function sde(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
118
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ide(e,t){if(e){if(typeof e=="string")return Yj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yj(e,t)}}function ode(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lde(e){if(Array.isArray(e))return Yj(e)}function Yj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Xj=function(t,n,r,a,i){var o=ta(t,UN),c=ta(t,kv),d=[].concat(FI(o),FI(c)),f=ta(t,Tv),h="".concat(a,"Id"),p=a[0],y=n;if(d.length&&(y=d.reduce(function(b,x){if(x.props[h]===r&&cs(x.props,"extendDomain")&&Le(x.props[p])){var S=x.props[p];return[Math.min(b[0],S),Math.max(b[1],S)]}return b},y)),f.length){var g="".concat(p,"1"),j="".concat(p,"2");y=f.reduce(function(b,x){if(x.props[h]===r&&cs(x.props,"extendDomain")&&Le(x.props[g])&&Le(x.props[j])){var S=x.props[g],N=x.props[j];return[Math.min(b[0],S,N),Math.max(b[1],S,N)]}return b},y)}return i&&i.length&&(y=i.reduce(function(b,x){return Le(x)?[Math.min(b[0],x),Math.max(b[1],x)]:b},y)),y},Zw={exports:{}},BI;function cde(){return BI||(BI=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,y){if(typeof h!="function")throw new TypeError("The listener must be a function");var g=new a(h,p||d,y),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 y=0,g=p.length,j=new Array(g);y<g;y++)j[y]=p[y].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,y,g,j){var b=n?n+f:f;if(!this._events[b])return!1;var x=this._events[b],S=arguments.length,N,_;if(x.fn){switch(x.once&&this.removeListener(f,x.fn,void 0,!0),S){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,h),!0;case 3:return x.fn.call(x.context,h,p),!0;case 4:return x.fn.call(x.context,h,p,y),!0;case 5:return x.fn.call(x.context,h,p,y,g),!0;case 6:return x.fn.call(x.context,h,p,y,g,j),!0}for(_=1,N=new Array(S-1);_<S;_++)N[_-1]=arguments[_];x.fn.apply(x.context,N)}else{var P=x.length,A;for(_=0;_<P;_++)switch(x[_].once&&this.removeListener(f,x[_].fn,void 0,!0),S){case 1:x[_].fn.call(x[_].context);break;case 2:x[_].fn.call(x[_].context,h);break;case 3:x[_].fn.call(x[_].context,h,p);break;case 4:x[_].fn.call(x[_].context,h,p,y);break;default:if(!N)for(A=1,N=new Array(S-1);A<S;A++)N[A-1]=arguments[A];x[_].fn.apply(x[_].context,N)}}return!0},c.prototype.on=function(f,h,p){return i(this,f,h,p,!1)},c.prototype.once=function(f,h,p){return i(this,f,h,p,!0)},c.prototype.removeListener=function(f,h,p,y){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&&(!y||j.once)&&(!p||j.context===p)&&o(this,g);else{for(var b=0,x=[],S=j.length;b<S;b++)(j[b].fn!==h||y&&!j[b].once||p&&j[b].context!==p)&&x.push(j[b]);x.length?this._events[g]=x.length===1?x[0]:x: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})(Zw)),Zw.exports}var ude=cde();const dde=Vt(ude);var e1=new dde,t1="recharts.syncMouseEvents";function Bd(e){"@babel/helpers - typeof";return Bd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bd(e)}function 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,O4(r.key),r)}}function hde(e,t,n){return t&&pde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function n1(e,t,n){return t=O4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O4(e){var t=mde(e,"string");return Bd(t)=="symbol"?t:t+""}function mde(e,t){if(Bd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Bd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var vde=(function(){function e(){fde(this,e),n1(this,"activeIndex",0),n1(this,"coordinateList",[]),n1(this,"layout","horizontal")}return hde(e,[{key:"setDetails",value:function(n){var r,a=n.coordinateList,i=a===void 0?null:a,o=n.container,c=o===void 0?null:o,d=n.layout,f=d===void 0?null:d,h=n.offset,p=h===void 0?null:h,y=n.mouseHandlerCallback,g=y===void 0?null:y;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,y=o+this.offset.top+c/2+h;this.mouseHandlerCallback({pageX:p,pageY:y})}}}])})();function gde(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e?.[0],a=e?.[1];if(r&&a&&Le(r)&&Le(a))return!0}return!1}function yde(e,t,n,r){var a=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-a:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-a,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function k4(e){var t=e.cx,n=e.cy,r=e.radius,a=e.startAngle,i=e.endAngle,o=ln(t,n,r,a),c=ln(t,n,r,i);return{points:[o,c],cx:t,cy:n,radius:r,startAngle:a,endAngle:i}}function xde(e,t,n){var r,a,i,o;if(e==="horizontal")r=t.x,i=r,a=n.top,o=n.top+n.height;else if(e==="vertical")a=t.y,o=a,r=n.left,i=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var c=t.cx,d=t.cy,f=t.innerRadius,h=t.outerRadius,p=t.angle,y=ln(c,d,f,p),g=ln(c,d,h,p);r=y.x,a=y.y,i=g.x,o=g.y}else return k4(t);return[{x:r,y:a},{x:i,y:o}]}function zd(e){"@babel/helpers - typeof";return zd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zd(e)}function zI(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 Hp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zI(Object(n),!0).forEach(function(r){bde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bde(e,t,n){return t=wde(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wde(e){var t=jde(e,"string");return zd(t)=="symbol"?t:t+""}function jde(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 Sde(e){var t,n,r=e.element,a=e.tooltipEventType,i=e.isActive,o=e.activeCoordinate,c=e.activePayload,d=e.offset,f=e.activeTooltipIndex,h=e.tooltipAxisBandSize,p=e.layout,y=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||y!=="ScatterChart"&&a!=="axis")return null;var j,b=Wh;if(y==="ScatterChart")j=o,b=ioe;else if(y==="BarChart")j=yde(p,o,d,h),b=FN;else if(p==="radial"){var x=k4(o),S=x.cx,N=x.cy,_=x.radius,P=x.startAngle,A=x.endAngle;j={cx:S,cy:N,startAngle:P,endAngle:A,innerRadius:_,outerRadius:_},b=kL}else j={points:xde(p,o,d)},b=Wh;var O=Hp(Hp(Hp(Hp({stroke:"#ccc",pointerEvents:"none"},d),j),pt(g,!1)),{},{payload:c,payloadIndex:f,className:wt("recharts-tooltip-cursor",g.className)});return v.isValidElement(g)?v.cloneElement(g,O):v.createElement(b,O)}var Nde=["item"],Cde=["children","className","width","height","style","compact","title","desc"];function gc(e){"@babel/helpers - typeof";return gc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gc(e)}function El(){return El=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},El.apply(this,arguments)}function UI(e,t){return Ede(e)||Ade(e,t)||T4(e,t)||_de()}function _de(){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 Ade(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 Ede(e){if(Array.isArray(e))return e}function qI(e,t){if(e==null)return{};var n=Pde(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Pde(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Ode(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kde(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,I4(r.key),r)}}function Rde(e,t,n){return t&&kde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Tde(e,t,n){return t=hm(t),Ide(e,R4()?Reflect.construct(t,n||[],hm(e).constructor):t.apply(e,n))}function Ide(e,t){if(t&&(gc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Mde(e)}function Mde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(R4=function(){return!!e})()}function hm(e){return hm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},hm(e)}function $de(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qj(e,t)}function Qj(e,t){return Qj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Qj(e,t)}function yc(e){return Fde(e)||Lde(e)||T4(e)||Dde()}function Dde(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
120
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function T4(e,t){if(e){if(typeof e=="string")return Jj(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 Jj(e,t)}}function Lde(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Fde(e){if(Array.isArray(e))return Jj(e)}function Jj(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 WI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function be(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WI(Object(n),!0).forEach(function(r){ht(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ht(e,t,n){return t=I4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I4(e){var t=Bde(e,"string");return gc(t)=="symbol"?t:t+""}function Bde(e,t){if(gc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(gc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var zde={xAxis:["bottom","top"],yAxis:["left","right"]},Ude={width:"100%",height:"100%"},M4={x:0,y:0};function Kp(e){return e}var qde=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},Wde=function(t,n,r,a){var i=n.find(function(h){return h&&h.index===r});if(i){if(t==="horizontal")return{x:i.coordinate,y:a.y};if(t==="vertical")return{x:a.x,y:i.coordinate};if(t==="centric"){var o=i.coordinate,c=a.radius;return be(be(be({},a),ln(a.cx,a.cy,c,o)),{},{angle:o,radius:c})}var d=i.coordinate,f=a.angle;return be(be(be({},a),ln(a.cx,a.cy,d,f)),{},{angle:f,radius:d})}return M4},Mv=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(yc(c),yc(f)):c},[]);return o.length>0?o:t&&t.length&&Le(a)&&Le(i)?t.slice(a,i+1):[]};function $4(e){return e==="number"?[0,"auto"]:void 0}var Zj=function(t,n,r,a){var i=t.graphicalItems,o=t.tooltipAxis,c=Mv(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 y;if(o.dataKey&&!o.allowDuplicatedCategory){var g=p===void 0?c:p;y=mh(g,o.dataKey,a)}else y=p&&p[r]||c[r];return y?[].concat(yc(d),[CL(f,y)]):d},[])},VI=function(t,n,r,a){var i=a||{x:t.chartX,y:t.chartY},o=qde(i,r),c=t.orderedTooltipTicks,d=t.tooltipAxis,f=t.tooltipTicks,h=Are(o,c,f,d);if(h>=0&&f){var p=f[h]&&f[h].value,y=Zj(t,n,h,p),g=Wde(r,c,h,i);return{activeTooltipIndex:h,activeLabel:p,activePayload:y,activeCoordinate:g}}return null},Vde=function(t,n){var r=n.axes,a=n.graphicalItems,i=n.axisType,o=n.axisIdKey,c=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,h=t.layout,p=t.children,y=t.stackOffset,g=bL(h,i);return r.reduce(function(j,b){var x,S=b.type.defaultProps!==void 0?be(be({},b.type.defaultProps),b.props):b.props,N=S.type,_=S.dataKey,P=S.allowDataOverflow,A=S.allowDuplicatedCategory,O=S.scale,k=S.ticks,R=S.includeHidden,M=S[o];if(j[M])return j;var z=Mv(t.data,{graphicalItems:a.filter(function($){var Z,ae=o in $.props?$.props[o]:(Z=$.type.defaultProps)===null||Z===void 0?void 0:Z[o];return ae===M}),dataStartIndex:d,dataEndIndex:f}),B=z.length,D,G,U;gde(S.domain,P,N)&&(D=pj(S.domain,null,P),g&&(N==="number"||O!=="auto")&&(U=Gu(z,_,"category")));var W=$4(N);if(!D||D.length===0){var X,J=(X=S.domain)!==null&&X!==void 0?X:W;if(_){if(D=Gu(z,_,N),N==="category"&&g){var T=bY(D);A&&T?(G=D,D=tm(0,B)):A||(D=Y2(J,D,b).reduce(function($,Z){return $.indexOf(Z)>=0?$:[].concat(yc($),[Z])},[]))}else if(N==="category")A?D=D.filter(function($){return $!==""&&!bt($)}):D=Y2(J,D,b).reduce(function($,Z){return $.indexOf(Z)>=0||Z===""||bt(Z)?$:[].concat(yc($),[Z])},[]);else if(N==="number"){var L=Rre(z,a.filter(function($){var Z,ae,V=o in $.props?$.props[o]:(Z=$.type.defaultProps)===null||Z===void 0?void 0:Z[o],ie="hide"in $.props?$.props.hide:(ae=$.type.defaultProps)===null||ae===void 0?void 0:ae.hide;return V===M&&(R||!ie)}),_,i,h);L&&(D=L)}g&&(N==="number"||O!=="auto")&&(U=Gu(z,_,"category"))}else g?D=tm(0,B):c&&c[M]&&c[M].hasStack&&N==="number"?D=y==="expand"?[0,1]:NL(c[M].stackGroups,d,f):D=xL(z,a.filter(function($){var Z=o in $.props?$.props[o]:$.type.defaultProps[o],ae="hide"in $.props?$.props.hide:$.type.defaultProps.hide;return Z===M&&(R||!ae)}),N,h,!0);if(N==="number")D=Xj(p,D,M,i,k),J&&(D=pj(J,D,P));else if(N==="category"&&J){var Q=J,F=D.every(function($){return Q.indexOf($)>=0});F&&(D=Q)}}return be(be({},j),{},ht({},M,be(be({},S),{},{axisType:i,domain:D,categoricalDomain:U,duplicateDomain:G,originalDomain:(x=S.domain)!==null&&x!==void 0?x:W,isCategorical:g,layout:h})))},{})},Hde=function(t,n){var r=n.graphicalItems,a=n.Axis,i=n.axisType,o=n.axisIdKey,c=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,h=t.layout,p=t.children,y=Mv(t.data,{graphicalItems:r,dataStartIndex:d,dataEndIndex:f}),g=y.length,j=bL(h,i),b=-1;return r.reduce(function(x,S){var N=S.type.defaultProps!==void 0?be(be({},S.type.defaultProps),S.props):S.props,_=N[o],P=$4("number");if(!x[_]){b++;var A;return j?A=tm(0,g):c&&c[_]&&c[_].hasStack?(A=NL(c[_].stackGroups,d,f),A=Xj(p,A,_,i)):(A=pj(P,xL(y,r.filter(function(O){var k,R,M=o in O.props?O.props[o]:(k=O.type.defaultProps)===null||k===void 0?void 0:k[o],z="hide"in O.props?O.props.hide:(R=O.type.defaultProps)===null||R===void 0?void 0:R.hide;return M===_&&!z}),"number",h),a.defaultProps.allowDataOverflow),A=Xj(p,A,_,i)),be(be({},x),{},ht({},_,be(be({axisType:i},a.defaultProps),{},{hide:!0,orientation:ea(zde,"".concat(i,".").concat(b%2),null),domain:A,originalDomain:P,isCategorical:j,layout:h})))}return x},{})},Kde=function(t,n){var r=n.axisType,a=r===void 0?"xAxis":r,i=n.AxisComp,o=n.graphicalItems,c=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,h=t.children,p="".concat(a,"Id"),y=ta(h,i),g={};return y&&y.length?g=Vde(t,{axes:y,graphicalItems:o,axisType:a,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f}):o&&o.length&&(g=Hde(t,{Axis:i,graphicalItems:o,axisType:a,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f})),g},Gde=function(t){var n=wl(t),r=mo(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:fN(r,function(a){return a.coordinate}),tooltipAxis:n,tooltipAxisBandSize:zh(n,r)}},HI=function(t){var n=t.children,r=t.defaultShowTooltip,a=Vr(n,oc),i=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(i=a.props.startIndex),a.props.endIndex>=0&&(o=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!r}},Yde=function(t){return!t||!t.length?!1:t.some(function(n){var r=Ls(n&&n.type);return r&&r.indexOf("Bar")>=0})},KI=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Xde=function(t,n){var r=t.props,a=t.graphicalItems,i=t.xAxisMap,o=i===void 0?{}:i,c=t.yAxisMap,d=c===void 0?{}:c,f=r.width,h=r.height,p=r.children,y=r.margin||{},g=Vr(p,oc),j=Vr(p,$l),b=Object.keys(d).reduce(function(A,O){var k=d[O],R=k.orientation;return!k.mirror&&!k.hide?be(be({},A),{},ht({},R,A[R]+k.width)):A},{left:y.left||0,right:y.right||0}),x=Object.keys(o).reduce(function(A,O){var k=o[O],R=k.orientation;return!k.mirror&&!k.hide?be(be({},A),{},ht({},R,ea(A,"".concat(R))+k.height)):A},{top:y.top||0,bottom:y.bottom||0}),S=be(be({},x),b),N=S.bottom;g&&(S.bottom+=g.props.height||oc.defaultProps.height),j&&n&&(S=Ore(S,a,r,n));var _=f-S.left-S.right,P=h-S.top-S.bottom;return be(be({brushBottom:N},S),{},{width:Math.max(_,0),height:Math.max(P,0)})},Qde=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},WN=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,y=function(S,N){var _=N.graphicalItems,P=N.stackGroups,A=N.offset,O=N.updateId,k=N.dataStartIndex,R=N.dataEndIndex,M=S.barSize,z=S.layout,B=S.barGap,D=S.barCategoryGap,G=S.maxBarSize,U=KI(z),W=U.numericAxisName,X=U.cateAxisName,J=Yde(_),T=[];return _.forEach(function(L,Q){var F=Mv(S.data,{graphicalItems:[L],dataStartIndex:k,dataEndIndex:R}),$=L.type.defaultProps!==void 0?be(be({},L.type.defaultProps),L.props):L.props,Z=$.dataKey,ae=$.maxBarSize,V=$["".concat(W,"Id")],ie=$["".concat(X,"Id")],ne={},de=d.reduce(function(we,Se){var Ve=N["".concat(Se.axisType,"Map")],Ot=$["".concat(Se.axisType,"Id")];Ve&&Ve[Ot]||Se.axisType==="zAxis"||_o();var xe=Ve[Ot];return be(be({},we),{},ht(ht({},Se.axisType,xe),"".concat(Se.axisType,"Ticks"),mo(xe)))},ne),oe=de[X],ge=de["".concat(X,"Ticks")],Re=P&&P[V]&&P[V].hasStack&&zre(L,P[V].stackGroups),re=Ls(L.type).indexOf("Bar")>=0,De=zh(oe,ge),Ae=[],We=J&&Ere({barSize:M,stackGroups:P,totalSize:Qde(de,X)});if(re){var ye,Ee,le=bt(ae)?G:ae,_e=(ye=(Ee=zh(oe,ge,!0))!==null&&Ee!==void 0?Ee:le)!==null&&ye!==void 0?ye:0;Ae=Pre({barGap:B,barCategoryGap:D,bandSize:_e!==De?_e:De,sizeList:We[ie],maxBarSize:le}),_e!==De&&(Ae=Ae.map(function(we){return be(be({},we),{},{position:be(be({},we.position),{},{offset:we.position.offset-_e/2})})}))}var pe=L&&L.type&&L.type.getComposedData;pe&&T.push({props:be(be({},pe(be(be({},de),{},{displayedData:F,props:S,dataKey:Z,item:L,bandSize:De,barPosition:Ae,offset:A,stackedData:Re,layout:z,dataStartIndex:k,dataEndIndex:R}))),{},ht(ht(ht({key:L.key||"item-".concat(Q)},W,de[W]),X,de[X]),"animationId",O)),childIndex:TY(L,S.children),item:L})}),T},g=function(S,N){var _=S.props,P=S.dataStartIndex,A=S.dataEndIndex,O=S.updateId;if(!cO({props:_}))return null;var k=_.children,R=_.layout,M=_.stackOffset,z=_.data,B=_.reverseStackOrder,D=KI(R),G=D.numericAxisName,U=D.cateAxisName,W=ta(k,r),X=Fre(z,W,"".concat(G,"Id"),"".concat(U,"Id"),M,B),J=d.reduce(function($,Z){var ae="".concat(Z.axisType,"Map");return be(be({},$),{},ht({},ae,Kde(_,be(be({},Z),{},{graphicalItems:W,stackGroups:Z.axisType===G&&X,dataStartIndex:P,dataEndIndex:A}))))},{}),T=Xde(be(be({},J),{},{props:_,graphicalItems:W}),N?.legendBBox);Object.keys(J).forEach(function($){J[$]=h(_,J[$],T,$.replace("Map",""),n)});var L=J["".concat(U,"Map")],Q=Gde(L),F=y(_,be(be({},J),{},{dataStartIndex:P,dataEndIndex:A,updateId:O,graphicalItems:W,stackGroups:X,offset:T}));return be(be({formattedGraphicalItems:F,graphicalItems:W,offset:T,stackGroups:X},Q),J)},j=(function(x){function S(N){var _,P,A;return Ode(this,S),A=Tde(this,S,[N]),ht(A,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),ht(A,"accessibilityManager",new vde),ht(A,"handleLegendBBoxUpdate",function(O){if(O){var k=A.state,R=k.dataStartIndex,M=k.dataEndIndex,z=k.updateId;A.setState(be({legendBBox:O},g({props:A.props,dataStartIndex:R,dataEndIndex:M,updateId:z},be(be({},A.state),{},{legendBBox:O}))))}}),ht(A,"handleReceiveSyncEvent",function(O,k,R){if(A.props.syncId===O){if(R===A.eventEmitterSymbol&&typeof A.props.syncMethod!="function")return;A.applySyncEvent(k)}}),ht(A,"handleBrushChange",function(O){var k=O.startIndex,R=O.endIndex;if(k!==A.state.dataStartIndex||R!==A.state.dataEndIndex){var M=A.state.updateId;A.setState(function(){return be({dataStartIndex:k,dataEndIndex:R},g({props:A.props,dataStartIndex:k,dataEndIndex:R,updateId:M},A.state))}),A.triggerSyncEvent({dataStartIndex:k,dataEndIndex:R})}}),ht(A,"handleMouseEnter",function(O){var k=A.getMouseInfo(O);if(k){var R=be(be({},k),{},{isTooltipActive:!0});A.setState(R),A.triggerSyncEvent(R);var M=A.props.onMouseEnter;xt(M)&&M(R,O)}}),ht(A,"triggeredAfterMouseMove",function(O){var k=A.getMouseInfo(O),R=k?be(be({},k),{},{isTooltipActive:!0}):{isTooltipActive:!1};A.setState(R),A.triggerSyncEvent(R);var M=A.props.onMouseMove;xt(M)&&M(R,O)}),ht(A,"handleItemMouseEnter",function(O){A.setState(function(){return{isTooltipActive:!0,activeItem:O,activePayload:O.tooltipPayload,activeCoordinate:O.tooltipPosition||{x:O.cx,y:O.cy}}})}),ht(A,"handleItemMouseLeave",function(){A.setState(function(){return{isTooltipActive:!1}})}),ht(A,"handleMouseMove",function(O){O.persist(),A.throttleTriggeredAfterMouseMove(O)}),ht(A,"handleMouseLeave",function(O){A.throttleTriggeredAfterMouseMove.cancel();var k={isTooltipActive:!1};A.setState(k),A.triggerSyncEvent(k);var R=A.props.onMouseLeave;xt(R)&&R(k,O)}),ht(A,"handleOuterEvent",function(O){var k=RY(O),R=ea(A.props,"".concat(k));if(k&&xt(R)){var M,z;/.*touch.*/i.test(k)?z=A.getMouseInfo(O.changedTouches[0]):z=A.getMouseInfo(O),R((M=z)!==null&&M!==void 0?M:{},O)}}),ht(A,"handleClick",function(O){var k=A.getMouseInfo(O);if(k){var R=be(be({},k),{},{isTooltipActive:!0});A.setState(R),A.triggerSyncEvent(R);var M=A.props.onClick;xt(M)&&M(R,O)}}),ht(A,"handleMouseDown",function(O){var k=A.props.onMouseDown;if(xt(k)){var R=A.getMouseInfo(O);k(R,O)}}),ht(A,"handleMouseUp",function(O){var k=A.props.onMouseUp;if(xt(k)){var R=A.getMouseInfo(O);k(R,O)}}),ht(A,"handleTouchMove",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&A.throttleTriggeredAfterMouseMove(O.changedTouches[0])}),ht(A,"handleTouchStart",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&A.handleMouseDown(O.changedTouches[0])}),ht(A,"handleTouchEnd",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&A.handleMouseUp(O.changedTouches[0])}),ht(A,"handleDoubleClick",function(O){var k=A.props.onDoubleClick;if(xt(k)){var R=A.getMouseInfo(O);k(R,O)}}),ht(A,"handleContextMenu",function(O){var k=A.props.onContextMenu;if(xt(k)){var R=A.getMouseInfo(O);k(R,O)}}),ht(A,"triggerSyncEvent",function(O){A.props.syncId!==void 0&&e1.emit(t1,A.props.syncId,O,A.eventEmitterSymbol)}),ht(A,"applySyncEvent",function(O){var k=A.props,R=k.layout,M=k.syncMethod,z=A.state.updateId,B=O.dataStartIndex,D=O.dataEndIndex;if(O.dataStartIndex!==void 0||O.dataEndIndex!==void 0)A.setState(be({dataStartIndex:B,dataEndIndex:D},g({props:A.props,dataStartIndex:B,dataEndIndex:D,updateId:z},A.state)));else if(O.activeTooltipIndex!==void 0){var G=O.chartX,U=O.chartY,W=O.activeTooltipIndex,X=A.state,J=X.offset,T=X.tooltipTicks;if(!J)return;if(typeof M=="function")W=M(T,O);else if(M==="value"){W=-1;for(var L=0;L<T.length;L++)if(T[L].value===O.activeLabel){W=L;break}}var Q=be(be({},J),{},{x:J.left,y:J.top}),F=Math.min(G,Q.x+Q.width),$=Math.min(U,Q.y+Q.height),Z=T[W]&&T[W].value,ae=Zj(A.state,A.props.data,W),V=T[W]?{x:R==="horizontal"?T[W].coordinate:F,y:R==="horizontal"?$:T[W].coordinate}:M4;A.setState(be(be({},O),{},{activeLabel:Z,activeCoordinate:V,activePayload:ae,activeTooltipIndex:W}))}else A.setState(O)}),ht(A,"renderCursor",function(O){var k,R=A.state,M=R.isTooltipActive,z=R.activeCoordinate,B=R.activePayload,D=R.offset,G=R.activeTooltipIndex,U=R.tooltipAxisBandSize,W=A.getTooltipEventType(),X=(k=O.props.active)!==null&&k!==void 0?k:M,J=A.props.layout,T=O.key||"_recharts-cursor";return q.createElement(Sde,{key:T,activeCoordinate:z,activePayload:B,activeTooltipIndex:G,chartName:n,element:O,isActive:X,layout:J,offset:D,tooltipAxisBandSize:U,tooltipEventType:W})}),ht(A,"renderPolarAxis",function(O,k,R){var M=ea(O,"type.axisType"),z=ea(A.state,"".concat(M,"Map")),B=O.type.defaultProps,D=B!==void 0?be(be({},B),O.props):O.props,G=z&&z[D["".concat(M,"Id")]];return v.cloneElement(O,be(be({},G),{},{className:wt(M,G.className),key:O.key||"".concat(k,"-").concat(R),ticks:mo(G,!0)}))}),ht(A,"renderPolarGrid",function(O){var k=O.props,R=k.radialLines,M=k.polarAngles,z=k.polarRadius,B=A.state,D=B.radiusAxisMap,G=B.angleAxisMap,U=wl(D),W=wl(G),X=W.cx,J=W.cy,T=W.innerRadius,L=W.outerRadius;return v.cloneElement(O,{polarAngles:Array.isArray(M)?M:mo(W,!0).map(function(Q){return Q.coordinate}),polarRadius:Array.isArray(z)?z:mo(U,!0).map(function(Q){return Q.coordinate}),cx:X,cy:J,innerRadius:T,outerRadius:L,key:O.key||"polar-grid",radialLines:R})}),ht(A,"renderLegend",function(){var O=A.state.formattedGraphicalItems,k=A.props,R=k.children,M=k.width,z=k.height,B=A.props.margin||{},D=M-(B.left||0)-(B.right||0),G=gL({children:R,formattedGraphicalItems:O,legendWidth:D,legendContent:f});if(!G)return null;var U=G.item,W=qI(G,Nde);return v.cloneElement(U,be(be({},W),{},{chartWidth:M,chartHeight:z,margin:B,onBBoxUpdate:A.handleLegendBBoxUpdate}))}),ht(A,"renderTooltip",function(){var O,k=A.props,R=k.children,M=k.accessibilityLayer,z=Vr(R,Hr);if(!z)return null;var B=A.state,D=B.isTooltipActive,G=B.activeCoordinate,U=B.activePayload,W=B.activeLabel,X=B.offset,J=(O=z.props.active)!==null&&O!==void 0?O:D;return v.cloneElement(z,{viewBox:be(be({},X),{},{x:X.left,y:X.top}),active:J,label:W,payload:J?U:[],coordinate:G,accessibilityLayer:M})}),ht(A,"renderBrush",function(O){var k=A.props,R=k.margin,M=k.data,z=A.state,B=z.offset,D=z.dataStartIndex,G=z.dataEndIndex,U=z.updateId;return v.cloneElement(O,{key:O.key||"_recharts-brush",onChange:Up(A.handleBrushChange,O.props.onChange),data:M,x:Le(O.props.x)?O.props.x:B.left,y:Le(O.props.y)?O.props.y:B.top+B.height+B.brushBottom-(R.bottom||0),width:Le(O.props.width)?O.props.width:B.width,startIndex:D,endIndex:G,updateId:"brush-".concat(U)})}),ht(A,"renderReferenceElement",function(O,k,R){if(!O)return null;var M=A,z=M.clipPathId,B=A.state,D=B.xAxisMap,G=B.yAxisMap,U=B.offset,W=O.type.defaultProps||{},X=O.props,J=X.xAxisId,T=J===void 0?W.xAxisId:J,L=X.yAxisId,Q=L===void 0?W.yAxisId:L;return v.cloneElement(O,{key:O.key||"".concat(k,"-").concat(R),xAxis:D[T],yAxis:G[Q],viewBox:{x:U.left,y:U.top,width:U.width,height:U.height},clipPathId:z})}),ht(A,"renderActivePoints",function(O){var k=O.item,R=O.activePoint,M=O.basePoint,z=O.childIndex,B=O.isRange,D=[],G=k.props.key,U=k.item.type.defaultProps!==void 0?be(be({},k.item.type.defaultProps),k.item.props):k.item.props,W=U.activeDot,X=U.dataKey,J=be(be({index:z,dataKey:X,cx:R.x,cy:R.y,r:4,fill:LN(k.item),strokeWidth:2,stroke:"#fff",payload:R.payload,value:R.value},pt(W,!1)),vh(W));return D.push(S.renderActiveDot(W,J,"".concat(G,"-activePoint-").concat(z))),M?D.push(S.renderActiveDot(W,be(be({},J),{},{cx:M.x,cy:M.y}),"".concat(G,"-basePoint-").concat(z))):B&&D.push(null),D}),ht(A,"renderGraphicChild",function(O,k,R){var M=A.filterFormatItem(O,k,R);if(!M)return null;var z=A.getTooltipEventType(),B=A.state,D=B.isTooltipActive,G=B.tooltipAxis,U=B.activeTooltipIndex,W=B.activeLabel,X=A.props.children,J=Vr(X,Hr),T=M.props,L=T.points,Q=T.isRange,F=T.baseLine,$=M.item.type.defaultProps!==void 0?be(be({},M.item.type.defaultProps),M.item.props):M.item.props,Z=$.activeDot,ae=$.hide,V=$.activeBar,ie=$.activeShape,ne=!!(!ae&&D&&J&&(Z||V||ie)),de={};z!=="axis"&&J&&J.props.trigger==="click"?de={onClick:Up(A.handleItemMouseEnter,O.props.onClick)}:z!=="axis"&&(de={onMouseLeave:Up(A.handleItemMouseLeave,O.props.onMouseLeave),onMouseEnter:Up(A.handleItemMouseEnter,O.props.onMouseEnter)});var oe=v.cloneElement(O,be(be({},M.props),de));function ge(Se){return typeof G.dataKey=="function"?G.dataKey(Se.payload):null}if(ne)if(U>=0){var Re,re;if(G.dataKey&&!G.allowDuplicatedCategory){var De=typeof G.dataKey=="function"?ge:"payload.".concat(G.dataKey.toString());Re=mh(L,De,W),re=Q&&F&&mh(F,De,W)}else Re=L?.[U],re=Q&&F&&F[U];if(ie||V){var Ae=O.props.activeIndex!==void 0?O.props.activeIndex:U;return[v.cloneElement(O,be(be(be({},M.props),de),{},{activeIndex:Ae})),null,null]}if(!bt(Re))return[oe].concat(yc(A.renderActivePoints({item:M,activePoint:Re,basePoint:re,childIndex:U,isRange:Q})))}else{var We,ye=(We=A.getItemByXY(A.state.activeCoordinate))!==null&&We!==void 0?We:{graphicalItem:oe},Ee=ye.graphicalItem,le=Ee.item,_e=le===void 0?O:le,pe=Ee.childIndex,we=be(be(be({},M.props),de),{},{activeIndex:pe});return[v.cloneElement(_e,we),null,null]}return Q?[oe,null,null]:[oe,null]}),ht(A,"renderCustomized",function(O,k,R){return v.cloneElement(O,be(be({key:"recharts-customized-".concat(R)},A.props),A.state))}),ht(A,"renderMap",{CartesianGrid:{handler:Kp,once:!0},ReferenceArea:{handler:A.renderReferenceElement},ReferenceLine:{handler:Kp},ReferenceDot:{handler:A.renderReferenceElement},XAxis:{handler:Kp},YAxis:{handler:Kp},Brush:{handler:A.renderBrush,once:!0},Bar:{handler:A.renderGraphicChild},Line:{handler:A.renderGraphicChild},Area:{handler:A.renderGraphicChild},Radar:{handler:A.renderGraphicChild},RadialBar:{handler:A.renderGraphicChild},Scatter:{handler:A.renderGraphicChild},Pie:{handler:A.renderGraphicChild},Funnel:{handler:A.renderGraphicChild},Tooltip:{handler:A.renderCursor,once:!0},PolarGrid:{handler:A.renderPolarGrid,once:!0},PolarAngleAxis:{handler:A.renderPolarAxis},PolarRadiusAxis:{handler:A.renderPolarAxis},Customized:{handler:A.renderCustomized}}),A.clipPathId="".concat((_=N.id)!==null&&_!==void 0?_:Tc("recharts"),"-clip"),A.throttleTriggeredAfterMouseMove=g5(A.triggeredAfterMouseMove,(P=N.throttleDelay)!==null&&P!==void 0?P:1e3/60),A.state={},A}return $de(S,x),Rde(S,[{key:"componentDidMount",value:function(){var _,P;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(_=this.props.margin.left)!==null&&_!==void 0?_:0,top:(P=this.props.margin.top)!==null&&P!==void 0?P:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var _=this.props,P=_.children,A=_.data,O=_.height,k=_.layout,R=Vr(P,Hr);if(R){var M=R.props.defaultIndex;if(!(typeof M!="number"||M<0||M>this.state.tooltipTicks.length-1)){var z=this.state.tooltipTicks[M]&&this.state.tooltipTicks[M].value,B=Zj(this.state,A,M,z),D=this.state.tooltipTicks[M].coordinate,G=(this.state.offset.top+O)/2,U=k==="horizontal",W=U?{x:D,y:G}:{y:D,x:G},X=this.state.formattedGraphicalItems.find(function(T){var L=T.item;return L.type.name==="Scatter"});X&&(W=be(be({},W),X.props.points[M].tooltipPosition),B=X.props.points[M].tooltipPayload);var J={activeTooltipIndex:M,isTooltipActive:!0,activeLabel:z,activePayload:B,activeCoordinate:W};this.setState(J),this.renderCursor(R),this.accessibilityManager.setIndex(M)}}}},{key:"getSnapshotBeforeUpdate",value:function(_,P){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==P.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==_.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==_.margin){var A,O;this.accessibilityManager.setDetails({offset:{left:(A=this.props.margin.left)!==null&&A!==void 0?A:0,top:(O=this.props.margin.top)!==null&&O!==void 0?O:0}})}return null}},{key:"componentDidUpdate",value:function(_){I1([Vr(_.children,Hr)],[Vr(this.props.children,Hr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var _=Vr(this.props.children,Hr);if(_&&typeof _.props.shared=="boolean"){var P=_.props.shared?"axis":"item";return c.indexOf(P)>=0?P:i}return i}},{key:"getMouseInfo",value:function(_){if(!this.container)return null;var P=this.container,A=P.getBoundingClientRect(),O=xZ(A),k={chartX:Math.round(_.pageX-O.left),chartY:Math.round(_.pageY-O.top)},R=A.width/P.offsetWidth||1,M=this.inRange(k.chartX,k.chartY,R);if(!M)return null;var z=this.state,B=z.xAxisMap,D=z.yAxisMap,G=this.getTooltipEventType(),U=VI(this.state,this.props.data,this.props.layout,M);if(G!=="axis"&&B&&D){var W=wl(B).scale,X=wl(D).scale,J=W&&W.invert?W.invert(k.chartX):null,T=X&&X.invert?X.invert(k.chartY):null;return be(be({},k),{},{xValue:J,yValue:T},U)}return U?be(be({},k),U):null}},{key:"inRange",value:function(_,P){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,O=this.props.layout,k=_/A,R=P/A;if(O==="horizontal"||O==="vertical"){var M=this.state.offset,z=k>=M.left&&k<=M.left+M.width&&R>=M.top&&R<=M.top+M.height;return z?{x:k,y:R}:null}var B=this.state,D=B.angleAxisMap,G=B.radiusAxisMap;if(D&&G){var U=wl(D);return J2({x:k,y:R},U)}return null}},{key:"parseEventsOfWrapper",value:function(){var _=this.props.children,P=this.getTooltipEventType(),A=Vr(_,Hr),O={};A&&P==="axis"&&(A.props.trigger==="click"?O={onClick:this.handleClick}:O={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var k=vh(this.props,this.handleOuterEvent);return be(be({},k),O)}},{key:"addListener",value:function(){e1.on(t1,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){e1.removeListener(t1,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(_,P,A){for(var O=this.state.formattedGraphicalItems,k=0,R=O.length;k<R;k++){var M=O[k];if(M.item===_||M.props.key===_.key||P===Ls(M.item.type)&&A===M.childIndex)return M}return null}},{key:"renderClipPath",value:function(){var _=this.clipPathId,P=this.state.offset,A=P.left,O=P.top,k=P.height,R=P.width;return q.createElement("defs",null,q.createElement("clipPath",{id:_},q.createElement("rect",{x:A,y:O,height:k,width:R})))}},{key:"getXScales",value:function(){var _=this.state.xAxisMap;return _?Object.entries(_).reduce(function(P,A){var O=UI(A,2),k=O[0],R=O[1];return be(be({},P),{},ht({},k,R.scale))},{}):null}},{key:"getYScales",value:function(){var _=this.state.yAxisMap;return _?Object.entries(_).reduce(function(P,A){var O=UI(A,2),k=O[0],R=O[1];return be(be({},P),{},ht({},k,R.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(_){var P;return(P=this.state.xAxisMap)===null||P===void 0||(P=P[_])===null||P===void 0?void 0:P.scale}},{key:"getYScaleByAxisId",value:function(_){var P;return(P=this.state.yAxisMap)===null||P===void 0||(P=P[_])===null||P===void 0?void 0:P.scale}},{key:"getItemByXY",value:function(_){var P=this.state,A=P.formattedGraphicalItems,O=P.activeItem;if(A&&A.length)for(var k=0,R=A.length;k<R;k++){var M=A[k],z=M.props,B=M.item,D=B.type.defaultProps!==void 0?be(be({},B.type.defaultProps),B.props):B.props,G=Ls(B.type);if(G==="Bar"){var U=(z.data||[]).find(function(T){return Bie(_,T)});if(U)return{graphicalItem:M,payload:U}}else if(G==="RadialBar"){var W=(z.data||[]).find(function(T){return J2(_,T)});if(W)return{graphicalItem:M,payload:W}}else if(Av(M,O)||Ev(M,O)||Md(M,O)){var X=cle({graphicalItem:M,activeTooltipItem:O,itemData:D.data}),J=D.activeIndex===void 0?X:D.activeIndex;return{graphicalItem:be(be({},M),{},{childIndex:J}),payload:Md(M,O)?D.data[X]:M.props.data[X]}}}return null}},{key:"render",value:function(){var _=this;if(!cO(this))return null;var P=this.props,A=P.children,O=P.className,k=P.width,R=P.height,M=P.style,z=P.compact,B=P.title,D=P.desc,G=qI(P,Cde),U=pt(G,!1);if(z)return q.createElement(CI,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},q.createElement($1,El({},U,{width:k,height:R,title:B,desc:D}),this.renderClipPath(),dO(A,this.renderMap)));if(this.props.accessibilityLayer){var W,X;U.tabIndex=(W=this.props.tabIndex)!==null&&W!==void 0?W:0,U.role=(X=this.props.role)!==null&&X!==void 0?X:"application",U.onKeyDown=function(T){_.accessibilityManager.keyboardEvent(T)},U.onFocus=function(){_.accessibilityManager.focus()}}var J=this.parseEventsOfWrapper();return q.createElement(CI,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},q.createElement("div",El({className:wt("recharts-wrapper",O),style:be({position:"relative",cursor:"default",width:k,height:R},M)},J,{ref:function(L){_.container=L}}),q.createElement($1,El({},U,{width:k,height:R,title:B,desc:D,style:Ude}),this.renderClipPath(),dO(A,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(v.Component);ht(j,"displayName",n),ht(j,"defaultProps",be({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},p)),ht(j,"getDerivedStateFromProps",function(x,S){var N=x.dataKey,_=x.data,P=x.children,A=x.width,O=x.height,k=x.layout,R=x.stackOffset,M=x.margin,z=S.dataStartIndex,B=S.dataEndIndex;if(S.updateId===void 0){var D=HI(x);return be(be(be({},D),{},{updateId:0},g(be(be({props:x},D),{},{updateId:0}),S)),{},{prevDataKey:N,prevData:_,prevWidth:A,prevHeight:O,prevLayout:k,prevStackOffset:R,prevMargin:M,prevChildren:P})}if(N!==S.prevDataKey||_!==S.prevData||A!==S.prevWidth||O!==S.prevHeight||k!==S.prevLayout||R!==S.prevStackOffset||!Ml(M,S.prevMargin)){var G=HI(x),U={chartX:S.chartX,chartY:S.chartY,isTooltipActive:S.isTooltipActive},W=be(be({},VI(S,_,k)),{},{updateId:S.updateId+1}),X=be(be(be({},G),U),W);return be(be(be({},X),g(be({props:x},X),S)),{},{prevDataKey:N,prevData:_,prevWidth:A,prevHeight:O,prevLayout:k,prevStackOffset:R,prevMargin:M,prevChildren:P})}if(!I1(P,S.prevChildren)){var J,T,L,Q,F=Vr(P,oc),$=F&&(J=(T=F.props)===null||T===void 0?void 0:T.startIndex)!==null&&J!==void 0?J:z,Z=F&&(L=(Q=F.props)===null||Q===void 0?void 0:Q.endIndex)!==null&&L!==void 0?L:B,ae=$!==z||Z!==B,V=!bt(_),ie=V&&!ae?S.updateId:S.updateId+1;return be(be({updateId:ie},g(be(be({props:x},S),{},{updateId:ie,dataStartIndex:$,dataEndIndex:Z}),S)),{},{prevChildren:P,dataStartIndex:$,dataEndIndex:Z})}return null}),ht(j,"renderActiveDot",function(x,S,N){var _;return v.isValidElement(x)?_=v.cloneElement(x,S):xt(x)?_=x(S):_=q.createElement(jv,S),q.createElement(It,{className:"recharts-active-dot",key:N},_)});var b=v.forwardRef(function(S,N){return q.createElement(j,El({},S,{ref:N}))});return b.displayName=j.displayName,b},GI=WN({chartName:"LineChart",GraphicalChild:hc,axisComponents:[{axisType:"xAxis",AxisComp:Ao},{axisType:"yAxis",AxisComp:Eo}],formatAxisMap:e4}),Jde=WN({chartName:"BarChart",GraphicalChild:zo,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Ao},{axisType:"yAxis",AxisComp:Eo}],formatAxisMap:e4}),Zde=WN({chartName:"PieChart",GraphicalChild:Zs,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:_v},{axisType:"radiusAxis",AxisComp:Nv}],formatAxisMap:Qre,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const efe=()=>{const{configs:e}=nf(),{source:t}=Pn(),[n,r]=v.useState([]),[a,i]=v.useState("timestamp"),[o,c]=v.useState("desc"),d=x=>{if(a===x){c(S=>S==="asc"?"desc":"asc");return}i(x),c("desc")};v.useEffect(()=>{let x=!0;return t.listResults().then(S=>{x&&r(S)}),()=>{x=!1}},[t]);const f=e.length,h=n.length,p=h===0?0:n.reduce((x,S)=>x+S.overallPassRate,0)/h,y=h===0?0:Math.round(n.reduce((x,S)=>x+S.avgLatency,0)/h),g=v.useMemo(()=>[...n].sort((S,N)=>{let _=0;return a==="timestamp"&&(_=new Date(S.timestamp).getTime()-new Date(N.timestamp).getTime()),a==="passRate"&&(_=S.overallPassRate-N.overallPassRate),a==="latency"&&(_=S.avgLatency-N.avgLatency),a==="scenarios"&&(_=S.totalScenarios-N.totalScenarios),o==="asc"?_:-_}),[n,a,o]),j=[...g].reverse().map(x=>({date:new Date(x.timestamp).toLocaleDateString("en-US",{month:"short",day:"numeric"}),passRate:Math.round(x.overallPassRate*100),latency:x.avgLatency})),b=x=>{const S=Array.from(new Set(x.scenarios.map(A=>A.scenarioId).filter(Boolean))),N=Array.from(new Set(x.scenarios.map(A=>A.agentName).filter(Boolean))),_=S.slice(0,2).join(", "),P=S.length>2?` +${S.length-2}`:"";return{scenarioCount:S.length,agentCount:N.length,scenarioPreview:_?`${_}${P}`:"n/a"}};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(r$,{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(se,{asChild:!0,children:s.jsxs(yt,{to:"/mcp-evaluations/new",children:[s.jsx(SS,{className:"mr-2 h-4 w-4"}),"New MCP Evaluation"]})}),s.jsx(se,{variant:"outline",asChild:!0,children:s.jsxs(yt,{to:"/run",children:[s.jsx(kl,{className:"mr-2 h-4 w-4"}),"Run Evaluation"]})}),s.jsx(se,{variant:"outline",asChild:!0,children:s.jsxs(yt,{to:"/results",children:[s.jsx(ed,{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(Ts,{title:"MCP Evaluations",value:f,icon:h1,subtitle:`${f} active`}),s.jsx(Ts,{title:"Total Runs",value:h,icon:JM,subtitle:"Last 30 days"}),s.jsx(Ts,{title:"Pass Rate",value:`${Math.round(p*100)}%`,icon:ed,subtitle:"+5% from last week",trend:"up"}),s.jsx(Ts,{title:"Avg Latency",value:`${y}ms`,icon:l$,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(Nt,{className:"pb-3",children:s.jsx(Ct,{className:"text-base",children:"Pass Rate Trend"})}),s.jsx(qe,{children:s.jsx(X1,{width:"100%",height:200,children:s.jsxs(GI,{data:j,children:[s.jsx(Ao,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(Eo,{domain:[0,100],tick:{fontSize:11},tickLine:!1,axisLine:!1,tickFormatter:x=>`${x}%`}),s.jsx(Hr,{formatter:x=>[`${x}%`,"Pass Rate"]}),s.jsx(hc,{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(Nt,{className:"pb-3",children:s.jsx(Ct,{className:"text-base",children:"Recent Tool Latency (ms)"})}),s.jsx(qe,{children:s.jsx(X1,{width:"100%",height:200,children:s.jsxs(GI,{data:j,children:[s.jsx(Ao,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(Eo,{tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(Hr,{formatter:x=>[`${x}ms`,"Latency"]}),s.jsx(hc,{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(Nt,{className:"pb-3",children:s.jsx(Ct,{className:"text-base",children:"Recent Runs"})}),s.jsx(qe,{className:"p-0",children:s.jsxs(Xr,{children:[s.jsx(Qr,{children:s.jsxs(Ut,{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(is,{className:"h-3.5 w-3.5"}):s.jsx(Wt,{className:"h-3.5 w-3.5"}):s.jsx(Pl,{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(is,{className:"h-3.5 w-3.5"}):s.jsx(Wt,{className:"h-3.5 w-3.5"}):s.jsx(Pl,{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(is,{className:"h-3.5 w-3.5"}):s.jsx(Wt,{className:"h-3.5 w-3.5"}):s.jsx(Pl,{className:"h-3.5 w-3.5 text-muted-foreground"})]})})]})}),s.jsx(Jr,{children:g.map(x=>s.jsxs(Ut,{className:"cursor-pointer",children:[s.jsx(Ke,{children:s.jsx(yt,{to:`/results/${x.id}`,className:"font-mono text-xs text-primary hover:underline",children:x.id})}),s.jsx(Ke,{className:"text-[11px] text-muted-foreground",children:(()=>{const S=b(x);return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Evaluated: ",S.scenarioCount," scenario",S.scenarioCount===1?"":"s"," · ",S.agentCount," agent",S.agentCount===1?"":"s"]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:S.scenarioPreview})]})})()}),s.jsx(Ke,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Gd,{className:"h-3 w-3"}),new Date(x.timestamp).toLocaleString()]})}),s.jsx(Ke,{children:s.jsx(vo,{rate:x.overallPassRate})}),s.jsx(Ke,{className:"text-right font-mono text-sm",children:x.totalScenarios})]},x.id))})]})})]})})]})};var tfe=v.createContext(void 0);function Lc(e){const t=v.useContext(tfe);return e||t||"ltr"}var r1="rovingFocusGroup.onEntryFocus",nfe={bubbles:!1,cancelable:!0},pf="RovingFocusGroup",[eS,D4,rfe]=Hd(pf),[afe,$v]=ir(pf,[rfe]),[sfe,ife]=afe(pf),L4=v.forwardRef((e,t)=>s.jsx(eS.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(eS.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(ofe,{...e,ref:t})})}));L4.displayName=pf;var ofe=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:h=!1,...p}=e,y=v.useRef(null),g=ft(t,y),j=Lc(i),[b,x]=na({prop:o,defaultProp:c??null,onChange:d,caller:pf}),[S,N]=v.useState(!1),_=En(f),P=D4(n),A=v.useRef(!1),[O,k]=v.useState(0);return v.useEffect(()=>{const R=y.current;if(R)return R.addEventListener(r1,_),()=>R.removeEventListener(r1,_)},[_]),s.jsx(sfe,{scope:n,orientation:r,dir:j,loop:a,currentTabStopId:b,onItemFocus:v.useCallback(R=>x(R),[x]),onItemShiftTab:v.useCallback(()=>N(!0),[]),onFocusableItemAdd:v.useCallback(()=>k(R=>R+1),[]),onFocusableItemRemove:v.useCallback(()=>k(R=>R-1),[]),children:s.jsx(Be.div,{tabIndex:S||O===0?-1:0,"data-orientation":r,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:Pe(e.onMouseDown,()=>{A.current=!0}),onFocus:Pe(e.onFocus,R=>{const M=!A.current;if(R.target===R.currentTarget&&M&&!S){const z=new CustomEvent(r1,nfe);if(R.currentTarget.dispatchEvent(z),!z.defaultPrevented){const B=P().filter(X=>X.focusable),D=B.find(X=>X.active),G=B.find(X=>X.id===b),W=[D,G,...B].filter(Boolean).map(X=>X.ref.current);z4(W,h)}}A.current=!1}),onBlur:Pe(e.onBlur,()=>N(!1))})})}),F4="RovingFocusGroupItem",B4=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:i,children:o,...c}=e,d=Vn(),f=i||d,h=ife(F4,n),p=h.currentTabStopId===f,y=D4(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(Be.span,{tabIndex:p?0:-1,"data-orientation":h.orientation,...c,ref:t,onMouseDown:Pe(e.onMouseDown,x=>{r?h.onItemFocus(f):x.preventDefault()}),onFocus:Pe(e.onFocus,()=>h.onItemFocus(f)),onKeyDown:Pe(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){h.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const S=ufe(x,h.orientation,h.dir);if(S!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let _=y().filter(P=>P.focusable).map(P=>P.ref.current);if(S==="last")_.reverse();else if(S==="prev"||S==="next"){S==="prev"&&_.reverse();const P=_.indexOf(x.currentTarget);_=h.loop?dfe(_,P+1):_.slice(P+1)}setTimeout(()=>z4(_))}}),children:typeof o=="function"?o({isCurrentTabStop:p,hasTabStop:b!=null}):o})})});B4.displayName=F4;var lfe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function cfe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function ufe(e,t,n){const r=cfe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return lfe[r]}function z4(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function dfe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var U4=L4,q4=B4;function ffe(e){const t=pfe(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(mfe);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function pfe(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=gfe(a),c=vfe(i,a.props);return a.type!==v.Fragment&&(c.ref=r?jr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hfe=Symbol("radix.slottable");function mfe(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hfe}function vfe(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function gfe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var tS=["Enter"," "],yfe=["ArrowDown","PageUp","Home"],W4=["ArrowUp","PageDown","End"],xfe=[...yfe,...W4],bfe={ltr:[...tS,"ArrowRight"],rtl:[...tS,"ArrowLeft"]},wfe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},hf="Menu",[Ud,jfe,Sfe]=Hd(hf),[Uo,V4]=ir(hf,[Sfe,$i,$v]),Dv=$i(),H4=$v(),[Nfe,qo]=Uo(hf),[Cfe,mf]=Uo(hf),K4=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:i,modal:o=!0}=e,c=Dv(t),[d,f]=v.useState(null),h=v.useRef(!1),p=En(i),y=Lc(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(Tm,{...c,children:s.jsx(Nfe,{scope:t,open:n,onOpenChange:p,content:d,onContentChange:f,children:s.jsx(Cfe,{scope:t,onClose:v.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:h,dir:y,modal:o,children:r})})})};K4.displayName=hf;var _fe="MenuAnchor",VN=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=Dv(n);return s.jsx(Xd,{...a,...r,ref:t})});VN.displayName=_fe;var HN="MenuPortal",[Afe,G4]=Uo(HN,{forceMount:void 0}),Y4=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,i=qo(HN,t);return s.jsx(Afe,{scope:t,forceMount:n,children:s.jsx(Kn,{present:n||i.open,children:s.jsx(jc,{asChild:!0,container:a,children:r})})})};Y4.displayName=HN;var ya="MenuContent",[Efe,KN]=Uo(ya),X4=v.forwardRef((e,t)=>{const n=G4(ya,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=qo(ya,e.__scopeMenu),o=mf(ya,e.__scopeMenu);return s.jsx(Ud.Provider,{scope:e.__scopeMenu,children:s.jsx(Kn,{present:r||i.open,children:s.jsx(Ud.Slot,{scope:e.__scopeMenu,children:o.modal?s.jsx(Pfe,{...a,ref:t}):s.jsx(Ofe,{...a,ref:t})})})})}),Pfe=v.forwardRef((e,t)=>{const n=qo(ya,e.__scopeMenu),r=v.useRef(null),a=ft(t,r);return v.useEffect(()=>{const i=r.current;if(i)return Km(i)},[]),s.jsx(GN,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Pe(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Ofe=v.forwardRef((e,t)=>{const n=qo(ya,e.__scopeMenu);return s.jsx(GN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),kfe=ffe("MenuContent.ScrollLock"),GN=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:y,onDismiss:g,disableOutsideScroll:j,...b}=e,x=qo(ya,n),S=mf(ya,n),N=Dv(n),_=H4(n),P=jfe(n),[A,O]=v.useState(null),k=v.useRef(null),R=ft(t,k,x.onContentChange),M=v.useRef(0),z=v.useRef(""),B=v.useRef(0),D=v.useRef(null),G=v.useRef("right"),U=v.useRef(0),W=j?Jd:v.Fragment,X=j?{as:kfe,allowPinchZoom:!0}:void 0,J=L=>{const Q=z.current+L,F=P().filter(ne=>!ne.disabled),$=document.activeElement,Z=F.find(ne=>ne.ref.current===$)?.textValue,ae=F.map(ne=>ne.textValue),V=qfe(ae,Q,Z),ie=F.find(ne=>ne.textValue===V)?.ref.current;(function ne(de){z.current=de,window.clearTimeout(M.current),de!==""&&(M.current=window.setTimeout(()=>ne(""),1e3))})(Q),ie&&setTimeout(()=>ie.focus())};v.useEffect(()=>()=>window.clearTimeout(M.current),[]),Vm();const T=v.useCallback(L=>G.current===D.current?.side&&Vfe(L,D.current?.area),[]);return s.jsx(Efe,{scope:n,searchRef:z,onItemEnter:v.useCallback(L=>{T(L)&&L.preventDefault()},[T]),onItemLeave:v.useCallback(L=>{T(L)||(k.current?.focus(),O(null))},[T]),onTriggerLeave:v.useCallback(L=>{T(L)&&L.preventDefault()},[T]),pointerGraceTimerRef:B,onPointerGraceIntentChange:v.useCallback(L=>{D.current=L},[]),children:s.jsx(W,{...X,children:s.jsx(Qd,{asChild:!0,trapped:a,onMountAutoFocus:Pe(i,L=>{L.preventDefault(),k.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:s.jsx(To,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:y,onDismiss:g,children:s.jsx(U4,{asChild:!0,..._,dir:S.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:O,onEntryFocus:Pe(d,L=>{S.isUsingKeyboardRef.current||L.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(Im,{role:"menu","aria-orientation":"vertical","data-state":fF(x.open),"data-radix-menu-content":"",dir:S.dir,...N,...b,ref:R,style:{outline:"none",...b.style},onKeyDown:Pe(b.onKeyDown,L=>{const F=L.target.closest("[data-radix-menu-content]")===L.currentTarget,$=L.ctrlKey||L.altKey||L.metaKey,Z=L.key.length===1;F&&(L.key==="Tab"&&L.preventDefault(),!$&&Z&&J(L.key));const ae=k.current;if(L.target!==ae||!xfe.includes(L.key))return;L.preventDefault();const ie=P().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);W4.includes(L.key)&&ie.reverse(),zfe(ie)}),onBlur:Pe(e.onBlur,L=>{L.currentTarget.contains(L.target)||(window.clearTimeout(M.current),z.current="")}),onPointerMove:Pe(e.onPointerMove,qd(L=>{const Q=L.target,F=U.current!==L.clientX;if(L.currentTarget.contains(Q)&&F){const $=L.clientX>U.current?"right":"left";G.current=$,U.current=L.clientX}}))})})})})})})});X4.displayName=ya;var Rfe="MenuGroup",YN=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(Be.div,{role:"group",...r,ref:t})});YN.displayName=Rfe;var Tfe="MenuLabel",Q4=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(Be.div,{...r,ref:t})});Q4.displayName=Tfe;var mm="MenuItem",YI="menu.itemSelect",Lv=v.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...a}=e,i=v.useRef(null),o=mf(mm,e.__scopeMenu),c=KN(mm,e.__scopeMenu),d=ft(t,i),f=v.useRef(!1),h=()=>{const p=i.current;if(!n&&p){const y=new CustomEvent(YI,{bubbles:!0,cancelable:!0});p.addEventListener(YI,g=>r?.(g),{once:!0}),gS(p,y),y.defaultPrevented?f.current=!1:o.onClose()}};return s.jsx(J4,{...a,ref:d,disabled:n,onClick:Pe(e.onClick,h),onPointerDown:p=>{e.onPointerDown?.(p),f.current=!0},onPointerUp:Pe(e.onPointerUp,p=>{f.current||p.currentTarget?.click()}),onKeyDown:Pe(e.onKeyDown,p=>{const y=c.searchRef.current!=="";n||y&&p.key===" "||tS.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Lv.displayName=mm;var J4=v.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:a,...i}=e,o=KN(mm,n),c=H4(n),d=v.useRef(null),f=ft(t,d),[h,p]=v.useState(!1),[y,g]=v.useState("");return v.useEffect(()=>{const j=d.current;j&&g((j.textContent??"").trim())},[i.children]),s.jsx(Ud.ItemSlot,{scope:n,disabled:r,textValue:a??y,children:s.jsx(q4,{asChild:!0,...c,focusable:!r,children:s.jsx(Be.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:f,onPointerMove:Pe(e.onPointerMove,qd(j=>{r?o.onItemLeave(j):(o.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Pe(e.onPointerLeave,qd(j=>o.onItemLeave(j))),onFocus:Pe(e.onFocus,()=>p(!0)),onBlur:Pe(e.onBlur,()=>p(!1))})})})}),Ife="MenuCheckboxItem",Z4=v.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...a}=e;return s.jsx(aF,{scope:e.__scopeMenu,checked:n,children:s.jsx(Lv,{role:"menuitemcheckbox","aria-checked":vm(n)?"mixed":n,...a,ref:t,"data-state":QN(n),onSelect:Pe(a.onSelect,()=>r?.(vm(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Z4.displayName=Ife;var eF="MenuRadioGroup",[Mfe,$fe]=Uo(eF,{value:void 0,onValueChange:()=>{}}),tF=v.forwardRef((e,t)=>{const{value:n,onValueChange:r,...a}=e,i=En(r);return s.jsx(Mfe,{scope:e.__scopeMenu,value:n,onValueChange:i,children:s.jsx(YN,{...a,ref:t})})});tF.displayName=eF;var nF="MenuRadioItem",rF=v.forwardRef((e,t)=>{const{value:n,...r}=e,a=$fe(nF,e.__scopeMenu),i=n===a.value;return s.jsx(aF,{scope:e.__scopeMenu,checked:i,children:s.jsx(Lv,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":QN(i),onSelect:Pe(r.onSelect,()=>a.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});rF.displayName=nF;var XN="MenuItemIndicator",[aF,Dfe]=Uo(XN,{checked:!1}),sF=v.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...a}=e,i=Dfe(XN,n);return s.jsx(Kn,{present:r||vm(i.checked)||i.checked===!0,children:s.jsx(Be.span,{...a,ref:t,"data-state":QN(i.checked)})})});sF.displayName=XN;var Lfe="MenuSeparator",iF=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(Be.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});iF.displayName=Lfe;var Ffe="MenuArrow",oF=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=Dv(n);return s.jsx(Mm,{...a,...r,ref:t})});oF.displayName=Ffe;var Bfe="MenuSub",[Ege,lF]=Uo(Bfe),Uu="MenuSubTrigger",cF=v.forwardRef((e,t)=>{const n=qo(Uu,e.__scopeMenu),r=mf(Uu,e.__scopeMenu),a=lF(Uu,e.__scopeMenu),i=KN(Uu,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(VN,{asChild:!0,...f,children:s.jsx(J4,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":fF(n.open),...e,ref:jr(t,a.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Pe(e.onPointerMove,qd(p=>{i.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),h()},100))})),onPointerLeave:Pe(e.onPointerLeave,qd(p=>{h();const y=n.content?.getBoundingClientRect();if(y){const g=n.content?.dataset.side,j=g==="right",b=j?-5:5,x=y[j?"left":"right"],S=y[j?"right":"left"];i.onPointerGraceIntentChange({area:[{x:p.clientX+b,y:p.clientY},{x,y:y.top},{x:S,y:y.top},{x:S,y:y.bottom},{x,y:y.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:Pe(e.onKeyDown,p=>{const y=i.searchRef.current!=="";e.disabled||y&&p.key===" "||bfe[r.dir].includes(p.key)&&(n.onOpenChange(!0),n.content?.focus(),p.preventDefault())})})})});cF.displayName=Uu;var uF="MenuSubContent",dF=v.forwardRef((e,t)=>{const n=G4(ya,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=qo(ya,e.__scopeMenu),o=mf(ya,e.__scopeMenu),c=lF(uF,e.__scopeMenu),d=v.useRef(null),f=ft(t,d);return s.jsx(Ud.Provider,{scope:e.__scopeMenu,children:s.jsx(Kn,{present:r||i.open,children:s.jsx(Ud.Slot,{scope:e.__scopeMenu,children:s.jsx(GN,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:f,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{o.isUsingKeyboardRef.current&&d.current?.focus(),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:Pe(e.onFocusOutside,h=>{h.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Pe(e.onEscapeKeyDown,h=>{o.onClose(),h.preventDefault()}),onKeyDown:Pe(e.onKeyDown,h=>{const p=h.currentTarget.contains(h.target),y=wfe[o.dir].includes(h.key);p&&y&&(i.onOpenChange(!1),c.trigger?.focus(),h.preventDefault())})})})})})});dF.displayName=uF;function fF(e){return e?"open":"closed"}function vm(e){return e==="indeterminate"}function QN(e){return vm(e)?"indeterminate":e?"checked":"unchecked"}function zfe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Ufe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function qfe(e,t,n){const a=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=Ufe(e,Math.max(i,0));a.length===1&&(o=o.filter(f=>f!==n));const d=o.find(f=>f.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function Wfe(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const c=t[i],d=t[o],f=c.x,h=c.y,p=d.x,y=d.y;h>r!=y>r&&n<(p-f)*(r-h)/(y-h)+f&&(a=!a)}return a}function Vfe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Wfe(n,t)}function qd(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Hfe=K4,Kfe=VN,Gfe=Y4,Yfe=X4,Xfe=YN,Qfe=Q4,Jfe=Lv,Zfe=Z4,epe=tF,tpe=rF,npe=sF,rpe=iF,ape=oF,spe=cF,ipe=dF,Fv="DropdownMenu",[ope]=ir(Fv,[V4]),Sr=V4(),[lpe,pF]=ope(Fv),hF=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:i,onOpenChange:o,modal:c=!0}=e,d=Sr(t),f=v.useRef(null),[h,p]=na({prop:a,defaultProp:i??!1,onChange:o,caller:Fv});return s.jsx(lpe,{scope:t,triggerId:Vn(),triggerRef:f,contentId:Vn(),open:h,onOpenChange:p,onOpenToggle:v.useCallback(()=>p(y=>!y),[p]),modal:c,children:s.jsx(Hfe,{...d,open:h,onOpenChange:p,dir:r,modal:c,children:n})})};hF.displayName=Fv;var mF="DropdownMenuTrigger",vF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...a}=e,i=pF(mF,n),o=Sr(n);return s.jsx(Kfe,{asChild:!0,...o,children:s.jsx(Be.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:jr(t,i.triggerRef),onPointerDown:Pe(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(i.onOpenToggle(),i.open||c.preventDefault())}),onKeyDown:Pe(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&i.onOpenToggle(),c.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});vF.displayName=mF;var cpe="DropdownMenuPortal",gF=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Sr(t);return s.jsx(Gfe,{...r,...n})};gF.displayName=cpe;var yF="DropdownMenuContent",xF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=pF(yF,n),i=Sr(n),o=v.useRef(!1);return s.jsx(Yfe,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...r,ref:t,onCloseAutoFocus:Pe(e.onCloseAutoFocus,c=>{o.current||a.triggerRef.current?.focus(),o.current=!1,c.preventDefault()}),onInteractOutside:Pe(e.onInteractOutside,c=>{const d=c.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0,h=d.button===2||f;(!a.modal||h)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});xF.displayName=yF;var upe="DropdownMenuGroup",dpe=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Sr(n);return s.jsx(Xfe,{...a,...r,ref:t})});dpe.displayName=upe;var fpe="DropdownMenuLabel",bF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Sr(n);return s.jsx(Qfe,{...a,...r,ref:t})});bF.displayName=fpe;var ppe="DropdownMenuItem",wF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Sr(n);return s.jsx(Jfe,{...a,...r,ref:t})});wF.displayName=ppe;var hpe="DropdownMenuCheckboxItem",jF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Sr(n);return s.jsx(Zfe,{...a,...r,ref:t})});jF.displayName=hpe;var mpe="DropdownMenuRadioGroup",vpe=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Sr(n);return s.jsx(epe,{...a,...r,ref:t})});vpe.displayName=mpe;var gpe="DropdownMenuRadioItem",SF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Sr(n);return s.jsx(tpe,{...a,...r,ref:t})});SF.displayName=gpe;var ype="DropdownMenuItemIndicator",NF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Sr(n);return s.jsx(npe,{...a,...r,ref:t})});NF.displayName=ype;var xpe="DropdownMenuSeparator",CF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Sr(n);return s.jsx(rpe,{...a,...r,ref:t})});CF.displayName=xpe;var bpe="DropdownMenuArrow",wpe=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Sr(n);return s.jsx(ape,{...a,...r,ref:t})});wpe.displayName=bpe;var jpe="DropdownMenuSubTrigger",_F=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Sr(n);return s.jsx(spe,{...a,...r,ref:t})});_F.displayName=jpe;var Spe="DropdownMenuSubContent",AF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Sr(n);return s.jsx(ipe,{...a,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});AF.displayName=Spe;var Npe=hF,Cpe=vF,_pe=gF,EF=xF,PF=bF,OF=wF,kF=jF,RF=SF,TF=NF,IF=CF,MF=_F,$F=AF;const Fc=Npe,Bc=Cpe,Ape=v.forwardRef(({className:e,inset:t,children:n,...r},a)=>s.jsxs(MF,{ref:a,className:je("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",t&&"pl-8",e),...r,children:[n,s.jsx(ZM,{className:"ml-auto h-4 w-4"})]}));Ape.displayName=MF.displayName;const Epe=v.forwardRef(({className:e,...t},n)=>s.jsx($F,{ref:n,className:je("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Epe.displayName=$F.displayName;const Wo=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(_pe,{children:s.jsx(EF,{ref:r,sideOffset:t,className:je("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Wo.displayName=EF.displayName;const pr=v.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(OF,{ref:r,className:je("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t&&"pl-8",e),...n}));pr.displayName=OF.displayName;const Ppe=v.forwardRef(({className:e,children:t,checked:n,...r},a)=>s.jsxs(kF,{ref:a,className:je("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),checked:n,...r,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(TF,{children:s.jsx(ql,{className:"h-4 w-4"})})}),t]}));Ppe.displayName=kF.displayName;const Ope=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(RF,{ref:r,className:je("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(TF,{children:s.jsx(PU,{className:"h-2 w-2 fill-current"})})}),t]}));Ope.displayName=RF.displayName;const JN=v.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(PF,{ref:r,className:je("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));JN.displayName=PF.displayName;const ZN=v.forwardRef(({className:e,...t},n)=>s.jsx(IF,{ref:n,className:je("-mx-1 my-1 h-px bg-muted",e),...t}));ZN.displayName=IF.displayName;const Mu=e=>e.configName?.trim()||e.name,kpe=()=>{const{configs:e,deleteConfig:t,cloneConfig:n,loading:r,reload:a}=nf(),i=ja(),[o,c]=v.useState("name"),[d,f]=v.useState("asc"),h=S=>{if(o===S){f(N=>N==="asc"?"desc":"asc");return}c(S),f(S==="updatedAt"?"desc":"asc")};v.useEffect(()=>{a();const S=()=>{a()};return window.addEventListener("focus",S),()=>{window.removeEventListener("focus",S)}},[a]);const p=async(S,N)=>{await t(S),Oe({title:"Deleted",description:`"${N}" has been removed.`})},y=async S=>{const N=await n(S);Oe({title:"Cloned",description:`Created "${Mu(N)}".`}),i(`/mcp-evaluations/${N.id}`)},g=S=>S.agentEntries?.length??S.agents?.length??0,j=S=>S.scenarioEntries?.length??S.scenarios?.length??0,b=v.useMemo(()=>[...e].sort((N,_)=>{let P=0;return o==="name"&&(P=Mu(N).localeCompare(Mu(_))),o==="scenarios"&&(P=j(N)-j(_)),o==="agents"&&(P=g(N)-g(_)),o==="updatedAt"&&(P=new Date(N.updatedAt).getTime()-new Date(_.updatedAt).getTime()),d==="asc"?P:-P}),[e,o,d]),x=S=>o!==S?s.jsx(Pl,{className:"h-3.5 w-3.5 text-muted-foreground"}):d==="asc"?s.jsx(is,{className:"h-3.5 w-3.5"}):s.jsx(Wt,{className:"h-3.5 w-3.5"});return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(n$,{className:"h-6 w-6"}),"MCP Evaluations"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage your MCP evaluation suites"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(se,{variant:"outline",size:"sm",onClick:()=>{a()},children:[s.jsx(xa,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(se,{variant:"outline",size:"sm",children:[s.jsx($U,{className:"mr-2 h-4 w-4"}),"Import YAML"]}),s.jsx(se,{size:"sm",asChild:!0,children:s.jsxs(yt,{to:"/mcp-evaluations/new",children:[s.jsx(us,{className:"mr-2 h-4 w-4"}),"Create New"]})})]})]}),s.jsx(Ue,{children:s.jsx(qe,{className:"p-0",children:s.jsxs(Xr,{children:[s.jsx(Qr,{children:s.jsxs(Ut,{children:[s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>h("name"),children:["Name",x("name")]})}),s.jsx(tt,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>h("scenarios"),children:["Scenarios",x("scenarios")]})}),s.jsx(tt,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>h("agents"),children:["Agents",x("agents")]})}),s.jsx(tt,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>h("updatedAt"),children:["Last Updated",x("updatedAt")]})}),s.jsx(tt,{className:"w-10"})]})}),s.jsxs(Jr,{children:[b.map(S=>s.jsxs(Ut,{children:[s.jsx(Ke,{children:s.jsxs("div",{children:[s.jsx(yt,{to:`/mcp-evaluations/${S.id}`,className:"font-medium text-sm hover:text-primary",children:Mu(S)}),S.loadError&&s.jsxs(Je,{variant:"destructive",className:"ml-2 align-middle text-[10px]",children:[s.jsx(Zp,{className:"mr-1 h-3 w-3"}),"Broken"]}),S.description&&s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:S.description}),S.loadError&&s.jsx("p",{className:"text-xs text-destructive mt-0.5 break-all",children:S.loadError})]})}),s.jsx(Ke,{className:"text-right font-mono text-sm",children:j(S)}),s.jsx(Ke,{className:"text-right font-mono text-sm",children:g(S)}),s.jsx(Ke,{className:"text-right text-xs text-muted-foreground",children:new Date(S.updatedAt).toLocaleDateString()}),s.jsx(Ke,{children:s.jsxs(Fc,{children:[s.jsx(Bc,{asChild:!0,children:s.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(_m,{className:"h-4 w-4"})})}),s.jsxs(Wo,{align:"end",children:[s.jsxs(pr,{onClick:()=>i(`/mcp-evaluations/${S.id}`),children:[s.jsx(Am,{className:"mr-2 h-3.5 w-3.5"}),"Edit"]}),s.jsxs(pr,{onClick:()=>{y(S.id)},children:[s.jsx(Ri,{className:"mr-2 h-3.5 w-3.5"}),"Clone"]}),s.jsxs(pr,{children:[s.jsx(ga,{className:"mr-2 h-3.5 w-3.5"}),"Download YAML"]}),s.jsxs(pr,{className:"text-destructive",onClick:()=>{p(S.id,Mu(S))},children:[s.jsx(ba,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]})})]},S.id)),!r&&e.length===0&&s.jsx(Ut,{children:s.jsx(Ke,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"No MCP evaluations yet. Create your first one to get started."})}),r&&s.jsx(Ut,{children:s.jsx(Ke,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"Loading MCP evaluations..."})})]})]})})})]})};var Rpe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Tpe=Rpe.reduce((e,t)=>{const n=Wm(`Primitive.${t}`),r=v.forwardRef((a,i)=>{const{asChild:o,...c}=a,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Ipe="Label",DF=v.forwardRef((e,t)=>s.jsx(Tpe.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));DF.displayName=Ipe;var LF=DF;const Mpe=Io("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),$e=v.forwardRef(({className:e,...t},n)=>s.jsx(LF,{ref:n,className:je(Mpe(),e),...t}));$e.displayName=LF.displayName;const Gs=v.forwardRef(({className:e,...t},n)=>s.jsx("textarea",{className:je("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Gs.displayName="Textarea";function Bv(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 zv="Switch",[$pe]=ir(zv),[Dpe,Lpe]=$pe(zv),FF=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,[y,g]=v.useState(null),j=ft(t,_=>g(_)),b=v.useRef(!1),x=y?h||!!y.closest("form"):!0,[S,N]=na({prop:a,defaultProp:i??!1,onChange:f,caller:zv});return s.jsxs(Dpe,{scope:n,checked:S,disabled:c,children:[s.jsx(Be.button,{type:"button",role:"switch","aria-checked":S,"aria-required":o,"data-state":qF(S),"data-disabled":c?"":void 0,disabled:c,value:d,...p,ref:j,onClick:Pe(e.onClick,_=>{N(P=>!P),x&&(b.current=_.isPropagationStopped(),b.current||_.stopPropagation())})}),x&&s.jsx(UF,{control:y,bubbles:!b.current,name:r,value:d,checked:S,required:o,disabled:c,form:h,style:{transform:"translateX(-100%)"}})]})});FF.displayName=zv;var BF="SwitchThumb",zF=v.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,a=Lpe(BF,n);return s.jsx(Be.span,{"data-state":qF(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});zF.displayName=BF;var Fpe="SwitchBubbleInput",UF=v.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...a},i)=>{const o=v.useRef(null),c=ft(o,i),d=Bv(n),f=Rm(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}})});UF.displayName=Fpe;function qF(e){return e?"checked":"unchecked"}var WF=FF,Bpe=zF;const gm=v.forwardRef(({className:e,...t},n)=>s.jsx(WF,{className:je("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",e),...t,ref:n,children:s.jsx(Bpe,{className:je("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));gm.displayName=WF.displayName;var Uv="Tabs",[zpe]=ir(Uv,[$v]),VF=$v(),[Upe,eC]=zpe(Uv),HF=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:o="horizontal",dir:c,activationMode:d="automatic",...f}=e,h=Lc(c),[p,y]=na({prop:r,onChange:a,defaultProp:i??"",caller:Uv});return s.jsx(Upe,{scope:n,baseId:Vn(),value:p,onValueChange:y,orientation:o,dir:h,activationMode:d,children:s.jsx(Be.div,{dir:h,"data-orientation":o,...f,ref:t})})});HF.displayName=Uv;var KF="TabsList",GF=v.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,i=eC(KF,n),o=VF(n);return s.jsx(U4,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:r,children:s.jsx(Be.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});GF.displayName=KF;var YF="TabsTrigger",XF=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,o=eC(YF,n),c=VF(n),d=ZF(o.baseId,r),f=eB(o.baseId,r),h=r===o.value;return s.jsx(q4,{asChild:!0,...c,focusable:!a,active:h,children:s.jsx(Be.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":f,"data-state":h?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:d,...i,ref:t,onMouseDown:Pe(e.onMouseDown,p=>{!a&&p.button===0&&p.ctrlKey===!1?o.onValueChange(r):p.preventDefault()}),onKeyDown:Pe(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&o.onValueChange(r)}),onFocus:Pe(e.onFocus,()=>{const p=o.activationMode!=="manual";!h&&!a&&p&&o.onValueChange(r)})})})});XF.displayName=YF;var QF="TabsContent",JF=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:i,...o}=e,c=eC(QF,n),d=ZF(c.baseId,r),f=eB(c.baseId,r),h=r===c.value,p=v.useRef(h);return v.useEffect(()=>{const y=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(y)},[]),s.jsx(Kn,{present:a||h,children:({present:y})=>s.jsx(Be.div,{"data-state":h?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!y,id:f,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:y&&i})})});JF.displayName=QF;function ZF(e,t){return`${e}-trigger-${t}`}function eB(e,t){return`${e}-content-${t}`}var qpe=HF,tB=GF,nB=XF,rB=JF;const tC=qpe,qv=v.forwardRef(({className:e,...t},n)=>s.jsx(tB,{ref:n,className:je("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));qv.displayName=tB.displayName;const Po=v.forwardRef(({className:e,...t},n)=>s.jsx(nB,{ref:n,className:je("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e),...t}));Po.displayName=nB.displayName;const Wd=v.forwardRef(({className:e,...t},n)=>s.jsx(rB,{ref:n,className:je("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Wd.displayName=rB.displayName;const XI={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 aB({provider:e}){return s.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${XI[e]??XI.custom}`,children:e})}function Vd(e,[t,n]){return Math.min(n,Math.max(t,e))}function Wpe(e){const t=Vpe(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(Kpe);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function Vpe(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=Ype(a),c=Gpe(i,a.props);return a.type!==v.Fragment&&(c.ref=r?jr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Hpe=Symbol("radix.slottable");function Kpe(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Hpe}function Gpe(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function Ype(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Xpe=[" ","Enter","ArrowUp","ArrowDown"],Qpe=[" ","Enter"],Oo="Select",[Wv,Vv,Jpe]=Hd(Oo),[zc]=ir(Oo,[Jpe,$i]),Hv=$i(),[Zpe,Ui]=zc(Oo),[ehe,the]=zc(Oo),sB=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:y,required:g,form:j}=e,b=Hv(t),[x,S]=v.useState(null),[N,_]=v.useState(null),[P,A]=v.useState(!1),O=Lc(f),[k,R]=na({prop:r,defaultProp:a??!1,onChange:i,caller:Oo}),[M,z]=na({prop:o,defaultProp:c,onChange:d,caller:Oo}),B=v.useRef(null),D=x?j||!!x.closest("form"):!0,[G,U]=v.useState(new Set),W=Array.from(G).map(X=>X.props.value).join(";");return s.jsx(Tm,{...b,children:s.jsxs(Zpe,{required:g,scope:t,trigger:x,onTriggerChange:S,valueNode:N,onValueNodeChange:_,valueNodeHasChildren:P,onValueNodeHasChildrenChange:A,contentId:Vn(),value:M,onValueChange:z,open:k,onOpenChange:R,dir:O,triggerPointerDownPosRef:B,disabled:y,children:[s.jsx(Wv.Provider,{scope:t,children:s.jsx(ehe,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(X=>{U(J=>new Set(J).add(X))},[]),onNativeOptionRemove:v.useCallback(X=>{U(J=>{const T=new Set(J);return T.delete(X),T})},[]),children:n})}),D?s.jsxs(PB,{"aria-hidden":!0,required:g,tabIndex:-1,name:h,autoComplete:p,value:M,onChange:X=>z(X.target.value),disabled:y,form:j,children:[M===void 0?s.jsx("option",{value:""}):null,Array.from(G)]},W):null]})})};sB.displayName=Oo;var iB="SelectTrigger",oB=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,i=Hv(n),o=Ui(iB,n),c=o.disabled||r,d=ft(t,o.onTriggerChange),f=Vv(n),h=v.useRef("touch"),[p,y,g]=kB(b=>{const x=f().filter(_=>!_.disabled),S=x.find(_=>_.value===o.value),N=RB(x,b,S);N!==void 0&&o.onValueChange(N.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(Xd,{asChild:!0,...i,children:s.jsx(Be.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":OB(o.value)?"":void 0,...a,ref:d,onClick:Pe(a.onClick,b=>{b.currentTarget.focus(),h.current!=="mouse"&&j(b)}),onPointerDown:Pe(a.onPointerDown,b=>{h.current=b.pointerType;const x=b.target;x.hasPointerCapture(b.pointerId)&&x.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(j(b),b.preventDefault())}),onKeyDown:Pe(a.onKeyDown,b=>{const x=p.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&y(b.key),!(x&&b.key===" ")&&Xpe.includes(b.key)&&(j(),b.preventDefault())})})})});oB.displayName=iB;var lB="SelectValue",cB=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:i,placeholder:o="",...c}=e,d=Ui(lB,n),{onValueNodeHasChildrenChange:f}=d,h=i!==void 0,p=ft(t,d.onValueNodeChange);return Hn(()=>{f(h)},[f,h]),s.jsx(Be.span,{...c,ref:p,style:{pointerEvents:"none"},children:OB(d.value)?s.jsx(s.Fragment,{children:o}):i})});cB.displayName=lB;var nhe="SelectIcon",uB=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return s.jsx(Be.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});uB.displayName=nhe;var rhe="SelectPortal",dB=e=>s.jsx(jc,{asChild:!0,...e});dB.displayName=rhe;var ko="SelectContent",fB=v.forwardRef((e,t)=>{const n=Ui(ko,e.__scopeSelect),[r,a]=v.useState();if(Hn(()=>{a(new DocumentFragment)},[]),!n.open){const i=r;return i?wc.createPortal(s.jsx(pB,{scope:e.__scopeSelect,children:s.jsx(Wv.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),i):null}return s.jsx(hB,{...e,ref:t})});fB.displayName=ko;var Ia=10,[pB,qi]=zc(ko),ahe="SelectContentImpl",she=Wpe("SelectContent.RemoveScroll"),hB=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:y,collisionPadding:g,sticky:j,hideWhenDetached:b,avoidCollisions:x,...S}=e,N=Ui(ko,n),[_,P]=v.useState(null),[A,O]=v.useState(null),k=ft(t,ne=>P(ne)),[R,M]=v.useState(null),[z,B]=v.useState(null),D=Vv(n),[G,U]=v.useState(!1),W=v.useRef(!1);v.useEffect(()=>{if(_)return Km(_)},[_]),Vm();const X=v.useCallback(ne=>{const[de,...oe]=D().map(re=>re.ref.current),[ge]=oe.slice(-1),Re=document.activeElement;for(const re of ne)if(re===Re||(re?.scrollIntoView({block:"nearest"}),re===de&&A&&(A.scrollTop=0),re===ge&&A&&(A.scrollTop=A.scrollHeight),re?.focus(),document.activeElement!==Re))return},[D,A]),J=v.useCallback(()=>X([R,_]),[X,R,_]);v.useEffect(()=>{G&&J()},[G,J]);const{onOpenChange:T,triggerPointerDownPosRef:L}=N;v.useEffect(()=>{if(_){let ne={x:0,y:0};const de=ge=>{ne={x:Math.abs(Math.round(ge.pageX)-(L.current?.x??0)),y:Math.abs(Math.round(ge.pageY)-(L.current?.y??0))}},oe=ge=>{ne.x<=10&&ne.y<=10?ge.preventDefault():_.contains(ge.target)||T(!1),document.removeEventListener("pointermove",de),L.current=null};return L.current!==null&&(document.addEventListener("pointermove",de),document.addEventListener("pointerup",oe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",de),document.removeEventListener("pointerup",oe,{capture:!0})}}},[_,T,L]),v.useEffect(()=>{const ne=()=>T(!1);return window.addEventListener("blur",ne),window.addEventListener("resize",ne),()=>{window.removeEventListener("blur",ne),window.removeEventListener("resize",ne)}},[T]);const[Q,F]=kB(ne=>{const de=D().filter(Re=>!Re.disabled),oe=de.find(Re=>Re.ref.current===document.activeElement),ge=RB(de,ne,oe);ge&&setTimeout(()=>ge.ref.current.focus())}),$=v.useCallback((ne,de,oe)=>{const ge=!W.current&&!oe;(N.value!==void 0&&N.value===de||ge)&&(M(ne),ge&&(W.current=!0))},[N.value]),Z=v.useCallback(()=>_?.focus(),[_]),ae=v.useCallback((ne,de,oe)=>{const ge=!W.current&&!oe;(N.value!==void 0&&N.value===de||ge)&&B(ne)},[N.value]),V=r==="popper"?nS:mB,ie=V===nS?{side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:y,collisionPadding:g,sticky:j,hideWhenDetached:b,avoidCollisions:x}:{};return s.jsx(pB,{scope:n,content:_,viewport:A,onViewportChange:O,itemRefCallback:$,selectedItem:R,onItemLeave:Z,itemTextRefCallback:ae,focusSelectedItem:J,selectedItemText:z,position:r,isPositioned:G,searchRef:Q,children:s.jsx(Jd,{as:she,allowPinchZoom:!0,children:s.jsx(Qd,{asChild:!0,trapped:N.open,onMountAutoFocus:ne=>{ne.preventDefault()},onUnmountAutoFocus:Pe(a,ne=>{N.trigger?.focus({preventScroll:!0}),ne.preventDefault()}),children:s.jsx(To,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:ne=>ne.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:s.jsx(V,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:ne=>ne.preventDefault(),...S,...ie,onPlaced:()=>U(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:Pe(S.onKeyDown,ne=>{const de=ne.ctrlKey||ne.altKey||ne.metaKey;if(ne.key==="Tab"&&ne.preventDefault(),!de&&ne.key.length===1&&F(ne.key),["ArrowUp","ArrowDown","Home","End"].includes(ne.key)){let ge=D().filter(Re=>!Re.disabled).map(Re=>Re.ref.current);if(["ArrowUp","End"].includes(ne.key)&&(ge=ge.slice().reverse()),["ArrowUp","ArrowDown"].includes(ne.key)){const Re=ne.target,re=ge.indexOf(Re);ge=ge.slice(re+1)}setTimeout(()=>X(ge)),ne.preventDefault()}})})})})})})});hB.displayName=ahe;var ihe="SelectItemAlignedPosition",mB=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,i=Ui(ko,n),o=qi(ko,n),[c,d]=v.useState(null),[f,h]=v.useState(null),p=ft(t,k=>h(k)),y=Vv(n),g=v.useRef(!1),j=v.useRef(!0),{viewport:b,selectedItem:x,selectedItemText:S,focusSelectedItem:N}=o,_=v.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&f&&b&&x&&S){const k=i.trigger.getBoundingClientRect(),R=f.getBoundingClientRect(),M=i.valueNode.getBoundingClientRect(),z=S.getBoundingClientRect();if(i.dir!=="rtl"){const Re=z.left-R.left,re=M.left-Re,De=k.left-re,Ae=k.width+De,We=Math.max(Ae,R.width),ye=window.innerWidth-Ia,Ee=Vd(re,[Ia,Math.max(Ia,ye-We)]);c.style.minWidth=Ae+"px",c.style.left=Ee+"px"}else{const Re=R.right-z.right,re=window.innerWidth-M.right-Re,De=window.innerWidth-k.right-re,Ae=k.width+De,We=Math.max(Ae,R.width),ye=window.innerWidth-Ia,Ee=Vd(re,[Ia,Math.max(Ia,ye-We)]);c.style.minWidth=Ae+"px",c.style.right=Ee+"px"}const B=y(),D=window.innerHeight-Ia*2,G=b.scrollHeight,U=window.getComputedStyle(f),W=parseInt(U.borderTopWidth,10),X=parseInt(U.paddingTop,10),J=parseInt(U.borderBottomWidth,10),T=parseInt(U.paddingBottom,10),L=W+X+G+T+J,Q=Math.min(x.offsetHeight*5,L),F=window.getComputedStyle(b),$=parseInt(F.paddingTop,10),Z=parseInt(F.paddingBottom,10),ae=k.top+k.height/2-Ia,V=D-ae,ie=x.offsetHeight/2,ne=x.offsetTop+ie,de=W+X+ne,oe=L-de;if(de<=ae){const Re=B.length>0&&x===B[B.length-1].ref.current;c.style.bottom="0px";const re=f.clientHeight-b.offsetTop-b.offsetHeight,De=Math.max(V,ie+(Re?Z:0)+re+J),Ae=de+De;c.style.height=Ae+"px"}else{const Re=B.length>0&&x===B[0].ref.current;c.style.top="0px";const De=Math.max(ae,W+b.offsetTop+(Re?$:0)+ie)+oe;c.style.height=De+"px",b.scrollTop=de-ae+b.offsetTop}c.style.margin=`${Ia}px 0`,c.style.minHeight=Q+"px",c.style.maxHeight=D+"px",r?.(),requestAnimationFrame(()=>g.current=!0)}},[y,i.trigger,i.valueNode,c,f,b,x,S,i.dir,r]);Hn(()=>_(),[_]);const[P,A]=v.useState();Hn(()=>{f&&A(window.getComputedStyle(f).zIndex)},[f]);const O=v.useCallback(k=>{k&&j.current===!0&&(_(),N?.(),j.current=!1)},[_,N]);return s.jsx(lhe,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:O,children:s.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P},children:s.jsx(Be.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});mB.displayName=ihe;var ohe="SelectPopperPosition",nS=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=Ia,...i}=e,o=Hv(n);return s.jsx(Im,{...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)"}})});nS.displayName=ohe;var[lhe,nC]=zc(ko,{}),rS="SelectViewport",vB=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,i=qi(rS,n),o=nC(rS,n),c=ft(t,i.onViewportChange),d=v.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),s.jsx(Wv.Slot,{scope:n,children:s.jsx(Be.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Pe(a.onScroll,f=>{const h=f.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:y}=o;if(y?.current&&p){const g=Math.abs(d.current-h.scrollTop);if(g>0){const j=window.innerHeight-Ia*2,b=parseFloat(p.style.minHeight),x=parseFloat(p.style.height),S=Math.max(b,x);if(S<j){const N=S+g,_=Math.min(j,N),P=N-_;p.style.height=_+"px",p.style.bottom==="0px"&&(h.scrollTop=P>0?P:0,p.style.justifyContent="flex-end")}}}d.current=h.scrollTop})})})]})});vB.displayName=rS;var gB="SelectGroup",[che,uhe]=zc(gB),dhe=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Vn();return s.jsx(che,{scope:n,id:a,children:s.jsx(Be.div,{role:"group","aria-labelledby":a,...r,ref:t})})});dhe.displayName=gB;var yB="SelectLabel",xB=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=uhe(yB,n);return s.jsx(Be.div,{id:a.id,...r,ref:t})});xB.displayName=yB;var ym="SelectItem",[fhe,bB]=zc(ym),wB=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:i,...o}=e,c=Ui(ym,n),d=qi(ym,n),f=c.value===r,[h,p]=v.useState(i??""),[y,g]=v.useState(!1),j=ft(t,N=>d.itemRefCallback?.(N,r,a)),b=Vn(),x=v.useRef("touch"),S=()=>{a||(c.onValueChange(r),c.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return s.jsx(fhe,{scope:n,value:r,disabled:a,textId:b,isSelected:f,onItemTextChange:v.useCallback(N=>{p(_=>_||(N?.textContent??"").trim())},[]),children:s.jsx(Wv.ItemSlot,{scope:n,value:r,disabled:a,textValue:h,children:s.jsx(Be.div,{role:"option","aria-labelledby":b,"data-highlighted":y?"":void 0,"aria-selected":f&&y,"data-state":f?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...o,ref:j,onFocus:Pe(o.onFocus,()=>g(!0)),onBlur:Pe(o.onBlur,()=>g(!1)),onClick:Pe(o.onClick,()=>{x.current!=="mouse"&&S()}),onPointerUp:Pe(o.onPointerUp,()=>{x.current==="mouse"&&S()}),onPointerDown:Pe(o.onPointerDown,N=>{x.current=N.pointerType}),onPointerMove:Pe(o.onPointerMove,N=>{x.current=N.pointerType,a?d.onItemLeave?.():x.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Pe(o.onPointerLeave,N=>{N.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Pe(o.onKeyDown,N=>{d.searchRef?.current!==""&&N.key===" "||(Qpe.includes(N.key)&&S(),N.key===" "&&N.preventDefault())})})})})});wB.displayName=ym;var qu="SelectItemText",jB=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...i}=e,o=Ui(qu,n),c=qi(qu,n),d=bB(qu,n),f=the(qu,n),[h,p]=v.useState(null),y=ft(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:x}=f;return Hn(()=>(b(j),()=>x(j)),[b,x,j]),s.jsxs(s.Fragment,{children:[s.jsx(Be.span,{id:d.textId,...i,ref:y}),d.isSelected&&o.valueNode&&!o.valueNodeHasChildren?wc.createPortal(i.children,o.valueNode):null]})});jB.displayName=qu;var SB="SelectItemIndicator",NB=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return bB(SB,n).isSelected?s.jsx(Be.span,{"aria-hidden":!0,...r,ref:t}):null});NB.displayName=SB;var aS="SelectScrollUpButton",CB=v.forwardRef((e,t)=>{const n=qi(aS,e.__scopeSelect),r=nC(aS,e.__scopeSelect),[a,i]=v.useState(!1),o=ft(t,r.onScrollButtonChange);return Hn(()=>{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(AB,{...e,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});CB.displayName=aS;var sS="SelectScrollDownButton",_B=v.forwardRef((e,t)=>{const n=qi(sS,e.__scopeSelect),r=nC(sS,e.__scopeSelect),[a,i]=v.useState(!1),o=ft(t,r.onScrollButtonChange);return Hn(()=>{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(AB,{...e,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});_B.displayName=sS;var AB=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,i=qi("SelectScrollButton",n),o=v.useRef(null),c=Vv(n),d=v.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return v.useEffect(()=>()=>d(),[d]),Hn(()=>{c().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),s.jsx(Be.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:Pe(a.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Pe(a.onPointerMove,()=>{i.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Pe(a.onPointerLeave,()=>{d()})})}),phe="SelectSeparator",EB=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(Be.div,{"aria-hidden":!0,...r,ref:t})});EB.displayName=phe;var iS="SelectArrow",hhe=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Hv(n),i=Ui(iS,n),o=qi(iS,n);return i.open&&o.position==="popper"?s.jsx(Mm,{...a,...r,ref:t}):null});hhe.displayName=iS;var mhe="SelectBubbleInput",PB=v.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=v.useRef(null),i=ft(r,a),o=Bv(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(Be.select,{...n,style:{...OM,...n.style},ref:i,defaultValue:t})});PB.displayName=mhe;function OB(e){return e===""||e===void 0}function kB(e){const t=En(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 RB(e,t,n){const a=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=vhe(e,Math.max(i,0));a.length===1&&(o=o.filter(f=>f!==n));const d=o.find(f=>f.textValue.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function vhe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ghe=sB,TB=oB,yhe=cB,xhe=uB,bhe=dB,IB=fB,whe=vB,MB=xB,$B=wB,jhe=jB,She=NB,DB=CB,LB=_B,FB=EB;const sn=ghe,on=yhe,Qt=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(TB,{ref:r,className:je("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,s.jsx(xhe,{asChild:!0,children:s.jsx(Wt,{className:"h-4 w-4 opacity-50"})})]}));Qt.displayName=TB.displayName;const BB=v.forwardRef(({className:e,...t},n)=>s.jsx(DB,{ref:n,className:je("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(is,{className:"h-4 w-4"})}));BB.displayName=DB.displayName;const zB=v.forwardRef(({className:e,...t},n)=>s.jsx(LB,{ref:n,className:je("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Wt,{className:"h-4 w-4"})}));zB.displayName=LB.displayName;const Jt=v.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>s.jsx(bhe,{children:s.jsxs(IB,{ref:a,className:je("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[s.jsx(BB,{}),s.jsx(whe,{className:je("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(zB,{})]})}));Jt.displayName=IB.displayName;const Nhe=v.forwardRef(({className:e,...t},n)=>s.jsx(MB,{ref:n,className:je("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Nhe.displayName=MB.displayName;const st=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs($B,{ref:r,className:je("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(She,{children:s.jsx(ql,{className:"h-4 w-4"})})}),s.jsx(jhe,{children:t})]}));st.displayName=$B.displayName;const Che=v.forwardRef(({className:e,...t},n)=>s.jsx(FB,{ref:n,className:je("-mx-1 my-1 h-px bg-muted",e),...t}));Che.displayName=FB.displayName;var Kv="Collapsible",[_he]=ir(Kv),[Ahe,rC]=_he(Kv),UB=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:i,onOpenChange:o,...c}=e,[d,f]=na({prop:r,defaultProp:a??!1,onChange:o,caller:Kv});return s.jsx(Ahe,{scope:n,disabled:i,contentId:Vn(),open:d,onOpenToggle:v.useCallback(()=>f(h=>!h),[f]),children:s.jsx(Be.div,{"data-state":sC(d),"data-disabled":i?"":void 0,...c,ref:t})})});UB.displayName=Kv;var qB="CollapsibleTrigger",WB=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,a=rC(qB,n);return s.jsx(Be.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":sC(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:t,onClick:Pe(e.onClick,a.onOpenToggle)})});WB.displayName=qB;var aC="CollapsibleContent",VB=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=rC(aC,e.__scopeCollapsible);return s.jsx(Kn,{present:n||a.open,children:({present:i})=>s.jsx(Ehe,{...r,ref:t,present:i})})});VB.displayName=aC;var Ehe=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:a,...i}=e,o=rC(aC,n),[c,d]=v.useState(r),f=v.useRef(null),h=ft(t,f),p=v.useRef(0),y=p.current,g=v.useRef(0),j=g.current,b=o.open||c,x=v.useRef(b),S=v.useRef(void 0);return v.useEffect(()=>{const N=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(N)},[]),Hn(()=>{const N=f.current;if(N){S.current=S.current||{transitionDuration:N.style.transitionDuration,animationName:N.style.animationName},N.style.transitionDuration="0s",N.style.animationName="none";const _=N.getBoundingClientRect();p.current=_.height,g.current=_.width,x.current||(N.style.transitionDuration=S.current.transitionDuration,N.style.animationName=S.current.animationName),d(r)}},[o.open,r]),s.jsx(Be.div,{"data-state":sC(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!b,...i,ref:h,style:{"--radix-collapsible-content-height":y?`${y}px`:void 0,"--radix-collapsible-content-width":j?`${j}px`:void 0,...e.style},children:b&&a})});function sC(e){return e?"open":"closed"}var Phe=UB;const Ci=Phe,Rs=WB,_i=VB,Ohe=Ym,khe=Xm,HB=v.forwardRef(({className:e,...t},n)=>s.jsx(Pc,{ref:n,className:je("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));HB.displayName=Pc.displayName;const KB=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(khe,{children:[s.jsx(HB,{}),s.jsxs(Oc,{ref:r,className:je("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,s.jsxs(Qm,{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(Us,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));KB.displayName=Oc.displayName;const GB=({className:e,...t})=>s.jsx("div",{className:je("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});GB.displayName="DialogHeader";const YB=v.forwardRef(({className:e,...t},n)=>s.jsx(Zd,{ref:n,className:je("text-lg font-semibold leading-none tracking-tight",e),...t}));YB.displayName=Zd.displayName;const XB=v.forwardRef(({className:e,...t},n)=>s.jsx(ef,{ref:n,className:je("text-sm text-muted-foreground",e),...t}));XB.displayName=ef.displayName;function Rhe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var iC="ScrollArea",[QB]=ir(iC),[The,Na]=QB(iC),JB=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,y]=v.useState(null),[g,j]=v.useState(null),[b,x]=v.useState(null),[S,N]=v.useState(0),[_,P]=v.useState(0),[A,O]=v.useState(!1),[k,R]=v.useState(!1),M=ft(t,B=>d(B)),z=Lc(a);return s.jsx(The,{scope:n,type:r,dir:z,scrollHideDelay:i,scrollArea:c,viewport:f,onViewportChange:h,content:p,onContentChange:y,scrollbarX:g,onScrollbarXChange:j,scrollbarXEnabled:A,onScrollbarXEnabledChange:O,scrollbarY:b,onScrollbarYChange:x,scrollbarYEnabled:k,onScrollbarYEnabledChange:R,onCornerWidthChange:N,onCornerHeightChange:P,children:s.jsx(Be.div,{dir:z,...o,ref:M,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});JB.displayName=iC;var ZB="ScrollAreaViewport",e8=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...i}=e,o=Na(ZB,n),c=v.useRef(null),d=ft(t,c,o.onViewportChange);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),s.jsx(Be.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})})]})});e8.displayName=ZB;var xs="ScrollAreaScrollbar",oC=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Na(xs,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(Ihe,{...r,ref:t,forceMount:n}):a.type==="scroll"?s.jsx(Mhe,{...r,ref:t,forceMount:n}):a.type==="auto"?s.jsx(t8,{...r,ref:t,forceMount:n}):a.type==="always"?s.jsx(lC,{...r,ref:t}):null});oC.displayName=xs;var Ihe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Na(xs,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(Kn,{present:n||i,children:s.jsx(t8,{"data-state":i?"visible":"hidden",...r,ref:t})})}),Mhe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Na(xs,e.__scopeScrollArea),i=e.orientation==="horizontal",o=Yv(()=>d("SCROLL_END"),100),[c,d]=Rhe("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 y=()=>{const g=f[h];p!==g&&(d("SCROLL"),o()),p=g};return f.addEventListener("scroll",y),()=>f.removeEventListener("scroll",y)}},[a.viewport,i,d,o]),s.jsx(Kn,{present:n||c!=="hidden",children:s.jsx(lC,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Pe(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Pe(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),t8=v.forwardRef((e,t)=>{const n=Na(xs,e.__scopeScrollArea),{forceMount:r,...a}=e,[i,o]=v.useState(!1),c=e.orientation==="horizontal",d=Yv(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;o(c?f:h)}},10);return xc(n.viewport,d),xc(n.content,d),s.jsx(Kn,{present:r||i,children:s.jsx(lC,{"data-state":i?"visible":"hidden",...a,ref:t})})}),lC=v.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,a=Na(xs,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=i8(c.viewport,c.content),h={...r,sizes:c,onSizesChange:d,hasThumb:f>0&&f<1,onThumbChange:y=>i.current=y,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:y=>o.current=y};function p(y,g){return zhe(y,o.current,c,g)}return n==="horizontal"?s.jsx($he,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const y=a.viewport.scrollLeft,g=QI(y,c,a.dir);i.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:y=>{a.viewport&&(a.viewport.scrollLeft=y)},onDragScroll:y=>{a.viewport&&(a.viewport.scrollLeft=p(y,a.dir))}}):n==="vertical"?s.jsx(Dhe,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const y=a.viewport.scrollTop,g=QI(y,c);i.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:y=>{a.viewport&&(a.viewport.scrollTop=y)},onDragScroll:y=>{a.viewport&&(a.viewport.scrollTop=p(y))}}):null}),$he=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=Na(xs,e.__scopeScrollArea),[o,c]=v.useState(),d=v.useRef(null),f=ft(t,d,i.onScrollbarXChange);return v.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),s.jsx(r8,{"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":Gv(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,p)=>{if(i.viewport){const y=i.viewport.scrollLeft+h.deltaX;e.onWheelScroll(y),l8(y,p)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&o&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:bm(o.paddingLeft),paddingEnd:bm(o.paddingRight)}})}})}),Dhe=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=Na(xs,e.__scopeScrollArea),[o,c]=v.useState(),d=v.useRef(null),f=ft(t,d,i.onScrollbarYChange);return v.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),s.jsx(r8,{"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":Gv(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,p)=>{if(i.viewport){const y=i.viewport.scrollTop+h.deltaY;e.onWheelScroll(y),l8(y,p)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&o&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:bm(o.paddingTop),paddingEnd:bm(o.paddingBottom)}})}})}),[Lhe,n8]=QB(xs),r8=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,...y}=e,g=Na(xs,n),[j,b]=v.useState(null),x=ft(t,M=>b(M)),S=v.useRef(null),N=v.useRef(""),_=g.viewport,P=r.content-r.viewport,A=En(h),O=En(d),k=Yv(p,10);function R(M){if(S.current){const z=M.clientX-S.current.left,B=M.clientY-S.current.top;f({x:z,y:B})}}return v.useEffect(()=>{const M=z=>{const B=z.target;j?.contains(B)&&A(z,P)};return document.addEventListener("wheel",M,{passive:!1}),()=>document.removeEventListener("wheel",M,{passive:!1})},[_,j,P,A]),v.useEffect(O,[r,O]),xc(j,k),xc(g.content,k),s.jsx(Lhe,{scope:n,scrollbar:j,hasThumb:a,onThumbChange:En(i),onThumbPointerUp:En(o),onThumbPositionChange:O,onThumbPointerDown:En(c),children:s.jsx(Be.div,{...y,ref:x,style:{position:"absolute",...y.style},onPointerDown:Pe(e.onPointerDown,M=>{M.button===0&&(M.target.setPointerCapture(M.pointerId),S.current=j.getBoundingClientRect(),N.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),R(M))}),onPointerMove:Pe(e.onPointerMove,R),onPointerUp:Pe(e.onPointerUp,M=>{const z=M.target;z.hasPointerCapture(M.pointerId)&&z.releasePointerCapture(M.pointerId),document.body.style.webkitUserSelect=N.current,g.viewport&&(g.viewport.style.scrollBehavior=""),S.current=null})})})}),xm="ScrollAreaThumb",a8=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=n8(xm,e.__scopeScrollArea);return s.jsx(Kn,{present:n||a.hasThumb,children:s.jsx(Fhe,{ref:t,...r})})}),Fhe=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,i=Na(xm,n),o=n8(xm,n),{onThumbPositionChange:c}=o,d=ft(t,p=>o.onThumbChange(p)),f=v.useRef(void 0),h=Yv(()=>{f.current&&(f.current(),f.current=void 0)},100);return v.useEffect(()=>{const p=i.viewport;if(p){const y=()=>{if(h(),!f.current){const g=Uhe(p,c);f.current=g,c()}};return c(),p.addEventListener("scroll",y),()=>p.removeEventListener("scroll",y)}},[i.viewport,h,c]),s.jsx(Be.div,{"data-state":o.hasThumb?"visible":"hidden",...a,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Pe(e.onPointerDownCapture,p=>{const g=p.target.getBoundingClientRect(),j=p.clientX-g.left,b=p.clientY-g.top;o.onThumbPointerDown({x:j,y:b})}),onPointerUp:Pe(e.onPointerUp,o.onThumbPointerUp)})});a8.displayName=xm;var cC="ScrollAreaCorner",s8=v.forwardRef((e,t)=>{const n=Na(cC,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx(Bhe,{...e,ref:t}):null});s8.displayName=cC;var Bhe=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=Na(cC,n),[i,o]=v.useState(0),[c,d]=v.useState(0),f=!!(i&&c);return xc(a.scrollbarX,()=>{const h=a.scrollbarX?.offsetHeight||0;a.onCornerHeightChange(h),d(h)}),xc(a.scrollbarY,()=>{const h=a.scrollbarY?.offsetWidth||0;a.onCornerWidthChange(h),o(h)}),f?s.jsx(Be.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 bm(e){return e?parseInt(e,10):0}function i8(e,t){const n=e/t;return isNaN(n)?0:n}function Gv(e){const t=i8(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function zhe(e,t,n,r="ltr"){const a=Gv(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 o8([d,f],p)(e)}function QI(e,t,n="ltr"){const r=Gv(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=Vd(e,d);return o8([0,o],[0,c])(f)}function o8(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 l8(e,t){return e>0&&e<t}var Uhe=(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 Yv(e,t){const n=En(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 xc(e,t){const n=En(t);Hn(()=>{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 c8=JB,qhe=e8,Whe=s8;const wm=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(c8,{ref:r,className:je("relative overflow-hidden",e),...n,children:[s.jsx(qhe,{className:"h-full w-full rounded-[inherit]",children:t}),s.jsx(u8,{}),s.jsx(Whe,{})]}));wm.displayName=c8.displayName;const u8=v.forwardRef(({className:e,orientation:t="vertical",...n},r)=>s.jsx(oC,{ref:r,orientation:t,className:je("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:s.jsx(a8,{className:"relative flex-1 rounded-full bg-border"})}));u8.displayName=oC.displayName;const Vhe=[{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 Hhe({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}=Pn(),[y,g]=v.useState(null),[j,b]=v.useState(null),[x,S]=v.useState(""),[N,_]=v.useState(!1),[P,A]=v.useState(new Set),O=v.useRef(null),k=v.useRef(null),R=v.useRef(null),[M,z]=v.useState(!1),B=v.useRef(!1),D=d||i[0]?.id||"";v.useEffect(()=>{if(!e||!D||y)return;let V=!1;return _(!0),p.createScenarioAssistantSession({configId:n,configPath:r,scenarioId:a.id,selectedAssistantAgentName:D,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(ie=>({name:ie.name||ie.id,url:ie.url})),availableAgents:i.map(ie=>({name:ie.name||ie.id,provider:ie.provider,model:ie.model}))}}).then(ie=>{V||(g(ie.sessionId),b(ie.session))}).catch(ie=>{V||Oe({title:"Could not start Scenario Assistant",description:ie instanceof Error?ie.message:String(ie),variant:"destructive"})}).finally(()=>{V||_(!1)}),()=>{V=!0}},[e,p,y,n,r,a,c,i,o,D]);const G=()=>{g(null),b(null),S(""),A(new Set),R.current=null},U=V=>{G(),p.closeScenarioAssistantSession(V).catch(()=>{})};v.useEffect(()=>{e||y&&(B.current||M||U(y))},[e,y,p,M]),v.useEffect(()=>()=>{y&&p.closeScenarioAssistantSession(y).catch(()=>{})},[y,p]),v.useEffect(()=>{if(!e)return;M&&z(!1),B.current&&(B.current=!1);const V=window.setTimeout(()=>{O.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(V)},[e,N,j?.messages.length,j?.pendingToolCalls.length,j?.warnings.length]),v.useEffect(()=>{const V=k.current;if(!V)return;V.style.height="0px";const ie=Math.min(V.scrollHeight,160);V.style.height=`${Math.max(40,ie)}px`},[x,e]);const W=i.length>0&&a.serverIds.length>0&&!!D,X=async V=>{if(!y)return;const ie=V.trim();if(!ie)return;const ne=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,de={id:ne,role:"user",text:ie,createdAt:new Date().toISOString()};b(oe=>oe&&{...oe,messages:[...oe.messages,de]}),S(""),_(!0);try{const oe=await p.sendScenarioAssistantMessage(y,ie);b(oe.session)}catch(oe){b(ge=>ge&&{...ge,messages:ge.messages.filter(Re=>Re.id!==ne)}),S(ge=>ge.trim()?ge:ie),Oe({title:"Scenario Assistant error",description:oe instanceof Error?oe.message:String(oe),variant:"destructive"})}finally{_(!1)}},J=V=>{S(V),requestAnimationFrame(()=>k.current?.focus())};v.useEffect(()=>{if(!e||!y||!j||!W||N)return;const V=String(f??"").trim();V&&R.current!==V&&(R.current=V,X(V))},[e,y,j,W,N,f]);const T=async V=>{if(y){_(!0);try{const ie=await p.approveScenarioAssistantToolCall(y,V);b(ie.session)}catch(ie){Oe({title:"Tool call failed",description:ie instanceof Error?ie.message:String(ie),variant:"destructive"})}finally{_(!1)}}},L=async V=>{if(y){_(!0);try{const ie=await p.denyScenarioAssistantToolCall(y,V);b(ie.session)}catch(ie){Oe({title:"Could not deny tool call",description:ie instanceof Error?ie.message:String(ie),variant:"destructive"})}finally{_(!1)}}},Q=async()=>{if(y){_(!0);try{const V=await p.approveAllScenarioAssistantToolCalls(y);b(V.session)}catch(V){Oe({title:"Could not approve all tool calls",description:V instanceof Error?V.message:String(V),variant:"destructive"})}finally{_(!1)}}},F=(V,ie,ne)=>{if(!ie)return;if(ne==="prompt"&&ie.prompt&&h({prompt:ie.prompt.replacement}),ne==="evalRules"&&ie.evalRules&&h({evalRules:ie.evalRules.replacement}),ne==="extractRules"&&ie.extractRules&&h({extractRules:ie.extractRules.replacement}),ne==="snapshotEval"&&ie.snapshotEval&&h({snapshotEval:{enabled:ie.snapshotEval.patch.enabled,baselineSnapshotId:ie.snapshotEval.patch.baselineSnapshotId}}),V){const oe=`${V}:${ne}`;A(ge=>new Set([...ge,oe]))}Oe({title:"Applied suggestion",description:`Updated ${{prompt:"Prompt",evalRules:"Checks",extractRules:"Value Capture Rules",snapshotEval:"Snapshot Settings"}[ne]}`})},$=V=>{V||(z(!1),B.current=!1),t(V)},Z=()=>{B.current=!0,z(!0),t(!1)},ae=()=>{B.current=!1,z(!1),y&&U(y)};return s.jsxs(s.Fragment,{children:[!e&&y&&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(se,{type:"button",size:"sm",variant:"outline",onClick:()=>t(!0),children:[s.jsx(fa,{className:"mr-1.5 h-3.5 w-3.5"}),"Resume"]}),s.jsx(se,{type:"button",size:"sm",variant:"ghost",className:"h-8 px-2 text-muted-foreground",onClick:ae,"aria-label":"Discard assistant session",title:"Discard assistant session",children:s.jsx(Us,{className:"h-4 w-4"})})]})]}),s.jsx(Ohe,{open:e,onOpenChange:$,children:s.jsxs(KB,{className:"max-w-6xl h-[85vh] flex flex-col",children:[y&&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:Z,"aria-label":"Minimize assistant",title:"Minimize assistant",children:[s.jsx(TU,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Minimize"})]}),s.jsx(GB,{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(YB,{className:"flex items-center gap-2",children:[s.jsx(fa,{className:"h-4 w-4"}),"Scenario Assistant"]}),s.jsx(XB,{children:"LLM-guided scenario authoring with MCP tool introspection and per-tool-call approval."})]})})}),W?s.jsxs("div",{className:"min-h-0 flex flex-1 flex-col gap-3",children:[s.jsx("div",{className:"grid gap-3 sm:grid-cols-1",children:s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{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(Is,{className:"h-3.5 w-3.5"}),j?`Loaded ${j.toolsLoaded} tools`:"Preparing..."]})]})}),s.jsx(wm,{className:"min-h-0 flex-1 rounded-md border p-3",children:s.jsxs("div",{className:"space-y-3",children:[j?.warnings?.map((V,ie)=>s.jsx("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900",children:V},`${V}-${ie}`)),j?.messages.map(V=>s.jsxs(v.Fragment,{children:[(()=>{const ie=V.pendingToolCallIds??(V.pendingToolCallId?[V.pendingToolCallId]:[]),ne=ie.map(re=>(j?.pendingToolCalls??[]).find(De=>De.id===re)).filter(re=>!!re),de=ie.map(re=>j.pendingToolCalls.find(De=>De.id===re)??j.pendingToolCalls.find(De=>De.id===re)).filter(Boolean);if(!(V.role==="assistant"&&ie.length>0))return s.jsx("div",{className:"space-y-2",children:s.jsx(Khe,{message:V})});const ge=ne.length,Re=de.length-ge;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(ha,{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(oS,{text:V.text,variant:"assistant"})}),de.length>1&&ge>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:[Re," of ",de.length," tool calls resolved"]}),s.jsxs(se,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{Q()},children:["Approve All (",ge,")"]})]}),de.map(re=>{const De=re.status==="pending",Ae=re.tool??re.publicToolName??"unknown_tool";return s.jsxs("details",{open:De,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(Is,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:`Tool call ${Ae}`}),s.jsx("span",{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${De?"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:De?"Needs approval":re.status==="error"?"Error":re.status==="denied"?"Denied":"Approved"})]})}),s.jsx(Wt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),s.jsxs("div",{className:"space-y-2 border-t border-border/50 px-3 py-2",children:[s.jsx("pre",{className:"max-h-40 w-full max-w-full overflow-x-auto overflow-y-auto whitespace-pre rounded border bg-muted/50 p-2 text-xs",children:s.jsx("code",{children:JSON.stringify(re.arguments??{},null,2)})}),De&&s.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{L(re.id)},children:"Deny"}),s.jsx(se,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{T(re.id)},children:"Approve"})]})]})]},re.id)})]})]})})(),V.suggestions&&s.jsxs("div",{className:"ml-0 space-y-3 rounded-md border border-dashed bg-muted/10 p-3",children:[s.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground",children:[s.jsx(fa,{className:"h-3.5 w-3.5"}),"Structured Suggestions"]}),V.suggestions.prompt&&s.jsx(Gp,{title:"Prompt",rationale:V.suggestions.prompt.rationale,preview:V.suggestions.prompt.replacement,applied:P.has(`${V.id}:prompt`),onApply:()=>F(V.id,V.suggestions,"prompt")}),V.suggestions.evalRules&&s.jsx(Gp,{title:"Checks",rationale:V.suggestions.evalRules.rationale,preview:JSON.stringify(V.suggestions.evalRules.replacement,null,2),applied:P.has(`${V.id}:evalRules`),onApply:()=>F(V.id,V.suggestions,"evalRules")}),V.suggestions.extractRules&&s.jsx(Gp,{title:"Value Capture Rules",rationale:V.suggestions.extractRules.rationale,preview:JSON.stringify(V.suggestions.extractRules.replacement,null,2),applied:P.has(`${V.id}:extractRules`),onApply:()=>F(V.id,V.suggestions,"extractRules")}),V.suggestions.snapshotEval&&s.jsx(Gp,{title:"Snapshot Settings",rationale:V.suggestions.snapshotEval.rationale,preview:JSON.stringify(V.suggestions.snapshotEval.patch,null,2),applied:P.has(`${V.id}:snapshotEval`),onApply:()=>F(V.id,V.suggestions,"snapshotEval")}),(()=>{const ie=V.suggestions?.notes,ne=Array.isArray(ie)?ie:typeof ie=="string"?[ie]:[];return ne.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:ne.map((de,oe)=>s.jsx("li",{children:de},`${V.id}-note-${oe}`))})]})})()]})]},V.id)),(j?.pendingToolCalls??[]).filter(V=>!(j?.messages??[]).some(ie=>ie.pendingToolCallId===V.id||ie.pendingToolCallIds?.includes(V.id))).map(V=>s.jsxs("details",{open:!0,className:"group min-w-0 rounded-md border bg-background",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-2 p-3",children:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Is,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),s.jsx("p",{className:"min-w-0 truncate font-mono text-xs font-semibold",children:V.publicToolName||V.tool}),s.jsx("span",{className:"shrink-0 rounded bg-amber-100 px-1.5 py-0.5 text-[10px] font-semibold text-amber-900",children:"Needs approval"})]})}),s.jsx(Wt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),s.jsxs("div",{className:"border-t px-3 pb-3 pt-2",children:[s.jsx("pre",{className:"max-h-40 w-full max-w-full overflow-x-auto overflow-y-auto whitespace-pre rounded border bg-muted/50 p-2 text-xs",children:s.jsx("code",{children:JSON.stringify(V.arguments??{},null,2)})}),s.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{L(V.id)},children:"Deny"}),s.jsx(se,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{T(V.id)},children:"Approve"})]})]})]},V.id)),!j&&N&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(sr,{className:"h-4 w-4 animate-spin"}),"Starting assistant session..."]}),j&&N&&s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700",children:s.jsx(ha,{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(sr,{className:"h-4 w-4 animate-spin"}),"Thinking..."]})]}),s.jsx("div",{ref:O})]})}),s.jsxs("div",{className:"rounded-xl border bg-background p-2 shadow-sm",children:[s.jsx(Gs,{ref:k,value:x,onChange:V=>S(V.target.value),placeholder:"Get assistance with creating or refining this scenario ...",disabled:!y||N,rows:1,className:"min-h-10 max-h-40 resize-none border-0 bg-transparent px-2 py-1 text-sm shadow-none focus-visible:ring-0 focus-visible:ring-offset-0",onKeyDown:V=>{V.key==="Enter"&&!V.shiftKey&&(V.preventDefault(),X(x))}}),s.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 px-1 pt-1",children:[s.jsxs(Fc,{children:[s.jsx(Bc,{asChild:!0,children:s.jsxs(se,{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:!y||N,children:[s.jsx(us,{className:"h-3 w-3"}),"Snippets",s.jsx(Wt,{className:"h-3 w-3"})]})}),s.jsxs(Wo,{align:"start",className:"w-[320px]",children:[s.jsx(JN,{children:"Scenario Assistant Snippets"}),s.jsx(ZN,{}),Vhe.map(V=>s.jsx(pr,{className:"items-start whitespace-normal px-2 py-2",onSelect:()=>J(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(se,{type:"button",size:"icon",className:"h-8 w-8 rounded-full",onClick:()=>{X(x)},disabled:!y||N||!x.trim(),"aria-label":"Send message",title:"Send message",children:N?s.jsx(sr,{className:"h-4 w-4 animate-spin"}):s.jsxs(s.Fragment,{children:[s.jsx(o$,{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 Gp({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(se,{type:"button",size:"sm",variant:r?"secondary":"outline",onClick:a,disabled:r,children:r?s.jsxs(s.Fragment,{children:[s.jsx(Ol,{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 Khe({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(Is,{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(i$,{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(oS,{text:e.text,variant:"assistant"})})]});const r=n==="user",a=r?NS:ha,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(oS,{text:e.text,variant:"assistant"})]}),i&&s.jsx(se,{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(Ri,{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 oS({text:e,variant:t="assistant"}){const n=Ghe(e);return s.jsx("div",{className:je("space-y-2",t==="system"&&"text-xs"),children:n.map((r,a)=>s.jsx(v.Fragment,{children:Yhe(r,a,t)},`md-${a}`))})}function Ghe(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 y=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:y,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(JI(t,r)){const y=ZI(t[r]);r+=2;const g=[];for(;r<t.length&&t[r].includes("|")&&!a(t[r]);)g.push(ZI(t[r])),r+=1;n.push({type:"table",headers:y,rows:g});continue}const f=c.match(/^\d+\.\s+/),h=c.match(/^[-*+]\s+/);if(f||h){const y=!!f,g=[];for(;r<t.length;){const j=t[r].trim();if(y?/^\d+\.\s+/.test(j):/^[-*+]\s+/.test(j)){g.push(j.replace(y?/^\d+\.\s+/:/^[-*+]\s+/,"")),r+=1;continue}a(t[r])&&(r+=1);break}n.push({type:"list",ordered:y,items:g});continue}const p=[o];for(r+=1;r<t.length;){const y=t[r],g=y.trim();if(a(y)||i(y)||/^---+$/.test(g)||/^#{1,4}\s+/.test(g)||JI(t,r)||/^\d+\.\s+/.test(g)||/^[-*+]\s+/.test(g))break;p.push(y),r+=1}n.push({type:"paragraph",text:p.join(`
124
- `)})}return n}function JI(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 ZI(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>t.trim())}function Yhe(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:$u(e.text,`${t}-h`)})}if(e.type==="paragraph")return s.jsx("p",{className:je("whitespace-pre-wrap leading-relaxed",n==="system"&&"leading-normal"),children:$u(e.text,`${t}-p`)});if(e.type==="code")return s.jsxs("div",{className:"rounded-md border bg-muted/70",children:[e.lang&&s.jsx("div",{className:"border-b px-2 py-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:e.lang}),s.jsx("pre",{className:"max-h-72 overflow-auto p-2 text-xs",children:s.jsx("code",{children:e.code})})]});if(e.type==="list"){const r=e.ordered?"ol":"ul";return s.jsx(r,{className:je("space-y-1 pl-5",e.ordered?"list-decimal":"list-disc"),children:e.items.map((a,i)=>s.jsx("li",{className:"leading-relaxed",children:$u(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:$u(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:$u(i,`${t}-tdc-${a}-${o}`)},`${t}-td-${a}-${o}`))},`${t}-row-${a}`))})]})}):null}function $u(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 Xhe="mcplab.feature.";function vf(e,t=!1){if(typeof window>"u")return t;try{const n=window.localStorage.getItem(`${Xhe}${e}`);return n==null?t:n==="1"||n==="true"}catch{return t}}const Qhe=()=>({id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]});function lS({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:y=!p,allowStructureEdits:g=!p}){const j=(N,_)=>{const P=e.map((A,O)=>O===N?{...A,..._}:A);h(P)},b=N=>h(e.filter((_,P)=>P!==N)),x=()=>h([...e,Qhe()]),S=(N,_)=>{const P=N+_;if(P<0||P>=e.length)return;const A=[...e],[O]=A.splice(N,1);A.splice(P,0,O),h(A)};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"}),y&&g&&s.jsxs(se,{type:"button",variant:"outline",size:"sm",onClick:x,children:[s.jsx(us,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Scenario"]})]}),e.map((N,_)=>s.jsx(Jhe,{scenario:N,scenarioOrigin:t?.[_],index:_,total:e.length,agents:n,servers:r,configId:a,configPath:i,defaultAssistantAgentName:o,assistantInitialPrompt:c?.[N.id],assistantAutoOpenNonce:d?.[N.id],snapshotEval:f,onUpdate:P=>j(_,P),onMoveUp:()=>S(_,-1),onMoveDown:()=>S(_,1),onRemove:()=>b(_),readOnly:p,allowStructureEdits:g},N.id)),e.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No scenarios configured. Add one to get started."})]})}function Jhe({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:y,onMoveUp:g,onMoveDown:j,onRemove:b,readOnly:x,allowStructureEdits:S}){const{source:N}=Pn(),_=vf("snapshots",!1),[P,A]=v.useState("required_tool"),[O,k]=v.useState(""),[R,M]=v.useState(""),[z,B]=v.useState(null),[D,G]=v.useState(!1),[U,W]=v.useState(null),[X,J]=v.useState(""),[T,L]=v.useState(""),[Q,F]=v.useState(!1),[$,Z]=v.useState(!x),ae=()=>{O.trim()&&(y({evalRules:[...e.evalRules,{type:P,value:O.trim()}]}),k(""),M(""))},V=pe=>{y({evalRules:e.evalRules.filter((we,Se)=>Se!==pe)})},ie=()=>{!X.trim()||!T.trim()||(y({extractRules:[...e.extractRules,{name:X.trim(),pattern:T.trim()}]}),J(""),L(""))},ne=pe=>{y({extractRules:e.extractRules.filter((we,Se)=>Se!==pe)})},de=pe=>{const we=e.serverIds.includes(pe)?e.serverIds.filter(Se=>Se!==pe):[...e.serverIds,pe];y({serverIds:we})},oe={required_tool:"Required",forbidden_tool:"Forbidden",response_contains:"Contains",response_not_contains:"Not Contains"},ge={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"},Re=P==="required_tool"||P==="forbidden_tool",re=e.serverIds.filter(pe=>i.some(we=>we.id===pe)),De=re.length>0,Ae=e.snapshotEval?.baselineSnapshotId!==void 0,[We,ye]=v.useState(""),[Ee,le]=v.useState(0);v.useEffect(()=>{const pe=(f??"").trim();pe&&We!==pe&&(F(!0),ye(pe))},[f,We]),v.useEffect(()=>{h&&h!==Ee&&(F(!0),le(h))},[h,Ee]),v.useEffect(()=>{B(null),W(null),M("")},[e.serverIds.join("|")]),v.useEffect(()=>{M("")},[P]);const _e=async()=>{if(!(!De||x)){G(!0),W(null);try{const pe=new Set;for(const we of re){const Se=await N.discoverToolsForAnalysis({serverNames:[we]});for(const Ve of Se.servers)for(const Ot of Ve.tools)pe.add(Ot.name)}B(Array.from(pe).sort((we,Se)=>we.localeCompare(Se)))}catch(pe){W(pe instanceof Error?pe.message:"Failed to load tools")}finally{G(!1)}}};return s.jsx(Ci,{open:$,onOpenChange:Z,children:s.jsxs(Ue,{className:x?"rounded-md border shadow-none":"border-dashed",children:[s.jsxs(Nt,{className:x?"px-3 py-3 flex-row items-center justify-between space-y-0":"pb-3 flex-row items-center justify-between space-y-0",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[!x&&s.jsx(Rs,{asChild:!0,children:s.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",children:s.jsx(Wt,{className:`h-3.5 w-3.5 transition-transform ${$?"rotate-0":"-rotate-90"}`})})}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[n+1,"."]}),s.jsx(Ct,{className:"truncate text-sm font-medium",children:e.name||`Scenario ${n+1}`})]}),x?s.jsxs("div",{className:"flex items-center gap-2",children:[t&&s.jsx(Je,{variant:t==="inline"?"secondary":"outline",children:t==="referenced"?"Referenced":"Inline"}),s.jsx(Rs,{asChild:!0,children:s.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8","aria-label":$?"Collapse scenario details":"Expand scenario details",children:s.jsx(Wt,{className:`h-4 w-4 transition-transform ${$?"rotate-180":""}`})})})]}):S&&s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>F(!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(fa,{className:"h-3.5 w-3.5"}),"Ask Assistant"]}),s.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:g,disabled:n===0,"aria-label":"Move scenario up",children:s.jsx(is,{className:"h-3.5 w-3.5"})}),s.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:j,disabled:n===r-1,"aria-label":"Move scenario down",children:s.jsx(Wt,{className:"h-3.5 w-3.5"})}),s.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:b,children:s.jsx(ba,{className:"h-3.5 w-3.5 text-destructive"})})]})]}),s.jsx(_i,{children:s.jsxs(qe,{className:"space-y-3",children:[s.jsx(Hhe,{open:Q,onOpenChange:F,configId:o,configPath:c,scenario:e,agents:a,servers:i,snapshotEval:p,defaultAssistantAgentName:d,initialUserMessage:f,onApplyPatch:pe=>y({...pe.prompt!==void 0?{prompt:pe.prompt}:{},...pe.evalRules!==void 0?{evalRules:pe.evalRules}:{},...pe.extractRules!==void 0?{extractRules:pe.extractRules}:{},...pe.snapshotEval!==void 0?{snapshotEval:{...e.snapshotEval??{},...pe.snapshotEval}}:{}})}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Name"}),s.jsx(mt,{value:e.name,onChange:pe=>y({name:pe.target.value}),disabled:x,placeholder:"e.g. List directory"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Servers"}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[i.map(pe=>s.jsx(Je,{variant:e.serverIds.includes(pe.id)?"default":"outline",className:`cursor-pointer text-xs ${e.serverIds.includes(pe.id)?"":"opacity-50"}`,onClick:()=>!x&&de(pe.id),children:pe.name||pe.id},pe.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(Nt,{className:"pb-2",children:[s.jsx(Ct,{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(Gs,{value:e.prompt,onChange:pe=>y({prompt:pe.target.value}),disabled:x,placeholder:"The prompt to send to the agent...",rows:4,className:"text-xs"})})]}),s.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[s.jsxs(Ue,{className:"border bg-muted/20",children:[s.jsx(Nt,{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(Ct,{className:"text-sm",children:"Checks"}),s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Checks determine pass/fail for the scenario. Add tool checks or text pattern checks for the final answer."})]}),!x&&s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>F(!0),title:"Ask for help improving checks",children:[s.jsx(fa,{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($e,{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((pe,we)=>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 ${ge[pe.type]}`,children:oe[pe.type]}),s.jsx("span",{className:"font-mono break-all",children:pe.value})]})}),!x&&s.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>V(we),"aria-label":`Remove check ${we+1}`,children:s.jsx(Us,{className:"h-3.5 w-3.5"})})]},we))}),!x&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex gap-2 items-end",children:[s.jsxs(sn,{value:P,onValueChange:pe=>A(pe),children:[s.jsx(Qt,{className:"h-8 w-[14.5rem] shrink-0 text-xs",children:s.jsx(on,{})}),s.jsxs(Jt,{children:[s.jsx(st,{value:"required_tool",children:"Required Tool"}),s.jsx(st,{value:"forbidden_tool",children:"Forbidden Tool"}),s.jsx(st,{value:"response_contains",children:"Text matches pattern"}),s.jsx(st,{value:"response_not_contains",children:"Text must not match"})]})]}),s.jsx(mt,{value:O,onChange:pe=>k(pe.target.value),placeholder:"Value",className:"h-8 text-xs font-mono",onKeyDown:pe=>pe.key==="Enter"&&(pe.preventDefault(),ae())}),s.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:ae,children:"Add"})]}),Re&&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($e,{className:"mb-1 block text-[11px] text-muted-foreground",children:"Pick from selected server tools (optional)"}),s.jsxs(sn,{value:R,onValueChange:pe=>{M(pe),k(pe)},disabled:D||!z||z.length===0,children:[s.jsx(Qt,{className:"h-8 text-xs",children:s.jsx(on,{placeholder:D?"Loading tools...":z&&z.length>0?"Select tool to insert in value field":"Load tools first"})}),s.jsx(Jt,{children:(z??[]).map(pe=>s.jsx(st,{value:pe,children:pe},pe))})]})]}),s.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:_e,disabled:!De||D,children:D?"Loading...":z?"Refresh tools":"Load tools"})]}),!De&&s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Select at least one server in this scenario to load tool names."}),U&&s.jsxs("p",{className:"text-[11px] text-destructive",children:["Could not load tools: ",U]})]})]})]})})]}),s.jsxs(Ue,{className:"border bg-muted/10",children:[s.jsx(Nt,{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(Ct,{className:"text-sm",children:"Value Capture Rules"}),s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Formerly “Extract Rules”. These do not fail the run. They capture structured values from the final answer for reporting, snapshots, and comparisons."})]}),!x&&s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>F(!0),title:"Ask for help improving value capture rules",children:[s.jsx(fa,{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($e,{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((pe,we)=>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:pe.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:pe.pattern})]})}),!x&&s.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>ne(we),"aria-label":`Remove value capture rule ${we+1}`,children:s.jsx(Us,{className:"h-3.5 w-3.5"})})]},we))}),!x&&s.jsxs("div",{className:"flex gap-2 items-end",children:[s.jsx(mt,{value:X,onChange:pe=>J(pe.target.value),placeholder:"Field name",className:"h-8 text-xs w-36"}),s.jsx(mt,{value:T,onChange:pe=>L(pe.target.value),placeholder:"Regex pattern",className:"h-8 text-xs font-mono",onKeyDown:pe=>pe.key==="Enter"&&(pe.preventDefault(),ie())}),s.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:ie,children:"Add"})]})]})})]})]}),_&&s.jsxs(Ue,{className:"border bg-amber-50/40",children:[s.jsxs(Nt,{className:"pb-2",children:[s.jsx(Ct,{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(gm,{checked:e.snapshotEval?.enabled!==!1,disabled:x,onCheckedChange:pe=>y({snapshotEval:{...e.snapshotEval??{},enabled:pe}})})]}),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(gm,{checked:!Ae,disabled:x,onCheckedChange:pe=>{if(pe){y({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:void 0}});return}y({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:e.snapshotEval?.baselineSnapshotId??""}})}})]}),Ae&&s.jsx(mt,{value:e.snapshotEval?.baselineSnapshotId??"",onChange:pe=>y({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:pe.target.value}}),disabled:x,placeholder:"Override baseline snapshot id",className:"h-8 text-xs font-mono"})]}),s.jsxs("p",{children:["Effective baseline snapshot:"," ",s.jsx("span",{className:"font-mono",children:e.snapshotEval?.baselineSnapshotId||p?.baselineSnapshotId||"Not configured"})]}),s.jsxs("p",{children:["Policy:"," ",s.jsx("span",{className:"font-mono",children:p?.mode??"warn"})," · config-level switch"," ",s.jsx("span",{className:"font-mono",children:p?.enabled?"on":"off"})]})]})]})]})})]})})}const Zhe=()=>({id:`cfg-${Date.now()}`,name:"",configName:"",description:"",servers:[],serverEntries:[],agents:[],agentEntries:[],scenarios:[],scenarioEntries:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),eM=()=>{const{id:e,tab:t}=Mo(),n=ja(),[r,a]=Ec(),{getConfig:i,addConfig:o,updateConfig:c,loading:d}=nf(),{source:f}=Pn(),h=vf("snapshots",!1),{servers:p,agents:y,scenarios:g}=Ua(),j=e==="new",b=!j&&!!e,x=b?i(e):void 0,[S,N]=v.useState(j),[_,P]=v.useState(()=>x?structuredClone(x):Zhe()),[A,O]=v.useState([]),[k,R]=v.useState(""),[M,z]=v.useState(""),[B,D]=v.useState(""),[G,U]=v.useState(null),[W,X]=v.useState(!1),[J,T]=v.useState(!1),[L,Q]=v.useState(""),[F,$]=v.useState(""),[Z,ae]=v.useState({}),[V,ie]=v.useState({}),[ne,de]=v.useState({}),oe=v.useMemo(()=>{const K=t||r.get("tab");return K==="agents"||K==="scenarios"?K:"scenarios"},[t,r]);v.useEffect(()=>{x&&!S&&P(structuredClone(x))},[x,S]),v.useEffect(()=>{let K=!0;return f.listSnapshots().then(ve=>{K&&O(ve)}).catch(()=>{K&&O([])}),()=>{K=!1}},[f]),v.useEffect(()=>{if(!k.trim()){U(null);return}let K=!0;return f.getResult(k.trim()).then(ve=>{if(!K)return;if(!ve){U(!1);return}const Fe=ve.overallPassRate===1&&ve.scenarios.every(ct=>ct.runs.every(jt=>jt.passed));U(Fe)}).catch(()=>{K&&U(!1)}),()=>{K=!1}},[k,f]);const ge=K=>P(ve=>({...ve,...K})),Re=v.useMemo(()=>_.serverEntries&&_.serverEntries.length>0?_.serverEntries:(_.servers??[]).map(K=>({kind:"inline",server:K})),[_.serverEntries,_.servers]),re=v.useMemo(()=>_.scenarioEntries&&_.scenarioEntries.length>0?_.scenarioEntries:_.scenarios.map(K=>({kind:"inline",scenario:K})),[_.scenarioEntries,_.scenarios]),De=K=>{ge({scenarioEntries:K,scenarios:K.filter(ve=>ve.kind==="inline").map(ve=>ve.scenario)})},Ae=v.useMemo(()=>_.agentEntries&&_.agentEntries.length>0?_.agentEntries:_.agents.map(K=>({kind:"inline",agent:K})),[_.agentEntries,_.agents]),We=K=>{ge({agentEntries:K,agents:K.filter(ve=>ve.kind==="inline").map(ve=>ve.agent)})},ye=!S,Ee=_.runDefaults?.selectedAgentNames??[],le=async K=>{if(!_.id||ye===!1){ge({snapshotEval:{enabled:K.enabled,mode:K.mode,baselineSnapshotId:K.baselineSnapshotId,baselineSourceRunId:K.baselineSourceRunId,lastUpdatedAt:new Date().toISOString()}});return}X(!0);try{const ve=await f.updateSnapshotPolicy(_.id,K);P(ve),Oe({title:"Snapshot policy updated"})}catch(ve){Oe({title:"Could not update snapshot policy",description:ve instanceof Error?ve.message:String(ve),variant:"destructive"})}finally{X(!1)}},_e=async()=>{if(!(!_.id||!k.trim())){T(!0);try{const K=await f.generateSnapshotEvalBaseline(k.trim(),_.id,M.trim()||void 0);P(K.config),D(K.snapshot.id),O(ve=>[K.snapshot,...ve.filter(Fe=>Fe.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{T(!1)}}},pe=async()=>{if(!_.name.trim()){Oe({title:"Validation Error",description:"Config ID is required.",variant:"destructive"});return}const K=Re.map(Ye=>Ye.kind==="referenced"?{kind:"referenced",ref:p.find(Dn=>Dn.id===Ye.ref)?.id||Ye.ref}:Ye),ve=Ae.map(Ye=>Ye.kind==="referenced"?{kind:"referenced",ref:y.find(Dn=>Dn.id===Ye.ref)?.id||Ye.ref}:Ye),Fe=re.map(Ye=>Ye.kind==="referenced"?{kind:"referenced",ref:g.find(Dn=>Dn.id===Ye.ref)?.id||Ye.ref}:Ye);if(Fe.filter(Ye=>Ye.kind==="inline").some(Ye=>!Ye.scenario.name?.trim())){Oe({title:"Validation Error",description:"Inline scenarios must have a name before saving.",variant:"destructive"});return}const jt=new Set(ve.map(Ye=>Ye.kind==="inline"?Ye.agent.id:Ye.ref)),Pt=(_.runDefaults?.selectedAgentNames??[]).filter(Ye=>jt.has(Ye)),yn={..._,serverEntries:K,servers:K.filter(Ye=>Ye.kind==="inline").map(Ye=>Ye.server),agentEntries:ve,agents:ve.filter(Ye=>Ye.kind==="inline").map(Ye=>Ye.agent),scenarioEntries:Fe,scenarios:Fe.filter(Ye=>Ye.kind==="inline").map(Ye=>Ye.scenario),runDefaults:Pt.length>0?{..._.runDefaults??{},selectedAgentNames:Pt}:void 0,updatedAt:new Date().toISOString()};if(j){const Ye=await o(yn);P(Ye);const xn=Ye.configName?.trim()||Ye.name;Oe({title:"MCP Evaluation Created",description:`"${xn}" has been saved.`}),n(`/mcp-evaluations/${Ye.id}`)}else{const Ye=await c(_.id,yn);P(Ye);const xn=Ye.configName?.trim()||Ye.name;Oe({title:"MCP Evaluation Updated",description:`"${xn}" has been updated.`}),N(!1),Ye.id!==e&&n(`/mcp-evaluations/${Ye.id}`,{replace:!0})}},we=_.configName?.trim()||_.name,Se=j?"New MCP Evaluation":S?`Editing: ${we}`:we,Ve=j?"/mcp-evaluations/new":`/mcp-evaluations/${encodeURIComponent(_.id||e||"")}`,Ot=!!x?.loadError,xe=v.useMemo(()=>y.map(K=>({id:K.id,ref:K.id,label:K.name||K.id,model:K.model})).sort((K,ve)=>K.label.localeCompare(ve.label)),[y]),ze=(K,ve)=>{const Fe=ve?Array.from(new Set([...Ee,K])):Ee.filter(ct=>ct!==K);ge({runDefaults:{..._.runDefaults??{},selectedAgentNames:Fe}})},Ge=K=>{const ve=new Set([...Ae.filter(Pt=>Pt.kind==="inline").map(Pt=>Pt.agent.name||Pt.agent.id),...y.map(Pt=>Pt.name||Pt.id)]),Fe=`${K}-custom`;let ct=Fe,jt=2;for(;ve.has(ct);)ct=`${Fe}-${jt}`,jt+=1;return ct},Dt=()=>{const ve={id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096};We([{kind:"inline",agent:ve},...Ae]),ae(Fe=>({...Fe,[ve.id]:!0}))},Lt=()=>{const K=y.find(ct=>ct.id===F);if(!K)return;const ve=K.id;new Set(Ae.filter(ct=>ct.kind==="referenced").map(ct=>ct.ref)).has(ve)||We([...Ae,{kind:"referenced",ref:ve}]),$("")},$t=()=>{const K=new Set(Ae.filter(Fe=>Fe.kind==="referenced").map(Fe=>Fe.ref)),ve=y.filter(Fe=>!K.has(Fe.id)).map(Fe=>({kind:"referenced",ref:Fe.id}));ve.length>0&&We([...Ae,...ve])},mn=()=>{const K=y.find(jt=>jt.id===F);if(!K)return;const ve=K.name||K.id,Fe=Ge(ve),ct={...structuredClone(K),id:`agt-${Date.now()}`,name:Fe};We([...Ae,{kind:"inline",agent:ct}]),ae(jt=>({...jt,[ct.id]:!0})),$(""),Oe({title:"Imported agent as inline",description:Fe})},_n=K=>{const ve=Ae[K];if(!ve)return;const Fe=ve.kind==="inline"?ve.agent.id:ve.ref,ct=Ee.filter(jt=>jt!==Fe);ge({runDefaults:{..._.runDefaults??{},selectedAgentNames:ct}}),ve.kind==="inline"&&ae(jt=>{const Pt={...jt};return delete Pt[ve.agent.id],Pt}),We(Ae.filter((jt,Pt)=>Pt!==K))},tr=(K,ve)=>{const Fe=K+ve;if(Fe<0||Fe>=Ae.length)return;const ct=[...Ae],[jt]=ct.splice(K,1);ct.splice(Fe,0,jt),We(ct)},or=K=>{const ve=Ae[K];if(!ve||ve.kind!=="referenced")return;const Fe=en(ve.ref);if(!Fe){Oe({title:"Referenced agent not found",variant:"destructive"});return}const ct=Fe.name||Fe.id,jt=Ge(ct),Pt={...structuredClone(Fe),id:`agt-${Date.now()}`,name:jt},yn=[...Ae];if(yn[K]={kind:"inline",agent:Pt},We(yn),Ee.includes(ve.ref)){const Ye=Ee.map(xn=>xn===ve.ref?Pt.id:xn);ge({runDefaults:{..._.runDefaults??{},selectedAgentNames:Array.from(new Set(Ye))}})}ae(Ye=>({...Ye,[Pt.id]:!0})),Oe({title:"Referenced agent converted to inline",description:jt})},Ca=()=>{const K=g.find(Fe=>Fe.id===L);if(!K)return;const ve={...structuredClone(K),id:`scn-${Date.now()}`,serverIds:[...K.serverIds]};De([...re,{kind:"inline",scenario:ve}]),de(Fe=>({...Fe,[ve.id]:!0})),Q("")},Mn=()=>{const ve={id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};De([{kind:"inline",scenario:ve},...re]),de(Fe=>({...Fe,[ve.id]:!0}))},Mr=()=>{const K=g.find(ct=>ct.id===L);if(!K)return;const ve=K.id;new Set(re.filter(ct=>ct.kind==="referenced").map(ct=>ct.ref)).has(ve)||De([...re,{kind:"referenced",ref:ve}]),Q("")},$r=K=>{const ve=re[K];ve?.kind==="inline"&&de(Fe=>{const ct={...Fe};return delete ct[ve.scenario.id],ct}),De(re.filter((Fe,ct)=>ct!==K))},hr=(K,ve)=>{const Fe=K+ve;if(Fe<0||Fe>=re.length)return;const ct=[...re],[jt]=ct.splice(K,1);ct.splice(Fe,0,jt),De(ct)},$n=K=>{const ve=re[K];if(!ve||ve.kind!=="referenced")return;const Fe=Sn(ve.ref);if(!Fe){Oe({title:"Referenced scenario not found",variant:"destructive"});return}const ct=new Set(re.filter(tn=>tn.kind==="inline").map(tn=>tn.scenario.name?.trim().toLowerCase()).filter(Boolean)),jt=`${(Fe.name||Fe.id).trim()}-custom`;let Pt=jt,yn=2;for(;ct.has(Pt.toLowerCase());)Pt=`${jt}-${yn}`,yn+=1;const Ye=Date.now(),xn={...structuredClone(Fe),id:`scn-${Ye}`,name:Pt,serverIds:[...Fe.serverIds]},Dn=[...re];Dn[K]={kind:"inline",scenario:xn},De(Dn),de(tn=>({...tn,[xn.id]:!0})),Oe({title:"Referenced scenario converted to inline",description:Pt})},On=K=>p.find(ve=>ve.id===K),en=K=>y.find(ve=>ve.id===K),Sn=K=>g.find(ve=>ve.id===K),ce=Re.filter(K=>K.kind==="referenced").map(K=>K.ref),Te=ce.map(On).filter(K=>!!K),ot=Ae.filter(K=>K.kind==="referenced").map(K=>K.ref),gt=ot.map(en).filter(K=>!!K);Ae.filter(K=>K.kind==="inline");const Ft=Ae.flatMap(K=>{if(K.kind==="referenced"){const ve=en(K.ref);return ve?[{agent:ve,origin:"referenced",ref:K.ref}]:[]}return[{agent:K.agent,origin:"inline",ref:void 0}]}),cn=re.filter(K=>K.kind==="referenced").map(K=>K.ref),At=re.flatMap(K=>{if(K.kind==="referenced"){const ve=Sn(K.ref);return ve?[{scenario:ve,origin:"referenced"}]:[]}return[{scenario:K.scenario,origin:"inline"}]}),mr=Array.from(new Map([...y,..._.agents,...gt].map(K=>[K.id,K])).values()),un=Array.from(new Map([...p,..._.servers??[],...Te].map(K=>[K.id,K])).values()),Kt=ce.filter(K=>!On(K)),Nr=ot.filter(K=>!en(K)),Dr=cn.filter(K=>!Sn(K));new Set(Kt);const Qa=new Set(Dr),ti=Ae.length,Vi=re.length;return v.useEffect(()=>{if(!F)return;y.some(ve=>ve.id===F)||$("")},[y,F]),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(se,{variant:"ghost",size:"icon",asChild:!0,className:"h-8 w-8",children:s.jsx(yt,{to:"/mcp-evaluations",children:s.jsx(xo,{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:Se}),s.jsx("p",{className:"text-sm text-muted-foreground",children:j?"Create a new MCP evaluation":d?"Loading configuration...":x?x.loadError?"MCP evaluation could not be fully loaded":`Last updated ${new Date(_.updatedAt).toLocaleDateString()}`:"MCP evaluation not found"})]}),s.jsxs("div",{className:"flex gap-2 shrink-0",children:[b&&!S&&s.jsx(se,{size:"sm",onClick:()=>N(!0),children:"Edit"}),b&&!S&&x&&!Ot&&s.jsx(se,{size:"sm",variant:"outline",asChild:!0,children:s.jsxs(yt,{to:`/run?configId=${encodeURIComponent(x.id)}`,children:[s.jsx(kl,{className:"mr-1.5 h-3.5 w-3.5"}),"Run MCP Evaluation"]})}),b&&!S&&Ot&&s.jsxs(Je,{variant:"destructive",className:"py-1 px-3 text-xs",children:[s.jsx(Zp,{className:"mr-1 h-3 w-3"}),"Broken config"]}),S&&s.jsxs(s.Fragment,{children:[!j&&s.jsx(se,{variant:"outline",size:"sm",onClick:()=>{P(structuredClone(x)),N(!1)},children:"Cancel"}),s.jsxs(se,{size:"sm",onClick:()=>{pe()},children:[s.jsx(MU,{className:"mr-1.5 h-3.5 w-3.5"}),"Save"]})]})]})]}),Ot&&!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(Zp,{className:"mt-0.5 h-5 w-5 text-destructive"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold",children:"This configuration is broken"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"The file is still present, but it could not be loaded because one or more references or fields are invalid."})]})]}),s.jsxs("div",{className:"rounded-md border bg-muted/20 p-3",children:[s.jsx("p",{className:"text-xs font-medium mb-1",children:"File"}),s.jsx("p",{className:"text-xs font-mono break-all",children:x?.sourcePath||x?.description})]}),s.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3",children:[s.jsx("p",{className:"text-xs font-medium mb-1 text-destructive",children:"Load Error"}),s.jsx("p",{className:"text-xs break-all text-destructive",children:x?.loadError})]}),(Kt.length>0||Nr.length>0||Dr.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"}),Kt.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Servers: ",s.jsx("span",{className:"text-destructive",children:Kt.join(", ")})]}),Nr.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Agents: ",s.jsx("span",{className:"text-destructive",children:Nr.join(", ")})]}),Dr.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Scenarios: ",s.jsx("span",{className:"text-destructive",children:Dr.join(", ")})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Valid items still render below. Only the missing references are marked as broken."})]})}),!Ot&&(_.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(Zp,{className:"h-4 w-4"}),"Migration warnings"]}),_.loadWarnings?.map((K,ve)=>s.jsx("p",{className:"text-xs text-muted-foreground",children:K},`${K}-${ve}`))]})}),s.jsxs("div",{className:"flex gap-4",children:[s.jsx(Je,{variant:oe==="scenarios"?"default":"outline",className:"py-1 px-3 text-xs",children:s.jsxs(yt,{to:`${Ve}/scenarios`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[s.jsx(aE,{className:"h-3 w-3"}),Vi," scenario",Vi!==1?"s":""]})}),s.jsx(Je,{variant:oe==="agents"?"default":"outline",className:"py-1 px-3 text-xs",children:s.jsxs(yt,{to:`${Ve}/agents`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[s.jsx(ha,{className:"h-3 w-3"}),ti," agent",ti!==1?"s":""]})})]}),s.jsx(Ue,{children:s.jsx(qe,{className:"pt-6 space-y-3",children:s.jsxs("div",{className:`grid gap-4 ${ye||!j?"sm:grid-cols-2":"sm:grid-cols-3"}`,children:[!ye&&j&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Config ID"}),s.jsx(mt,{value:_.name,onChange:K=>ge({name:K.target.value}),disabled:ye,placeholder:"e.g. check-weather"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Name (optional)"}),s.jsx(mt,{value:_.configName||"",onChange:K=>ge({configName:K.target.value}),disabled:ye,placeholder:"e.g. Weather checks baseline"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Description"}),s.jsx(mt,{value:_.description||"",onChange:K=>ge({description:K.target.value}),disabled:ye,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($e,{className:"text-xs",children:"Enable snapshot baseline"}),s.jsx(gm,{checked:_.snapshotEval?.enabled??!1,disabled:W,onCheckedChange:K=>{const ve=_.snapshotEval;le({enabled:K,mode:ve?.mode??"warn",baselineSnapshotId:ve?.baselineSnapshotId,baselineSourceRunId:ve?.baselineSourceRunId})}})]})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Drift mode"}),s.jsxs(sn,{value:_.snapshotEval?.mode??"warn",onValueChange:K=>{const ve=_.snapshotEval;le({enabled:ve?.enabled??!1,mode:K,baselineSnapshotId:ve?.baselineSnapshotId,baselineSourceRunId:ve?.baselineSourceRunId})},children:[s.jsx(Qt,{className:"h-8",children:s.jsx(on,{})}),s.jsxs(Jt,{children:[s.jsx(st,{value:"warn",children:"Warn"}),s.jsx(st,{value:"fail_on_drift",children:"Fail on drift"})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{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:_.snapshotEval?.baselineSnapshotId??"No baseline linked"})]})]}),_.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($e,{className:"text-xs",children:"Generate baseline from passing run"}),s.jsx(mt,{value:k,onChange:K=>R(K.target.value),placeholder:"Run id (e.g. 20260208-140213)",className:"h-8 font-mono text-xs"}),G===!1&&s.jsx("p",{className:"text-[11px] text-destructive",children:"Run is missing or not fully passing."})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx($e,{className:"text-xs",children:"Snapshot name (optional)"}),s.jsx(mt,{value:M,onChange:K=>z(K.target.value),placeholder:"e.g. config-baseline-v1",className:"h-8 text-xs"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx($e,{className:"text-xs",children:"Switch baseline"}),s.jsxs(sn,{value:B||_.snapshotEval?.baselineSnapshotId||"",onValueChange:K=>{D(K),le({enabled:_.snapshotEval?.enabled??!0,mode:_.snapshotEval?.mode??"warn",baselineSnapshotId:K||void 0,baselineSourceRunId:_.snapshotEval?.baselineSourceRunId})},children:[s.jsx(Qt,{className:"h-8",children:s.jsx(on,{placeholder:"Select snapshot"})}),s.jsx(Jt,{children:A.map(K=>s.jsx(st,{value:K.id,children:K.name},K.id))})]})]}),s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:()=>{_e()},disabled:J||!k.trim()||G!==!0,children:J?"Generating...":"Generate Baseline"}),s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:()=>{le({enabled:_.snapshotEval?.enabled??!1,mode:_.snapshotEval?.mode??"warn",baselineSnapshotId:void 0,baselineSourceRunId:void 0})},disabled:W,children:"Clear Baseline"})]})]})]})}),s.jsxs(tC,{value:oe,onValueChange:K=>{if(K!=="servers"&&K!=="agents"&&K!=="scenarios")return;const ve=new URLSearchParams(r);if(ve.delete("tab"),a(ve,{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(qv,{children:[s.jsxs(Po,{value:"scenarios",className:"gap-1.5",children:[s.jsx(aE,{className:"h-3.5 w-3.5"}),"Scenarios"]}),s.jsxs(Po,{value:"agents",className:"gap-1.5",children:[s.jsx(ha,{className:"h-3.5 w-3.5"}),"Agents"]})]}),s.jsxs(Wd,{value:"agents",children:[!ye&&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(sn,{value:F,onValueChange:$,children:[s.jsx(Qt,{className:"h-8",children:s.jsx(on,{placeholder:"Select agent from library"})}),s.jsx(Jt,{children:xe.map(K=>s.jsx(st,{value:K.id,children:K.label},K.id))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!F,onClick:Lt,children:"Add Ref"}),s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!F,onClick:mn,children:"Import Inline"}),s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:y.length===0||y.every(K=>Ae.some(ve=>ve.kind==="referenced"&&ve.ref===K.id)),onClick:$t,children:"Add All Refs"}),s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:Dt,children:"Add agent"})]})]}),s.jsxs("div",{className:"space-y-2",children:[Ae.map((K,ve)=>{const Fe=K.kind==="referenced"?en(K.ref):null,ct=K.kind==="inline"?K.agent.name?.trim()||K.agent.id:Fe?.name||K.ref,jt=K.kind==="inline"?K.agent.model:Fe?.model||"unknown",Pt=K.kind==="inline"?K.agent.id:K.ref,yn=K.kind==="referenced"&&!Fe,Ye=K.kind==="inline"?K.agent.id:K.ref,xn=Ee.includes(Ye),Dn=K.kind==="inline"&&!!Z[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(se,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>tr(ve,-1),disabled:ve===0,"aria-label":"Move agent up",children:s.jsx(is,{className:"h-3 w-3"})}),s.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>tr(ve,1),disabled:ve===Ae.length-1,"aria-label":"Move agent down",children:s.jsx(Wt,{className:"h-3 w-3"})})]}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[ve+1,"."]}),s.jsx("span",{className:"truncate font-medium",children:ct}),s.jsx(Je,{variant:K.kind==="inline"?"secondary":"outline",children:K.kind==="inline"?"Inline":"Referenced"}),s.jsx(Je,{variant:"outline",className:"font-mono text-[10px]",children:jt}),xn&&s.jsx(Je,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),yn&&s.jsx(Je,{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:xn,onChange:tn=>ze(Ye,tn.target.checked)}),s.jsx("span",{children:"Default"})]}),K.kind==="inline"&&s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>ae(tn=>({...tn,[K.agent.id]:!tn[K.agent.id]})),children:Dn?"Collapse":"Expand"}),K.kind==="referenced"&&s.jsx(s.Fragment,{children:s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>or(ve),disabled:yn,children:"Convert to inline"})}),s.jsx(se,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>_n(ve),"aria-label":"Remove agent entry",children:s.jsx(ba,{className:"h-3.5 w-3.5"})})]})]}),K.kind==="inline"&&Dn&&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($e,{className:"text-xs",children:"Name"}),s.jsx(mt,{value:K.agent.name,onChange:tn=>{const H=[...Ae];H[ve]={kind:"inline",agent:{...K.agent,name:tn.target.value}},We(H)},placeholder:"e.g. GPT-5 Mini custom"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Provider"}),s.jsxs(sn,{value:K.agent.provider,onValueChange:tn=>{const H=[...Ae];H[ve]={kind:"inline",agent:{...K.agent,provider:tn}},We(H)},children:[s.jsx(Qt,{children:s.jsx(on,{})}),s.jsxs(Jt,{children:[s.jsx(st,{value:"openai",children:"OpenAI"}),s.jsx(st,{value:"anthropic",children:"Anthropic"}),s.jsx(st,{value:"azure",children:"Azure OpenAI"}),s.jsx(st,{value:"google",children:"Google"}),s.jsx(st,{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($e,{className:"text-xs",children:"Model"}),s.jsx(mt,{value:K.agent.model,onChange:tn=>{const H=[...Ae];H[ve]={kind:"inline",agent:{...K.agent,model:tn.target.value}},We(H)},className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Max Tokens"}),s.jsx(mt,{type:"number",min:1,max:128e3,value:K.agent.maxTokens,onChange:tn=>{const H=[...Ae];H[ve]={kind:"inline",agent:{...K.agent,maxTokens:parseInt(tn.target.value)||0}},We(H)},className:"font-mono text-xs"})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Temperature"}),s.jsx(mt,{type:"number",min:0,max:2,step:.01,value:K.agent.temperature,onChange:tn=>{const H=[...Ae];H[ve]={kind:"inline",agent:{...K.agent,temperature:Number(tn.target.value)||0}},We(H)},className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"System Prompt"}),s.jsx(Gs,{value:K.agent.systemPrompt||"",onChange:tn=>{const H=[...Ae];H[ve]={kind:"inline",agent:{...K.agent,systemPrompt:tn.target.value}},We(H)},rows:3,className:"text-xs"})]})]})]},`agent-entry-${ve}-${Pt}`)}),Ae.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents configured yet. Add inline agents or references."})]}),Nr.length>0&&s.jsxs("p",{className:"text-xs text-destructive",children:["Missing agent refs: ",Nr.join(", ")]})]})}),ye?s.jsx(Ue,{children:s.jsx(qe,{className:"pt-4",children:s.jsxs("div",{className:"space-y-2",children:[Ft.map((K,ve)=>{const Fe=K.agent.name||K.agent.id,ct=Ee.includes(K.origin==="inline"?K.agent.id:K.ref||K.agent.id),jt=K.ref??K.agent.id,Pt=!!V[jt];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:[ve+1,"."]}),s.jsx("div",{className:"truncate font-medium text-sm",children:Fe})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[ct&&s.jsx(Je,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),s.jsx(Je,{variant:K.origin==="inline"?"secondary":"outline",children:K.origin==="inline"?"Inline":"Referenced"}),s.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8",onClick:()=>ie(yn=>({...yn,[jt]:!yn[jt]})),"aria-label":Pt?"Collapse agent details":"Expand agent details",children:s.jsx(Wt,{className:`h-4 w-4 transition-transform ${Pt?"rotate-180":""}`})})]})]}),Pt&&s.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 border-t pt-2",children:[s.jsx(aB,{provider:K.agent.provider}),s.jsx(Je,{variant:"outline",className:"text-xs font-mono",children:K.agent.model}),s.jsxs(Je,{variant:"outline",className:"text-xs font-mono",children:["max_tokens: ",K.agent.maxTokens]}),s.jsxs(Je,{variant:"outline",className:"text-xs font-mono",children:["temperature: ",K.agent.temperature]})]})]},`agent-view-${ve}-${K.ref??K.agent.id}`)}),Ft.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No agents configured."})]})})}):null]}),s.jsxs(Wd,{value:"scenarios",children:[!ye&&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(sn,{value:L,onValueChange:Q,children:[s.jsx(Qt,{className:"h-8",children:s.jsx(on,{placeholder:"Select scenario from library"})}),s.jsx(Jt,{children:[...g].sort((K,ve)=>(K.name||K.id).localeCompare(ve.name||ve.id)).map(K=>s.jsx(st,{value:K.id,children:K.name||K.id},K.id))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!L,onClick:Mr,children:"Add Ref"}),s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!L,onClick:Ca,children:"Import Inline"}),s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:Mn,children:"Add scenario"})]})]}),s.jsxs("div",{className:"space-y-2",children:[re.map((K,ve)=>{const Fe=K.kind==="referenced"?Sn(K.ref):null,ct=K.kind==="inline"?K.scenario.name?.trim()||K.scenario.id:Fe?.name||K.ref,jt=K.kind==="inline"&&!K.scenario.name?.trim(),Pt=K.kind==="referenced"&&Qa.has(K.ref),yn=K.kind==="inline"&&!!ne[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(se,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>hr(ve,-1),disabled:ve===0,"aria-label":"Move scenario up",children:s.jsx(is,{className:"h-3 w-3"})}),s.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>hr(ve,1),disabled:ve===re.length-1,"aria-label":"Move scenario down",children:s.jsx(Wt,{className:"h-3 w-3"})})]}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[ve+1,"."]}),s.jsx("span",{className:"truncate font-medium",children:ct}),s.jsx(Je,{variant:K.kind==="inline"?"secondary":"outline",children:K.kind==="inline"?"Inline":"Referenced"}),jt&&s.jsx(Je,{variant:"destructive",children:"Name required"}),Pt&&s.jsx(Je,{variant:"destructive",children:"Missing"})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[K.kind==="inline"&&s.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-7 w-7",onClick:()=>de(Ye=>({...Ye,[K.scenario.id]:!Ye[K.scenario.id]})),"aria-label":yn?"Collapse scenario details":"Expand scenario details",children:s.jsx(Wt,{className:`h-3.5 w-3.5 transition-transform ${yn?"rotate-180":""}`})}),K.kind==="referenced"&&s.jsx(s.Fragment,{children:s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>$n(ve),disabled:Pt,children:"Convert to inline"})}),s.jsx(se,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>$r(ve),"aria-label":"Remove scenario entry",children:s.jsx(ba,{className:"h-3.5 w-3.5"})})]})]}),K.kind==="inline"&&yn&&s.jsx("div",{className:"border-t px-3 py-3",children:s.jsx(lS,{scenarios:[K.scenario],scenarioOrigins:["inline"],agents:[..._.agents,...gt],servers:[..._.servers??[],...Te],configId:_.id,configPath:_.sourcePath,defaultAssistantAgentName:_.runDefaults?.selectedAgentNames?.[0],snapshotEval:_.snapshotEval,onChange:Ye=>{const xn=Ye[0];if(!xn)return;const Dn=[...re];Dn[ve]={kind:"inline",scenario:xn},De(Dn)},readOnly:!1,allowAdd:!1,allowStructureEdits:!1})})]},`scenario-entry-${ve}-${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."})]}),Dr.length>0&&s.jsxs("p",{className:"text-xs text-destructive",children:["Missing scenario refs: ",Dr.join(", ")]})]})}),ye?s.jsx(Ue,{children:s.jsx(qe,{className:"pt-4",children:s.jsx(lS,{scenarios:At.map(K=>K.scenario),scenarioOrigins:At.map(K=>K.origin),agents:mr,servers:un,configId:_.id,configPath:_.sourcePath,defaultAssistantAgentName:_.runDefaults?.selectedAgentNames?.[0],snapshotEval:_.snapshotEval,onChange:()=>{},readOnly:!0})})}):null]})]})]})};var eme=Symbol("radix.slottable");function tme(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=eme,t}var d8="AlertDialog",[nme]=ir(d8,[PD]),ei=PD(),f8=e=>{const{__scopeAlertDialog:t,...n}=e,r=ei(t);return s.jsx(Ym,{...r,...n,modal:!0})};f8.displayName=d8;var rme="AlertDialogTrigger",ame=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ei(n);return s.jsx(UK,{...a,...r,ref:t})});ame.displayName=rme;var sme="AlertDialogPortal",p8=e=>{const{__scopeAlertDialog:t,...n}=e,r=ei(t);return s.jsx(Xm,{...r,...n})};p8.displayName=sme;var ime="AlertDialogOverlay",h8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ei(n);return s.jsx(Pc,{...a,...r,ref:t})});h8.displayName=ime;var Fl="AlertDialogContent",[ome,lme]=nme(Fl),cme=tme("AlertDialogContent"),m8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,i=ei(n),o=v.useRef(null),c=ft(t,o),d=v.useRef(null);return s.jsx(LK,{contentName:Fl,titleName:v8,docsSlug:"alert-dialog",children:s.jsx(ome,{scope:n,cancelRef:d,children:s.jsxs(Oc,{role:"alertdialog",...i,...a,ref:c,onOpenAutoFocus:Pe(a.onOpenAutoFocus,f=>{f.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[s.jsx(cme,{children:r}),s.jsx(dme,{contentRef:o})]})})})});m8.displayName=Fl;var v8="AlertDialogTitle",g8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ei(n);return s.jsx(Zd,{...a,...r,ref:t})});g8.displayName=v8;var y8="AlertDialogDescription",x8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ei(n);return s.jsx(ef,{...a,...r,ref:t})});x8.displayName=y8;var ume="AlertDialogAction",b8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ei(n);return s.jsx(Qm,{...a,...r,ref:t})});b8.displayName=ume;var w8="AlertDialogCancel",j8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=lme(w8,n),i=ei(n),o=ft(t,a);return s.jsx(Qm,{...i,...r,ref:o})});j8.displayName=w8;var dme=({contentRef:e})=>{const t=`\`${Fl}\` requires a description for the component to be accessible for screen reader users.
125
-
126
- You can add a description to the \`${Fl}\` by passing a \`${y8}\` 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 \`${Fl}\`. 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},fme=f8,pme=p8,S8=h8,N8=m8,C8=b8,_8=j8,A8=g8,E8=x8;const bs=fme,hme=pme,P8=v.forwardRef(({className:e,...t},n)=>s.jsx(S8,{className:je("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));P8.displayName=S8.displayName;const Wa=v.forwardRef(({className:e,...t},n)=>s.jsxs(hme,{children:[s.jsx(P8,{}),s.jsx(N8,{ref:n,className:je("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));Wa.displayName=N8.displayName;const Va=({className:e,...t})=>s.jsx("div",{className:je("flex flex-col space-y-2 text-center sm:text-left",e),...t});Va.displayName="AlertDialogHeader";const Ha=({className:e,...t})=>s.jsx("div",{className:je("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Ha.displayName="AlertDialogFooter";const Ka=v.forwardRef(({className:e,...t},n)=>s.jsx(A8,{ref:n,className:je("text-lg font-semibold",e),...t}));Ka.displayName=A8.displayName;const Ga=v.forwardRef(({className:e,...t},n)=>s.jsx(E8,{ref:n,className:je("text-sm text-muted-foreground",e),...t}));Ga.displayName=E8.displayName;const Ya=v.forwardRef(({className:e,...t},n)=>s.jsx(C8,{ref:n,className:je(zS(),e),...t}));Ya.displayName=C8.displayName;const Xa=v.forwardRef(({className:e,...t},n)=>s.jsx(_8,{ref:n,className:je(zS({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Xa.displayName=_8.displayName;const mme=()=>{const{servers:e,setServers:t,reload:n,loading:r}=Ua(),a=ja(),[i,o]=v.useState(null),c=p=>p.name?.trim()||p.id,d=async p=>{const y=`${c(p)}-copy`;let g=y,j=1;for(;e.some(x=>(x.name?.trim()||x.id)===g);)g=`${y}-${j}`,j+=1;const b={...structuredClone(p),id:`srv-${Date.now()}`,name:g};await t([...e,b]),Oe({title:"Server duplicated",description:`Created ${g}.`})},f=async p=>{await t(e.filter(y=>y.id!==p.id)),Oe({title:"Server deleted",description:`${c(p)} was removed.`}),o(null)},h=p=>p.transport==="stdio"?[p.command,...p.args||[]].filter(Boolean).join(" "):p.url||"";return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(e$,{className:"h-6 w-6"}),"Servers"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Reusable MCP server definitions shared across configurations."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[s.jsx(xa,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(se,{type:"button",size:"sm",onClick:()=>a("/libraries/servers/new"),children:[s.jsx(us,{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(se,{type:"button",size:"sm",className:"mt-4",onClick:()=>a("/libraries/servers/new"),children:[s.jsx(us,{className:"mr-2 h-4 w-4"}),"Add Server"]})]}):s.jsx(Ue,{children:s.jsx(qe,{className:"p-0",children:s.jsxs(Xr,{children:[s.jsx(Qr,{children:s.jsxs(Ut,{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(Jr,{children:e.map(p=>s.jsxs(Ut,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>a(`/libraries/servers/${encodeURIComponent(p.id)}`),children:[s.jsx(Ke,{className:"font-medium",children:c(p)}),s.jsx(Ke,{children:s.jsx(Je,{variant:"secondary",className:"font-mono text-xs",children:p.transport})}),s.jsx(Ke,{children:s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:h(p)})}),s.jsx(Ke,{children:!p.authType||p.authType==="none"?s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"}):s.jsx(Je,{variant:"outline",className:"text-xs",children:p.authType})}),s.jsx(Ke,{className:"text-right",onClick:y=>y.stopPropagation(),children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsxs(se,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>o(p),children:[s.jsx(ba,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{d(p)},children:[s.jsx(Ri,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>a(`/libraries/servers/${encodeURIComponent(p.id)}`),children:[s.jsx(Am,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},p.id))})]})})}),s.jsx(bs,{open:!!i,onOpenChange:p=>!p&&o(null),children:s.jsxs(Wa,{children:[s.jsxs(Va,{children:[s.jsx(Ka,{children:"Delete server?"}),s.jsxs(Ga,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-mono",children:i?c(i):""})," from the library. This action cannot be undone."]})]}),s.jsxs(Ha,{children:[s.jsx(Xa,{children:"Cancel"}),s.jsx(Ya,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{i&&f(i)},children:"Delete Server"})]})]})})]})},tM={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"},vme=()=>({id:`srv-${Date.now()}`,name:"",transport:"stdio",authType:"none",oauthRedirectUrl:"http://localhost:6274/oauth/"}),gme=()=>{const{serverId:e}=Mo(),t=ja(),{servers:n,setServers:r}=Ua(),{source:a}=Pn(),i=e==="new",o=e?decodeURIComponent(e):"",c=i?null:n.find(R=>R.id===o||R.name===o),d=R=>R.name?.trim()||R.id,[f,h]=v.useState(()=>c??vme()),[p,y]=v.useState(!1),[g,j]=v.useState(!1),[b,x]=v.useState({status:"idle"}),[S,N]=v.useState(!1);v.useEffect(()=>{c&&h(c)},[c]);const _=R=>{h(M=>({...M,authType:R,...R!=="oauth2"?{oauthClientId:void 0,oauthClientSecret:void 0,oauthRedirectUrl:void 0,oauthScope:void 0}:{oauthRedirectUrl:M.oauthRedirectUrl||"http://localhost:6274/oauth/"}}))},P=async()=>{N(!0),x({status:"loading"});try{const M=(await a.discoverToolsForAnalysis({serverNames:[f.id]})).servers[0];M&&M.warnings.length===0?x({status:"success",toolNames:M.tools.map(z=>z.name),toolCount:M.tools.length,testedAt:new Date().toISOString()}):x({status:"error",message:M?.warnings[0]??"Connection failed",testedAt:new Date().toISOString()})}catch(R){x({status:"error",message:R instanceof Error?R.message:String(R),testedAt:new Date().toISOString()})}},A=async()=>{if(!f.name.trim()){Oe({title:"Name is required",variant:"destructive"});return}j(!0);try{if(i)await r([...n,f]),Oe({title:"Server created"}),t(`/libraries/servers/${encodeURIComponent(f.id)}`);else{const R=n.map(M=>M.id===c?.id?f:M);await r(R),Oe({title:"Server saved"}),f.id!==o&&t(`/libraries/servers/${encodeURIComponent(f.id)}`,{replace:!0})}}finally{j(!1)}},O=async()=>{const R=n.filter(M=>M.id!==c?.id);await r(R),Oe({title:"Server deleted"}),t("/libraries/servers")},k=()=>f.transport==="stdio"?[f.command,...f.args||[]].filter(Boolean).join(" "):f.url||"";return!i&&!c?s.jsxs("div",{className:"space-y-4",children:[s.jsxs(yt,{to:"/libraries/servers",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(xo,{className:"h-4 w-4"})," Servers"]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:['Server "',o,'" not found.']})]}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsxs(yt,{to:"/libraries/servers",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(xo,{className:"h-4 w-4"})," Servers"]}),s.jsx("h1",{className:"text-2xl font-bold",children:i?"New Server":d(f)})]}),!i&&s.jsxs(se,{type:"button",onClick:()=>{P()},children:[s.jsx(c$,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),S&&s.jsxs(Ue,{children:[s.jsxs(Nt,{className:"flex-row items-center justify-between space-y-0",children:[s.jsx(Ct,{className:"text-base",children:"Connection Test"}),s.jsx("button",{type:"button",onClick:()=>N(!1),className:"rounded-sm opacity-70 hover:opacity-100",children:s.jsx(Us,{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}),k()&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"mx-1",children:"·"}),s.jsx("span",{children:"Endpoint:"}),s.jsx("code",{className:"font-mono text-xs",children:k()})]})]}),b.status==="loading"&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(sr,{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(ql,{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(R=>s.jsx("li",{className:"font-mono text-xs",children:R},R))})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(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]}),tM[f.transport]&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",tM[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(Nt,{children:s.jsx(Ct,{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($e,{children:"Name"}),s.jsx(mt,{value:f.name,onChange:R=>h(M=>({...M,name:R.target.value})),placeholder:"e.g. Filesystem MCP"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{children:"Transport"}),s.jsxs(sn,{value:f.transport,onValueChange:R=>h(M=>({...M,transport:R})),children:[s.jsx(Qt,{children:s.jsx(on,{})}),s.jsxs(Jt,{children:[s.jsx(st,{value:"stdio",children:"stdio"}),s.jsx(st,{value:"sse",children:"SSE"}),s.jsx(st,{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($e,{children:"Command"}),s.jsx(mt,{value:f.command||"",onChange:R=>h(M=>({...M,command:R.target.value})),placeholder:"npx",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{children:"Args (comma-separated)"}),s.jsx(mt,{value:(f.args||[]).join(", "),onChange:R=>h(M=>({...M,args:R.target.value.split(",").map(z=>z.trim()).filter(Boolean)})),placeholder:"-y, @mcp/server",className:"font-mono text-xs"})]})]}):s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{children:"URL"}),s.jsx(mt,{value:f.url||"",onChange:R=>h(M=>({...M,url:R.target.value})),placeholder:"http://localhost:3001/sse",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{children:"Auth Type"}),s.jsxs(sn,{value:f.authType||"none",onValueChange:R=>_(R),children:[s.jsx(Qt,{children:s.jsx(on,{})}),s.jsxs(Jt,{children:[s.jsx(st,{value:"none",children:"None"}),s.jsx(st,{value:"bearer",children:"Bearer Token"}),s.jsx(st,{value:"api-key",children:"API Key"}),s.jsx(st,{value:"oauth2",children:"OAuth 2.0"})]})]})]}),f.authType&&f.authType!=="none"&&f.authType!=="oauth2"&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{children:f.authType==="bearer"?"Token":"API Key"}),s.jsx(mt,{type:"password",value:f.authValue||"",onChange:R=>h(M=>({...M,authValue:R.target.value})),placeholder:"••••••••",className:"font-mono text-xs"})]})]}),f.authType==="oauth2"&&s.jsxs("div",{className:"space-y-3 rounded-md border p-3",children:[s.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"OAuth 2.0 Flow"}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Client ID"}),s.jsx(mt,{value:f.oauthClientId||"",onChange:R=>h(M=>({...M,oauthClientId:R.target.value})),placeholder:"your-client-id",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Client Secret (optional)"}),s.jsx(mt,{type:"password",value:f.oauthClientSecret||"",onChange:R=>h(M=>({...M,oauthClientSecret:R.target.value})),placeholder:"••••••••",className:"font-mono text-xs"})]})]}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Redirect URL"}),s.jsx(mt,{value:f.oauthRedirectUrl||"http://localhost:6274/oauth/",onChange:R=>h(M=>({...M,oauthRedirectUrl:R.target.value})),placeholder:"http://localhost:6274/oauth/",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Scope (space-separated)"}),s.jsx(mt,{value:f.oauthScope||"",onChange:R=>h(M=>({...M,oauthScope:R.target.value})),placeholder:"openid profile mcp",className:"font-mono text-xs"})]})]})]}),s.jsxs("div",{className:"flex items-center justify-between pt-2",children:[s.jsx("div",{children:!i&&s.jsx(se,{type:"button",variant:"destructive",size:"sm",onClick:()=>y(!0),children:"Delete"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(se,{type:"button",variant:"outline",size:"sm",onClick:()=>t("/libraries/servers"),children:"Cancel"}),s.jsxs(se,{type:"button",size:"sm",onClick:()=>{A()},disabled:g,children:[g&&s.jsx(sr,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Create Server":"Save"]})]})]})]})]}),s.jsx(bs,{open:p,onOpenChange:y,children:s.jsxs(Wa,{children:[s.jsxs(Va,{children:[s.jsx(Ka,{children:"Delete server?"}),s.jsxs(Ga,{children:["This will permanently remove the server"," ",s.jsx("span",{className:"font-mono",children:f.name}),". This action cannot be undone."]})]}),s.jsxs(Ha,{children:[s.jsx(Xa,{children:"Cancel"}),s.jsx(Ya,{onClick:()=>{O()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},yme=()=>{const{agents:e,setAgents:t,reload:n,loading:r}=Ua(),a=ja(),[i,o]=v.useState(null),c=async f=>{const h=`${f.name}-copy`;let p=h,y=1;for(;e.some(j=>j.name===p);)p=`${h}-${y}`,y+=1;const g={...structuredClone(f),id:`agt-${Date.now()}`,name:p};await t([...e,g]),Oe({title:"Agent duplicated",description:`Created ${p}.`})},d=async f=>{await t(e.filter(h=>h.id!==f.id)),Oe({title:"Agent deleted",description:`${f.name} was removed.`}),o(null)};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(ha,{className:"h-6 w-6"}),"Agents"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Reusable agent profiles shared across configurations."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[s.jsx(xa,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(se,{type:"button",size:"sm",onClick:()=>a("/libraries/agents/new"),children:[s.jsx(us,{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(se,{type:"button",size:"sm",className:"mt-4",onClick:()=>a("/libraries/agents/new"),children:[s.jsx(us,{className:"mr-2 h-4 w-4"}),"Add Agent"]})]}):s.jsx(Ue,{children:s.jsx(qe,{className:"p-0",children:s.jsxs(Xr,{children:[s.jsx(Qr,{children:s.jsxs(Ut,{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(Jr,{children:e.map(f=>s.jsxs(Ut,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>a(`/libraries/agents/${encodeURIComponent(f.id)}`),children:[s.jsx(Ke,{className:"font-medium",children:f.name}),s.jsx(Ke,{children:s.jsx(aB,{provider:f.provider})}),s.jsx(Ke,{children:s.jsx("span",{className:"font-mono text-xs",children:f.model})}),s.jsx(Ke,{className:"font-mono text-xs",children:f.maxTokens}),s.jsx(Ke,{className:"font-mono text-xs",children:f.temperature.toFixed(2)}),s.jsx(Ke,{className:"text-right",onClick:h=>h.stopPropagation(),children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsxs(se,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>o(f),children:[s.jsx(ba,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{c(f)},children:[s.jsx(Ri,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>a(`/libraries/agents/${encodeURIComponent(f.id)}`),children:[s.jsx(Am,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},f.id))})]})})}),s.jsx(bs,{open:!!i,onOpenChange:f=>!f&&o(null),children:s.jsxs(Wa,{children:[s.jsxs(Va,{children:[s.jsx(Ka,{children:"Delete agent?"}),s.jsxs(Ga,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-mono",children:i?.name})," from the library. This action cannot be undone."]})]}),s.jsxs(Ha,{children:[s.jsx(Xa,{children:"Cancel"}),s.jsx(Ya,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{i&&d(i)},children:"Delete Agent"})]})]})})]})};var O8=["PageUp","PageDown"],k8=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],R8={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Uc="Slider",[cS,xme,bme]=Hd(Uc),[T8]=ir(Uc,[bme]),[wme,Xv]=T8(Uc),I8=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:y=()=>{},inverted:g=!1,form:j,...b}=e,x=v.useRef(new Set),S=v.useRef(0),_=o==="horizontal"?jme:Sme,[P=[],A]=na({prop:h,defaultProp:f,onChange:B=>{[...x.current][S.current]?.focus(),p(B)}}),O=v.useRef(P);function k(B){const D=Eme(P,B);z(B,D)}function R(B){z(B,S.current)}function M(){const B=O.current[S.current];P[S.current]!==B&&y(P)}function z(B,D,{commit:G}={commit:!1}){const U=Rme(i),W=Tme(Math.round((B-r)/i)*i+r,U),X=Vd(W,[r,a]);A((J=[])=>{const T=_me(J,X,D);if(kme(T,d*i)){S.current=T.indexOf(X);const L=String(T)!==String(J);return L&&G&&y(T),L?T:J}else return J})}return s.jsx(wme,{scope:e.__scopeSlider,name:n,disabled:c,min:r,max:a,valueIndexToChangeRef:S,thumbs:x.current,values:P,orientation:o,form:j,children:s.jsx(cS.Provider,{scope:e.__scopeSlider,children:s.jsx(cS.Slot,{scope:e.__scopeSlider,children:s.jsx(_,{"aria-disabled":c,"data-disabled":c?"":void 0,...b,ref:t,onPointerDown:Pe(b.onPointerDown,()=>{c||(O.current=P)}),min:r,max:a,inverted:g,onSlideStart:c?void 0:k,onSlideMove:c?void 0:R,onSlideEnd:c?void 0:M,onHomeKeyDown:()=>!c&&z(r,0,{commit:!0}),onEndKeyDown:()=>!c&&z(a,P.length-1,{commit:!0}),onStepKeyDown:({event:B,direction:D})=>{if(!c){const W=O8.includes(B.key)||B.shiftKey&&k8.includes(B.key)?10:1,X=S.current,J=P[X],T=i*W*D;z(J+T,X,{commit:!0})}}})})})})});I8.displayName=Uc;var[M8,$8]=T8(Uc,{startEdge:"left",endEdge:"right",size:"width",direction:1}),jme=v.forwardRef((e,t)=>{const{min:n,max:r,dir:a,inverted:i,onSlideStart:o,onSlideMove:c,onSlideEnd:d,onStepKeyDown:f,...h}=e,[p,y]=v.useState(null),g=ft(t,_=>y(_)),j=v.useRef(void 0),b=Lc(a),x=b==="ltr",S=x&&!i||!x&&i;function N(_){const P=j.current||p.getBoundingClientRect(),A=[0,P.width],k=uC(A,S?[n,r]:[r,n]);return j.current=P,k(_-P.left)}return s.jsx(M8,{scope:e.__scopeSlider,startEdge:S?"left":"right",endEdge:S?"right":"left",direction:S?1:-1,size:"width",children:s.jsx(D8,{dir:b,"data-orientation":"horizontal",...h,ref:g,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:_=>{const P=N(_.clientX);o?.(P)},onSlideMove:_=>{const P=N(_.clientX);c?.(P)},onSlideEnd:()=>{j.current=void 0,d?.()},onStepKeyDown:_=>{const A=R8[S?"from-left":"from-right"].includes(_.key);f?.({event:_,direction:A?-1:1})}})})}),Sme=v.forwardRef((e,t)=>{const{min:n,max:r,inverted:a,onSlideStart:i,onSlideMove:o,onSlideEnd:c,onStepKeyDown:d,...f}=e,h=v.useRef(null),p=ft(t,h),y=v.useRef(void 0),g=!a;function j(b){const x=y.current||h.current.getBoundingClientRect(),S=[0,x.height],_=uC(S,g?[r,n]:[n,r]);return y.current=x,_(b-x.top)}return s.jsx(M8,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:s.jsx(D8,{"data-orientation":"vertical",...f,ref:p,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:b=>{const x=j(b.clientY);i?.(x)},onSlideMove:b=>{const x=j(b.clientY);o?.(x)},onSlideEnd:()=>{y.current=void 0,c?.()},onStepKeyDown:b=>{const S=R8[g?"from-bottom":"from-top"].includes(b.key);d?.({event:b,direction:S?-1:1})}})})}),D8=v.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:a,onSlideEnd:i,onHomeKeyDown:o,onEndKeyDown:c,onStepKeyDown:d,...f}=e,h=Xv(Uc,n);return s.jsx(Be.span,{...f,ref:t,onKeyDown:Pe(e.onKeyDown,p=>{p.key==="Home"?(o(p),p.preventDefault()):p.key==="End"?(c(p),p.preventDefault()):O8.concat(k8).includes(p.key)&&(d(p),p.preventDefault())}),onPointerDown:Pe(e.onPointerDown,p=>{const y=p.target;y.setPointerCapture(p.pointerId),p.preventDefault(),h.thumbs.has(y)?y.focus():r(p)}),onPointerMove:Pe(e.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&a(p)}),onPointerUp:Pe(e.onPointerUp,p=>{const y=p.target;y.hasPointerCapture(p.pointerId)&&(y.releasePointerCapture(p.pointerId),i(p))})})}),L8="SliderTrack",F8=v.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=Xv(L8,n);return s.jsx(Be.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...r,ref:t})});F8.displayName=L8;var uS="SliderRange",B8=v.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=Xv(uS,n),i=$8(uS,n),o=v.useRef(null),c=ft(t,o),d=a.values.length,f=a.values.map(y=>q8(y,a.min,a.max)),h=d>1?Math.min(...f):0,p=100-Math.max(...f);return s.jsx(Be.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...r,ref:c,style:{...e.style,[i.startEdge]:h+"%",[i.endEdge]:p+"%"}})});B8.displayName=uS;var dS="SliderThumb",z8=v.forwardRef((e,t)=>{const n=xme(e.__scopeSlider),[r,a]=v.useState(null),i=ft(t,c=>a(c)),o=v.useMemo(()=>r?n().findIndex(c=>c.ref.current===r):-1,[n,r]);return s.jsx(Nme,{...e,ref:i,index:o})}),Nme=v.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:a,...i}=e,o=Xv(dS,n),c=$8(dS,n),[d,f]=v.useState(null),h=ft(t,N=>f(N)),p=d?o.form||!!d.closest("form"):!0,y=Rm(d),g=o.values[r],j=g===void 0?0:q8(g,o.min,o.max),b=Ame(r,o.values.length),x=y?.[c.size],S=x?Pme(x,j,c.direction):0;return v.useEffect(()=>{if(d)return o.thumbs.add(d),()=>{o.thumbs.delete(d)}},[d,o.thumbs]),s.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${j}% + ${S}px)`},children:[s.jsx(cS.ItemSlot,{scope:e.__scopeSlider,children:s.jsx(Be.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:Pe(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),p&&s.jsx(U8,{name:a??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:g},r)]})});z8.displayName=dS;var Cme="RadioBubbleInput",U8=v.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const a=v.useRef(null),i=ft(a,r),o=Bv(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(Be.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});U8.displayName=Cme;function _me(e=[],t,n){const r=[...e];return r[n]=t,r.sort((a,i)=>a-i)}function q8(e,t,n){const i=100/(n-t)*(e-t);return Vd(i,[0,100])}function Ame(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Eme(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 Pme(e,t,n){const r=e/2,i=uC([0,50],[0,r]);return(r-i(t)*n)*n}function Ome(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function kme(e,t){if(t>0){const n=Ome(e);return Math.min(...n)>=t}return!0}function uC(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 Rme(e){return(String(e).split(".")[1]||"").length}function Tme(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var W8=I8,Ime=F8,Mme=B8,$me=z8;const V8=v.forwardRef(({className:e,...t},n)=>s.jsxs(W8,{ref:n,className:je("relative flex w-full touch-none select-none items-center",e),...t,children:[s.jsx(Ime,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:s.jsx(Mme,{className:"absolute h-full bg-primary"})}),s.jsx($me,{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"})]}));V8.displayName=W8.displayName;function Dme(e){const t=Lme(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(Bme);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 Lme(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=Ume(a),c=zme(i,a.props);return a.type!==v.Fragment&&(c.ref=r?jr(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 Fme=Symbol("radix.slottable");function Bme(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Fme}function zme(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 Ume(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 Qv="Popover",[H8]=ir(Qv,[$i]),gf=$i(),[qme,Wi]=H8(Qv),K8=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!1}=e,c=gf(t),d=v.useRef(null),[f,h]=v.useState(!1),[p,y]=na({prop:r,defaultProp:a??!1,onChange:i,caller:Qv});return s.jsx(Tm,{...c,children:s.jsx(qme,{scope:t,contentId:Vn(),triggerRef:d,open:p,onOpenChange:y,onOpenToggle:v.useCallback(()=>y(g=>!g),[y]),hasCustomAnchor:f,onCustomAnchorAdd:v.useCallback(()=>h(!0),[]),onCustomAnchorRemove:v.useCallback(()=>h(!1),[]),modal:o,children:n})})};K8.displayName=Qv;var G8="PopoverAnchor",Wme=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Wi(G8,n),i=gf(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:c}=a;return v.useEffect(()=>(o(),()=>c()),[o,c]),s.jsx(Xd,{...i,...r,ref:t})});Wme.displayName=G8;var Y8="PopoverTrigger",X8=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Wi(Y8,n),i=gf(n),o=ft(t,a.triggerRef),c=s.jsx(Be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":tz(a.open),...r,ref:o,onClick:Pe(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:s.jsx(Xd,{asChild:!0,...i,children:c})});X8.displayName=Y8;var dC="PopoverPortal",[Vme,Hme]=H8(dC,{forceMount:void 0}),Q8=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=Wi(dC,t);return s.jsx(Vme,{scope:t,forceMount:n,children:s.jsx(Kn,{present:n||i.open,children:s.jsx(jc,{asChild:!0,container:a,children:r})})})};Q8.displayName=dC;var bc="PopoverContent",J8=v.forwardRef((e,t)=>{const n=Hme(bc,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=Wi(bc,e.__scopePopover);return s.jsx(Kn,{present:r||i.open,children:i.modal?s.jsx(Gme,{...a,ref:t}):s.jsx(Yme,{...a,ref:t})})});J8.displayName=bc;var Kme=Dme("PopoverContent.RemoveScroll"),Gme=v.forwardRef((e,t)=>{const n=Wi(bc,e.__scopePopover),r=v.useRef(null),a=ft(t,r),i=v.useRef(!1);return v.useEffect(()=>{const o=r.current;if(o)return Km(o)},[]),s.jsx(Jd,{as:Kme,allowPinchZoom:!0,children:s.jsx(Z8,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pe(e.onCloseAutoFocus,o=>{o.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Pe(e.onPointerDownOutside,o=>{const c=o.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,f=c.button===2||d;i.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:Pe(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),Yme=v.forwardRef((e,t)=>{const n=Wi(bc,e.__scopePopover),r=v.useRef(!1),a=v.useRef(!1);return s.jsx(Z8,{...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()}})}),Z8=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,y=Wi(bc,n),g=gf(n);return Vm(),s.jsx(Qd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(To,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>y.onOpenChange(!1),children:s.jsx(Im,{"data-state":tz(y.open),role:"dialog",id:y.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)"}})})})}),ez="PopoverClose",Xme=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Wi(ez,n);return s.jsx(Be.button,{type:"button",...r,ref:t,onClick:Pe(e.onClick,()=>a.onOpenChange(!1))})});Xme.displayName=ez;var Qme="PopoverArrow",Jme=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=gf(n);return s.jsx(Mm,{...a,...r,ref:t})});Jme.displayName=Qme;function tz(e){return e?"open":"closed"}var Zme=K8,eve=X8,tve=Q8,nz=J8;const nve=Zme,rve=eve,rz=v.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>s.jsx(tve,{children:s.jsx(nz,{ref:a,align:t,sideOffset:n,className:je("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));rz.displayName=nz.displayName;var nM=1,ave=.9,sve=.8,ive=.17,a1=.1,s1=.999,ove=.9999,lve=.99,cve=/[\\\/_+.#"@\[\(\{&]/,uve=/[\\\/_+.#"@\[\(\{&]/g,dve=/[\s-]/,az=/[\s-]/g;function fS(e,t,n,r,a,i,o){if(i===t.length)return a===e.length?nM:lve;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,y,g,j;f>=0;)p=fS(e,t,n,r,f+1,i+1,o),p>h&&(f===a?p*=nM:cve.test(e.charAt(f-1))?(p*=sve,g=e.slice(a,f-1).match(uve),g&&a>0&&(p*=Math.pow(s1,g.length))):dve.test(e.charAt(f-1))?(p*=ave,j=e.slice(a,f-1).match(az),j&&a>0&&(p*=Math.pow(s1,j.length))):(p*=ive,a>0&&(p*=Math.pow(s1,f-a))),e.charAt(f)!==t.charAt(i)&&(p*=ove)),(p<a1&&n.charAt(f-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(f-1)!==r.charAt(i))&&(y=fS(e,t,n,r,f+1,i+2,o),y*a1>p&&(p=y*a1)),p>h&&(h=p),f=n.indexOf(d,f+1);return o[c]=h,h}function rM(e){return e.toLowerCase().replace(az," ")}function fve(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,fS(e,t,rM(e),rM(t),0,0,{})}var Du='[cmdk-group=""]',i1='[cmdk-group-items=""]',pve='[cmdk-group-heading=""]',sz='[cmdk-item=""]',aM=`${sz}:not([aria-disabled="true"])`,pS="cmdk-item-select",jl="data-value",hve=(e,t,n)=>fve(e,t,n),iz=v.createContext(void 0),yf=()=>v.useContext(iz),oz=v.createContext(void 0),fC=()=>v.useContext(oz),lz=v.createContext(void 0),cz=v.forwardRef((e,t)=>{let n=Sl(()=>{var $,Z;return{search:"",value:(Z=($=e.value)!=null?$:e.defaultValue)!=null?Z:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Sl(()=>new Set),a=Sl(()=>new Map),i=Sl(()=>new Map),o=Sl(()=>new Set),c=uz(e),{label:d,children:f,value:h,onValueChange:p,filter:y,shouldFilter:g,loop:j,disablePointerSelection:b=!1,vimBindings:x=!0,...S}=e,N=Vn(),_=Vn(),P=Vn(),A=v.useRef(null),O=Cve();Ro(()=>{if(h!==void 0){let $=h.trim();n.current.value=$,k.emit()}},[h]),Ro(()=>{O(6,G)},[]);let k=v.useMemo(()=>({subscribe:$=>(o.current.add($),()=>o.current.delete($)),snapshot:()=>n.current,setState:($,Z,ae)=>{var V,ie,ne,de;if(!Object.is(n.current[$],Z)){if(n.current[$]=Z,$==="search")D(),z(),O(1,B);else if($==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let oe=document.getElementById(P);oe?oe.focus():(V=document.getElementById(N))==null||V.focus()}if(O(7,()=>{var oe;n.current.selectedItemId=(oe=U())==null?void 0:oe.id,k.emit()}),ae||O(5,G),((ie=c.current)==null?void 0:ie.value)!==void 0){let oe=Z??"";(de=(ne=c.current).onValueChange)==null||de.call(ne,oe);return}}k.emit()}},emit:()=>{o.current.forEach($=>$())}}),[]),R=v.useMemo(()=>({value:($,Z,ae)=>{var V;Z!==((V=i.current.get($))==null?void 0:V.value)&&(i.current.set($,{value:Z,keywords:ae}),n.current.filtered.items.set($,M(Z,ae)),O(2,()=>{z(),k.emit()}))},item:($,Z)=>(r.current.add($),Z&&(a.current.has(Z)?a.current.get(Z).add($):a.current.set(Z,new Set([$]))),O(3,()=>{D(),z(),n.current.value||B(),k.emit()}),()=>{i.current.delete($),r.current.delete($),n.current.filtered.items.delete($);let ae=U();O(4,()=>{D(),ae?.getAttribute("id")===$&&B(),k.emit()})}),group:$=>(a.current.has($)||a.current.set($,new Set),()=>{i.current.delete($),a.current.delete($)}),filter:()=>c.current.shouldFilter,label:d||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:N,inputId:P,labelId:_,listInnerRef:A}),[]);function M($,Z){var ae,V;let ie=(V=(ae=c.current)==null?void 0:ae.filter)!=null?V:hve;return $?ie($,n.current.search,Z):0}function z(){if(!n.current.search||c.current.shouldFilter===!1)return;let $=n.current.filtered.items,Z=[];n.current.filtered.groups.forEach(V=>{let ie=a.current.get(V),ne=0;ie.forEach(de=>{let oe=$.get(de);ne=Math.max(oe,ne)}),Z.push([V,ne])});let ae=A.current;W().sort((V,ie)=>{var ne,de;let oe=V.getAttribute("id"),ge=ie.getAttribute("id");return((ne=$.get(ge))!=null?ne:0)-((de=$.get(oe))!=null?de:0)}).forEach(V=>{let ie=V.closest(i1);ie?ie.appendChild(V.parentElement===ie?V:V.closest(`${i1} > *`)):ae.appendChild(V.parentElement===ae?V:V.closest(`${i1} > *`))}),Z.sort((V,ie)=>ie[1]-V[1]).forEach(V=>{var ie;let ne=(ie=A.current)==null?void 0:ie.querySelector(`${Du}[${jl}="${encodeURIComponent(V[0])}"]`);ne?.parentElement.appendChild(ne)})}function B(){let $=W().find(ae=>ae.getAttribute("aria-disabled")!=="true"),Z=$?.getAttribute(jl);k.setState("value",Z||void 0)}function D(){var $,Z,ae,V;if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ie=0;for(let ne of r.current){let de=(Z=($=i.current.get(ne))==null?void 0:$.value)!=null?Z:"",oe=(V=(ae=i.current.get(ne))==null?void 0:ae.keywords)!=null?V:[],ge=M(de,oe);n.current.filtered.items.set(ne,ge),ge>0&&ie++}for(let[ne,de]of a.current)for(let oe of de)if(n.current.filtered.items.get(oe)>0){n.current.filtered.groups.add(ne);break}n.current.filtered.count=ie}function G(){var $,Z,ae;let V=U();V&&((($=V.parentElement)==null?void 0:$.firstChild)===V&&((ae=(Z=V.closest(Du))==null?void 0:Z.querySelector(pve))==null||ae.scrollIntoView({block:"nearest"})),V.scrollIntoView({block:"nearest"}))}function U(){var $;return($=A.current)==null?void 0:$.querySelector(`${sz}[aria-selected="true"]`)}function W(){var $;return Array.from((($=A.current)==null?void 0:$.querySelectorAll(aM))||[])}function X($){let Z=W()[$];Z&&k.setState("value",Z.getAttribute(jl))}function J($){var Z;let ae=U(),V=W(),ie=V.findIndex(de=>de===ae),ne=V[ie+$];(Z=c.current)!=null&&Z.loop&&(ne=ie+$<0?V[V.length-1]:ie+$===V.length?V[0]:V[ie+$]),ne&&k.setState("value",ne.getAttribute(jl))}function T($){let Z=U(),ae=Z?.closest(Du),V;for(;ae&&!V;)ae=$>0?Sve(ae,Du):Nve(ae,Du),V=ae?.querySelector(aM);V?k.setState("value",V.getAttribute(jl)):J($)}let L=()=>X(W().length-1),Q=$=>{$.preventDefault(),$.metaKey?L():$.altKey?T(1):J(1)},F=$=>{$.preventDefault(),$.metaKey?X(0):$.altKey?T(-1):J(-1)};return v.createElement(Be.div,{ref:t,tabIndex:-1,...S,"cmdk-root":"",onKeyDown:$=>{var Z;(Z=S.onKeyDown)==null||Z.call(S,$);let ae=$.nativeEvent.isComposing||$.keyCode===229;if(!($.defaultPrevented||ae))switch($.key){case"n":case"j":{x&&$.ctrlKey&&Q($);break}case"ArrowDown":{Q($);break}case"p":case"k":{x&&$.ctrlKey&&F($);break}case"ArrowUp":{F($);break}case"Home":{$.preventDefault(),X(0);break}case"End":{$.preventDefault(),L();break}case"Enter":{$.preventDefault();let V=U();if(V){let ie=new Event(pS);V.dispatchEvent(ie)}}}}},v.createElement("label",{"cmdk-label":"",htmlFor:R.inputId,id:R.labelId,style:Ave},d),Jv(e,$=>v.createElement(oz.Provider,{value:k},v.createElement(iz.Provider,{value:R},$))))}),mve=v.forwardRef((e,t)=>{var n,r;let a=Vn(),i=v.useRef(null),o=v.useContext(lz),c=yf(),d=uz(e),f=(r=(n=d.current)==null?void 0:n.forceMount)!=null?r:o?.forceMount;Ro(()=>{if(!f)return c.item(a,o?.id)},[f]);let h=dz(a,i,[e.value,e.children,i],e.keywords),p=fC(),y=Mi(O=>O.value&&O.value===h.current),g=Mi(O=>f||c.filter()===!1?!0:O.search?O.filtered.items.get(a)>0:!0);v.useEffect(()=>{let O=i.current;if(!(!O||e.disabled))return O.addEventListener(pS,j),()=>O.removeEventListener(pS,j)},[g,e.onSelect,e.disabled]);function j(){var O,k;b(),(k=(O=d.current).onSelect)==null||k.call(O,h.current)}function b(){p.setState("value",h.current,!0)}if(!g)return null;let{disabled:x,value:S,onSelect:N,forceMount:_,keywords:P,...A}=e;return v.createElement(Be.div,{ref:jr(i,t),...A,id:a,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!y,"data-disabled":!!x,"data-selected":!!y,onPointerMove:x||c.getDisablePointerSelection()?void 0:b,onClick:x?void 0:j},e.children)}),vve=v.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...i}=e,o=Vn(),c=v.useRef(null),d=v.useRef(null),f=Vn(),h=yf(),p=Mi(g=>a||h.filter()===!1?!0:g.search?g.filtered.groups.has(o):!0);Ro(()=>h.group(o),[]),dz(o,c,[e.value,e.heading,d]);let y=v.useMemo(()=>({id:o,forceMount:a}),[a]);return v.createElement(Be.div,{ref:jr(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),Jv(e,g=>v.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},v.createElement(lz.Provider,{value:y},g))))}),gve=v.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=v.useRef(null),i=Mi(o=>!o.search);return!n&&!i?null:v.createElement(Be.div,{ref:jr(a,t),...r,"cmdk-separator":"",role:"separator"})}),yve=v.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,i=fC(),o=Mi(f=>f.search),c=Mi(f=>f.selectedItemId),d=yf();return v.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),v.createElement(Be.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)}})}),xve=v.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,i=v.useRef(null),o=v.useRef(null),c=Mi(f=>f.selectedItemId),d=yf();return v.useEffect(()=>{if(o.current&&i.current){let f=o.current,h=i.current,p,y=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let g=f.offsetHeight;h.style.setProperty("--cmdk-list-height",g.toFixed(1)+"px")})});return y.observe(f),()=>{cancelAnimationFrame(p),y.unobserve(f)}}},[]),v.createElement(Be.div,{ref:jr(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:d.listId},Jv(e,f=>v.createElement("div",{ref:jr(o,d.listInnerRef),"cmdk-list-sizer":""},f)))}),bve=v.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:i,container:o,...c}=e;return v.createElement(Ym,{open:n,onOpenChange:r},v.createElement(Xm,{container:o},v.createElement(Pc,{"cmdk-overlay":"",className:a}),v.createElement(Oc,{"aria-label":e.label,"cmdk-dialog":"",className:i},v.createElement(cz,{ref:t,...c}))))}),wve=v.forwardRef((e,t)=>Mi(n=>n.filtered.count===0)?v.createElement(Be.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),jve=v.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...i}=e;return v.createElement(Be.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Jv(e,o=>v.createElement("div",{"aria-hidden":!0},o)))}),Ir=Object.assign(cz,{List:xve,Item:mve,Input:yve,Group:vve,Separator:gve,Dialog:bve,Empty:wve,Loading:jve});function Sve(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Nve(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function uz(e){let t=v.useRef(e);return Ro(()=>{t.current=e}),t}var Ro=typeof window>"u"?v.useEffect:v.useLayoutEffect;function Sl(e){let t=v.useRef();return t.current===void 0&&(t.current=e()),t}function Mi(e){let t=fC(),n=()=>e(t.snapshot());return v.useSyncExternalStore(t.subscribe,n,n)}function dz(e,t,n,r=[]){let a=v.useRef(),i=yf();return Ro(()=>{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(jl,c),a.current=c}),a}var Cve=()=>{let[e,t]=v.useState(),n=Sl(()=>new Map);return Ro(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function _ve(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Jv({asChild:e,children:t},n){return e&&v.isValidElement(t)?v.cloneElement(_ve(t),{ref:t.ref},n(t.props.children)):n(t)}var Ave={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const fz=v.forwardRef(({className:e,...t},n)=>s.jsx(Ir,{ref:n,className:je("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));fz.displayName=Ir.displayName;const pz=v.forwardRef(({className:e,...t},n)=>s.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[s.jsx(jS,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),s.jsx(Ir.Input,{ref:n,className:je("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));pz.displayName=Ir.Input.displayName;const hz=v.forwardRef(({className:e,...t},n)=>s.jsx(Ir.List,{ref:n,className:je("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));hz.displayName=Ir.List.displayName;const mz=v.forwardRef((e,t)=>s.jsx(Ir.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));mz.displayName=Ir.Empty.displayName;const vz=v.forwardRef(({className:e,...t},n)=>s.jsx(Ir.Group,{ref:n,className:je("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));vz.displayName=Ir.Group.displayName;const Eve=v.forwardRef(({className:e,...t},n)=>s.jsx(Ir.Separator,{ref:n,className:je("-mx-1 h-px bg-border",e),...t}));Eve.displayName=Ir.Separator.displayName;const hS=v.forwardRef(({className:e,...t},n)=>s.jsx(Ir.Item,{ref:n,className:je("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...t}));hS.displayName=Ir.Item.displayName;const sM={openai:["gpt-4o","gpt-4o-mini","gpt-4-turbo","o1","o1-mini"],anthropic:["claude-3-5-sonnet-latest","claude-3-5-haiku-latest","claude-3-opus-latest"],azure:["gpt-4o","gpt-4-turbo"],google:["gemini-2.0-flash","gemini-1.5-pro"],custom:[]},iM={anthropic:"Check that `ANTHROPIC_API_KEY` is set in your environment",openai:"Check that `OPENAI_API_KEY` is set in your environment",azure:"Check that Azure OpenAI env vars are configured in your environment"},Pve=()=>({id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096}),Ove=()=>{const{agentName:e}=Mo(),t=ja(),{agents:n,setAgents:r}=Ua(),{source:a}=Pn(),i=e==="new",o=e?decodeURIComponent(e):"",c=i?null:n.find(T=>T.id===o)??n.find(T=>T.name===o),[d,f]=v.useState(()=>c??Pve()),[h,p]=v.useState(!1),[y,g]=v.useState(!1),[j,b]=v.useState({status:"idle"}),[x,S]=v.useState(!1),[N,_]=v.useState([]),[P,A]=v.useState(!1),[O,k]=v.useState(!1),[R,M]=v.useState(!1);v.useEffect(()=>{c&&f(c)},[c]);const z=d.provider==="anthropic"||d.provider==="openai"||d.provider==="azure",B=Array.from(new Set([...sM[d.provider]||[],...N])),D=B.includes(d.model),G=R||!!d.model&&!D,U=async()=>{if(S(!0),d.provider==="google"||d.provider==="custom"){b({status:"unsupported"});return}b({status:"loading"});try{const T=await a.listProviderModels(d.provider);b({status:"success",items:T.items,source:T.source,kind:T.kind,testedAt:new Date().toISOString()})}catch(T){b({status:"error",message:T instanceof Error?T.message:String(T),testedAt:new Date().toISOString()})}},W=async()=>{if(!z){Oe({title:"Provider discovery not supported",description:"Model discovery is available for Anthropic, OpenAI, and Azure OpenAI."});return}A(!0);try{const T=await a.listProviderModels(d.provider);_(T.items),Oe({title:T.kind==="deployments"?"Deployments loaded":"Models loaded",description:`${T.items.length} ${T.kind} from ${T.source}`})}catch(T){Oe({title:"Could not load provider models",description:String(T instanceof Error?T.message:T),variant:"destructive"})}finally{A(!1)}},X=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 T=n.map(L=>L.id===c?.id?d:L);await r(T),Oe({title:"Agent saved"}),d.id!==o&&t(`/libraries/agents/${encodeURIComponent(d.id)}`,{replace:!0})}}finally{g(!1)}},J=async()=>{const T=n.filter(L=>L.id!==c?.id);await r(T),Oe({title:"Agent deleted"}),t("/libraries/agents")};return!i&&!c?s.jsxs("div",{className:"space-y-4",children:[s.jsxs(yt,{to:"/libraries/agents",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(xo,{className:"h-4 w-4"})," Agents"]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:['Agent "',o,'" not found.']})]}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsxs(yt,{to:"/libraries/agents",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(xo,{className:"h-4 w-4"})," Agents"]}),s.jsx("h1",{className:"text-2xl font-bold",children:i?"New Agent":d.name})]}),!i&&s.jsxs(se,{type:"button",onClick:()=>{U()},children:[s.jsx(c$,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),x&&s.jsxs(Ue,{children:[s.jsxs(Nt,{className:"flex-row items-center justify-between space-y-0",children:[s.jsx(Ct,{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(Us,{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(sr,{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(ql,{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(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(j.testedAt).toLocaleString()]})]}),j.status==="error"&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("p",{className:"text-sm text-destructive",children:[s.jsx("span",{className:"font-medium",children:"✗ Connection failed"})," —"," ",j.message]}),iM[d.provider]&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",iM[d.provider]]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(j.testedAt).toLocaleString()]})]}),j.status==="unsupported"&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-sm text-muted-foreground",children:["Connection testing is not supported for the"," ",s.jsx("span",{className:"font-medium",children:d.provider})," provider. Supported providers: Anthropic, OpenAI, Azure OpenAI."]})]})]}),s.jsxs(Ue,{children:[s.jsx(Nt,{children:s.jsx(Ct,{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($e,{children:"Name"}),s.jsx(mt,{value:d.name,onChange:T=>f(L=>({...L,name:T.target.value})),placeholder:"e.g. GPT-4o"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{children:"Provider"}),s.jsxs(sn,{value:d.provider,onValueChange:T=>f(L=>({...L,provider:T,model:sM[T]?.[0]||""})),children:[s.jsx(Qt,{children:s.jsx(on,{})}),s.jsxs(Jt,{children:[s.jsx(st,{value:"openai",children:"OpenAI"}),s.jsx(st,{value:"anthropic",children:"Anthropic"}),s.jsx(st,{value:"azure",children:"Azure OpenAI"}),s.jsx(st,{value:"google",children:"Google"}),s.jsx(st,{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($e,{children:d.provider==="azure"?"Deployment":"Model"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(nve,{open:O,onOpenChange:k,children:[s.jsx(rve,{asChild:!0,children:s.jsxs(se,{type:"button",variant:"outline",role:"combobox","aria-expanded":O,className:"h-9 flex-1 justify-between font-mono text-xs",children:[s.jsx("span",{className:"truncate text-left",children:d.model||"Select model..."}),s.jsx(Wt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(rz,{className:"w-[420px] p-0",align:"start",children:s.jsxs(fz,{children:[s.jsx(pz,{placeholder:`Search ${d.provider==="azure"?"deployments":"models"}...`}),s.jsxs(hz,{children:[s.jsxs(mz,{children:["No ",d.provider==="azure"?"deployments":"models"," found."]}),s.jsxs(vz,{heading:d.provider==="azure"?"Deployments":"Models",children:[B.map(T=>s.jsxs(hS,{value:T,onSelect:L=>{f(Q=>({...Q,model:L})),M(!1),k(!1)},children:[s.jsx(ql,{className:je("mr-2 h-4 w-4",d.model===T?"opacity-100":"opacity-0")}),s.jsx("span",{className:"font-mono text-xs",children:T})]},T)),s.jsx(hS,{value:"__custom_model_id__",onSelect:()=>{M(!0),k(!1)},children:s.jsx("span",{className:"font-medium",children:d.provider==="azure"?"Custom deployment ID...":"Custom model ID..."})})]})]})]})})]}),z&&s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-9 shrink-0 text-xs",onClick:()=>{W()},disabled:P,title:d.provider==="azure"?"Fetch Azure OpenAI deployments":`Fetch ${d.provider} models`,children:[P?s.jsx(sr,{className:"mr-1 h-3 w-3 animate-spin"}):s.jsx(xa,{className:"mr-1 h-3 w-3"}),d.provider==="azure"?"Fetch Deployments":"Fetch Models"]})]}),G&&s.jsx(mt,{value:d.model,onChange:T=>f(L=>({...L,model:T.target.value})),placeholder:d.provider==="azure"?"Type deployment name manually":"Type model name manually",className:"font-mono text-xs"}),N.length>0&&s.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Loaded ",N.length," ",d.provider==="azure"?"deployment names":"models"," from provider discovery."]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{children:"Max Tokens"}),s.jsx(mt,{type:"number",min:1,max:128e3,value:d.maxTokens,onChange:T=>f(L=>({...L,maxTokens:parseInt(T.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($e,{children:"Max Turns"}),s.jsx(mt,{type:"number",min:1,max:50,value:d.maxTurns??"",onChange:T=>{const L=T.target.value.trim();f(Q=>({...Q,maxTurns:L&&parseInt(L)||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($e,{children:"Temperature"}),s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:d.temperature.toFixed(2)})]}),s.jsx(V8,{value:[d.temperature],onValueChange:([T])=>f(L=>({...L,temperature:T})),min:0,max:2,step:.01})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{children:"System Prompt"}),s.jsx(Gs,{value:d.systemPrompt||"",onChange:T=>f(L=>({...L,systemPrompt:T.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(se,{type:"button",variant:"destructive",size:"sm",onClick:()=>p(!0),children:"Delete"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(se,{type:"button",variant:"outline",size:"sm",onClick:()=>t("/libraries/agents"),children:"Cancel"}),s.jsxs(se,{type:"button",size:"sm",onClick:()=>{X()},disabled:y,children:[y&&s.jsx(sr,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Create Agent":"Save"]})]})]})]})]}),s.jsx(bs,{open:h,onOpenChange:p,children:s.jsxs(Wa,{children:[s.jsxs(Va,{children:[s.jsx(Ka,{children:"Delete agent?"}),s.jsxs(Ga,{children:["This will permanently remove the agent"," ",s.jsx("span",{className:"font-mono",children:d.name}),". This action cannot be undone."]})]}),s.jsxs(Ha,{children:[s.jsx(Xa,{children:"Cancel"}),s.jsx(Ya,{onClick:()=>{J()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},oM="mcplab.resultAssistantScenarioHandoff",lM=()=>{const{testCaseId:e}=Mo(),[t,n]=Ec(),r=ja(),{source:a}=Pn(),{scenarios:i,setScenarios:o,agents:c,servers:d,reload:f,loading:h}=Ua(),[p,y]=v.useState(""),[g,j]=v.useState("all"),[b,x]=v.useState("name"),[S,N]=v.useState("asc"),[_,P]=v.useState(""),[A,O]=v.useState(null),[k,R]=v.useState("idle"),[M,z]=v.useState(""),[B,D]=v.useState(""),[G,U]=v.useState(0),[W,X]=v.useState(null),J=v.useRef(null),T=v.useRef(!1),L=v.useRef(!1),Q=v.useRef(null),F=v.useRef(0),$=e?decodeURIComponent(e):void 0,Z=$?i.findIndex(ye=>ye.id===$):-1,ae=Z>=0?i[Z]:void 0,V=async ye=>{if(!ae||Z<0||!ye)return;const Ee=[...i];Ee[Z]=ye,await o(Ee)},ie=async()=>{const ye=Q.current;if(!ye||!ae)return;if(T.current){L.current=!0;return}T.current=!0,L.current=!1;const Ee=++F.current;R("saving"),z("");try{await V(ye),Ee===F.current&&R("saved")}catch(le){const _e=le instanceof Error?le.message:String(le);Ee===F.current&&(R("error"),z(_e)),Oe({title:"Could not save scenario",description:_e,variant:"destructive"})}finally{T.current=!1,L.current&&(L.current=!1,ie())}},ne=ye=>{Q.current=ye,R("dirty"),z(""),J.current&&window.clearTimeout(J.current),J.current=window.setTimeout(()=>{J.current=null,ie()},700)},de=async()=>{const ye=`scn-${Date.now()}`;let Ee=ye,le=1;for(;i.some(pe=>pe.id===Ee);)Ee=`${ye}-${le}`,le+=1;const _e={id:Ee,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};await o([...i,_e]),r(`/libraries/test-cases/${encodeURIComponent(Ee)}`),Oe({title:"Test case created",description:`Opened ${Ee} for editing.`})},oe=ye=>{const Ee=(ye||`scn-${Date.now()}`).trim().replace(/\s+/g,"-").replace(/[^a-zA-Z0-9_-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")||`scn-${Date.now()}`;let le=Ee,_e=1;for(;i.some(pe=>pe.id===le);)le=`${Ee}-${_e}`,_e+=1;return le},ge=async(ye,Ee=!1)=>{const le=oe(`${ye.id}-copy`),_e={...structuredClone(ye),id:le,name:ye.name?`${ye.name} (Copy)`:""};await o([...i,_e]),Oe({title:"Test case duplicated",description:`Created ${_e.id}.`}),Ee&&r(`/libraries/test-cases/${encodeURIComponent(_e.id)}`)},Re=async ye=>{J.current&&(window.clearTimeout(J.current),J.current=null);const Ee=i.filter(le=>le.id!==ye.id);await o(Ee),Oe({title:"Test case deleted",description:`${ye.id} was removed.`}),ae?.id===ye.id&&(O(null),Q.current=null,R("idle"),z(""),r("/libraries/test-cases"))},re=ye=>ye.map(Ee=>d.find(le=>le.id===Ee)).filter(Boolean).map(Ee=>Ee?.name||Ee?.id).filter(Boolean),De=v.useMemo(()=>{const ye=new Set;for(const Ee of i)for(const le of re(Ee.serverIds))ye.add(le);return Array.from(ye).sort((Ee,le)=>Ee.localeCompare(le))},[i,d]),Ae=v.useMemo(()=>{const ye=p.trim().toLowerCase(),Ee=i.filter(le=>{const _e=(le.name||"").toLowerCase(),pe=le.id.toLowerCase(),we=(le.prompt||"").toLowerCase(),Se=re(le.serverIds);return g!=="all"&&!Se.includes(g)?!1:ye?_e.includes(ye)||pe.includes(ye)||we.includes(ye)||Se.some(Ve=>Ve.toLowerCase().includes(ye)):!0});return Ee.sort((le,_e)=>{const pe=re(le.serverIds),we=re(_e.serverIds);let Se=0;switch(b){case"id":Se=le.id.localeCompare(_e.id);break;case"servers":Se=pe.length-we.length;break;case"evalRules":Se=le.evalRules.length-_e.evalRules.length;break;case"extractRules":Se=le.extractRules.length-_e.extractRules.length;break;default:Se=(le.name||le.id).localeCompare(_e.name||_e.id);break}return Se===0&&(Se=le.id.localeCompare(_e.id)),S==="asc"?Se:-Se}),Ee},[i,p,g,b,S,d]);v.useEffect(()=>{let ye=!0;return a.getWorkspaceSettings().then(Ee=>{!ye||!Ee||P(Ee.scenarioAssistantAgentName??"")}).catch(()=>{ye&&P("")}),()=>{ye=!1}},[a]),v.useEffect(()=>{if($&&t.get("assistantHandoff")==="1")try{const ye=window.sessionStorage.getItem(oM);if(!ye)return;const Ee=JSON.parse(ye);if(!Ee||Ee.scenarioId!==$||!Ee.prompt)return;D(String(Ee.prompt)),U(Date.now()),window.sessionStorage.removeItem(oM);const le=new URLSearchParams(t);le.delete("assistantHandoff"),n(le,{replace:!0}),Oe({title:"Suggestion sent to Scenario Assistant",description:"Review the suggestion and apply changes in the scenario editor."})}catch{}},[$,t,n]),v.useEffect(()=>{ae?(O(structuredClone(ae)),Q.current=structuredClone(ae),R("idle"),z("")):(O(null),Q.current=null,R("idle"),z("")),J.current&&(window.clearTimeout(J.current),J.current=null),T.current=!1,L.current=!1},[ae]),v.useEffect(()=>()=>{J.current&&window.clearTimeout(J.current)},[]);const We=_||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(t$,{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:[ae&&s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>r("/libraries/test-cases"),children:[s.jsx(xo,{className:"mr-2 h-4 w-4"}),"Back to Overview"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{f()},disabled:h,children:[s.jsx(xa,{className:"mr-2 h-4 w-4"}),"Refresh"]}),!ae&&s.jsxs(se,{type:"button",size:"sm",onClick:()=>{de()},children:[s.jsx(us,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Test Case"]})]})]}),!ae&&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($e,{className:"text-xs",children:"Search"}),s.jsxs("div",{className:"relative",children:[s.jsx(jS,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),s.jsx(mt,{value:p,onChange:ye=>y(ye.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($e,{className:"text-xs",children:"Server Filter"}),s.jsxs(sn,{value:g,onValueChange:j,children:[s.jsx(Qt,{className:"h-8 text-xs",children:s.jsx(on,{})}),s.jsxs(Jt,{children:[s.jsx(st,{value:"all",children:"All servers"}),De.map(ye=>s.jsx(st,{value:ye,children:ye},ye))]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Sort By"}),s.jsxs(sn,{value:b,onValueChange:ye=>x(ye),children:[s.jsx(Qt,{className:"h-8 text-xs",children:s.jsx(on,{})}),s.jsxs(Jt,{children:[s.jsx(st,{value:"name",children:"Name"}),s.jsx(st,{value:"id",children:"ID"}),s.jsx(st,{value:"servers",children:"# Servers"}),s.jsx(st,{value:"evalRules",children:"# Eval Rules"}),s.jsx(st,{value:"extractRules",children:"# Extract Rules"})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Direction"}),s.jsxs(sn,{value:S,onValueChange:ye=>N(ye),children:[s.jsx(Qt,{className:"h-8 w-28 text-xs",children:s.jsx(on,{})}),s.jsxs(Jt,{children:[s.jsx(st,{value:"asc",children:"Ascending"}),s.jsx(st,{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 ",Ae.length," of ",i.length," test case",i.length!==1?"s":"","."]}),$&&!ae&&s.jsxs("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900",children:["Test case ",s.jsx("code",{className:"font-mono",children:$})," was not found."]}),i.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No library test cases yet."}):Ae.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No test cases match the current filters."}):s.jsx("div",{className:"grid gap-3",children:Ae.map(ye=>{const Ee=$===ye.id,le=`/libraries/test-cases/${encodeURIComponent(ye.id)}`,_e=re(ye.serverIds);return s.jsx("div",{className:`rounded-lg border p-3 ${Ee?"border-primary bg-primary/5":""}`,children:s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"space-y-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx(yt,{to:le,className:"font-medium truncate hover:underline",children:ye.name||ye.id}),s.jsx(Je,{variant:"outline",className:"font-mono text-[10px]",children:ye.id}),Ee&&s.jsx(Je,{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:[_e.length," server",_e.length!==1?"s":""]}),s.jsxs("span",{children:[ye.evalRules.length," eval rule",ye.evalRules.length!==1?"s":""]}),s.jsxs("span",{children:[ye.extractRules.length," extract rule",ye.extractRules.length!==1?"s":""]})]}),_e.length>0&&s.jsx("div",{className:"flex flex-wrap gap-1",children:_e.map(pe=>s.jsx(Je,{variant:"secondary",className:"text-[10px]",children:pe},`${ye.id}-${pe}`))})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(se,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>X(ye),children:[s.jsx(ba,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{ge(ye)},children:[s.jsx(Ri,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsx(se,{type:"button",size:"sm",variant:Ee?"default":"outline",asChild:!0,children:s.jsxs(yt,{to:le,children:[s.jsx(Am,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})})]})]})},ye.id)})})]})})]}),ae&&A?s.jsxs(Ue,{children:[s.jsxs(Nt,{className:"pb-3",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsx("div",{children:s.jsx(Ct,{className:"text-base",children:"Edit Test Case"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{ge(A,!0)},children:[s.jsx(Ri,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>X(A),children:[s.jsx(ba,{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:ae.id}),"."]}),s.jsx(Je,{variant:"outline",className:`text-[10px] ${k==="saving"?"border-amber-300 text-amber-700":k==="saved"?"border-emerald-300 text-emerald-700":k==="error"?"border-destructive/40 text-destructive":k==="dirty"?"border-sky-300 text-sky-700":""}`,children:k==="saving"?"Saving...":k==="saved"?"Saved":k==="error"?"Save failed":k==="dirty"?"Unsaved changes":"Ready"}),k==="error"&&M&&s.jsx("span",{className:"text-[11px] text-destructive",children:M})]})})]}),s.jsx(qe,{className:"pt-3",children:s.jsx(lS,{scenarios:[A],agents:c,servers:d,defaultAssistantAgentName:We,assistantInitialPromptByScenarioId:B&&A?.id?{[A.id]:B}:void 0,assistantAutoOpenNonceByScenarioId:A?.id&&G?{[A.id]:G}:void 0,onChange:ye=>{const Ee=ye[0];Ee&&(O(Ee),ne(Ee))},allowAdd:!1})})]}):null,s.jsx(bs,{open:!!W,onOpenChange:ye=>!ye&&X(null),children:s.jsxs(Wa,{children:[s.jsxs(Va,{children:[s.jsx(Ka,{children:"Delete test case?"}),s.jsxs(Ga,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-medium",children:W?.name||W?.id})," ","from the library. This action cannot be undone."]})]}),s.jsxs(Ha,{children:[s.jsx(Xa,{children:"Cancel"}),s.jsx(Ya,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{W&&(Re(W),X(null))},children:"Delete Test Case"})]})]})})]})},kve=()=>{const{source:e}=Pn(),{agents:t,reload:n,loading:r}=Ua(),[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 y=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(SS,{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(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{g()},disabled:r||a,children:[s.jsx(xa,{className:"mr-2 h-4 w-4"}),"Refresh"]})]}),s.jsxs(Ue,{children:[s.jsxs(Nt,{className:"pb-3",children:[s.jsx(Ct,{className:"text-base",children:"Scenario Assistant"}),s.jsx(Ds,{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($e,{className:"text-xs",children:"Assistant Agent"}),s.jsxs(sn,{value:h||"__none__",onValueChange:j=>{y(j==="__none__"?"":j)},disabled:o,children:[s.jsx(Qt,{className:"h-9 text-sm",children:s.jsx(on,{placeholder:"Select assistant agent"})}),s.jsxs(Jt,{children:[s.jsx(st,{value:"__none__",children:"None (use first agent)"}),t.map(j=>s.jsxs(st,{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 Zv="Checkbox",[Rve]=ir(Zv),[Tve,pC]=Rve(Zv);function Ive(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,[y,g]=na({prop:n,defaultProp:a??!1,onChange:d,caller:Zv}),[j,b]=v.useState(null),[x,S]=v.useState(null),N=v.useRef(!1),_=j?!!o||!!j.closest("form"):!0,P={checked:y,disabled:i,setChecked:g,control:j,setControl:b,name:c,form:o,value:h,hasConsumerStoppedPropagationRef:N,required:f,defaultChecked:ki(a)?!1:a,isFormControl:_,bubbleInput:x,setBubbleInput:S};return s.jsx(Tve,{scope:t,...P,children:Mve(p)?p(P):r})}var gz="CheckboxTrigger",yz=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:y,isFormControl:g,bubbleInput:j}=pC(gz,e),b=ft(a,h),x=v.useRef(d);return v.useEffect(()=>{const S=i?.form;if(S){const N=()=>p(x.current);return S.addEventListener("reset",N),()=>S.removeEventListener("reset",N)}},[i,p]),s.jsx(Be.button,{type:"button",role:"checkbox","aria-checked":ki(d)?"mixed":d,"aria-required":f,"data-state":Sz(d),"data-disabled":c?"":void 0,disabled:c,value:o,...r,ref:b,onKeyDown:Pe(t,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:Pe(n,S=>{p(N=>ki(N)?!0:!N),j&&g&&(y.current=S.isPropagationStopped(),y.current||S.stopPropagation())})})});yz.displayName=gz;var hC=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(Ive,{__scopeCheckbox:n,checked:a,defaultChecked:i,disabled:c,required:o,onCheckedChange:f,name:r,form:h,value:d,internal_do_not_use_render:({isFormControl:y})=>s.jsxs(s.Fragment,{children:[s.jsx(yz,{...p,ref:t,__scopeCheckbox:n}),y&&s.jsx(jz,{__scopeCheckbox:n})]})})});hC.displayName=Zv;var xz="CheckboxIndicator",bz=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,i=pC(xz,n);return s.jsx(Kn,{present:r||ki(i.checked)||i.checked===!0,children:s.jsx(Be.span,{"data-state":Sz(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});bz.displayName=xz;var wz="CheckboxBubbleInput",jz=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:y,setBubbleInput:g}=pC(wz,e),j=ft(n,g),b=Bv(i),x=Rm(r);v.useEffect(()=>{const N=y;if(!N)return;const _=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(_,"checked").set,O=!a.current;if(b!==i&&A){const k=new Event("click",{bubbles:O});N.indeterminate=ki(i),A.call(N,ki(i)?!1:i),N.dispatchEvent(k)}},[y,b,i,a]);const S=v.useRef(ki(i)?!1:i);return s.jsx(Be.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??S.current,required:c,disabled:d,name:f,value:h,form:p,...t,tabIndex:-1,ref:j,style:{...t.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});jz.displayName=wz;function Mve(e){return typeof e=="function"}function ki(e){return e==="indeterminate"}function Sz(e){return ki(e)?"indeterminate":e?"checked":"unchecked"}const va=v.forwardRef(({className:e,...t},n)=>s.jsx(hC,{ref:n,className:je("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:s.jsx(bz,{className:je("flex items-center justify-center text-current"),children:s.jsx(ql,{className:"h-4 w-4"})})}));va.displayName=hC.displayName;const $ve=Io("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"}}),Bl=v.forwardRef(({className:e,variant:t,...n},r)=>s.jsx("div",{ref:r,role:"alert",className:je($ve({variant:t}),e),...n}));Bl.displayName="Alert";const zl=v.forwardRef(({className:e,...t},n)=>s.jsx("h5",{ref:n,className:je("mb-1 font-medium leading-none tracking-tight",e),...t}));zl.displayName="AlertTitle";const Ul=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:je("text-sm [&_p]:leading-relaxed",e),...t}));Ul.displayName="AlertDescription";function Dve(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:y,children:g,...j}=p,b=y?.[e]?.[d]||c,x=v.useMemo(()=>j,Object.values(j));return s.jsx(b.Provider,{value:x,children:g})};f.displayName=i+"Provider";function h(p,y){const g=y?.[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,Lve(a,...t)]}function Lve(...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 Fve=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Nz=Fve.reduce((e,t)=>{const n=Wm(`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}},{}),mC="Progress",vC=100,[Bve]=Dve(mC),[zve,Uve]=Bve(mC),Cz=v.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:a,getValueLabel:i=qve,...o}=e;(a||a===0)&&!cM(a)&&console.error(Wve(`${a}`,"Progress"));const c=cM(a)?a:vC;r!==null&&!uM(r,c)&&console.error(Vve(`${r}`,"Progress"));const d=uM(r,c)?r:null,f=jm(d)?i(d,c):void 0;return s.jsx(zve,{scope:n,value:d,max:c,children:s.jsx(Nz.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":jm(d)?d:void 0,"aria-valuetext":f,role:"progressbar","data-state":Ez(d,c),"data-value":d??void 0,"data-max":c,...o,ref:t})})});Cz.displayName=mC;var _z="ProgressIndicator",Az=v.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,a=Uve(_z,n);return s.jsx(Nz.div,{"data-state":Ez(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...r,ref:t})});Az.displayName=_z;function qve(e,t){return`${Math.round(e/t*100)}%`}function Ez(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function jm(e){return typeof e=="number"}function cM(e){return jm(e)&&!isNaN(e)&&e>0}function uM(e,t){return jm(e)&&!isNaN(e)&&e<=t&&e>=0}function Wve(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${vC}\`.`}function Vve(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 ${vC} if no \`max\` prop is set)
133
- - \`null\` or \`undefined\` if the progress is indeterminate.
134
-
135
- Defaulting to \`null\`.`}var Pz=Cz,Hve=Az;const eg=v.forwardRef(({className:e,value:t,...n},r)=>s.jsx(Pz,{ref:r,className:je("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:s.jsx(Hve,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));eg.displayName=Pz.displayName;const Lu=["critical","high","medium","low","info"];function o1(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 Kve(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 dM({text:e}){return s.jsxs("div",{className:"mt-2 rounded-md border px-2.5 py-2 text-[11px] text-slate-800",children:[s.jsxs("div",{className:"mb-1 inline-flex items-center gap-1 font-medium text-slate-700",children:[s.jsx(RU,{className:"h-3.5 w-3.5"}),"Suggested improvement"]}),s.jsx("p",{children:e})]})}function gC(e){const t=[];t.push("# MCP Tool Analysis Report",""),t.push(`- Created: ${e.createdAt}`),t.push(`- Assistant Agent: ${e.assistantAgentName}`),t.push(`- Assistant Model: ${e.assistantAgentModel}`),t.push(`- Modes: ${[e.modes.metadataReview?"metadata review":null,e.modes.deeperAnalysis?"deeper analysis":null].filter(Boolean).join(" + ")}`),t.push("","## Summary"),t.push(`- Servers analyzed: ${e.summary.serversAnalyzed}`),t.push(`- Tools analyzed: ${e.summary.toolsAnalyzed}`),t.push(`- Tools skipped: ${e.summary.toolsSkipped}`,"");for(const n of e.servers){t.push(`## Server: ${n.serverName}`),n.warnings.length>0&&t.push(...n.warnings.map(r=>`- Warning: ${r}`),"");for(const r of n.tools){if(t.push(`### ${r.publicToolName}`),t.push(`- Safety: ${r.safetyClassification} (${r.classificationReason})`),r.metadataReview?.issues.length){t.push("#### Metadata issues");for(const a of r.metadataReview.issues)t.push(` - [${a.severity}] ${a.title}: ${a.detail}`)}if(r.deeperAnalysis)if(!r.deeperAnalysis.attempted)t.push(`- Deeper analysis: skipped (${r.deeperAnalysis.skippedReason??"unknown"})`);else{t.push(`- Deeper analysis sample calls: ${r.deeperAnalysis.sampleCalls.length}`);for(const a of r.deeperAnalysis.sampleCalls){t.push(` - Call ${a.callIndex}: ${a.ok?"ok":"error"}${a.durationMs?` (${a.durationMs}ms)`:""}`),a.error&&t.push(` - Error: ${a.error}`);for(const i of a.observations)t.push(` - ${i}`)}}if(r.overallRecommendations.length>0){t.push("#### Recommendations");for(const a of r.overallRecommendations)t.push(` - ${a}`)}if(r.metadataReview?.evalReadinessNotes.length){t.push("#### Agent/Eval readiness notes");for(const a of r.metadataReview.evalReadinessNotes)t.push(` - ${a}`)}t.push("")}}return`${t.join(`
136
- `)}
137
- `}function Oz({report:e}){const[t,n]=v.useState([...Lu]),r=v.useMemo(()=>new Set(t),[t]),a=i=>{n(o=>{const c=o.includes(i)?o.filter(d=>d!==i):[...o,i];return c.length===0?[...Lu]:c})};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(Nt,{className:"pb-3",children:[s.jsx(Ct,{className:"text-base",children:"Analysis Overview"}),s.jsx(Ds,{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:[Lu.filter(i=>e.summary.issueCounts[i]>0).map(i=>{const o=r.has(i);return s.jsx("button",{type:"button",onClick:()=>a(i),className:"rounded-full","aria-pressed":o,children:s.jsxs(Je,{variant:"outline",className:`capitalize font-normal ${o?o1(i):Kve(i)} ${o?"ring-1 ring-current":"opacity-70"}`,children:[i,": ",e.summary.issueCounts[i]]})},i)}),s.jsx(se,{type:"button",size:"sm",variant:"ghost",onClick:()=>n([...Lu]),className:"h-7 px-2 text-xs",children:"Reset"})]})})]}),s.jsx("div",{className:"space-y-4",children:e.servers.map(i=>{const o=i.tools.filter(c=>{const d=[...c.metadataReview?.issues??[],...c.deeperAnalysis?.sampleCalls.flatMap(f=>f.issues)??[]];return d.length===0?t.length===Lu.length:d.some(f=>r.has(f.severity))});return o.length===0?null:s.jsxs(Ue,{children:[s.jsxs(Nt,{className:"pb-3",children:[s.jsx(Ct,{className:"text-base",children:i.serverName}),s.jsxs(Ds,{children:["Discovered ",i.toolCountDiscovered," · Showing ",o.length," of ",i.toolCountAnalyzed," analyzed · Skipped ",i.toolCountSkipped]})]}),s.jsxs(qe,{className:"space-y-3",children:[i.warnings.length>0&&s.jsxs(Bl,{children:[s.jsx(zl,{children:"Warnings"}),s.jsx(Ul,{children:s.jsx("ul",{className:"ml-4 list-disc space-y-1",children:i.warnings.map(c=>s.jsx("li",{children:c},`${i.serverName}-${c}`))})})]}),o.map(c=>s.jsxs("details",{className:"group rounded-md border p-3",children:[s.jsx("summary",{className:"cursor-pointer list-none",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("div",{className:"font-mono text-sm",children:c.publicToolName}),c.description&&s.jsx("p",{className:"text-xs text-muted-foreground",children:c.description})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Je,{variant:c.safetyClassification==="read_like"?"secondary":"outline",children:c.safetyClassification}),s.jsx(Wt,{className:"h-4 w-4 text-muted-foreground transition-transform group-open:rotate-180"})]})]})}),s.jsxs("div",{className:"mt-3 space-y-2",children:[c.metadataReview&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:"Metadata review"}),c.metadataReview.issues.filter(d=>r.has(d.severity)).length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No metadata issues reported."}):s.jsx("div",{className:"space-y-1",children:c.metadataReview.issues.filter(d=>r.has(d.severity)).map((d,f)=>s.jsxs("div",{className:"rounded border p-2 text-xs",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx("span",{className:"inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full border bg-muted px-1 text-[10px] font-semibold text-muted-foreground",children:f+1}),s.jsx("span",{className:"min-w-0 font-bold leading-tight",children:d.title})]}),s.jsx(Je,{variant:"outline",className:`shrink-0 text-[10px] ${o1(d.severity)}`,children:d.severity})]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",d.detail]}),d.suggestion&&s.jsx(dM,{text:d.suggestion})]},d.id))})]}),c.deeperAnalysis&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:"Deeper analysis"}),c.deeperAnalysis.attempted?s.jsx("div",{className:"space-y-2",children:c.deeperAnalysis.sampleCalls.map(d=>s.jsxs("div",{className:"rounded border p-2 text-xs",children:[s.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[s.jsx(Je,{variant:d.ok?"secondary":"destructive",className:"text-[10px]",children:d.ok?"ok":"error"}),s.jsxs("span",{children:["Call ",d.callIndex]}),d.durationMs!==void 0&&s.jsxs("span",{className:"text-muted-foreground",children:[d.durationMs,"ms"]})]}),d.error&&s.jsx("p",{className:"text-destructive",children:d.error}),d.observations.length>0&&s.jsxs("div",{className:"mt-2",children:[s.jsx("div",{className:"mb-1 inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Observations"}),s.jsx("ul",{className:"ml-4 list-disc space-y-1",children:d.observations.map((f,h)=>s.jsx("li",{children:f},`${c.publicToolName}-obs-${d.callIndex}-${h}`))})]}),d.issues.filter(f=>r.has(f.severity)).length>0&&s.jsx("div",{className:"mt-2 space-y-1",children:d.issues.filter(f=>r.has(f.severity)).map((f,h)=>s.jsxs("div",{className:"rounded border p-2",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx("span",{className:"inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full border bg-muted px-1 text-[10px] font-semibold text-muted-foreground",children:h+1}),s.jsx("span",{className:"min-w-0 font-bold leading-tight",children:f.title})]}),s.jsx(Je,{variant:"outline",className:`shrink-0 text-[10px] ${o1(f.severity)}`,children:f.severity})]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",f.detail]}),f.suggestion&&s.jsx(dM,{text:f.suggestion})]},`${d.callIndex}-${f.id}`))})]},`${c.publicToolName}-call-${d.callIndex}`))}):s.jsx("p",{className:"text-xs text-muted-foreground",children:c.deeperAnalysis.skippedReason??"Skipped"})]})]})]},c.publicToolName))]})]},i.serverName)})})]})}const l1="mcplab.toolAnalysis.activeJobId";function fM(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 pM({text:e}){return s.jsxs(X$,{children:[s.jsx(Q$,{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(EU,{className:"h-3.5 w-3.5"})})}),s.jsx(MS,{className:"max-w-xs text-xs",children:s.jsx("p",{children:e})})]})}function Gve(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 Yve=()=>{const{source:e}=Pn(),{servers:t,agents:n,loading:r,reload:a}=Ua(),[i,o]=v.useState(""),[c,d]=v.useState([]),[f,h]=v.useState(!1),[p,y]=v.useState([]),[g,j]=v.useState({}),[b,x]=v.useState(""),[S,N]=v.useState(!0),[_,P]=v.useState(!1),[A,O]=v.useState(2),[k,R]=v.useState(1),[M,z]=v.useState(1e4),[B,D]=v.useState(null),[G,U]=v.useState([]),[W,X]=v.useState(null),[J,T]=v.useState(null),[L,Q]=v.useState(!1),[F,$]=v.useState("configure"),[Z,ae]=v.useState("idle"),V=v.useRef(null),ie=i||n[0]?.name||"",ne=v.useMemo(()=>{let xe=0;const ze=new Set,Ge=new Set;for(const Lt of G){const $t=typeof Lt.payload?.message=="string"?Lt.payload.message:"";if(!$t)continue;const mn=$t.match(/\((\d+)\s+tools?\)/i);mn&&(xe=Math.max(xe,Number(mn[1])||0));const _n=$t.match(/^Started\s+(.+)$/);_n&&ze.add(_n[1]);const tr=$t.match(/^Finished\s+(.+)$/);tr&&Ge.add(tr[1])}const Dt=xe>0?Math.max(0,Math.min(100,Math.round(Ge.size/xe*100))):0;return{totalTools:xe,startedTools:ze.size,finishedTools:Ge.size,percent:Dt}},[G]);v.useEffect(()=>{let xe=!0;return e.getWorkspaceSettings().then(ze=>{!xe||!ze||o(ze.scenarioAssistantAgentName??"")}).catch(()=>{xe&&o("")}),()=>{xe=!1}},[e]),v.useEffect(()=>()=>{V.current?.()},[]);const de=()=>{try{sessionStorage.removeItem(l1)}catch{}},oe=xe=>{try{sessionStorage.setItem(l1,xe)}catch{}},ge=xe=>{V.current?.(),V.current=e.subscribeToolAnalysisJob(xe,ze=>{if(U(Ge=>[...Ge,ze]),ze.type==="completed")e.getToolAnalysisResult(xe).then(Ge=>{X(Ge.report),T(Ge.savedReportId??null)}).catch(Ge=>Oe({title:"Could not load analysis report",description:Ge instanceof Error?Ge.message:String(Ge),variant:"destructive"})).finally(()=>{de(),D(null),Q(!1),ae("idle"),$("run")});else if(ze.type==="error"){const Ge=String(ze.payload?.message??"");de(),ae(Ge.toLowerCase().includes("abort")?"stopped":"error"),D(null),Q(!1)}})};v.useEffect(()=>{if(B||W)return;let xe="";try{xe=sessionStorage.getItem(l1)??""}catch{xe=""}if(xe)return $("run"),ae("running"),Q(!0),D(xe),U([]),ge(xe),()=>{}},[e,B,W]);const Re=async()=>{if(c.length===0){y([]),j({});return}h(!0);try{const xe=await e.discoverToolsForAnalysis({serverNames:c});y(xe.servers),j(ze=>{const Ge={};for(const Dt of xe.servers){const Lt=ze[Dt.serverName]??[],$t=Dt.tools.map(_n=>_n.name),mn=Lt.filter(_n=>$t.includes(_n));Ge[Dt.serverName]=mn.length>0?mn:$t}return Ge})}catch(xe){Oe({title:"Could not discover MCP tools",description:xe instanceof Error?xe.message:String(xe),variant:"destructive"})}finally{h(!1)}};v.useEffect(()=>{Re()},[c.join("|")]);const re=v.useMemo(()=>{const xe=b.trim().toLowerCase();return xe?p.map(ze=>({...ze,tools:ze.tools.filter(Ge=>Ge.name.toLowerCase().includes(xe)||(Ge.description||"").toLowerCase().includes(xe))})).filter(ze=>ze.tools.length>0):p},[p,b]),De=v.useMemo(()=>Object.values(g).reduce((xe,ze)=>xe+ze.length,0),[g]),Ae=c[0]??"",We=async()=>{if(!S&&!_){Oe({title:"Select at least one mode",variant:"destructive"});return}if(c.length!==1){Oe({title:"Select exactly one server",variant:"destructive"});return}if(De===0){Oe({title:"Select at least one tool",variant:"destructive"});return}Q(!0),U([]),X(null),T(null),$("run"),ae("running");try{const{jobId:xe}=await e.startToolAnalysis({serverNames:c,selectedToolsByServer:g,maxParallelTools:A,modes:{metadataReview:S,deeperAnalysis:_},deeperAnalysisOptions:{autoRunPolicy:"read_only_allowlist",sampleCallsPerTool:k,toolCallTimeoutMs:M}});D(xe),oe(xe),ge(xe)}catch(xe){Q(!1),ae("error"),$("run"),Oe({title:"Could not start tool analysis",description:xe instanceof Error?xe.message:String(xe),variant:"destructive"})}},ye=async()=>{if(!B)return;const xe=B;try{const ze=await e.stopToolAnalysis(xe);if(ze.status==="completed"){V.current?.(),V.current=null;const Ge=await e.getToolAnalysisResult(xe);X(Ge.report),T(Ge.savedReportId??null),de(),D(null),Q(!1),ae("idle"),$("run"),Oe({title:"Analysis already finished",description:"Showing the result overview."});return}if(ze.status==="stopped"){V.current?.(),V.current=null,de(),D(null),Q(!1),ae("stopped"),Oe({title:"Analysis stopped"});return}if(ze.status==="error"){V.current?.(),V.current=null,de(),D(null),Q(!1),ae("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(ze){Oe({title:"Could not stop analysis",description:ze instanceof Error?ze.message:String(ze),variant:"destructive"})}},Ee=()=>{$("configure"),ae("idle"),D(null)},le=(xe,ze)=>{d(Ge=>ze?[xe]:Ge.filter(Dt=>Dt!==xe))},_e=(xe,ze,Ge)=>{j(Dt=>{const Lt=new Set(Dt[xe]??[]);return Ge?Lt.add(ze):Lt.delete(ze),{...Dt,[xe]:Array.from(Lt)}})},pe=(xe,ze)=>{j(Ge=>({...Ge,[xe]:ze}))},we=!0,Se=B!==null||G.length>0||Z==="stopped"||Z==="error",Ve=!!W,Ot=xe=>{if(xe==="configure"&&we){$("configure");return}if(xe==="run"&&Se){$("run");return}xe==="report"&&Ve&&$("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(a$,{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:()=>Ot("configure"),className:"rounded-full","aria-label":"Open Configure Analysis",children:s.jsx(Je,{variant:F==="configure"?"default":"outline",className:"cursor-pointer",children:"Configure Analysis"})}),s.jsx("button",{type:"button",onClick:()=>Ot("run"),disabled:!Se,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Run Analysis",children:s.jsx(Je,{variant:F==="run"?"default":"outline",className:Se?"cursor-pointer":"cursor-not-allowed",children:"Run Analysis"})}),s.jsx("button",{type:"button",onClick:()=>Ot("report"),disabled:!Ve,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Report",children:s.jsx(Je,{variant:F==="report"?"default":"outline",className:Ve?"cursor-pointer":"cursor-not-allowed",children:"Report"})})]})]}),F==="configure"&&s.jsxs(Ue,{children:[s.jsxs(Nt,{children:[s.jsx(Ct,{className:"text-base",children:"Run MCP analysis"}),s.jsx(Ds,{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:[!ie&&s.jsxs(Bl,{children:[s.jsx(zl,{children:"No assistant agent available"}),s.jsxs(Ul,{children:["Add a library agent in"," ",s.jsx(yt,{to:"/libraries/agents",className:"underline",children:"Agents"})," ","and optionally set the default Scenario Assistant Agent in"," ",s.jsx(yt,{to:"/settings",className:"underline",children:"Settings"}),"."]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx($e,{className:"text-xs",children:"Servers"}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{a()},disabled:r,children:[s.jsx(xa,{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(xe=>{const ze=c.includes(xe.id);return s.jsxs("label",{className:"flex items-start gap-2 rounded-md border p-2 text-sm",children:[s.jsx(va,{checked:ze,onCheckedChange:Ge=>le(xe.id,!!Ge)}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"font-medium",children:xe.name||xe.id}),xe.url&&s.jsx("div",{className:"truncate text-xs text-muted-foreground",children:xe.url})]})]},xe.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($e,{className:"text-xs",children:"Filter visible tools"}),s.jsxs("div",{className:"relative",children:[s.jsx(jS,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),s.jsx(mt,{className:"h-9 pl-8",placeholder:"Filter tools by name or description...",value:b,onChange:xe=>x(xe.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($e,{className:"text-xs",children:Ae?`Tools for ${Ae}`:"Tools"}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Re()},disabled:f||c.length===0,children:[f&&s.jsx(sr,{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..."}):re.length===0&&!f?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No discovered tools match the current filters."}):re.map(xe=>{const ze=new Set(g[xe.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:xe.serverName}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(se,{type:"button",size:"sm",variant:"ghost",onClick:()=>pe(xe.serverName,xe.tools.map(Ge=>Ge.name)),children:"Select all"}),s.jsx(se,{type:"button",size:"sm",variant:"ghost",onClick:()=>pe(xe.serverName,[]),children:"Clear"})]})]}),xe.warnings.length>0&&s.jsx("div",{className:"mb-2 space-y-1",children:xe.warnings.map(Ge=>s.jsx("div",{className:"text-xs text-amber-700",children:Gve(xe.serverName,Ge)},`${xe.serverName}-${Ge}`))}),s.jsx("div",{className:"grid gap-2",children:xe.tools.map(Ge=>s.jsxs("label",{className:"flex items-start gap-2 rounded border p-2",children:[s.jsx(va,{checked:ze.has(Ge.name),onCheckedChange:Dt=>_e(xe.serverName,Ge.name,!!Dt)}),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:Ge.name}),s.jsx(Je,{variant:Ge.safetyClassification==="read_like"?"secondary":"outline",className:"text-[10px]",children:Ge.safetyClassification==="read_like"?"read-like":"unsafe/unknown"})]}),Ge.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:Ge.description}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:Ge.classificationReason})]})]},`${xe.serverName}-${Ge.name}`))})]},xe.serverName)})}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Selected tools: ",De]})]}),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(va,{checked:S,onCheckedChange:xe=>N(!!xe)}),s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Metadata / schema review",s.jsx(pM,{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(va,{checked:_,onCheckedChange:xe=>P(!!xe)}),s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Deeper analysis",s.jsx(pM,{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($e,{className:"text-xs",children:"Max parallel tools"}),s.jsx(mt,{type:"number",min:1,max:8,value:A,onChange:xe=>O(Math.max(1,Math.min(8,Number(xe.target.value)||2))),className:"h-8"})]}),_?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx($e,{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($e,{className:"text-xs",children:"Sample calls per tool"}),s.jsx(mt,{type:"number",min:1,max:5,value:k,onChange:xe=>R(Math.max(1,Math.min(5,Number(xe.target.value)||1))),className:"h-8"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx($e,{className:"text-xs",children:"Tool call timeout (ms)"}),s.jsx(mt,{type:"number",min:1e3,max:6e4,step:500,value:M,onChange:xe=>z(Math.max(1e3,Math.min(6e4,Number(xe.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(se,{type:"button",onClick:()=>{We()},disabled:L||!!B,children:[(L||!!B)&&s.jsx(sr,{className:"mr-2 h-4 w-4 animate-spin"}),"Analyze Tools"]})})]})]}),F==="run"&&s.jsxs(Ue,{children:[s.jsx(Nt,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Ct,{className:"flex items-center gap-2 text-base",children:s.jsx("span",{children:"Progress"})}),s.jsx(Ds,{children:B?"Live tool-analysis job events:":W?"Analysis finished. Review the summary below or open the saved report details.":Z==="stopped"?"Analysis was stopped. You can return to Configure Analysis.":Z==="error"?"Analysis ended with an error. Review the log and go back to Configure Analysis.":"Analysis finished."})]}),B?s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{ye()},children:"Stop Analysis"}):s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:Ee,children:"Back to Configure Analysis"})]})}),s.jsxs(qe,{className:"space-y-2",children:[B&&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(sr,{className:"h-3.5 w-3.5 animate-spin"}),"Analysis is still running..."]}),(ne.totalTools>0||B)&&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:ne.totalTools>0?`${ne.finishedTools}/${ne.totalTools} tools finished`:"Preparing analysis..."}),s.jsx("span",{children:ne.totalTools>0?`${ne.percent}%`:"0%"})]}),s.jsx(eg,{value:ne.totalTools>0?ne.percent:0,className:"h-2"})]}),G.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:B?"Starting analysis...":"No progress events captured."}):s.jsx("div",{className:"max-h-64 space-y-1 overflow-auto rounded border bg-muted/20 p-2",children:G.map((xe,ze)=>s.jsxs("div",{className:"text-xs",children:[s.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(xe.ts).toLocaleTimeString()}),s.jsx(Je,{variant:"outline",className:"mr-2 text-[10px]",children:xe.type}),s.jsx("span",{className:"break-all",children:typeof xe.payload.message=="string"?xe.payload.message:JSON.stringify(xe.payload)})]},`${xe.ts}-${ze}`))}),!B&&W&&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:[W.summary.toolsAnalyzed," tools analyzed, ",W.summary.toolsSkipped," skipped, across"," ",W.summary.serversAnalyzed," server",W.summary.serversAnalyzed!==1?"s":"","."]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[J&&s.jsx(se,{asChild:!0,size:"sm",children:s.jsx(yt,{to:`/tool-analysis-results/${J}`,children:"Open result details"})}),s.jsx(se,{asChild:!0,size:"sm",variant:"outline",children:s.jsx(yt,{to:"/tool-analysis-results",children:"View all results"})}),s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>Ot("report"),children:"View inline report"})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[W.summary.issueCounts.critical>0&&s.jsxs(Je,{className:"bg-red-600 text-white hover:bg-red-600",children:["Critical: ",W.summary.issueCounts.critical]}),W.summary.issueCounts.high>0&&s.jsxs(Je,{className:"bg-orange-500 text-white hover:bg-orange-500",children:["High: ",W.summary.issueCounts.high]}),W.summary.issueCounts.medium>0&&s.jsxs(Je,{className:"bg-amber-500 text-white hover:bg-amber-500",children:["Medium: ",W.summary.issueCounts.medium]}),W.summary.issueCounts.low>0&&s.jsxs(Je,{className:"bg-blue-500 text-white hover:bg-blue-500",children:["Low: ",W.summary.issueCounts.low]}),W.summary.issueCounts.info>0&&s.jsxs(Je,{variant:"outline",children:["Info: ",W.summary.issueCounts.info]}),Object.values(W.summary.issueCounts).every(xe=>xe===0)&&s.jsx(Je,{className:"bg-green-600 text-white hover:bg-green-600",children:"No findings"})]})]})})]})]}),F==="report"&&W&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-semibold",children:"Report"}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:[W.summary.toolsAnalyzed," tools analyzed across ",W.summary.serversAnalyzed," server",W.summary.serversAnalyzed!==1?"s":"","."]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:Ee,children:"Back to Configure Analysis"}),J&&s.jsxs(s.Fragment,{children:[s.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx(yt,{to:`/tool-analysis-results/${J}`,children:"Open saved report"})}),s.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx(yt,{to:"/tool-analysis-results",children:"View all reports"})})]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>fM(`tool-analysis-${Date.now()}.json`,`${JSON.stringify(W,null,2)}
138
- `,"application/json"),children:[s.jsx(ga,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>fM(`tool-analysis-${Date.now()}.md`,gC(W),"text/markdown"),children:[s.jsx(ga,{className:"mr-2 h-4 w-4"}),"Export Markdown"]})]})]}),s.jsx(Oz,{report:W})]})]})};function hM(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 Xve(){const{source:e}=Pn(),[t,n]=v.useState([]),[r,a]=v.useState(!0),[i,o]=v.useState(null),[c,d]=v.useState(!1),f=async()=>{a(!0);try{n(await e.listToolAnalysisResults())}catch(g){Oe({title:"Could not load tool analysis results",description:g instanceof Error?g.message:String(g),variant:"destructive"})}finally{a(!1)}};v.useEffect(()=>{f()},[]);const h=v.useMemo(()=>t.find(g=>g.reportId===i)??null,[t,i]),p=async()=>{if(i){d(!0);try{await e.deleteToolAnalysisSavedResult(i),n(g=>g.filter(j=>j.reportId!==i)),Oe({title:"Tool analysis report deleted"}),o(null)}catch(g){Oe({title:"Could not delete report",description:g instanceof Error?g.message:String(g),variant:"destructive"})}finally{d(!1)}}},y=async(g,j)=>{try{const b=await e.getToolAnalysisSavedResult(g);j==="json"?hM(`${g}.json`,`${JSON.stringify(b,null,2)}
139
- `,"application/json"):hM(`${g}.md`,gC(b.report),"text/markdown")}catch(b){Oe({title:"Could not export saved report",description:b instanceof Error?b.message:String(b),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(s$,{className:"h-6 w-6"}),"Tool Analysis Results"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Browse persisted Analyze MCP Tools reports."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(se,{variant:"outline",onClick:()=>{f()},disabled:r,children:r?"Refreshing...":"Refresh"}),s.jsx(se,{asChild:!0,variant:"outline",children:s.jsx(yt,{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(Xr,{children:[s.jsx(Qr,{children:s.jsxs(Ut,{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(Jr,{children:t.map(g=>s.jsxs(Ut,{children:[s.jsx(Ke,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(yt,{to:`/tool-analysis-results/${g.reportId}`,className:"font-mono text-xs text-primary hover:underline",children:g.reportId}),s.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[g.assistantAgentName," · ",g.assistantAgentModel]})]})}),s.jsx(Ke,{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:g.serverNames.length})," · Tools:"," ",s.jsx("span",{className:"font-medium text-foreground",children:g.summary.toolsAnalyzed})," · ","Skipped: ",s.jsx("span",{className:"font-medium text-foreground",children:g.summary.toolsSkipped})]}),s.jsxs("div",{className:"font-mono text-xs text-foreground/80",children:[g.serverNames.slice(0,2).join(", "),g.serverNames.length>2?` +${g.serverNames.length-2}`:""]})]})}),s.jsx(Ke,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Gd,{className:"h-3 w-3"}),new Date(g.createdAt).toLocaleString()]})}),s.jsx(Ke,{children:s.jsxs("div",{className:"flex flex-wrap gap-1",children:[["critical","high","medium","low","info"].map(j=>g.summary.issueCounts[j]>0?s.jsxs(Je,{variant:"outline",className:"capitalize",children:[j,": ",g.summary.issueCounts[j]]},`${g.reportId}-${j}`):null),Object.values(g.summary.issueCounts).every(j=>j===0)&&s.jsx(Je,{variant:"outline",children:"No issues"})]})}),s.jsx(Ke,{children:s.jsxs("div",{className:"flex flex-wrap gap-1",children:[g.modes.metadataReview&&s.jsx(Je,{variant:"outline",children:"metadata"}),g.modes.deeperAnalysis&&s.jsx(Je,{variant:"outline",children:"deeper"})]})}),s.jsx(Ke,{children:s.jsxs(Fc,{children:[s.jsx(Bc,{asChild:!0,children:s.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(_m,{className:"h-4 w-4"})})}),s.jsxs(Wo,{align:"end",children:[s.jsx(pr,{asChild:!0,children:s.jsx(yt,{to:`/tool-analysis-results/${g.reportId}`,children:"View"})}),s.jsxs(pr,{onSelect:()=>{y(g.reportId,"json")},children:[s.jsx(ga,{className:"mr-2 h-3.5 w-3.5"})," Export JSON"]}),s.jsxs(pr,{onSelect:()=>{y(g.reportId,"markdown")},children:[s.jsx(ga,{className:"mr-2 h-3.5 w-3.5"})," Export Markdown"]}),s.jsxs(pr,{className:"text-destructive",onSelect:j=>{j.preventDefault(),o(g.reportId)},children:[s.jsx(ba,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},g.reportId))})]})})}),s.jsx(bs,{open:!!i,onOpenChange:g=>!g&&o(null),children:s.jsxs(Wa,{children:[s.jsxs(Va,{children:[s.jsx(Ka,{children:"Delete tool analysis report?"}),s.jsx(Ga,{children:h?`Delete saved report '${h.reportId}' from disk? This cannot be undone.`:"Delete this saved report from disk? This cannot be undone."})]}),s.jsxs(Ha,{children:[s.jsx(Xa,{disabled:c,children:"Cancel"}),s.jsx(Ya,{onClick:g=>{g.preventDefault(),p()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}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 Qve(){const{id:e=""}=Mo(),t=ja(),{source:n}=Pn(),[r,a]=v.useState(null),[i,o]=v.useState(!0),[c,d]=v.useState(!1),[f,h]=v.useState(!1),[p,y]=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 x=b instanceof Error?b.message:String(b);if(x.includes("(404)")){d(!0),a(null);return}Oe({title:"Could not load saved tool analysis report",description:x,variant:"destructive"})}).finally(()=>{j&&o(!1)}),()=>{j=!1}},[e,n]);const g=async()=>{y(!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{y(!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(se,{asChild:!0,variant:"outline",children:s.jsx(yt,{to:"/tool-analysis-results",children:"Back to Tool Analysis Results"})})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"font-mono text-xl font-semibold",children:r.reportId}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:[new Date(r.createdAt).toLocaleString()," · ",r.serverNames.join(", ")||"—"]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(se,{asChild:!0,size:"sm",variant:"outline",children:s.jsx(yt,{to:"/tool-analysis-results",children:"Back to results"})}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>mM(`${r.reportId}.json`,`${JSON.stringify(r,null,2)}
140
- `,"application/json"),children:[s.jsx(ga,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>mM(`${r.reportId}.md`,gC(r.report),"text/markdown"),children:[s.jsx(ga,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>h(!0),children:[s.jsx(ba,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]}),s.jsx(Oz,{report:r.report}),s.jsx(bs,{open:f,onOpenChange:h,children:s.jsxs(Wa,{children:[s.jsxs(Va,{children:[s.jsx(Ka,{children:"Delete tool analysis report?"}),s.jsxs(Ga,{children:["Delete saved report '",r.reportId,"' from disk? This cannot be undone."]})]}),s.jsxs(Ha,{children:[s.jsx(Xa,{disabled:p,children:"Cancel"}),s.jsx(Ya,{onClick:j=>{j.preventDefault(),g()},disabled:p,children:p?"Deleting...":"Delete"})]})]})})]})}const Jve=[{id:"configure",label:"Configure Debug Session"},{id:"run",label:"Run / Inspect Flow"},{id:"report",label:"Report / Export"}];function Zve(e){return navigator.clipboard.writeText(e)}function ege(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}function tge(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 nge(){const{source:e}=Pn(),{servers:t,reload:n,loading:r}=Ua(),[a,i]=v.useState("configure"),[o,c]=v.useState(""),[d,f]=v.useState("pre_registered"),[h,p]=v.useState("local_callback"),[y,g]=v.useState(!0),[j,b]=v.useState(!0),[x,S]=v.useState(""),[N,_]=v.useState(""),[P,A]=v.useState(""),[O,k]=v.useState(""),[R,M]=v.useState("client_secret_basic"),[z,B]=v.useState("{}"),[D,G]=v.useState(""),[U,W]=v.useState(""),[X,J]=v.useState(""),[T,L]=v.useState(""),[Q,F]=v.useState(""),[$,Z]=v.useState(""),[ae,V]=v.useState(""),[ie,ne]=v.useState(""),[de,oe]=v.useState(null),[ge,Re]=v.useState(null),[re,De]=v.useState([]),[Ae,We]=v.useState(!1),[ye,Ee]=v.useState(!1),[le,_e]=v.useState(!1),[pe,we]=v.useState("all"),[Se,Ve]=v.useState("all"),[Ot,xe]=v.useState("inspector"),ze=v.useRef(null),Ge=v.useRef(null);v.useEffect(()=>()=>{ze.current?.(),ze.current=null},[]),v.useEffect(()=>{Ge.current?.scrollIntoView({behavior:"smooth",block:"end"})},[re.length]);const Dt=v.useMemo(()=>t.filter(ce=>ce.authType==="oauth2"),[t]),Lt=Dt.find(ce=>ce.id===o);v.useEffect(()=>{o&&(Dt.some(ce=>ce.id===o)||c(""))},[Dt,o]);const $t=v.useMemo(()=>{const ce=de?.stepStates.length??0,Te=de?.stepStates.filter(Ft=>Ft.status==="completed"||Ft.status==="skipped").length??0,ot=de?.stepStates.filter(Ft=>Ft.status==="failed").length??0,gt=ce>0?Math.round((Te+ot)/ce*100):0;return{total:ce,completed:Te,failed:ot,percent:gt}},[de]),mn=v.useMemo(()=>(de?.network??[]).filter(Te=>!(pe!=="all"&&Te.stepId!==pe||Se==="error"&&!(Te.phase==="response"&&(Te.status??0)>=400)||Se==="ok"&&!(Te.phase==="response"&&(Te.status??0)<400))),[de?.network,pe,Se]),_n=!!ge,tr=!!(de&&(de.status==="completed"||de.status==="error"||de.status==="stopped")),or=ce=>{if(ce==="configure"||ce==="run"&&_n||ce==="report"&&tr)return i(ce)},Ca=()=>{let ce;if(d==="dcr"&&z.trim())try{ce=JSON.parse(z)}catch{throw new Error("DCR metadata JSON is invalid")}if(!Lt)throw new Error("Select an MCP server");return{profile:"latest",target:{serverName:Lt.id,overrides:{authorizationServerMetadataUrl:X||void 0,authorizationEndpoint:T||void 0,tokenEndpoint:Q||void 0,registrationEndpoint:$||void 0,cimdUrl:D||void 0,resourceBaseUrl:ae||void 0}},registrationMethod:d,clientConfig:{preRegistered:d==="pre_registered"?{clientId:P.trim(),clientSecret:O.trim()||void 0,tokenEndpointAuthMethod:R||void 0}:void 0,dcr:d==="dcr"?{metadata:ce,tokenEndpointAuthMethod:R||void 0}:void 0,cimd:d==="cimd"?{cimdUrl:D||void 0,expectedClientId:U||void 0}:void 0},runtime:{redirectMode:h,scopes:x.split(/[,\s]+/).map(Te=>Te.trim()).filter(Boolean),resource:N.trim()||void 0,usePkce:j,codeChallengeMethod:"S256"},display:{showSensitiveValues:y}}},Mn=ce=>{ze.current?.(),ze.current=e.subscribeOAuthDebuggerSession(ce,Te=>{De(gt=>[...gt,Te]),(Te.type==="completed"||Te.type==="error"||Te.type==="stopped")&&We(!1),e.getOAuthDebuggerSession(ce).then(gt=>{oe(gt.session),gt.session.status==="completed"&&i("report")}).catch(()=>{})})},Mr=async()=>{Ee(!0);try{const ce=Ca(),Te=await e.createOAuthDebuggerSession(ce);Re(Te.sessionId),oe(Te.session),De([]),i("run"),Mn(Te.sessionId);const ot=await e.startOAuthDebuggerSession(Te.sessionId);oe(ot.session),We(!0),(ot.session.status==="waiting_for_user"||ot.session.status==="waiting_for_browser_callback")&&We(!1)}catch(ce){Oe({title:"Could not start OAuth Debugger session",description:ce instanceof Error?ce.message:String(ce),variant:"destructive"})}finally{Ee(!1)}},$r=async()=>{if(ge)try{Ee(!0);const ce=await e.submitOAuthDebuggerManualCallback(ge,{redirectUrl:ie.trim()||void 0});oe(ce.session),ne(""),We(!0)}catch(ce){Oe({title:"Could not submit callback",description:ce instanceof Error?ce.message:String(ce),variant:"destructive"})}finally{Ee(!1)}},hr=async()=>{if(ge){_e(!0);try{const ce=await e.stopOAuthDebuggerSession(ge);if(We(!1),ce.status!=="running"){const Te=await e.getOAuthDebuggerSession(ge);oe(Te.session),Te.session.status==="completed"?i("report"):i("run")}}catch(ce){Oe({title:"Could not stop session",description:ce instanceof Error?ce.message:String(ce),variant:"destructive"})}finally{_e(!1)}}},$n=async()=>{ze.current?.(),ze.current=null,oe(null),Re(null),De([]),We(!1),_e(!1),Ee(!1),ne(""),we("all"),Ve("all"),xe("inspector"),i("run"),await Mr()},On=async ce=>{if(!(!ge||!de))try{const Te=await e.exportOAuthDebuggerSession(ge,ce);let ot="";const gt=ce==="json"?"json":ce==="raw"?"txt":"md";typeof Te=="string"?ot=Te:ot=`${JSON.stringify(Te,null,2)}
143
- `;const Ft=new Blob([ot],{type:"text/plain;charset=utf-8"}),cn=URL.createObjectURL(Ft),At=document.createElement("a");At.href=cn,At.download=`oauth-debugger-${ge}.${gt}`,At.click(),URL.revokeObjectURL(cn)}catch(Te){if(ce==="markdown"){const ot=tge(de,re),gt=new Blob([ot],{type:"text/markdown;charset=utf-8"}),Ft=URL.createObjectURL(gt),cn=document.createElement("a");cn.href=Ft,cn.download=`oauth-debugger-${de.id}.md`,cn.click(),URL.revokeObjectURL(Ft);return}Oe({title:"Export failed",description:Te instanceof Error?Te.message:String(Te),variant:"destructive"})}},en=ge?`${ege()}/api/oauth-debugger/sessions/${ge}/authorize`:void 0,Sn=ce=>ce==="error"?"destructive":ce==="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:Jve.map(ce=>{const Te=a===ce.id,ot=ce.id==="configure"||ce.id==="run"&&_n||ce.id==="report"&&tr;return s.jsx("button",{type:"button",onClick:()=>ot&&or(ce.id),disabled:!ot,className:"rounded-full",children:s.jsx(Je,{variant:Te?"default":"outline",className:ot?"":"opacity-50",children:ce.label})},ce.id)})})]}),a==="configure"&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs(Ue,{children:[s.jsx(Nt,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Ct,{className:"text-base",children:"Target MCP Server"}),s.jsx(Ds,{children:"Select one MCP server from Libraries and optionally override endpoints."})]}),s.jsxs(se,{type:"button",variant:"outline",size:"sm",onClick:()=>{n()},disabled:r,children:[s.jsx(xa,{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($e,{children:"MCP Server"}),s.jsxs(sn,{value:o,onValueChange:c,children:[s.jsx(Qt,{children:s.jsx(on,{placeholder:"Select an MCP server"})}),s.jsx(Jt,{children:Dt.map(ce=>s.jsx(st,{value:ce.id,children:ce.name||ce.id},ce.id))})]}),Dt.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"}),"."]}),Lt&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:[Lt.transport," · ",Lt.url||Lt.command||"No URL/command"]})]})})]}),s.jsxs(Ue,{children:[s.jsx(Nt,{className:"pb-3",children:s.jsx(Ct,{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(ce=>s.jsx("button",{type:"button",onClick:()=>f(ce.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===ce.id?"bg-primary":"bg-muted-foreground/30"}`}),s.jsx("span",{className:"text-sm font-medium",children:ce.label})]})},ce.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($e,{className:"text-xs",children:"Redirect mode"}),s.jsxs(sn,{value:h,onValueChange:ce=>p(ce),children:[s.jsx(Qt,{children:s.jsx(on,{})}),s.jsxs(Jt,{children:[s.jsx(st,{value:"local_callback",children:"Local callback (recommended)"}),s.jsx(st,{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($e,{className:"text-xs",children:"client_id"}),s.jsx(mt,{value:P,onChange:ce=>A(ce.target.value)})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx($e,{className:"text-xs",children:"client_secret (optional)"}),s.jsx(mt,{value:O,onChange:ce=>k(ce.target.value),type:"password"})]})]}),d==="cimd"&&s.jsxs("div",{className:"space-y-1",children:[s.jsx($e,{className:"text-xs",children:"CIMD URL"}),s.jsx(mt,{value:D,onChange:ce=>G(ce.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),s.jsxs(Ue,{children:[s.jsx(Nt,{className:"pb-3",children:s.jsx(Ct,{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($e,{className:"text-xs",children:"Scopes (space or comma separated)"}),s.jsx(mt,{value:x,onChange:ce=>S(ce.target.value),placeholder:"openid profile mcp"})]}),s.jsxs("div",{className:"flex items-center gap-2 md:col-span-2",children:[s.jsx(va,{checked:j,onCheckedChange:ce=>b(!!ce)}),s.jsx($e,{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($e,{className:"text-xs",children:"Token endpoint auth method"}),s.jsx(mt,{value:R,onChange:ce=>M(ce.target.value),placeholder:"client_secret_basic / none / client_secret_post"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx($e,{className:"text-xs",children:"Resource / audience (optional)"}),s.jsx(mt,{value:N,onChange:ce=>_(ce.target.value),placeholder:"https://resource.example.com"})]})]}),d==="dcr"&&s.jsxs("div",{className:"space-y-1",children:[s.jsx($e,{className:"text-xs",children:"DCR metadata JSON (optional overrides)"}),s.jsx(Gs,{value:z,onChange:ce=>B(ce.target.value),className:"min-h-32 font-mono text-xs"})]}),d==="cimd"&&s.jsxs("div",{className:"space-y-1",children:[s.jsx($e,{className:"text-xs",children:"Expected client_id (optional)"}),s.jsx(mt,{value:U,onChange:ce=>W(ce.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($e,{className:"text-xs",children:"Authorization server metadata URL"}),s.jsx(mt,{value:X,onChange:ce=>J(ce.target.value),placeholder:"https://.../.well-known/oauth-authorization-server"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx($e,{className:"text-xs",children:"Resource server base URL"}),s.jsx(mt,{value:ae,onChange:ce=>V(ce.target.value),placeholder:"https://resource.example.com"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx($e,{className:"text-xs",children:"Authorization endpoint"}),s.jsx(mt,{value:T,onChange:ce=>L(ce.target.value),placeholder:"https://.../authorize"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx($e,{className:"text-xs",children:"Token endpoint"}),s.jsx(mt,{value:Q,onChange:ce=>F(ce.target.value),placeholder:"https://.../token"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx($e,{className:"text-xs",children:"Registration endpoint (DCR)"}),s.jsx(mt,{value:$,onChange:ce=>Z(ce.target.value),placeholder:"https://.../register"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx($e,{className:"text-xs",children:"CIMD URL override"}),s.jsx(mt,{value:D,onChange:ce=>G(ce.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),s.jsxs(Bl,{children:[s.jsx(Uy,{className:"h-4 w-4"}),s.jsx(zl,{children:"Secrets display"}),s.jsxs(Ul,{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(va,{checked:!y,onCheckedChange:ce=>g(ce===!1)}),s.jsx($e,{children:"Hide sensitive values in inspector"})]})]})]})]})]}),s.jsx("div",{className:"flex justify-end",children:s.jsxs(se,{type:"button",onClick:()=>{Mr()},disabled:ye,children:[ye&&s.jsx(sr,{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(Nt,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Ct,{className:"text-base",children:"Progress"}),s.jsx(Ds,{children:"Visual OAuth flow guide with live session events and next-step actions."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[de?.uiHints.authorizationUrl&&en&&s.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsxs("a",{href:en,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(ah,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{$n()},disabled:ye,children:[s.jsx(xa,{className:"mr-2 h-4 w-4"}),"Restart"]}),ge&&s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{hr()},disabled:le||!ge,children:[(le||Ae)&&le&&s.jsx(sr,{className:"mr-2 h-4 w-4 animate-spin"}),s.jsx(Jp,{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:[$t.completed+$t.failed,"/",$t.total," steps"]}),s.jsxs("span",{children:[$t.percent,"%"]})]}),s.jsx(eg,{value:$t.percent,className:"h-2"})]}),de?.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(Gs,{value:ie,onChange:ce=>ne(ce.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(se,{type:"button",size:"sm",onClick:()=>{$r()},disabled:ye||!ie.trim(),children:[ye&&s.jsx(sr,{className:"mr-2 h-4 w-4 animate-spin"}),"Continue"]}),de.uiHints.authorizationUrl&&en&&s.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx("a",{href:en,target:"_blank",rel:"noopener noreferrer",children:"Open Authorization URL"})})]})]})}),de?.status==="waiting_for_browser_callback"&&s.jsxs(Bl,{children:[s.jsx(Uy,{className:"h-4 w-4"}),s.jsx(zl,{children:"Waiting for browser callback"}),s.jsxs(Ul,{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:de.uiHints.callbackUrl}),de.uiHints.authorizationUrl&&en&&s.jsx("div",{className:"pt-2",children:s.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsxs("a",{href:en,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:de?.stepStates.map(ce=>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:ce.title}),s.jsx("div",{className:"text-xs text-muted-foreground",children:ce.description})]}),s.jsx(Je,{variant:ce.status==="failed"?"destructive":ce.status==="completed"?"outline":ce.status==="active"?"secondary":"outline",className:ce.status==="completed"?"border-emerald-300 bg-emerald-50 text-emerald-700":void 0,children:ce.status})]}),ce.outcomeSummary&&s.jsx("p",{className:"mt-2 text-xs text-muted-foreground break-all",children:ce.outcomeSummary})]},ce.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(Nt,{className:"pb-3",children:[s.jsx(Ct,{className:"text-base",children:"Inspect"}),s.jsx(Ds,{children:"Live events and network requests/responses for the OAuth flow."})]}),s.jsx(qe,{className:"space-y-3",children:s.jsxs(tC,{value:Ot,onValueChange:ce=>xe(ce),children:[s.jsxs(qv,{className:"grid grid-cols-2",children:[s.jsx(Po,{value:"inspector",children:"Network Inspector"}),s.jsx(Po,{value:"events",children:"Live Debug"})]}),s.jsx(Wd,{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((ce,Te)=>s.jsxs("div",{className:"break-all",children:[s.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(ce.ts).toLocaleTimeString()}),s.jsx(Je,{variant:"outline",className:"mr-2 text-[10px]",children:ce.type}),typeof ce.payload.message=="string"?ce.payload.message:JSON.stringify(ce.payload)]},`${ce.ts}-${Te}`)),s.jsx("div",{ref:Ge})]})}),s.jsxs(Wd,{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($e,{className:"text-xs",children:"Filter by step"}),s.jsxs(sn,{value:pe,onValueChange:we,children:[s.jsx(Qt,{className:"h-8",children:s.jsx(on,{})}),s.jsxs(Jt,{children:[s.jsx(st,{value:"all",children:"All steps"}),(de?.stepStates??[]).map(ce=>s.jsx(st,{value:ce.id,children:ce.title},ce.id))]})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx($e,{className:"text-xs",children:"Filter by status"}),s.jsxs(sn,{value:Se,onValueChange:Ve,children:[s.jsx(Qt,{className:"h-8",children:s.jsx(on,{})}),s.jsxs(Jt,{children:[s.jsx(st,{value:"all",children:"All"}),s.jsx(st,{value:"ok",children:"Successful responses"}),s.jsx(st,{value:"error",children:"Error responses"})]})]})]})]}),s.jsx("div",{className:"max-h-[34rem] space-y-2 overflow-auto",children:mn.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No network exchanges captured yet."}):mn.map(ce=>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:ce.label}),s.jsxs("div",{className:"text-xs text-muted-foreground break-all",children:[ce.method?`${ce.method} `:"",ce.url]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Je,{variant:"outline",children:ce.phase}),typeof ce.status=="number"&&s.jsx(Je,{variant:ce.status>=400?"destructive":"secondary",children:ce.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(ce.headers,null,2)})]}),ce.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:ce.bodyText})]}),s.jsx("div",{className:"flex gap-2",children:s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Zve(JSON.stringify(ce,null,2))},children:[s.jsx(Ri,{className:"mr-2 h-4 w-4"}),"Copy JSON"]})})]})]},ce.id))})]})]})})]})})]})}),a==="report"&&de&&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(se,{type:"button",size:"sm",variant:"outline",onClick:()=>i("configure"),children:"Back to Configure"}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{On("json")},children:[s.jsx(ga,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{On("markdown")},children:[s.jsx(ga,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{On("raw")},children:[s.jsx(ga,{className:"mr-2 h-4 w-4"}),"Copy/Export Raw Trace"]})]})]}),s.jsxs(Bl,{children:[s.jsx(Uy,{className:"h-4 w-4"}),s.jsx(zl,{children:"Secrets display mode"}),s.jsx(Ul,{children:y?"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:de.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:de.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:de.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:de.validations.length})]})})]}),s.jsxs(Ue,{children:[s.jsx(Nt,{className:"pb-3",children:s.jsx(Ct,{className:"text-base",children:"Key values"})}),s.jsxs(qe,{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx($e,{className:"text-xs",children:"Issuer"}),s.jsx("p",{className:"text-sm break-all",children:de.summary?.issuer||"-"})]}),s.jsxs("div",{children:[s.jsx($e,{className:"text-xs",children:"Client ID"}),s.jsx("p",{className:"text-sm break-all",children:de.summary?.clientId||"-"})]}),s.jsxs("div",{children:[s.jsx($e,{className:"text-xs",children:"Redirect URI"}),s.jsx("p",{className:"text-sm break-all",children:de.summary?.redirectUri||"-"})]}),s.jsxs("div",{children:[s.jsx($e,{className:"text-xs",children:"Token endpoint status"}),s.jsx("p",{className:"text-sm",children:de.summary?.tokenEndpointStatus??"-"})]}),s.jsxs("div",{children:[s.jsx($e,{className:"text-xs",children:"Token type"}),s.jsx("p",{className:"text-sm",children:de.summary?.tokenType||"-"})]}),s.jsxs("div",{children:[s.jsx($e,{className:"text-xs",children:"Scopes granted"}),s.jsx("p",{className:"text-sm break-all",children:(de.summary?.grantedScopes??[]).join(", ")||"-"})]})]})]}),s.jsxs(Ue,{children:[s.jsx(Nt,{className:"pb-3",children:s.jsx(Ct,{className:"text-base",children:"Validation findings"})}),s.jsx(qe,{className:"space-y-2",children:de.validations.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No validation findings recorded."}):de.validations.map((ce,Te)=>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:Te+1}),s.jsx("span",{className:"font-bold",children:ce.title})]}),s.jsx(Je,{variant:Sn(ce.severity),children:ce.severity})]}),s.jsxs("p",{className:"text-sm",children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",ce.detail]}),ce.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:ce.recommendation})]}),s.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Step: ",ce.stepId,ce.specReference&&s.jsxs(s.Fragment,{children:[" · ",s.jsx("a",{href:ce.specReference,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"Spec reference"})]})]})]},ce.id))})]})]})]})}const c1="mcplab.runEvaluation.activeJobId",rge=()=>{const[e]=Ec(),[t,n]=v.useState(""),[r,a]=v.useState("1"),[i,o]=v.useState(!1),[c,d]=v.useState(0),[f,h]=v.useState([]),[p,y]=v.useState(!1),[g,j]=v.useState(!1),[b,x]=v.useState(""),[S,N]=v.useState(null),[_,P]=v.useState([]),[A,O]=v.useState([]),[k,R]=v.useState(!0),[M,z]=v.useState(""),[B,D]=v.useState(!1),[G,U]=v.useState([]),[W,X]=v.useState(null),J=v.useRef(null),T=v.useRef(null),{configs:L,reload:Q}=nf(),{source:F}=Pn(),$=vf("snapshots",!1),{agents:Z,scenarios:ae}=Ua(),V=L.find(le=>le.id===t),ie=e.get("configId"),ne=v.useMemo(()=>{if(!V)return[];const le=new Map,_e=V.agentEntries&&V.agentEntries.length>0?V.agentEntries:V.agents.map(pe=>({kind:"inline",agent:pe}));for(const pe of _e){if(pe.kind==="inline"){const Se=pe.agent.id;le.has(Se)||le.set(Se,pe.agent);continue}const we=Z.find(Se=>Se.id===pe.ref);we&&!le.has(we.id)&&le.set(we.id,we)}return Array.from(le.values())},[V,Z]),de=v.useMemo(()=>{if(!V)return[];const le=new Map,_e=V.scenarioEntries&&V.scenarioEntries.length>0?V.scenarioEntries:V.scenarios.map(pe=>({kind:"inline",scenario:pe}));for(const pe of _e){if(pe.kind==="inline"){le.has(pe.scenario.id)||le.set(pe.scenario.id,pe.scenario);continue}const we=ae.find(Se=>Se.id===pe.ref);we&&!le.has(we.id)&&le.set(we.id,we)}return Array.from(le.values())},[V,ae]);v.useEffect(()=>{ie&&L.some(le=>le.id===ie)&&n(ie)},[ie,L]),v.useEffect(()=>{if(!V){P([]),O([]);return}const le=ne.filter(_e=>(V.runDefaults?.selectedAgentNames??[]).includes(_e.id)).map(_e=>_e.id);P(le.length>0?le:ne.map(_e=>_e.id)),O(de.map(_e=>_e.id)),R(!0)},[V?.id,V?.sourcePath,ne,de]);const oe=async()=>{if(!V?.sourcePath){h(we=>[...we,`[${new Date().toLocaleTimeString()}] Missing source path for selected config.`]);return}const le=ne.filter(we=>_.includes(we.id));if(le.length===0){h(we=>[...we,`[${new Date().toLocaleTimeString()}] Select at least one agent.`]);return}const _e=de.filter(we=>A.includes(we.id));if(_e.length===0){h(we=>[...we,`[${new Date().toLocaleTimeString()}] Select at least one test.`]);return}o(!0),y(!1),j(!1),x("");const pe=(V.serverEntries??[]).some(we=>we.kind==="referenced")||(V.agentEntries??[]).some(we=>we.kind==="referenced")||(V.scenarioEntries??[]).some(we=>we.kind==="referenced")?"refs-composed":"single-file/inline";h([`[${new Date().toLocaleTimeString()}] Starting evaluation run...`,`[${new Date().toLocaleTimeString()}] Config=${V.name} mode=${pe} agents=${le.map(we=>we.name||we.id).join(", ")} tests=${_e.map(we=>we.id).join(", ")} runs=${Number(r)} snapshotEval=${$&&k?"on":"off"}`]),d(10);try{const{jobId:we}=await F.startRun({configPath:V.sourcePath,runsPerScenario:Number(r),agents:le.map(Se=>Se.id),scenarioIds:_e.map(Se=>Se.id),applySnapshotEval:$?k:!1});N(we),Ae(we),Ee(we),We()}catch(we){const Se=we instanceof Error?we.message:String(we),Ve=Se.includes("Anthropic model not found")?" Hint: this usually means the API key works but the model ID is not enabled for that Anthropic account. Change the agent model in Manage Agents (library) or inline config.":"";h(Ot=>[...Ot,`[${new Date().toLocaleTimeString()}] Error: ${Se}${Ve}`]),o(!1),d(0),N(null)}},ge=()=>{oe()},Re=()=>{S&&F.stopRun(S),T.current?.(),T.current=null,De(),N(null),o(!1),y(!1),j(!0),h(le=>[...le,`[${new Date().toLocaleTimeString()}] Run aborted by user.`]),We()},re=async()=>{if(b){D(!0);try{const le=await F.createSnapshotFromRun(b,M.trim()||void 0);Oe({title:"Snapshot saved",description:`Created ${le.name} (${le.id})`}),M.trim()||z(le.name)}catch(le){Oe({title:"Could not save snapshot",description:le instanceof Error?le.message:String(le),variant:"destructive"})}finally{D(!1)}}};v.useEffect(()=>{J.current&&(J.current.scrollTop=J.current.scrollHeight)},[f]),v.useEffect(()=>()=>{T.current?.()},[]),v.useEffect(()=>{if(S||p)return;let le="";try{le=sessionStorage.getItem(c1)??""}catch{le=""}if(le)return N(le),o(!0),y(!1),j(!1),h(_e=>_e.length>0?_e:[`[${new Date().toLocaleTimeString()}] Reattached to in-progress evaluation run...`]),Ee(le),()=>{}},[S,p]),v.useEffect(()=>{Q(),We();const le=()=>{Q(),We()};return window.addEventListener("focus",le),()=>{window.removeEventListener("focus",le)}},[Q]);const De=()=>{try{sessionStorage.removeItem(c1)}catch{}},Ae=le=>{try{sessionStorage.setItem(c1,le)}catch{}},We=async()=>{try{const le=await F.getRunQueue();U(le.queued),X(le.active)}catch{}},ye=async le=>{try{await F.removeQueuedRun(le),U(_e=>_e.filter(pe=>pe.jobId!==le))}catch(_e){const pe=_e instanceof Error?_e.message:String(_e);if(pe.includes("Use the /stop endpoint"))try{await F.stopRun(le)}catch{}else Oe({title:"Could not remove queued run",description:pe,variant:"destructive"})}We()},Ee=le=>{T.current?.(),T.current=F.subscribeRunJob(le,_e=>{const pe=new Date(_e.ts).toLocaleTimeString();if(_e.type==="queued"){h(we=>{const Se=_e.payload.position?` (position ${_e.payload.position})`:"",Ve=`[${pe}] Run queued${Se}. Waiting for active run to finish...`;return we.includes(Ve)?we:[...we,Ve]}),d(5);return}if(_e.type==="started"&&(h(we=>{const Se=`[${pe}] Run started.`;return we.includes(Se)?we:[...we,Se]}),d(we=>Math.max(we,30)),j(!1)),_e.type==="log"){const we=String(_e.payload.message??"").trim();we&&(h(Se=>{const Ve=`[${pe}] ${we}`;return Se.includes(Ve)?Se:[...Se,Ve]}),d(Se=>{const Ve=we.toLowerCase();if(Ve.startsWith("loading mcp evaluation config"))return Math.max(Se,15);if(Ve.startsWith("loaded config"))return Math.max(Se,20);if(Ve.startsWith("selected "))return Math.max(Se,30);if(Ve.startsWith("using requested agents")||Ve.startsWith("using resolved default agents"))return Math.max(Se,35);if(Ve.startsWith("expanded to "))return Math.max(Se,45);if(Ve.startsWith("running evaluation"))return Math.max(Se,50);const Ot=Ve.match(/^scenario (\d+)\/(\d+) finished:/);if(Ot){const xe=Number(Ot[1]),ze=Number(Ot[2]);return Math.max(Se,50+Math.round(xe/ze*25))}return Ve.startsWith("evaluation execution finished")?Math.max(Se,78):Ve.startsWith("applying snapshot evaluation policy")?Math.max(Se,82):Ve.includes("snapshot evaluation applied")||Ve.includes("snapshot evaluation enabled")?Math.max(Se,88):Ve.startsWith("writing results to ")?Math.max(Se,94):Ve.startsWith("run finished:")?Math.max(Se,98):Se}))}if(_e.type==="completed"){const we=String(_e.payload.runId??"");if(h(Se=>{const Ve=`[${pe}] Run completed.`;return Se.includes(Ve)?Se:[...Se,Ve]}),_e.payload.snapshotEval&&typeof _e.payload.snapshotEval=="object"){const Se=_e.payload.snapshotEval;h(Ve=>{const Ot=`[${pe}] Snapshot eval (${Se.mode??"warn"}) baseline=${Se.baseline_snapshot_id??"-"} score=${Se.overall_score??"-"} status=${Se.status??"-"}`;return Ve.includes(Ot)?Ve:[...Ve,Ot]})}d(100),o(!1),y(!0),j(!1),x(we),De(),N(null),T.current?.(),T.current=null,We()}if(_e.type==="error"){const we=String(_e.payload.message??"Unknown error"),Se=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(Ve=>[...Ve,`[${pe}] Error: ${we}${Se}`]),o(!1),y(!1),j(!1),d(0),De(),N(null),T.current?.(),T.current=null,We()}})};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(kl,{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($e,{children:"MCP Evaluation"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(sn,{value:t,onValueChange:n,children:[s.jsx(Qt,{children:s.jsx(on,{placeholder:"Select a config"})}),s.jsx(Jt,{children:L.map(le=>s.jsx(st,{value:le.id,children:le.name},le.id))})]}),s.jsx(se,{type:"button",variant:"outline",size:"icon",className:"h-10 w-10 shrink-0",onClick:()=>{Q()},"aria-label":"Refresh configs",title:"Refresh configs",children:s.jsx(xa,{className:"h-4 w-4"})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{children:"Variance Runs"}),s.jsx(mt,{type:"number",min:"1",max:"10",value:r,onChange:le=>a(le.target.value)})]})]}),V&&s.jsxs("div",{className:"space-y-2",children:[$&&V.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 (",V.snapshotEval.mode,") · baseline:"," ",s.jsx("span",{className:"font-mono",children:V.snapshotEval.baselineSnapshotId??"none"})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx($e,{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:()=>P(ne.map(le=>le.id)),children:"Select all"}),s.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>P([]),children:"Clear"})]})]}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:ne.map(le=>{const _e=_.includes(le.id);return s.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[s.jsx(va,{checked:_e,onCheckedChange:pe=>{const we=pe===!0;P(Se=>we?[...Se,le.id]:Se.filter(Ve=>Ve!==le.id))}}),s.jsx("span",{children:le.name||le.id})]},le.id)})}),ne.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents available in this config. Add inline agents or agent references."})]}),V&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx($e,{children:"Tests"}),s.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[s.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>O(de.map(le=>le.id)),children:"Select all"}),s.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>O([]),children:"Clear"})]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[A.length," of ",de.length," selected"]}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:de.map(le=>{const _e=A.includes(le.id);return s.jsxs("label",{className:"flex items-start gap-2 text-sm rounded-md border p-2",children:[s.jsx(va,{checked:_e,onCheckedChange:pe=>{const we=pe===!0;O(Se=>we?[...Se,le.id]:Se.filter(Ve=>Ve!==le.id))}}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:"block font-medium",children:le.name||le.id}),s.jsx("span",{className:"block font-mono text-xs text-muted-foreground truncate",children:le.id})]})]},le.id)})})]}),$&&s.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[s.jsx(va,{checked:k,onCheckedChange:le=>R(le===!0)}),s.jsx("span",{children:"Apply snapshot evaluation policy (if configured)"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(se,{onClick:ge,disabled:!t||ne.length>0&&_.length===0||de.length>0&&A.length===0,children:[s.jsx(kl,{className:"mr-2 h-4 w-4"}),W?"Queue Run":"Run"]}),i&&s.jsxs(se,{variant:"destructive",onClick:Re,children:[s.jsx(Jp,{className:"mr-2 h-4 w-4"}),"Stop"]})]})]})}),(i||f.length>0)&&s.jsxs(Ue,{children:[s.jsx(Nt,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Ct,{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(eg,{value:c,className:"h-2"}),s.jsx("div",{ref:J,className:"h-64 overflow-auto rounded-md border bg-muted/30 p-3 font-mono text-xs space-y-0.5",children:f.map((le,_e)=>s.jsx("div",{className:le.includes("✓")?"text-success":le.includes("aborted")?"text-destructive":"text-foreground",children:le},_e))})]})]}),s.jsxs(Ue,{children:[s.jsx(Nt,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(Ct,{className:"inline-flex items-center gap-2 text-base",children:[s.jsx(Gd,{className:"h-4 w-4"}),"Run Queue"]}),s.jsx(se,{variant:"ghost",size:"sm",onClick:()=>{We()},children:s.jsx(xa,{className:"h-3 w-3"})})]})}),s.jsx(qe,{children:!W&&G.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:[W&&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===W.jobId?"ring-2 ring-primary/40":""}`,onClick:()=>{S!==W.jobId&&(N(W.jobId),Ae(W.jobId),o(!0),y(!1),j(!1),h([`[${new Date().toLocaleTimeString()}] Attached to running job ${W.jobId}...`]),d(10),Ee(W.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:W.runParams.configPath.split("/").pop()??W.runParams.configPath}),W.runParams.agents&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:["agents: ",W.runParams.agents.join(", ")]})]}),s.jsxs(se,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-destructive hover:text-destructive hover:bg-destructive/10",onClick:le=>{le.stopPropagation(),W&&(F.stopRun(W.jobId),We())},title:"Stop running job",children:[s.jsx(Jp,{className:"mr-1 h-3 w-3"}),"Stop"]})]}),G.map((le,_e)=>{const pe=le.runParams.configPath.split("/").pop()??le.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:["#",_e+1," Queued"]}),s.jsx("span",{className:"font-mono text-xs",children:pe}),le.runParams.agents&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:["agents: ",le.runParams.agents.join(", ")]})]}),s.jsx(se,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:()=>{ye(le.jobId)},title:"Remove from queue",children:s.jsx(Us,{className:"h-4 w-4"})})]},le.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(Jp,{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(se,{type:"button",variant:"outline",onClick:()=>{h([]),d(0),j(!1)},children:"Clear Progress"}),s.jsxs(se,{type:"button",onClick:ge,disabled:!t,children:[s.jsx(kl,{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(Ol,{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(se,{asChild:!0,className:"ml-auto",children:s.jsx(yt,{to:`/results/${b}${t?`?configId=${encodeURIComponent(t)}`:""}`,children:"View Results"})})]}),$&&b&&s.jsxs("div",{className:"mt-4 flex flex-wrap items-end gap-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx($e,{className:"text-xs",children:"Snapshot name (optional)"}),s.jsx(mt,{value:M,onChange:le=>z(le.target.value),placeholder:"e.g. baseline-v1",className:"h-8 w-64"})]}),s.jsx(se,{type:"button",variant:"outline",size:"sm",onClick:()=>{re()},disabled:B,children:B?"Saving...":"Save Snapshot"})]})]})})]})},age=()=>{const{source:e}=Pn(),[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,y]=v.useState("desc"),[g,j]=v.useState("all"),b=k=>{if(f===k){y(R=>R==="asc"?"desc":"asc");return}h(k),y(k==="timestamp"?"desc":"asc")},x=async()=>{a(!0);try{n(await e.listResults())}catch(k){Oe({title:"Could not load results",description:k instanceof Error?k.message:String(k),variant:"destructive"})}finally{a(!1)}};v.useEffect(()=>{let k=!0;return a(!0),e.listResults().then(R=>{k&&n(R)}).catch(R=>{k&&Oe({title:"Could not load results",description:R instanceof Error?R.message:String(R),variant:"destructive"})}).finally(()=>{k&&a(!1)}),()=>{k=!1}},[e]);const S=v.useMemo(()=>{const k=new Set;return t.forEach(R=>{R.scenarios.forEach(M=>{const z=String(M.scenarioName??"").trim(),B=String(M.scenarioId??"").trim(),D=z||B;D&&k.add(D)})}),Array.from(k).sort((R,M)=>R.localeCompare(M))},[t]),N=v.useMemo(()=>g==="all"?t:t.filter(k=>k.scenarios.some(R=>{const M=String(R.scenarioName??"").trim(),z=String(R.scenarioId??"").trim();return(M||z)===g})),[t,g]),_=v.useMemo(()=>[...N].sort((R,M)=>{let z=0;return f==="id"&&(z=R.id.localeCompare(M.id)),f==="timestamp"&&(z=new Date(R.timestamp).getTime()-new Date(M.timestamp).getTime()),f==="passRate"&&(z=R.overallPassRate-M.overallPassRate),f==="scenarios"&&(z=R.totalScenarios-M.totalScenarios),f==="avgToolCalls"&&(z=R.avgToolCalls-M.avgToolCalls),p==="asc"?z:-z}),[N,f,p]),P=k=>f!==k?s.jsx(Pl,{className:"h-3.5 w-3.5 text-muted-foreground"}):p==="asc"?s.jsx(is,{className:"h-3.5 w-3.5"}):s.jsx(Wt,{className:"h-3.5 w-3.5"}),A=k=>{const R=Array.from(new Map(k.scenarios.map(D=>{const G=String(D.scenarioId??"").trim(),U=String(D.scenarioName??"").trim();return!G&&!U?null:[G||U,U||G]}).filter(D=>!!D)).values()),M=Array.from(new Set(k.scenarios.map(D=>D.agentName).filter(Boolean))),z=R.slice(0,2).join(", "),B=R.length>2?` +${R.length-2}`:"";return{scenarioCount:R.length,agentCount:M.length,scenarioPreview:z?`${z}${B}`:"n/a"}},O=async k=>{d(!0);try{await e.deleteResult(k),n(R=>R.filter(M=>M.id!==k)),Oe({title:"Run deleted",description:k}),o(null)}catch(R){Oe({title:"Could not delete run",description:R instanceof Error?R.message:String(R),variant:"destructive"})}finally{d(!1)}};return s.jsxs("div",{className:"space-y-6",children:[s.jsx(bs,{open:i!==null,onOpenChange:k=>{!k&&!c&&o(null)},children:s.jsxs(Wa,{children:[s.jsxs(Va,{children:[s.jsx(Ka,{children:"Delete run?"}),s.jsxs(Ga,{children:["This will permanently remove the run artifacts from disk for"," ",s.jsx("span",{className:"font-mono",children:i??""}),"."]})]}),s.jsxs(Ha,{children:[s.jsx(Xa,{disabled:c,children:"Cancel"}),s.jsx(Ya,{disabled:c||!i,onClick:k=>{k.preventDefault(),i&&O(i)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:c?"Deleting...":"Delete run"})]})]})}),s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(ed,{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(sn,{value:g,onValueChange:j,children:[s.jsx(Qt,{className:"w-[260px]",children:s.jsx(on,{placeholder:"Filter by scenario"})}),s.jsxs(Jt,{children:[s.jsx(st,{value:"all",children:"All scenarios"}),S.map(k=>s.jsx(st,{value:k,children:k},k))]})]}),s.jsx(se,{variant:"outline",onClick:()=>{x()},disabled:r,children:r?"Refreshing...":"Refresh"})]})]}),s.jsx(Ue,{children:s.jsx(qe,{className:"p-0",children:s.jsxs(Xr,{children:[s.jsx(Qr,{children:s.jsxs(Ut,{children:[s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>b("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:()=>b("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:()=>b("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:()=>b("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:()=>b("avgToolCalls"),children:["Avg Tool Calls",P("avgToolCalls")]})}),s.jsx(tt,{className:"w-10"})]})}),s.jsx(Jr,{children:_.map(k=>s.jsxs(Ut,{children:[s.jsx(Ke,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(yt,{to:`/results/${k.id}`,className:"font-mono text-xs text-primary hover:underline",children:k.id}),k.configId?s.jsx("div",{className:"text-[11px] text-muted-foreground",children:k.configId}):null]})}),s.jsx(Ke,{className:"text-[11px] text-muted-foreground",children:(()=>{const R=A(k);return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Evaluated: ",R.scenarioCount," scenario",R.scenarioCount===1?"":"s"," · ",R.agentCount," agent",R.agentCount===1?"":"s"]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:R.scenarioPreview})]})})()}),s.jsx(Ke,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Gd,{className:"h-3 w-3"}),new Date(k.timestamp).toLocaleString()]})}),s.jsx(Ke,{children:s.jsx(vo,{rate:k.overallPassRate})}),s.jsx(Ke,{className:"font-mono text-sm",children:k.totalScenarios}),s.jsx(Ke,{className:"font-mono text-sm",children:k.avgToolCalls.toFixed(0)}),s.jsx(Ke,{children:s.jsxs(Fc,{children:[s.jsx(Bc,{asChild:!0,children:s.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(_m,{className:"h-4 w-4"})})}),s.jsxs(Wo,{align:"end",children:[s.jsx(pr,{asChild:!0,children:s.jsxs(yt,{to:`/results/${k.id}`,children:[s.jsx(OU,{className:"mr-2 h-3.5 w-3.5"}),"View"]})}),s.jsxs(pr,{children:[s.jsx(ga,{className:"mr-2 h-3.5 w-3.5"}),"Export JSON"]}),s.jsxs(pr,{className:"text-destructive",onSelect:R=>{R.preventDefault(),o(k.id)},children:[s.jsx(ba,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]})})]},k.id))})]})})})]})};function Zu({text:e,variant:t="assistant",className:n}){const r=sge(e);return s.jsx("div",{className:je("space-y-2",t==="system"&&"text-xs",n),children:r.map((a,i)=>s.jsx(v.Fragment,{children:ige(a,i,t)},`md-${i}`))})}function sge(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 y=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:y,code:g.join(`
146
- `)});continue}if(/^---+$/.test(c)||/^\*\*\*+$/.test(c)){n.push({type:"hr"}),r+=1;continue}if(c.startsWith(">")){const y=[];for(;r<t.length&&t[r].trim().startsWith(">");)y.push(t[r].trim().replace(/^>\s?/,"")),r+=1;n.push({type:"blockquote",text:y.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(vM(t,r)){const y=gM(t[r]);r+=2;const g=[];for(;r<t.length&&t[r].includes("|")&&!a(t[r]);)g.push(gM(t[r])),r+=1;n.push({type:"table",headers:y,rows:g});continue}const f=c.match(/^\d+\.\s+/),h=c.match(/^[-*+]\s+/);if(f||h){const y=!!f,g=[];for(;r<t.length;){const j=t[r].trim();if(y?/^\d+\.\s+/.test(j):/^[-*+]\s+/.test(j)){g.push(j.replace(y?/^\d+\.\s+/:/^[-*+]\s+/,"")),r+=1;continue}a(t[r])&&(r+=1);break}n.push({type:"list",ordered:y,items:g});continue}const p=[o];for(r+=1;r<t.length;){const y=t[r],g=y.trim();if(a(y)||i(y)||/^---+$/.test(g)||/^#{1,4}\s+/.test(g)||g.startsWith(">")||vM(t,r)||/^\d+\.\s+/.test(g)||/^[-*+]\s+/.test(g))break;p.push(y),r+=1}n.push({type:"paragraph",text:p.join(`
148
- `)})}return n}function vM(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 gM(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>t.trim())}function ige(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:xl(e.text,`${t}-h`)})}if(e.type==="paragraph")return s.jsx("p",{className:je("whitespace-pre-wrap leading-relaxed",n==="system"&&"leading-normal"),children:xl(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:xl(e.text,`${t}-bq`)});if(e.type==="code")return s.jsxs("div",{className:"rounded-md border bg-muted/70",children:[e.lang&&s.jsx("div",{className:"border-b px-2 py-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:e.lang}),s.jsx("pre",{className:"max-h-72 overflow-auto p-2 text-xs",children:s.jsx("code",{children:e.code})})]});if(e.type==="list"){const r=e.ordered?"ol":"ul";return s.jsx(r,{className:je("space-y-1 pl-5",e.ordered?"list-decimal":"list-disc"),children:e.items.map((a,i)=>s.jsx("li",{className:"leading-relaxed",children:xl(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:xl(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:xl(i,`${t}-tdc-${a}-${o}`)},`${t}-td-${a}-${o}`))},`${t}-row-${a}`))})]})}):null}function xl(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 oge(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">${oo(c.scenarioName)}</span>
153
- <span class="scenario-agent">${oo(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">${oo(f.name)} <small>${f.duration}ms</small></span>`).join("")}
166
- </div>
167
- ${d.failureReasons.length?`<div class="failure-reasons">${d.failureReasons.map(f=>oo(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 — ${oo(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">${oo(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">${oo(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 oo(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}const lge="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 yM(e){const t=new Date().toISOString().replace(/[:]/g,"-").replace(/\..+/,"");return`mcplab/reports/result-assistant/${e}-${t}.md`}function xM(e){const t=e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}const uge=()=>{const{id:e}=Mo(),t=ja(),[n]=Ec(),{source:r}=Pn(),a=vf("snapshots",!1),{configs:i}=nf(),{scenarios:o}=Ua(),[c,d]=v.useState(void 0),[f,h]=v.useState(!0),[p,y]=v.useState(new Set),[g,j]=v.useState(new Set),[b,x]=v.useState([]),[S,N]=v.useState(""),[_,P]=v.useState(null),[A,O]=v.useState(!1),[k,R]=v.useState(""),[M,z]=v.useState(""),[B,D]=v.useState(!1),[G,U]=v.useState(!1),[W,X]=v.useState(null),[J,T]=v.useState([]),[L,Q]=v.useState([]),[F,$]=v.useState(""),[Z,ae]=v.useState(!1),[V,ie]=v.useState(!1),[ne,de]=v.useState("assistant"),[oe,ge]=v.useState(null),[Re,re]=v.useState(null),[De,Ae]=v.useState(!1),[We,ye]=v.useState(""),[Ee,le]=v.useState(""),[_e,pe]=v.useState(!1),[we,Se]=v.useState(!1),[Ve,Ot]=v.useState(!1),[xe,ze]=v.useState([]),[Ge,Dt]=v.useState(!1),[Lt,$t]=v.useState(""),[mn,_n]=v.useState(null),[tr,or]=v.useState(!1),[Ca,Mn]=v.useState(null),Mr=v.useRef(null),$r=v.useRef(null),hr=v.useCallback(async(H,he)=>{Dt(!0);try{const Ie=(await r.listMarkdownReports()).filter(kt=>{const _t=String(kt.relativePath??""),kn=String(kt.name??"");return _t.includes(H)||kn.includes(H)});if(ze(Ie),he&&Ie.length>0){const kt=Ie.find(_t=>_t.relativePath===he||_t.path===he||_t.relativePath.endsWith(he)||_t.path.endsWith(he));kt&&$t(kt.relativePath)}return Ie}catch{return ze([]),[]}finally{Dt(!1)}},[r]);v.useEffect(()=>{if(!e)return;let H=!0;const he=W;return he&&(r.closeResultAssistantSession(he).catch(()=>{}),X(null),T([]),Q([]),re(null)),h(!0),r.getResult(e).then(at=>{H&&(d(at),h(!1))}),()=>{H=!1}},[e,r]),v.useEffect(()=>{let H=!0;return r.listSnapshots().then(he=>{H&&x(he)}).catch(()=>{H&&x([])}),()=>{H=!1}},[r]),v.useEffect(()=>{if(!c?.id){ze([]);return}let H=!0;return(async()=>{const he=await hr(c.id)})(),()=>{H=!1}},[c?.id,hr]),v.useEffect(()=>{if(xe.length===0){$t(""),_n(null),Mn(null);return}(!Lt||!xe.some(H=>H.relativePath===Lt))&&$t(xe[0].relativePath)},[xe,Lt]),v.useEffect(()=>{if(!G||ne!=="reports")return;if(!Lt){_n(null),Mn(null);return}let H=!0;return or(!0),Mn(null),r.getMarkdownReport(Lt).then(he=>{H&&_n(he)}).catch(he=>{H&&(_n(null),Mn(he instanceof Error?he.message:String(he)))}).finally(()=>{H&&or(!1)}),()=>{H=!1}},[G,ne,Lt,r]);const $n=n.get("configId")??"",On=v.useMemo(()=>{const H=$n?i.find(he=>he.id===$n):void 0;return H||(c?i.find(he=>he.id===c.configId):void 0)},[i,$n,c]),en=v.useMemo(()=>{const H=new Map;if(On){for(const he of On.scenarios)H.set(he.id,he),he.name&&!H.has(he.name)&&H.set(he.name,he);for(const he of On.scenarioEntries??[]){if(he.kind!=="referenced")continue;const at=o.find(Ie=>Ie.id===he.ref);at&&(H.set(at.id,at),at.name&&H.set(at.name,at),H.has(he.ref)||H.set(he.ref,at))}}for(const he of o)H.has(he.id)||H.set(he.id,he),he.name&&!H.has(he.name)&&H.set(he.name,he);return H},[On,o]),Sn=v.useMemo(()=>{if(!c?.snapshotEval?.baselineSnapshotId)return"";const H=i.filter(he=>he.snapshotEval?.baselineSnapshotId===c.snapshotEval?.baselineSnapshotId);return H.length===1?H[0].id:""},[i,c?.snapshotEval?.baselineSnapshotId]);if(v.useEffect(()=>{c?.snapshotEval?.baselineSnapshotId&&N(H=>H||c.snapshotEval.baselineSnapshotId)},[c?.snapshotEval?.baselineSnapshotId]),v.useEffect(()=>{if($n&&i.some(H=>H.id===$n)){R($n);return}Sn&&R(H=>H||Sn)},[$n,i,Sn]),v.useEffect(()=>{if(!G)return;const H=window.setTimeout(()=>{Mr.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(H)},[G,J.length,Z]),v.useEffect(()=>()=>{W&&r.closeResultAssistantSession(W).catch(()=>{})},[W,r]),v.useEffect(()=>{const H=$r.current;if(!H)return;H.style.height="0px";const he=Math.min(H.scrollHeight,160);H.style.height=`${Math.max(40,he)}px`},[F,G]),f)return s.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Loading result..."});if(!c)return s.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Result not found"});const ce=c.scenarios.reduce((H,he)=>H+he.runs.filter(at=>at.passed).length,0),Te=c.totalRuns-ce,ot=[{name:"Pass",value:ce,color:"hsl(152, 69%, 40%)"},{name:"Fail",value:Te,color:"hsl(0, 72%, 51%)"}],gt={};c.scenarios.forEach(H=>H.runs.forEach(he=>he.toolCalls.forEach(at=>{gt[at.name]=(gt[at.name]||0)+1})));const Ft=Object.entries(gt).map(([H,he])=>({name:H,count:he})).sort((H,he)=>he.count-H.count),cn=H=>{y(he=>{const at=new Set(he);return at.has(H)?at.delete(H):at.add(H),at})},At=(H,he,at,Ie)=>`${H}:${he}:${at}:${Ie}`,mr=(H,he)=>`${H}::${he}`,un=H=>{j(he=>{const at=new Set(he);return at.has(H)?at.delete(H):at.add(H),at})},Kt=H=>{const he=!H.endsWith(":conversation");return g.has(H)?!he:he},Nr=new Map((_?.scenario_results??[]).map(H=>[H.scenario_id,H])),Dr=async()=>{if(!(!c||!S)){O(!0);try{const H=await r.compareSnapshot(S,c.id);P(H)}finally{O(!1)}}},Qa=async H=>{const he=H||c.snapshotEval?.baselineSnapshotId;if(he){N(he),O(!0);try{const at=await r.compareSnapshot(he,c.id);P(at)}catch(at){Oe({title:"Could not review drift",description:at instanceof Error?at.message:String(at),variant:"destructive"})}finally{O(!1)}}},ti=async()=>{if(!k){Oe({title:"Select a configuration",description:"Choose which config should receive the new baseline.",variant:"destructive"});return}D(!0);try{const H=await r.generateSnapshotEvalBaseline(c.id,k,M.trim()||void 0);x(he=>[H.snapshot,...he.filter(at=>at.id!==H.snapshot.id)]),N(H.snapshot.id),Oe({title:"Baseline updated",description:`${H.snapshot.name} is now linked to the selected config.`}),M.trim()||z(H.snapshot.name),c.snapshotEval?.applied&&Qa(H.snapshot.id)}catch(H){Oe({title:"Could not accept new baseline",description:H instanceof Error?H.message:String(H),variant:"destructive"})}finally{D(!1)}},Vi=async()=>{const H=F.trim();if(!H||!c)return;const he=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,at={id:he,role:"user",text:H,createdAt:new Date().toISOString()};$(""),T(Ie=>[...Ie,at]),ae(!0);try{let Ie=W;if(!Ie){const _t=await r.createResultAssistantSession(c.id);Ie=_t.sessionId,X(_t.session.id),Q(_t.session.pendingToolCalls),re({assistantAgentName:_t.session.selectedAssistantAgentName,provider:_t.session.provider,model:_t.session.model}),T(kn=>{const Ja=kn.some(Ln=>Ln.id===he),Gt=_t.session.messages;return Ja?[...Gt,at]:Gt})}const kt=await r.sendResultAssistantMessage(Ie,H);ve(kt.session)}catch(Ie){T(kt=>kt.filter(_t=>_t.id!==he)),Oe({title:"MCP Labs Assistant error",description:Ie instanceof Error?Ie.message:String(Ie),variant:"destructive"})}finally{ae(!1)}},K=H=>{$(H),requestAnimationFrame(()=>$r.current?.focus())},ve=H=>{X(H.id),T(H.messages),Q(H.pendingToolCalls),re({assistantAgentName:H.selectedAssistantAgentName,provider:H.provider,model:H.model})},Fe=async H=>{if(W){ae(!0);try{const he=await r.approveResultAssistantToolCall(W,H);ve(he.session)}catch(he){Oe({title:"Could not approve assistant action",description:he instanceof Error?he.message:String(he),variant:"destructive"})}finally{ae(!1)}}},ct=async H=>{if(W){ae(!0);try{const he=await r.denyResultAssistantToolCall(W,H);ve(he.session)}catch(he){Oe({title:"Could not deny assistant action",description:he instanceof Error?he.message:String(he),variant:"destructive"})}finally{ae(!1)}}},jt=(H,he)=>{de("assistant"),U(!0),ge(he?.scenarioId??null),J.length===0&&T([{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()}]),H&&$(H)},Pt=H=>{de("reports"),U(!0)},yn=H=>{if(!c)return;if(!oe){Oe({title:"No scenario context",description:"Ask about a specific scenario or run first, then send the suggestion.",variant:"destructive"});return}const he=o.find(Ie=>Ie.id===oe)??o.find(Ie=>Ie.name===oe);if(!he){Oe({title:"Scenario not found in library",description:`Could not find library scenario '${oe}' to open in Scenario Assistant.`,variant:"destructive"});return}const at=[`I am sending a suggestion from the Result Assistant for scenario '${oe}' based on run '${c.id}'.`,"Please review the suggestion, check it against the current scenario configuration, and propose concrete updates to the Checks and/or Value Capture Rules if appropriate.","","Result Assistant suggestion:",H].join(`
249
- `);try{window.sessionStorage.setItem(lge,JSON.stringify({type:"result-assistant-handoff-v1",runId:c.id,configId:$n||c.configId||"",scenarioId:he.id,prompt:at,sourceReply:H})),t(`/libraries/test-cases/${encodeURIComponent(he.id)}?assistantHandoff=1`)}catch(Ie){Oe({title:"Could not create handoff",description:Ie instanceof Error?Ie.message:String(Ie),variant:"destructive"})}},Ye=H=>{c&&(Ot(!1),ye(H),le(yM(c.id)),pe(!1),Ae(!0))},xn=()=>{c&&(Ot(!0),ye(""),le(yM(c.id)),pe(!1),Ae(!0))},Dn=async()=>{if(!c)return;if(!We.trim()){Oe({title:"No markdown to write",description:"The selected assistant response is empty.",variant:"destructive"});return}Se(!0);try{const he=await r.applyResultAssistantReport({runId:c.id,markdown:We,outputPath:Ee.trim()||void 0,overwrite:_e});Oe({title:"Markdown report written",description:typeof he.path=="string"&&he.path?he.path:he.outputPath}),await hr(c.id,typeof he.path=="string"&&he.path||he.outputPath||void 0),G&&de("reports"),Ae(!1)}catch(he){Oe({title:"Could not write markdown report",description:he instanceof Error?he.message:String(he),variant:"destructive"})}finally{Se(!1)}},tn=async H=>{try{await navigator.clipboard.writeText(H),Oe({title:"Copied"})}catch(he){Oe({title:"Could not copy",description:he instanceof Error?he.message:String(he),variant:"destructive"})}};return s.jsxs("div",{className:`${G?"xl:flex xl:h-[calc(100vh-2rem-48px)] xl:min-h-0 xl:flex-col xl:overflow-hidden":""}`,children:[s.jsx("div",{className:`${G?"xl:shrink-0 xl:pb-6":"mb-6"}`,children:s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[s.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[s.jsx(se,{variant:"ghost",size:"icon",asChild:!0,children:s.jsx(yt,{to:"/results",children:s.jsx(xo,{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(vo,{rate:c.overallPassRate}),a&&c.snapshotEval?.applied&&s.jsxs(Je,{variant:"outline",className:"text-xs",children:["Snapshot policy · ",c.snapshotEval.mode," · ",c.snapshotEval.status]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[new Date(c.timestamp).toLocaleString()," · Config hash: ",s.jsx("span",{className:"font-mono",children:c.configHash})]}),a&&c.snapshotEval?.applied&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Baseline: ",s.jsx("span",{className:"font-mono",children:c.snapshotEval.baselineSnapshotId})," · score: ",c.snapshotEval.overallScore]})]})]}),s.jsxs("div",{className:"ml-auto flex shrink-0 flex-wrap items-center justify-end gap-2",children:[a&&c.snapshotEval?.applied&&s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>{Qa()},disabled:A,children:[s.jsx(wS,{className:"h-3.5 w-3.5"}),A?"Reviewing drift...":"Review Drift"]}),s.jsxs(se,{variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>{const H=oge(c),he=new Blob([H],{type:"text/html"}),at=URL.createObjectURL(he),Ie=document.createElement("a");Ie.href=at,Ie.download=`mcplab-report-${c.id}.html`,Ie.click(),URL.revokeObjectURL(at)},children:[s.jsx(ga,{className:"h-3.5 w-3.5"}),"Download Report"]}),s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>Pt(),disabled:Ge,children:[s.jsx(sh,{className:"h-3.5 w-3.5"}),Ge?"Reference Reports...":`Reference Reports${xe.length?` (${xe.length})`:""}`]}),s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>jt(),children:[s.jsx(fa,{className:"h-3.5 w-3.5"}),"MCP Labs Assistant"]})]})]})}),s.jsxs("div",{className:`grid gap-6 items-start ${G?V?"xl:grid-cols-[minmax(0,1fr)_52rem] xl:flex-1 xl:min-h-0 xl:overflow-hidden":"xl:grid-cols-[minmax(0,1fr)_28rem] xl:flex-1 xl:min-h-0 xl:overflow-hidden":"grid-cols-1"}`,children:[s.jsxs("div",{className:`min-w-0 space-y-6 ${G?"xl:h-full xl:min-h-0 xl:overflow-y-auto xl:pr-2":""}`,children:[a&&c.snapshotEval?.applied&&s.jsxs(Ue,{className:"border-amber-500/30",children:[s.jsx(Nt,{className:"pb-3",children:s.jsx(Ct,{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(Je,{variant:"outline",children:["Mode: ",c.snapshotEval.mode]}),s.jsxs(Je,{variant:"outline",children:["Status: ",c.snapshotEval.status]}),s.jsxs(Je,{variant:"outline",children:["Overall score: ",c.snapshotEval.overallScore]}),s.jsxs(Je,{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(sn,{value:k,onValueChange:R,children:[s.jsx(Qt,{className:"h-8",children:s.jsx(on,{placeholder:"Select config to update"})}),s.jsx(Jt,{children:i.map(H=>s.jsx(st,{value:H.id,children:H.name},H.id))})]}),!k&&s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Tip: open results from the Run page to prefill the config automatically."})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"New snapshot name (optional)"}),s.jsx("div",{className:"relative",children:s.jsx("input",{value:M,onChange:H=>z(H.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(se,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5",onClick:()=>{Qa()},disabled:A,children:[s.jsx(xa,{className:`h-3.5 w-3.5 ${A?"animate-spin":""}`}),"Review Drift"]}),s.jsx(se,{type:"button",size:"sm",className:"h-8",onClick:()=>{ti()},disabled:B||c.overallPassRate!==1,children:B?"Accepting...":"Accept as New Baseline"})]})]}),c.overallPassRate!==1&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"Baseline updates require a fully passing run (same rule as snapshot creation)."})]})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-5",children:[s.jsx(Ts,{title:"Scenarios",value:c.totalScenarios,icon:h1}),s.jsx(Ts,{title:"Total Runs",value:c.totalRuns,icon:JM}),s.jsx(Ts,{title:"Pass Rate",value:`${Math.round(c.overallPassRate*100)}%`,icon:ed}),s.jsx(Ts,{title:"Avg Tool Calls",value:xM(c.avgToolCalls),icon:Ol}),s.jsx(Ts,{title:"Avg Latency",value:`${c.avgLatency}ms`,icon:l$})]}),s.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[s.jsxs(Ue,{children:[s.jsx(Nt,{className:"pb-2",children:s.jsx(Ct,{className:"text-base",children:"Pass / Fail"})}),s.jsxs(qe,{className:"flex items-center justify-center",children:[s.jsxs(Zde,{width:180,height:180,children:[s.jsx(Zs,{data:ot,dataKey:"value",innerRadius:50,outerRadius:75,paddingAngle:3,children:ot.map((H,he)=>s.jsx(uv,{fill:H.color},he))}),s.jsx(Hr,{})]}),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"}),ce," 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"}),Te," failed"]})]})]})]}),s.jsxs(Ue,{children:[s.jsx(Nt,{className:"pb-2",children:s.jsx(Ct,{className:"text-base",children:"Tool Usage"})}),s.jsx(qe,{children:s.jsx(X1,{width:"100%",height:180,children:s.jsxs(Jde,{data:Ft,layout:"vertical",children:[s.jsx(Ao,{type:"number",tick:{fontSize:11}}),s.jsx(Eo,{type:"category",dataKey:"name",tick:{fontSize:11},width:120}),s.jsx(Hr,{}),s.jsx(zo,{dataKey:"count",fill:"hsl(38, 92%, 50%)",radius:[0,4,4,0]})]})})})]})]}),s.jsxs(Ue,{children:[s.jsx(Nt,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx(Ct,{className:"text-base",children:"Scenarios"}),s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5 px-2 text-xs",onClick:()=>jt("Summarize the scenario results in this run. Highlight failed scenarios/checks first, then mention notable tool usage and extracted values."),children:[s.jsx(fa,{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(sn,{value:S,onValueChange:N,children:[s.jsx(Qt,{className:"h-8",children:s.jsx(on,{placeholder:"Select snapshot"})}),s.jsx(Jt,{children:b.map(H=>s.jsx(st,{value:H.id,children:H.name},H.id))})]})]}),s.jsx(se,{type:"button",variant:"outline",size:"sm",disabled:!S||A,onClick:()=>{Dr()},children:A?"Comparing...":"Compare Snapshot"}),_&&s.jsxs(Je,{variant:"outline",className:"h-8 px-2 py-0 text-xs",children:["Overall snapshot score: ",_.overall_score]})]}),s.jsxs(Xr,{children:[s.jsx(Qr,{children:s.jsxs(Ut,{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:"Snapshot"})]})}),s.jsx(Jr,{children:c.scenarios.map(H=>{const he=mr(H.scenarioId,H.agentName),at=H.scenarioName||H.scenarioId;return s.jsx(Ci,{open:p.has(he),onOpenChange:()=>cn(he),asChild:!0,children:s.jsxs(s.Fragment,{children:[s.jsx(Rs,{asChild:!0,children:s.jsxs(Ut,{className:"cursor-pointer hover:bg-muted/50",children:[s.jsx(Ke,{children:s.jsx(Wt,{className:`h-4 w-4 transition-transform ${p.has(he)?"rotate-180":""}`})}),s.jsx(Ke,{className:"font-medium text-sm",children:H.scenarioName}),s.jsx(Ke,{className:"text-sm",children:H.agentName}),s.jsx(Ke,{className:"font-mono text-sm",children:H.runs.length}),s.jsx(Ke,{children:s.jsx(vo,{rate:H.passRate})}),s.jsx(Ke,{className:"font-mono text-sm",children:xM(H.avgToolCalls)}),s.jsx(Ke,{children:(()=>{const Ie=Nr.get(H.scenarioId);if(!Ie)return s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"});const kt=Ie.status==="Match"?"bg-success/15 text-success":Ie.status==="Warn"?"bg-amber-500/15 text-amber-600":"bg-destructive/15 text-destructive";return s.jsxs(Je,{variant:"outline",className:`text-xs ${kt}`,children:[Ie.status," · ",Ie.score]})})()})]})}),s.jsx(_i,{asChild:!0,children:s.jsx("tr",{children:s.jsx("td",{colSpan:7,className:"p-0",children:s.jsxs("div",{className:"bg-muted/30 p-4 space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border bg-card px-3 py-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-xs font-semibold",children:"Scenario details"}),s.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[at," · ",H.agentName," · ",Math.round(H.passRate*100),"% pass rate"]})]}),s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>jt(`Explain why scenario '${at}' failed (agent: ${H.agentName}). Summarize the likely cause from the result details and suggest what to inspect next.`,{scenarioId:H.scenarioId}),children:[s.jsx(fa,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]}),(()=>{const Ie=Nr.get(H.scenarioId);return!Ie||Ie.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: ",Ie.baseline_agents.join(", ")||"—"," · observed agents: ",Ie.observed_agents.join(", ")||"—"]}),s.jsx("ul",{className:"space-y-1 text-xs text-muted-foreground",children:Ie.reasons.map((kt,_t)=>s.jsxs("li",{children:["• ",kt]},_t))})]})})(),H.runs.map(Ie=>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:Ie.passed?s.jsx(Ol,{className:"h-4 w-4 text-success"}):s.jsx(Qp,{className:"h-4 w-4 text-destructive"})}),s.jsxs("div",{className:"flex-1 space-y-1",children:[(()=>{const kt=en.get(H.scenarioId),_t=kt?pge(kt.evalRules,Ie.failureReasons):[],kn=_t.filter(Gt=>Gt.status==="failed"),Ja=_t.filter(Gt=>Gt.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 #",Ie.runIndex+1]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[Ie.duration,"ms"]}),!Ie.passed&&s.jsx(Je,{variant:"outline",className:"h-5 border-destructive/30 bg-destructive/10 text-destructive text-[10px]",children:"Failed"})]}),Ie.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(Qp,{className:"h-3.5 w-3.5"}),"Failure reasons"]}),s.jsx("ul",{className:"space-y-1 text-xs text-destructive",children:Ie.failureReasons.map((Gt,Ln)=>s.jsxs("li",{children:["• ",jM(Gt)]},Ln))})]}),_t.length>0&&s.jsx(Ci,{open:Kt(At(H.scenarioId,H.agentName,Ie.runIndex,"checks")),onOpenChange:()=>un(At(H.scenarioId,H.agentName,Ie.runIndex,"checks")),children:s.jsxs("div",{className:"rounded-md border bg-muted/20 p-2",children:[s.jsx(Rs,{asChild:!0,children:s.jsxs("button",{type:"button",className:"mb-2 flex w-full flex-wrap items-center gap-2 text-left",children:[s.jsx(Wt,{className:`h-3.5 w-3.5 transition-transform ${Kt(At(H.scenarioId,H.agentName,Ie.runIndex,"checks"))?"rotate-180":""}`}),s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Checks"}),s.jsxs(Je,{variant:"outline",className:"h-5 border-success/30 bg-success/10 text-success text-[10px]",children:[Ja.length," passed"]}),s.jsxs(Je,{variant:"outline",className:`h-5 text-[10px] ${kn.length>0?"border-destructive/30 bg-destructive/10 text-destructive":""}`,children:[kn.length," failed"]})]})}),s.jsx(_i,{children:s.jsx("div",{className:"space-y-1",children:_t.map((Gt,Ln)=>s.jsxs("div",{className:`flex items-start justify-between gap-2 rounded-md border px-2 py-1.5 text-xs ${Gt.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:[Gt.status==="failed"?s.jsx(Qp,{className:"h-3.5 w-3.5 shrink-0 text-destructive"}):s.jsx(Ol,{className:"h-3.5 w-3.5 shrink-0 text-success"}),s.jsx("span",{className:"font-medium",children:mge(Gt.rule)})]}),Gt.failureReason&&s.jsx("p",{className:"mt-1 pl-5 text-[11px] text-destructive",children:jM(Gt.failureReason)})]}),s.jsx(Je,{variant:"outline",className:`shrink-0 text-[10px] ${Gt.status==="failed"?"border-destructive/30 text-destructive":"border-success/30 text-success"}`,children:Gt.status})]},`${Gt.rule.type}-${Gt.rule.value}-${Ln}`))})})]})})]})})(),s.jsx(Ci,{open:Kt(At(H.scenarioId,H.agentName,Ie.runIndex,"extracts")),onOpenChange:()=>un(At(H.scenarioId,H.agentName,Ie.runIndex,"extracts")),children:s.jsxs("div",{className:"rounded-md border border-violet-500/20 bg-violet-500/5 p-2",children:[s.jsx(Rs,{asChild:!0,children:s.jsxs("button",{type:"button",className:"mb-2 flex w-full flex-wrap items-center justify-between gap-2 text-left",children:[s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[s.jsx(Wt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${Kt(At(H.scenarioId,H.agentName,Ie.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(h1,{className:"h-3.5 w-3.5 text-violet-600"}),"Extracted values"]})]}),s.jsxs(Je,{variant:"outline",className:"h-5 text-[10px]",children:[Object.keys(Ie.extractedValues??{}).length," total"]})]})}),s.jsx(_i,{children:Object.keys(Ie.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(Ie.extractedValues??{}).map(([kt,_t])=>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:_t===null?"null":String(_t)})]},kt))})})]})}),s.jsx(Ci,{open:Kt(At(H.scenarioId,H.agentName,Ie.runIndex,"tools")),onOpenChange:()=>un(At(H.scenarioId,H.agentName,Ie.runIndex,"tools")),children:s.jsxs("div",{className:"rounded-md border border-sky-500/20 bg-sky-500/5 p-2",children:[s.jsx(Rs,{asChild:!0,children:s.jsxs("button",{type:"button",className:"mb-2 flex w-full flex-wrap items-center justify-between gap-2 text-left",children:[s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[s.jsx(Wt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${Kt(At(H.scenarioId,H.agentName,Ie.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(Is,{className:"h-3.5 w-3.5 text-sky-600"}),"Tool call sequence"]})]}),s.jsxs(Je,{variant:"outline",className:"h-5 text-[10px]",children:[Ie.toolCalls.length," total"]})]})}),s.jsx(_i,{children:Ie.toolCalls.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No tool calls captured for this run."}):s.jsx("div",{className:"flex flex-wrap gap-1",children:Ie.toolCalls.map((kt,_t)=>s.jsxs(Je,{variant:"outline",className:"font-mono text-xs bg-background",children:[s.jsxs("span",{className:"mr-1 text-muted-foreground",children:["#",_t+1]}),kt.name,s.jsxs("span",{className:"ml-1 text-muted-foreground",children:[kt.duration,"ms"]})]},_t))})})]})}),s.jsx(Ci,{open:Kt(At(H.scenarioId,H.agentName,Ie.runIndex,"final")),onOpenChange:()=>un(At(H.scenarioId,H.agentName,Ie.runIndex,"final")),children:s.jsxs("div",{className:"rounded-md border border-muted-foreground/20 bg-card p-2",children:[s.jsx(Rs,{asChild:!0,children:s.jsxs("button",{type:"button",className:"mb-2 flex w-full items-center gap-2 text-left",children:[s.jsx(Wt,{className:`h-3.5 w-3.5 transition-transform ${Kt(At(H.scenarioId,H.agentName,Ie.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(ha,{className:"h-3.5 w-3.5"}),"Final answer"]})]})}),s.jsx(_i,{children:s.jsx(mS,{text:Ie.finalAnswer||"No final answer captured.",maxLength:1200,className:"text-xs text-foreground"})})]})}),s.jsx(Ci,{open:Kt(At(H.scenarioId,H.agentName,Ie.runIndex,"conversation")),onOpenChange:()=>un(At(H.scenarioId,H.agentName,Ie.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(Rs,{asChild:!0,children:s.jsxs("button",{type:"button",className:"flex min-w-0 items-center gap-2 text-left",children:[s.jsx(Wt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${Kt(At(H.scenarioId,H.agentName,Ie.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(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>jt(`Explain Run #${Ie.runIndex+1} for scenario '${at}'. It ${Ie.passed?"passed":"failed"} in ${Ie.duration}ms. Focus on the tool sequence and ${Ie.passed?"why it passed":"what caused the failure"}.`,{scenarioId:H.scenarioId}),children:[s.jsx(fa,{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:Ie.conversation.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No conversation trace captured."}):Ie.conversation.map(kt=>s.jsx(dge,{item:kt,fallbackUserPrompt:en.get(H.scenarioId)?.prompt},kt.id))})}),!Kt(At(H.scenarioId,H.agentName,Ie.runIndex,"conversation"))&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"Expand to inspect user/assistant/tool messages for this run."})]})})]})]},Ie.runIndex))]})})})})]})},he)})})]})]})]})]}),G&&s.jsxs("div",{className:"min-w-0 space-y-0 xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[s.jsx(tC,{value:ne,onValueChange:H=>de(H),className:"min-w-0 -mb-px px-3 pt-1",children:s.jsxs(qv,{className:"h-auto w-full justify-start rounded-none border-b bg-transparent p-0",children:[s.jsx(Po,{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(Po,{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"})]})}),ne==="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(Nt,{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(Ct,{className:"flex items-center gap-2 text-base",children:[s.jsx(fa,{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(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>ie(H=>!H),children:[V?s.jsx(sE,{className:"h-3.5 w-3.5"}):s.jsx(iE,{className:"h-3.5 w-3.5"}),V?"Compact":"Expand"]}),s.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>U(!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(wm,{className:"min-h-0 flex-1 bg-muted/15 px-4 py-4",children:s.jsxs("div",{className:"space-y-3 pr-2",children:[J.map((H,he)=>{const at=H.role==="user",Ie=H.role==="assistant",kt=H.role==="system",_t=H.role==="tool",kn=H.pendingToolCallId?L.find(qc=>qc.id===H.pendingToolCallId):void 0,Ja=Ie&&!!H.pendingToolCallId;if(_t&&/^(Approved|Denied) tool call\b/i.test(String(H.text??"").trim()))return null;kn?.server??H.toolRequestServer;const Gt=kn?.tool??H.toolRequestName,Ln=kn?.publicToolName??H.toolRequestPublicName,xf=Ie&&!Ja&&fge(H.text,!!oe);if(Ja){const qc=Gt??Ln??"unknown_tool";return Gt&&Gt.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(ha,{className:"h-3 w-3"})}),s.jsxs("details",{open:!!kn,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(Is,{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 ${qc}`}),s.jsx("span",{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${kn?"bg-amber-100 text-amber-900":"bg-muted text-muted-foreground"}`,children:kn?"Needs approval":"Completed"})]})}),s.jsx(Wt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),s.jsxs("div",{className:"min-w-0 space-y-2 border-t border-border/50 px-3 py-2",children:[s.jsx(Zu,{text:H.text,className:"text-sm"}),kn&&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(kn.arguments??{},null,2)})}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:Z,onClick:()=>{ct(kn.id)},children:"Deny"}),s.jsx(se,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:Z,onClick:()=>{Fe(kn.id)},children:"Approve"})]})]})]})]})]},`${H.id??`${H.role}-${he}`}:${kn?"pending":"completed"}`)}const Lr=at||Ie&&!_t&&!kt;return s.jsxs("div",{className:`flex items-start gap-2 ${at?"justify-end":"justify-start"}`,children:[!at&&s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700",children:kt?s.jsx(i$,{className:"h-3 w-3"}):s.jsx(ha,{className:"h-3 w-3"})}),s.jsxs("div",{className:"relative max-w-[92%]",children:[s.jsxs("div",{className:`max-w-full rounded-md border p-3 text-sm ${at?"border-primary/20 bg-primary/10":kt?"border-amber-400/30 bg-amber-50/70":_t?"border-blue-300/30 bg-blue-50/50":"border-border/80 bg-background shadow-sm"}`,children:[!(at||kt)&&s.jsx("p",{className:`mb-2 text-[11px] font-semibold text-muted-foreground ${at?"text-right":""}`,children:_t?"Tool":"Assistant"}),s.jsx(Zu,{text:H.text,className:"text-sm"}),xf&&s.jsxs("div",{className:"mt-3 flex max-w-full flex-wrap justify-end gap-2 overflow-x-auto pb-1",children:[s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>yn(H.text),children:[s.jsx(fa,{className:"h-3.5 w-3.5"}),"Send to Scenario Assistant"]}),s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>Ye(H.text),children:[s.jsx(Is,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})]}),!xf&&Ie&&!Ja&&s.jsx("div",{className:"mt-3 flex max-w-full justify-end overflow-x-auto pb-1",children:s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>Ye(H.text),children:[s.jsx(Is,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})})]}),Lr&&s.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"absolute -right-8 bottom-1 h-6 w-6 text-muted-foreground",onClick:()=>{tn(H.text)},"aria-label":"Copy message",title:"Copy message",children:s.jsx(Ri,{className:"h-3.5 w-3.5"})})]}),at&&s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-primary/30 bg-primary/15 text-primary",children:s.jsx(NS,{className:"h-3 w-3"})})]},H.id??`${H.role}-${he}`)}),L.filter(H=>!J.some(he=>he.pendingToolCallId===H.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)"}),L.filter(H=>!J.some(he=>he.pendingToolCallId===H.id)).map(H=>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:H.publicToolName}),s.jsxs("p",{className:"break-all text-xs text-muted-foreground",children:[H.server,"::",H.tool]})]}),s.jsx(Wt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),s.jsxs("div",{className:"border-t px-3 pb-3 pt-2",children:[s.jsx("pre",{className:"max-h-48 min-w-0 w-full max-w-full overflow-x-auto overflow-y-auto whitespace-pre-wrap break-words rounded border bg-muted/50 p-2 text-xs",children:s.jsx("code",{className:"break-words",children:JSON.stringify(H.arguments??{},null,2)})}),s.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:Z,onClick:()=>{ct(H.id)},children:"Deny"}),s.jsx(se,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:Z,onClick:()=>{Fe(H.id)},children:"Approve"})]})]})]},H.id))]}),Z&&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(ha,{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(sr,{className:"h-4 w-4 animate-spin"}),"Thinking..."]})]}),s.jsx("div",{ref:Mr})]})}),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(Gs,{ref:$r,value:F,onChange:H=>$(H.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:H=>{H.key==="Enter"&&!H.shiftKey&&(H.preventDefault(),Z||Vi())}}),s.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 px-1 pt-1",children:[s.jsxs(Fc,{children:[s.jsx(Bc,{asChild:!0,children:s.jsxs(se,{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:Z,children:[s.jsx(us,{className:"h-3 w-3"}),"Snippets",s.jsx(Wt,{className:"h-3 w-3"})]})}),s.jsxs(Wo,{align:"start",className:"w-[360px]",children:[s.jsx(JN,{children:"Result Assistant Snippets"}),s.jsx(ZN,{}),cge.map(H=>s.jsx(pr,{className:"items-start whitespace-normal px-2 py-2",onSelect:()=>K(H.prompt),children:s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("div",{className:"text-xs font-medium leading-tight",children:H.label}),s.jsx("div",{className:"text-[11px] leading-snug text-muted-foreground",children:H.description})]})},H.label))]})]}),s.jsx(se,{type:"button",size:"icon",className:"h-8 w-8 shrink-0 rounded-full",onClick:()=>{Vi()},disabled:Z||!F.trim(),"aria-label":"Send assistant message",title:"Send assistant message",children:Z?s.jsx(sr,{className:"h-4 w-4 animate-spin"}):s.jsxs(s.Fragment,{children:[s.jsx(o$,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Ask"})]})})]})]})})]})]}):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(Nt,{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(Ct,{className:"flex items-center gap-2 text-base",children:[s.jsx(sh,{className:"h-4 w-4 text-muted-foreground"}),"Reference Reports"]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>ie(H=>!H),children:[V?s.jsx(sE,{className:"h-3.5 w-3.5"}):s.jsx(iE,{className:"h-3.5 w-3.5"}),V?"Compact":"Expand"]}),s.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>U(!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:[(Ge||xe.length===0||xe.length>1)&&s.jsx("div",{className:"border-b px-4 py-3",children:Ge?s.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading reference reports..."}):xe.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(se,{type:"button",size:"sm",variant:"outline",className:"shrink-0 gap-1.5",onClick:()=>xn(),children:[s.jsx(us,{className:"h-3.5 w-3.5"}),"New Report"]})]}):s.jsx("div",{className:"space-y-2",children:xe.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(sn,{value:Lt,onValueChange:$t,children:[s.jsx(Qt,{className:"h-8",children:s.jsx(on,{placeholder:"Select a report"})}),s.jsx(Jt,{children:xe.map(H=>s.jsx(st,{value:H.relativePath,children:H.name},H.path))})]})]}):null})}),s.jsx(wm,{className:"min-h-0 flex-1 bg-muted/15 px-4 py-4",children:xe.length===0?s.jsx("div",{className:"text-sm text-muted-foreground",children:"No report selected."}):tr?s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(sr,{className:"h-4 w-4 animate-spin"}),"Loading report..."]}):Ca?s.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive",children:["Could not load report: ",Ca]}):mn?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:mn.name}),s.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:mn.relativePath}),s.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:new Date(mn.mtime).toLocaleString()})]}),s.jsx("div",{className:"rounded-md border bg-background p-3",children:s.jsx(Zu,{text:mn.content,className:"text-sm"})})]}):s.jsx("div",{className:"text-sm text-muted-foreground",children:"Select a report to preview."})})]})]})]}),s.jsx(bs,{open:De,onOpenChange:H=>!we&&Ae(H),children:s.jsxs(Wa,{className:"max-w-2xl",children:[s.jsxs(Va,{children:[s.jsx(Ka,{children:Ve?"Create markdown report":"Approve MCP action: write markdown report"}),s.jsx(Ga,{children:Ve?"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:[!Ve&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Output path"}),s.jsx(mt,{value:Ee,onChange:H=>le(H.target.value),placeholder:"mcplab/reports/result-assistant/my-report.md",disabled:we})]}),s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx(va,{checked:_e,onCheckedChange:H=>pe(H===!0),disabled:we}),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:Ve?"Markdown content":"Markdown preview (to be written)"}),s.jsx(Gs,{value:We,onChange:H=>ye(H.target.value),rows:10,className:"font-mono text-xs",disabled:we})]})]}),s.jsxs(Ha,{children:[s.jsx(Xa,{disabled:we,children:"Cancel"}),s.jsx(Ya,{onClick:H=>{H.preventDefault(),Dn()},disabled:we,children:we?"Writing...":Ve?"Save Report":"Approve & Write"})]})]})})]})]})};function dge({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(Ol,{className:"h-3.5 w-3.5 text-emerald-700 dark:text-emerald-300"}):s.jsx(Qp,{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=bM(e.text,e.kind),a=t?bM(t,"user_prompt"):"",i=n&&!r&&a?a:r,o=n?"User prompt":e.kind==="assistant_final"?"Agent final":"Agent",c=n?NS:ha;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(mS,{text:i,maxLength:280,className:"text-xs"}):s.jsx(mS,{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 bM(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 fge(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(Ci,{open:a,onOpenChange:i,children:s.jsxs("div",{className:`rounded-md border p-2 text-xs ${o[e]}`,children:[s.jsx(Rs,{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(Is,{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 mS({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(Zu,{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=hge(n,t);return{rule:n,status:r?"failed":"passed",failureReason:r}})}function hge(e,t){const n=e.type==="required_tool"?`Required tool not used: ${e.value}`:e.type==="forbidden_tool"?`Forbidden tool used: ${e.value}`:`Regex assertion failed: ${e.value}`,r=t.find(a=>a===n);if(r)return r;if(e.type==="response_contains"||e.type==="response_not_contains")return t.find(a=>a.startsWith("Regex assertion failed:")&&a.includes(e.value))}function mge(e){return e.type==="required_tool"?`Required tool · ${e.value}`:e.type==="forbidden_tool"?`Forbidden tool · ${e.value}`:e.type==="response_contains"?`Text must match pattern · ${e.value}`:e.type==="response_not_contains"?`Text must not match pattern · ${e.value}`:`${e.type} · ${e.value}`}function jM(e){const t=String(e??"").trim(),n=t.match(/^Regex assertion failed:\s*(.+)$/i);return n?`Text match failed: ${n[1]}`:t}const SM=["hsl(38, 92%, 50%)","hsl(200, 80%, 50%)","hsl(152, 69%, 40%)","hsl(280, 60%, 50%)","hsl(0, 72%, 51%)"],vge=()=>{const{source:e}=Pn(),t=vf("snapshots",!1),[n,r]=v.useState([]),[a,i]=v.useState(!1),[o,c]=v.useState(new Set),[d,f]=v.useState("timestamp"),[h,p]=v.useState("desc"),[y,g]=v.useState("all"),[j,b]=v.useState("runs"),[x,S]=v.useState([]),[N,_]=v.useState(""),[P,A]=v.useState(""),[O,k]=v.useState(null),R=async()=>{i(!0);try{r(await e.listResults())}catch(T){Oe({title:"Could not load results",description:T instanceof Error?T.message:String(T),variant:"destructive"})}finally{i(!1)}};v.useEffect(()=>{let T=!0;return i(!0),e.listResults().then(L=>{T&&r(L)}).catch(L=>{T&&Oe({title:"Could not load results",description:L instanceof Error?L.message:String(L),variant:"destructive"})}).finally(()=>{T&&i(!1)}),()=>{T=!1}},[e]),v.useEffect(()=>{let T=!0;return e.listSnapshots().then(L=>{T&&S(L)}).catch(()=>{T&&S([])}),()=>{T=!1}},[e]);const M=T=>{if(d===T){p(L=>L==="asc"?"desc":"asc");return}f(T),p(T==="timestamp"?"desc":"asc")},z=T=>{c(L=>{const Q=new Set(L);return Q.has(T)?Q.delete(T):Q.add(T),Q})},B=v.useMemo(()=>{const T=new Set;return n.forEach(L=>{L.scenarios.forEach(Q=>{const F=String(Q.scenarioName??"").trim(),$=String(Q.scenarioId??"").trim(),Z=F||$;Z&&T.add(Z)})}),Array.from(T).sort((L,Q)=>L.localeCompare(Q))},[n]),D=v.useMemo(()=>y==="all"?n:n.filter(T=>T.scenarios.some(L=>{const Q=String(L.scenarioName??"").trim(),F=String(L.scenarioId??"").trim();return(Q||F)===y})),[n,y]),G=v.useMemo(()=>[...D].sort((L,Q)=>{let F=0;return d==="id"&&(F=L.id.localeCompare(Q.id)),d==="timestamp"&&(F=new Date(L.timestamp).getTime()-new Date(Q.timestamp).getTime()),d==="passRate"&&(F=L.overallPassRate-Q.overallPassRate),d==="scenarios"&&(F=L.totalScenarios-Q.totalScenarios),h==="asc"?F:-F}),[D,d,h]),U=G.filter(T=>o.has(T.id)),W=T=>d!==T?s.jsx(Pl,{className:"h-3.5 w-3.5 text-muted-foreground"}):h==="asc"?s.jsx(is,{className:"h-3.5 w-3.5"}):s.jsx(Wt,{className:"h-3.5 w-3.5"}),X=T=>{const L=Array.from(new Set(T.scenarios.map(Z=>Z.scenarioId).filter(Boolean))),Q=Array.from(new Set(T.scenarios.map(Z=>Z.agentName).filter(Boolean))),F=L.slice(0,2).join(", "),$=L.length>2?` +${L.length-2}`:"";return{scenarioCount:L.length,agentCount:Q.length,scenarioPreview:F?`${F}${$}`:"n/a"}},J=[...new Set(U.flatMap(T=>T.scenarios.map(L=>L.scenarioId)))];return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(wS,{className:"h-6 w-6"}),"Compare Runs"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Select 2–5 runs to compare"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[j==="runs"&&s.jsxs(sn,{value:y,onValueChange:g,children:[s.jsx(Qt,{className:"w-[260px]",children:s.jsx(on,{placeholder:"Filter by scenario"})}),s.jsxs(Jt,{children:[s.jsx(st,{value:"all",children:"All scenarios"}),B.map(T=>s.jsx(st,{value:T,children:T},T))]})]}),s.jsx(se,{variant:"outline",onClick:()=>{R()},disabled:a,children:a?"Refreshing...":"Refresh"})]})]}),j==="runs"&&s.jsx(Ue,{children:s.jsx(qe,{className:"p-0",children:s.jsxs(Xr,{children:[s.jsx(Qr,{children:s.jsxs(Ut,{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:()=>M("id"),children:["Run ID",W("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:()=>M("timestamp"),children:["Timestamp",W("timestamp")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>M("passRate"),children:["Pass Rate",W("passRate")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>M("scenarios"),children:["Scenarios",W("scenarios")]})})]})}),s.jsx(Jr,{children:G.map(T=>s.jsxs(Ut,{children:[s.jsx(Ke,{children:s.jsx(va,{checked:o.has(T.id),onCheckedChange:()=>z(T.id),disabled:!o.has(T.id)&&o.size>=5})}),s.jsx(Ke,{className:"font-mono text-xs",children:T.id}),s.jsx(Ke,{className:"text-[11px] text-muted-foreground",children:(()=>{const L=X(T);return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Evaluated: ",L.scenarioCount," scenario",L.scenarioCount===1?"":"s"," · ",L.agentCount," agent",L.agentCount===1?"":"s"]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:L.scenarioPreview})]})})()}),s.jsx(Ke,{className:"text-xs text-muted-foreground",children:new Date(T.timestamp).toLocaleString()}),s.jsx(Ke,{children:s.jsx(vo,{rate:T.overallPassRate})}),s.jsx(Ke,{className:"font-mono text-sm",children:T.totalScenarios})]},T.id))})]})})}),j==="runs"&&U.length>=2&&s.jsxs(s.Fragment,{children:[U.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(se,{asChild:!0,size:"sm",children:s.jsx(yt,{to:`/compare/results?left=${encodeURIComponent(U[0].id)}&right=${encodeURIComponent(U[1].id)}&leftConfig=${encodeURIComponent(U[0].configId)}&rightConfig=${encodeURIComponent(U[1].configId)}`,children:"Compare full results"})})]})})}),s.jsxs(Ue,{children:[s.jsx(Nt,{className:"pb-3",children:s.jsx(Ct,{className:"text-base",children:"Summary Comparison"})}),s.jsx(qe,{className:"p-0",children:s.jsxs(Xr,{children:[s.jsx(Qr,{children:s.jsxs(Ut,{children:[s.jsx(tt,{children:"Metric"}),U.map((T,L)=>s.jsx(tt,{style:{color:SM[L]},className:"font-mono text-xs",children:T.id},T.id))]})}),s.jsxs(Jr,{children:[s.jsxs(Ut,{children:[s.jsx(Ke,{className:"font-medium",children:"Pass Rate"}),U.map(T=>s.jsx(Ke,{children:s.jsx(vo,{rate:T.overallPassRate})},T.id))]}),s.jsxs(Ut,{children:[s.jsx(Ke,{className:"font-medium",children:"Total Runs"}),U.map(T=>s.jsx(Ke,{className:"font-mono",children:T.totalRuns},T.id))]}),s.jsxs(Ut,{children:[s.jsx(Ke,{className:"font-medium",children:"Tool Calls"}),U.map(T=>s.jsx(Ke,{className:"font-mono",children:T.avgToolCalls.toFixed(1)},T.id))]}),s.jsxs(Ut,{children:[s.jsx(Ke,{className:"font-medium",children:"Avg Latency"}),U.map(T=>s.jsxs(Ke,{className:"font-mono",children:[T.avgLatency,"ms"]},T.id))]})]})]})})]}),s.jsxs(Ue,{children:[s.jsx(Nt,{className:"pb-3",children:s.jsx(Ct,{className:"text-base",children:"Scenario Breakdown"})}),s.jsx(qe,{className:"p-0",children:s.jsxs(Xr,{children:[s.jsx(Qr,{children:s.jsxs(Ut,{children:[s.jsx(tt,{children:"Scenario"}),U.map((T,L)=>s.jsx(tt,{style:{color:SM[L]},className:"font-mono text-xs",children:T.id},T.id))]})}),s.jsx(Jr,{children:J.map(T=>s.jsxs(Ut,{children:[s.jsx(Ke,{className:"font-medium text-sm",children:T}),U.map(L=>{const Q=L.scenarios.find(F=>F.scenarioId===T);return s.jsx(Ke,{children:Q?s.jsx(vo,{rate:Q.passRate}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},L.id)})]},T))})]})})]})]}),t&&j==="snapshot"&&s.jsxs(Ue,{children:[s.jsx(Nt,{className:"pb-3",children:s.jsx(Ct,{className:"text-base",children:"Run vs Snapshot"})}),s.jsxs(qe,{className:"space-y-3",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Run"}),s.jsxs(sn,{value:P,onValueChange:A,children:[s.jsx(Qt,{children:s.jsx(on,{placeholder:"Select run"})}),s.jsx(Jt,{children:n.map(T=>s.jsx(st,{value:T.id,children:T.id},T.id))})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Snapshot"}),s.jsxs(sn,{value:N,onValueChange:_,children:[s.jsx(Qt,{children:s.jsx(on,{placeholder:"Select snapshot"})}),s.jsx(Jt,{children:x.map(T=>s.jsx(st,{value:T.id,children:T.name},T.id))})]})]})]}),s.jsx(se,{type:"button",variant:"outline",size:"sm",disabled:!P||!N,onClick:()=>{e.compareSnapshot(N,P).then(k)},children:"Compare"}),O&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("p",{className:"text-sm font-medium",children:["Overall score: ",O.overall_score]}),s.jsxs(Xr,{children:[s.jsx(Qr,{children:s.jsxs(Ut,{children:[s.jsx(tt,{children:"Scenario"}),s.jsx(tt,{children:"Agents"}),s.jsx(tt,{children:"Score"}),s.jsx(tt,{children:"Status"}),s.jsx(tt,{children:"Reasons"})]})}),s.jsx(Jr,{children:O.scenario_results.map(T=>s.jsxs(Ut,{children:[s.jsx(Ke,{children:T.scenario_id}),s.jsxs(Ke,{className:"text-xs text-muted-foreground",children:["baseline: ",T.baseline_agents.join(", ")||"—"," · observed: ",T.observed_agents.join(", ")||"—"]}),s.jsx(Ke,{className:"font-mono text-xs",children:T.score}),s.jsx(Ke,{children:T.status}),s.jsx(Ke,{className:"text-xs text-muted-foreground",children:T.reasons.slice(0,2).join("; ")||"—"})]},T.scenario_id))})]})]})]})]})]})},NM=(e,t)=>{const n=new URLSearchParams;return t&&n.set("configId",t),n.set("embed","1"),`/results/${encodeURIComponent(e)}?${n.toString()}`},gge=()=>{const[e]=Ec(),t=e.get("left")??"",n=e.get("right")??"",r=e.get("leftConfig"),a=e.get("rightConfig");return!t||!n?s.jsxs(Ue,{children:[s.jsx(Nt,{children:s.jsx(Ct,{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(se,{asChild:!0,variant:"outline",children:s.jsx(yt,{to:"/compare",children:"Back to Compare"})})]})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Full Result Compare"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Side-by-side Result Detail views for deep inspection."})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(se,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs(yt,{to:"/compare",children:[s.jsx(AU,{className:"mr-1.5 h-4 w-4"}),"Back to Compare"]})}),s.jsx(se,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:`/results/${encodeURIComponent(t)}${r?`?configId=${encodeURIComponent(r)}`:""}`,target:"_blank",rel:"noreferrer",children:["Open Left",s.jsx(ah,{className:"ml-1.5 h-3.5 w-3.5"})]})}),s.jsx(se,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:`/results/${encodeURIComponent(n)}${a?`?configId=${encodeURIComponent(a)}`:""}`,target:"_blank",rel:"noreferrer",children:["Open Right",s.jsx(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(Nt,{className:"py-3",children:s.jsx(Ct,{className:"text-sm font-mono",children:t})}),s.jsx(qe,{className:"p-0",children:s.jsx("iframe",{title:`Result ${t}`,src:NM(t,r),className:"h-[calc(100vh-15rem)] w-full border-0"})})]}),s.jsxs(Ue,{className:"overflow-hidden",children:[s.jsx(Nt,{className:"py-3",children:s.jsx(Ct,{className:"text-sm font-mono",children:n})}),s.jsx(qe,{className:"p-0",children:s.jsx("iframe",{title:`Result ${n}`,src:NM(n,a),className:"h-[calc(100vh-15rem)] w-full border-0"})})]})]})]})};function yge(e){return e.match(/(?:^|\/)(?:result-assistant|results?)\/([0-9]{8}-[0-9]{6})(?:-|\/)/i)?.[1]??null}function xge(){const{source:e}=Pn(),[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]),y=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(sh,{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(se,{variant:"outline",onClick:()=>{f()},children:"Refresh"}),h?s.jsx(se,{asChild:!0,variant:"outline",children:s.jsx(yt,{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(Xr,{children:[s.jsx(Qr,{children:s.jsxs(Ut,{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(Jr,{children:t.map(g=>s.jsxs(Ut,{children:[s.jsx(Ke,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(yt,{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(Ke,{className:"text-xs text-muted-foreground font-mono",children:(()=>{const j=yge(g.relativePath);return j?s.jsx(yt,{to:`/results/${encodeURIComponent(j)}`,className:"text-primary hover:underline",children:j}):s.jsx("span",{className:"text-muted-foreground",children:"—"})})()}),s.jsx(Ke,{className:"text-xs text-muted-foreground font-mono",children:g.relativePath.includes("/")?g.relativePath.slice(0,g.relativePath.lastIndexOf("/")):"."}),s.jsx(Ke,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Gd,{className:"h-3 w-3"}),new Date(g.mtime).toLocaleString()]})}),s.jsx(Ke,{children:s.jsxs(Fc,{children:[s.jsx(Bc,{asChild:!0,children:s.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(_m,{className:"h-4 w-4"})})}),s.jsxs(Wo,{align:"end",children:[s.jsx(pr,{asChild:!0,children:s.jsx(yt,{to:`/markdown-reports/view?path=${encodeURIComponent(g.relativePath)}`,children:"View"})}),s.jsxs(pr,{className:"text-destructive",onSelect:j=>{j.preventDefault(),o(g.relativePath)},children:[s.jsx(ba,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},g.path))})]})})}),s.jsx(bs,{open:!!i,onOpenChange:g=>!g&&o(null),children:s.jsxs(Wa,{children:[s.jsxs(Va,{children:[s.jsx(Ka,{children:"Delete markdown report?"}),s.jsx(Ga,{children:p?`Delete '${p.name}' from disk? This cannot be undone.`:"Delete this report from disk? This cannot be undone."})]}),s.jsxs(Ha,{children:[s.jsx(Xa,{disabled:c,children:"Cancel"}),s.jsx(Ya,{onClick:g=>{g.preventDefault(),y()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}function bge(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function wge(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 jge(){const{source:e}=Pn(),[t]=Ec(),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 y=!0;if(a(null),d(!1),!n){o(!1);return}return o(!0),e.getMarkdownReport(n).then(g=>{y&&a(g)}).catch(g=>{if(!y)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(()=>{y&&o(!1)}),()=>{y=!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(se,{asChild:!0,variant:"outline",children:s.jsx(yt,{to:"/markdown-reports",children:"Back to Markdown Reports"})})]});if(i)return s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading markdown report..."});if(c||!r)return s.jsxs("div",{className:"space-y-4",children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Markdown Report"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Report not found."}),s.jsx(se,{asChild:!0,variant:"outline",children:s.jsx(yt,{to:"/markdown-reports",children:"Back to Markdown Reports"})})]});const p=wge(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()," "," · "," ",bge(r.sizeBytes)]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[p?s.jsxs(s.Fragment,{children:[s.jsx(se,{variant:"outline",size:"sm",onClick:()=>h(!0),children:"Open Result Panel"}),s.jsx(se,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(yt,{to:`/results/${encodeURIComponent(p)}`,children:"Open Result"})})]}):null,s.jsx(se,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(yt,{to:"/markdown-reports",children:"Back to reports"})})]})]}),s.jsx(Ue,{children:s.jsx(qe,{className:"pt-6",children:s.jsx(Zu,{text:r.content,variant:"assistant"})})}),p?s.jsx(VD,{open:f,onOpenChange:h,children:s.jsxs(VS,{side:"right",className:"w-[96vw] max-w-none p-0 sm:max-w-5xl",children:[s.jsx(KD,{className:"border-b px-4 py-3 pr-12",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(GD,{className:"text-base",children:["Result ",p]}),s.jsx(se,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(yt,{to:`/results/${encodeURIComponent(p)}`,target:"_blank",rel:"noreferrer",children:"Open full page"})})]})}),s.jsx("div",{className:"h-[calc(100vh-64px)]",children:s.jsx("iframe",{title:`Result ${p}`,src:`/results/${encodeURIComponent(p)}?embed=1`,className:"h-full w-full border-0"})})]})}):null]})}const Sge=()=>{const e=vs();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"})]})})},Nge=new dV;function Cge(){const{scenarioId:e}=Mo();return s.jsx(pD,{to:e?`/libraries/test-cases/${encodeURIComponent(e)}`:"/libraries/test-cases",replace:!0})}const _ge=()=>s.jsx(pV,{client:Nge,children:s.jsx(Y$,{children:s.jsx(SG,{children:s.jsx(AG,{children:s.jsxs(_G,{children:[s.jsx(yq,{}),s.jsx(Xq,{}),s.jsx(hH,{children:s.jsxs(sH,{children:[s.jsxs(Yt,{element:s.jsx(CG,{}),children:[s.jsx(Yt,{path:"/",element:s.jsx(efe,{})}),s.jsx(Yt,{path:"/mcp-evaluations",element:s.jsx(kpe,{})}),s.jsx(Yt,{path:"/mcp-evaluations/:id",element:s.jsx(eM,{})}),s.jsx(Yt,{path:"/mcp-evaluations/:id/:tab",element:s.jsx(eM,{})}),s.jsx(Yt,{path:"/tool-analysis",element:s.jsx(Yve,{})}),s.jsx(Yt,{path:"/tool-analysis-results",element:s.jsx(Xve,{})}),s.jsx(Yt,{path:"/tool-analysis-results/:id",element:s.jsx(Qve,{})}),s.jsx(Yt,{path:"/oauth-debugger",element:s.jsx(nge,{})}),s.jsx(Yt,{path:"/libraries/servers",element:s.jsx(mme,{})}),s.jsx(Yt,{path:"/libraries/servers/:serverId",element:s.jsx(gme,{})}),s.jsx(Yt,{path:"/libraries/agents",element:s.jsx(yme,{})}),s.jsx(Yt,{path:"/libraries/agents/:agentName",element:s.jsx(Ove,{})}),s.jsx(Yt,{path:"/libraries/test-cases",element:s.jsx(lM,{})}),s.jsx(Yt,{path:"/libraries/test-cases/:testCaseId",element:s.jsx(lM,{})}),s.jsx(Yt,{path:"/libraries/scenarios",element:s.jsx(pD,{to:"/libraries/test-cases",replace:!0})}),s.jsx(Yt,{path:"/libraries/scenarios/:scenarioId",element:s.jsx(Cge,{})}),s.jsx(Yt,{path:"/settings",element:s.jsx(kve,{})}),s.jsx(Yt,{path:"/run",element:s.jsx(rge,{})}),s.jsx(Yt,{path:"/results",element:s.jsx(age,{})}),s.jsx(Yt,{path:"/results/:id",element:s.jsx(uge,{})}),s.jsx(Yt,{path:"/markdown-reports",element:s.jsx(xge,{})}),s.jsx(Yt,{path:"/markdown-reports/view",element:s.jsx(jge,{})}),s.jsx(Yt,{path:"/compare",element:s.jsx(vge,{})}),s.jsx(Yt,{path:"/compare/results",element:s.jsx(gge,{})})]}),s.jsx(Yt,{path:"*",element:s.jsx(Sge,{})})]})})]})})})})});j7.createRoot(document.getElementById("root")).render(s.jsx(_ge,{}));