@inspectr/mcplab 1.2.0 → 1.3.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 mU(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();var Ep=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ht(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fy={exports:{}},Pu={},By={exports:{}},Ot={};var KA;function vU(){if(KA)return Ot;KA=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,$,ee){this.props=F,this.context=$,this.refs=b,this.updater=ee||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,$,ee){this.props=F,this.context=$,this.refs=b,this.updater=ee||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,$,ee){var ae,K={},le=null,ie=null;if($!=null)for(ae in $.ref!==void 0&&(ie=$.ref),$.key!==void 0&&(le=""+$.key),$)A.call($,ae)&&!k.hasOwnProperty(ae)&&(K[ae]=$[ae]);var fe=arguments.length-2;if(fe===1)K.children=ee;else if(1<fe){for(var oe=Array(fe),ce=0;ce<fe;ce++)oe[ce]=arguments[ce+2];K.children=oe}if(F&&F.defaultProps)for(ae in fe=F.defaultProps,fe)K[ae]===void 0&&(K[ae]=fe[ae]);return{$$typeof:e,type:F,key:le,ref:ie,props:K,_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(ee){return $[ee]})}var L=/\/+/g;function G(F,$){return typeof F=="object"&&F!==null&&F.key!=null?B(""+F.key):$.toString(36)}function U(F,$,ee,ae,K){var le=typeof F;(le==="undefined"||le==="boolean")&&(F=null);var ie=!1;if(F===null)ie=!0;else switch(le){case"string":case"number":ie=!0;break;case"object":switch(F.$$typeof){case e:case t:ie=!0}}if(ie)return ie=F,K=K(ie),F=ae===""?"."+G(ie,0):ae,P(K)?(ee="",F!=null&&(ee=F.replace(L,"$&/")+"/"),U(K,$,ee,"",function(ce){return ce})):K!=null&&(z(K)&&(K=M(K,ee+(!K.key||ie&&ie.key===K.key?"":(""+K.key).replace(L,"$&/")+"/")+F)),$.push(K)),1;if(ie=0,ae=ae===""?".":ae+":",P(F))for(var fe=0;fe<F.length;fe++){le=F[fe];var oe=ae+G(le,fe);ie+=U(le,$,ee,oe,K)}else if(oe=y(F),typeof oe=="function")for(F=oe.call(F),fe=0;!(le=F.next()).done;)le=le.value,oe=ae+G(le,fe++),ie+=U(le,$,ee,oe,K);else if(le==="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 ie}function H(F,$,ee){if(F==null)return F;var ae=[],K=0;return U(F,ae,"","",function(le){return $.call(ee,le,K++)}),ae}function Q(F){if(F._status===-1){var $=F._result;$=$(),$.then(function(ee){(F._status===0||F._status===-1)&&(F._status=1,F._result=ee)},function(ee){(F._status===0||F._status===-1)&&(F._status=2,F._result=ee)}),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},D={ReactCurrentDispatcher:J,ReactCurrentBatchConfig:T,ReactCurrentOwner:O};function X(){throw Error("act(...) is not supported in production builds of React.")}return Ot.Children={map:H,forEach:function(F,$,ee){H(F,function(){$.apply(this,arguments)},ee)},count:function(F){var $=0;return H(F,function(){$++}),$},toArray:function(F){return H(F,function($){return $})||[]},only:function(F){if(!z(F))throw Error("React.Children.only expected to receive a single React element child.");return F}},Ot.Component=x,Ot.Fragment=n,Ot.Profiler=a,Ot.PureComponent=N,Ot.StrictMode=r,Ot.Suspense=d,Ot.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=D,Ot.act=X,Ot.cloneElement=function(F,$,ee){if(F==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+F+".");var ae=j({},F.props),K=F.key,le=F.ref,ie=F._owner;if($!=null){if($.ref!==void 0&&(le=$.ref,ie=O.current),$.key!==void 0&&(K=""+$.key),F.type&&F.type.defaultProps)var fe=F.type.defaultProps;for(oe in $)A.call($,oe)&&!k.hasOwnProperty(oe)&&(ae[oe]=$[oe]===void 0&&fe!==void 0?fe[oe]:$[oe])}var oe=arguments.length-2;if(oe===1)ae.children=ee;else if(1<oe){fe=Array(oe);for(var ce=0;ce<oe;ce++)fe[ce]=arguments[ce+2];ae.children=fe}return{$$typeof:e,type:F.type,key:K,ref:le,props:ae,_owner:ie}},Ot.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},Ot.createElement=R,Ot.createFactory=function(F){var $=R.bind(null,F);return $.type=F,$},Ot.createRef=function(){return{current:null}},Ot.forwardRef=function(F){return{$$typeof:c,render:F}},Ot.isValidElement=z,Ot.lazy=function(F){return{$$typeof:h,_payload:{_status:-1,_result:F},_init:Q}},Ot.memo=function(F,$){return{$$typeof:f,type:F,compare:$===void 0?null:$}},Ot.startTransition=function(F){var $=T.transition;T.transition={};try{F()}finally{T.transition=$}},Ot.unstable_act=X,Ot.useCallback=function(F,$){return J.current.useCallback(F,$)},Ot.useContext=function(F){return J.current.useContext(F)},Ot.useDebugValue=function(){},Ot.useDeferredValue=function(F){return J.current.useDeferredValue(F)},Ot.useEffect=function(F,$){return J.current.useEffect(F,$)},Ot.useId=function(){return J.current.useId()},Ot.useImperativeHandle=function(F,$,ee){return J.current.useImperativeHandle(F,$,ee)},Ot.useInsertionEffect=function(F,$){return J.current.useInsertionEffect(F,$)},Ot.useLayoutEffect=function(F,$){return J.current.useLayoutEffect(F,$)},Ot.useMemo=function(F,$){return J.current.useMemo(F,$)},Ot.useReducer=function(F,$,ee){return J.current.useReducer(F,$,ee)},Ot.useRef=function(F){return J.current.useRef(F)},Ot.useState=function(F){return J.current.useState(F)},Ot.useSyncExternalStore=function(F,$,ee){return J.current.useSyncExternalStore(F,$,ee)},Ot.useTransition=function(){return J.current.useTransition()},Ot.version="18.3.1",Ot}var GA;function SS(){return GA||(GA=1,By.exports=vU()),By.exports}var YA;function gU(){if(YA)return Pu;YA=1;var e=SS(),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 Pu.Fragment=n,Pu.jsx=o,Pu.jsxs=o,Pu}var XA;function yU(){return XA||(XA=1,Fy.exports=gU()),Fy.exports}var s=yU(),Pp={},zy={exports:{}},Ir={},Uy={exports:{}},qy={};var QA;function xU(){return QA||(QA=1,(function(e){function t(T,D){var X=T.length;T.push(D);e:for(;0<X;){var F=X-1>>>1,$=T[F];if(0<a($,D))T[F]=D,T[X]=$,X=F;else break e}}function n(T){return T.length===0?null:T[0]}function r(T){if(T.length===0)return null;var D=T[0],X=T.pop();if(X!==D){T[0]=X;e:for(var F=0,$=T.length,ee=$>>>1;F<ee;){var ae=2*(F+1)-1,K=T[ae],le=ae+1,ie=T[le];if(0>a(K,X))le<$&&0>a(ie,K)?(T[F]=ie,T[le]=X,F=le):(T[F]=K,T[ae]=X,F=ae);else if(le<$&&0>a(ie,X))T[F]=ie,T[le]=X,F=le;else break e}}return D}function a(T,D){var X=T.sortIndex-D.sortIndex;return X!==0?X:T.id-D.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 D=n(f);D!==null;){if(D.callback===null)r(f);else if(D.startTime<=T)r(f),D.sortIndex=D.expirationTime,t(d,D);else break;D=n(f)}}function P(T){if(b=!1,_(T),!j)if(n(d)!==null)j=!0,Q(A);else{var D=n(f);D!==null&&J(P,D.startTime-T)}}function A(T,D){j=!1,b&&(b=!1,S(R),R=-1),g=!0;var X=y;try{for(_(D),p=n(d);p!==null&&(!(p.expirationTime>D)||T&&!B());){var F=p.callback;if(typeof F=="function"){p.callback=null,y=p.priorityLevel;var $=F(p.expirationTime<=D);D=e.unstable_now(),typeof $=="function"?p.callback=$:p===n(d)&&r(d),_(D)}else r(d);p=n(d)}if(p!==null)var ee=!0;else{var ae=n(f);ae!==null&&J(P,ae.startTime-D),ee=!1}return ee}finally{p=null,y=X,g=!1}}var O=!1,k=null,R=-1,M=5,z=-1;function B(){return!(e.unstable_now()-z<M)}function L(){if(k!==null){var T=e.unstable_now();z=T;var D=!0;try{D=k(!0,T)}finally{D?G():(O=!1,k=null)}}else O=!1}var G;if(typeof N=="function")G=function(){N(L)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,H=U.port2;U.port1.onmessage=L,G=function(){H.postMessage(null)}}else G=function(){x(L,0)};function Q(T){k=T,O||(O=!0,G())}function J(T,D){R=x(function(){T(e.unstable_now())},D)}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,Q(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 D=3;break;default:D=y}var X=y;y=D;try{return T()}finally{y=X}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(T,D){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var X=y;y=T;try{return D()}finally{y=X}},e.unstable_scheduleCallback=function(T,D,X){var F=e.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?F+X:F):X=F,T){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=X+$,T={id:h++,callback:D,priorityLevel:T,startTime:X,expirationTime:$,sortIndex:-1},X>F?(T.sortIndex=X,t(f,T),n(d)===null&&T===n(f)&&(b?(S(R),R=-1):b=!0,J(P,X-F))):(T.sortIndex=$,t(d,T),j||g||(j=!0,Q(A))),T},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(T){var D=y;return function(){var X=y;y=D;try{return T.apply(this,arguments)}finally{y=X}}}})(qy)),qy}var JA;function bU(){return JA||(JA=1,Uy.exports=xU()),Uy.exports}var ZA;function wU(){if(ZA)return Ir;ZA=1;var e=SS(),t=bU();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"),L=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),J=Symbol.for("react.offscreen"),T=Symbol.iterator;function D(l){return l===null||typeof l!="object"?null:(l=T&&l[T]||l["@@iterator"],typeof l=="function"?l:null)}var X=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 ee=!1;function ae(l,u){if(!l||ee)return"";ee=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(u)if(u=function(){throw Error()},Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(me){var 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 te=`
|
|
5
|
-
`+C[I].replace(" at new "," at ");return l.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",l.displayName)),te}while(1<=I&&0<=Y);break}}}finally{ee=!1,Error.prepareStackTrace=m}return(l=l?l.displayName||l.name:"")?$(l):""}function K(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 le(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 L:var u=l.render;return l=l.displayName,l||(l=u.displayName||u.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case H:return u=l.displayName||null,u!==null?u:le(l.type)||"Memo";case Q:u=l._payload,l=l._init;try{return le(l(u))}catch{}}return null}function ie(l){var u=l.type;switch(l.tag){case 24:return"Cache";case 9:return(u.displayName||"Context")+".Consumer";case 10:return(u._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=u.render,l=l.displayName||l.name||"",u.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return u;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return le(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 fe(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 ce(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 Se(l){l._valueTracker||(l._valueTracker=ce(l))}function ne(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 Te(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}function Ae(l,u){var m=u.checked;return X({},u,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:m??l._wrapperState.initialChecked})}function Ye(l,u){var m=u.defaultValue==null?"":u.defaultValue,w=u.checked!=null?u.checked:u.defaultChecked;m=fe(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 ge(l,u){u=u.checked,u!=null&&_(l,"checked",u,!1)}function Oe(l,u){ge(l,u);var m=fe(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")?dt(l,u.type,m):u.hasOwnProperty("defaultValue")&&dt(l,u.type,fe(u.defaultValue)),u.checked==null&&u.defaultChecked!=null&&(l.defaultChecked=!!u.defaultChecked)}function Be(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 dt(l,u,m){(u!=="number"||Te(l.ownerDocument)!==l)&&(m==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+m&&(l.defaultValue=""+m))}var be=Array.isArray;function Je(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=""+fe(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 lt(l,u){if(u.dangerouslySetInnerHTML!=null)throw Error(n(91));return X({},u,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function Rt(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(be(m)){if(1<m.length)throw Error(n(93));m=m[0]}u=m}u==null&&(u=""),m=u}l._wrapperState={initialValue:fe(m)}}function qt(l,u){var m=fe(u.value),w=fe(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 Z(l){var u=l.textContent;u===l._wrapperState.initialValue&&u!==""&&u!==null&&(l.value=u)}function je(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 we(l,u){return l==null||l==="http://www.w3.org/1999/xhtml"?je(u):l==="http://www.w3.org/2000/svg"&&u==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var ke,Le=(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(ke=ke||document.createElement("div"),ke.innerHTML="<svg>"+u.valueOf().toString()+"</svg>",u=ke.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;u.firstChild;)l.appendChild(u.firstChild)}});function Xe(l,u){if(u){var m=l.firstChild;if(m&&m===l.lastChild&&m.nodeType===3){m.nodeValue=u;return}}l.textContent=u}var At={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},jn=["Webkit","ms","Moz","O"];Object.keys(At).forEach(function(l){jn.forEach(function(u){u=u+l.charAt(0).toUpperCase()+l.substring(1),At[u]=At[l]})});function Sn(l,u,m){return u==null||typeof u=="boolean"||u===""?"":m||typeof u!="number"||u===0||At.hasOwnProperty(l)&&At[l]?(""+u).trim():u+"px"}function lr(l,u){l=l.style;for(var m in u)if(u.hasOwnProperty(m)){var w=m.indexOf("--")===0,C=Sn(m,u[m],w);m==="float"&&(m="cssFloat"),w?l.setProperty(m,C):l[m]=C}}var cr=X({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 Ln(l,u){if(u){if(cr[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 ur(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 Ar=null;function Fr(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var Br=null,Yn=null,Kt=null;function On(l){if(l=hu(l)){if(typeof Br!="function")throw Error(n(280));var u=l.stateNode;u&&(u=qf(u),Br(l.stateNode,l.type,u))}}function ue(l){Yn?Kt?Kt.push(l):Kt=[l]:Yn=l}function Re(){if(Yn){var l=Yn,u=Kt;if(Kt=Yn=null,On(l),u)for(l=0;l<u.length;l++)On(u[l])}}function nt(l,u){return l(u)}function xt(){}var Ft=!1;function Yt(l,u,m){if(Ft)return l(u,m);Ft=!0;try{return nt(l,u,m)}finally{Ft=!1,(Yn!==null||Kt!==null)&&(xt(),Re())}}function Nn(l,u){var m=l.stateNode;if(m===null)return null;var w=qf(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 dr=!1;if(c)try{var vn={};Object.defineProperty(vn,"passive",{get:function(){dr=!0}}),window.addEventListener("test",vn,vn),window.removeEventListener("test",vn,vn)}catch{dr=!1}function Xn(l,u,m,w,C,E,I,Y,te){var me=Array.prototype.slice.call(arguments,3);try{u.apply(m,me)}catch(Ce){this.onError(Ce)}}var Er=!1,yr=null,ri=!1,ai=null,kn={onError:function(l){Er=!0,yr=l}};function W(l,u,m,w,C,E,I,Y,te){Er=!1,yr=null,Xn.apply(kn,arguments)}function he(l,u,m,w,C,E,I,Y,te){if(W.apply(this,arguments),Er){if(Er){var me=yr;Er=!1,yr=null}else throw Error(n(198));ri||(ri=!0,ai=me)}}function De(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 kt(l){if(De(l)!==l)throw Error(n(188))}function Pt(l){var u=l.alternate;if(!u){if(u=De(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 kt(C),l;if(E===w)return kt(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 gn(l){return l=Pt(l),l!==null?Cn(l):null}function Cn(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var u=Cn(l);if(u!==null)return u;l=l.sibling}return null}var We=t.unstable_scheduleCallback,_n=t.unstable_cancelCallback,Tt=t.unstable_shouldYield,An=t.unstable_requestPaint,nn=t.unstable_now,sg=t.unstable_getCurrentPriorityLevel,Yc=t.unstable_ImmediatePriority,Cf=t.unstable_UserBlockingPriority,Yi=t.unstable_NormalPriority,ig=t.unstable_LowPriority,_f=t.unstable_IdlePriority,Go=null,ia=null;function V(l){if(ia&&typeof ia.onCommitFiberRoot=="function")try{ia.onCommitFiberRoot(Go,l,void 0,(l.current.flags&128)===128)}catch{}}var ve=Math.clz32?Math.clz32:Mt,st=Math.log,Me=Math.LN2;function Mt(l){return l>>>=0,l===0?32:31-(st(l)/Me|0)|0}var Et=64,yn=4194304;function zr(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 Xt(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=zr(Y):(E&=I,E!==0&&(w=zr(E)))}else I=m&~C,I!==0?w=zr(I):E!==0&&(w=zr(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-ve(u),C=1<<m,w|=l[m],u&=~C;return w}function ts(l,u){switch(l){case 1:case 2:case 4:return u+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Af(l,u){for(var m=l.suspendedLanes,w=l.pingedLanes,C=l.expirationTimes,E=l.pendingLanes;0<E;){var I=31-ve(E),Y=1<<I,te=C[I];te===-1?((Y&m)===0||(Y&w)!==0)&&(C[I]=ts(Y,u)):te<=u&&(l.expiredLanes|=Y),E&=~Y}}function Xc(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function Yo(){var l=Et;return Et<<=1,(Et&4194240)===0&&(Et=64),l}function og(l){for(var u=[],m=0;31>m;m++)u.push(l);return u}function Qc(l,u,m){l.pendingLanes|=u,u!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,u=31-ve(u),l[u]=m}function $z(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-ve(m),E=1<<C;u[C]=0,w[C]=-1,l[C]=-1,m&=~E}}function lg(l,u){var m=l.entangledLanes|=u;for(l=l.entanglements;m;){var w=31-ve(m),C=1<<w;C&u|l[w]&u&&(l[w]|=u),m&=~C}}var Wt=0;function CC(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var _C,cg,AC,EC,PC,ug=!1,Ef=[],si=null,ii=null,oi=null,Jc=new Map,Zc=new Map,li=[],Dz="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 OC(l,u){switch(l){case"focusin":case"focusout":si=null;break;case"dragenter":case"dragleave":ii=null;break;case"mouseover":case"mouseout":oi=null;break;case"pointerover":case"pointerout":Jc.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zc.delete(u.pointerId)}}function eu(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=hu(u),u!==null&&cg(u)),l):(l.eventSystemFlags|=w,u=l.targetContainers,C!==null&&u.indexOf(C)===-1&&u.push(C),l)}function Lz(l,u,m,w,C){switch(u){case"focusin":return si=eu(si,l,u,m,w,C),!0;case"dragenter":return ii=eu(ii,l,u,m,w,C),!0;case"mouseover":return oi=eu(oi,l,u,m,w,C),!0;case"pointerover":var E=C.pointerId;return Jc.set(E,eu(Jc.get(E)||null,l,u,m,w,C)),!0;case"gotpointercapture":return E=C.pointerId,Zc.set(E,eu(Zc.get(E)||null,l,u,m,w,C)),!0}return!1}function kC(l){var u=Xi(l.target);if(u!==null){var m=De(u);if(m!==null){if(u=m.tag,u===13){if(u=ct(m),u!==null){l.blockedOn=u,PC(l.priority,function(){AC(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 Pf(l){if(l.blockedOn!==null)return!1;for(var u=l.targetContainers;0<u.length;){var m=fg(l.domEventName,l.eventSystemFlags,u[0],l.nativeEvent);if(m===null){m=l.nativeEvent;var w=new m.constructor(m.type,m);Ar=w,m.target.dispatchEvent(w),Ar=null}else return u=hu(m),u!==null&&cg(u),l.blockedOn=m,!1;u.shift()}return!0}function RC(l,u,m){Pf(l)&&m.delete(u)}function Fz(){ug=!1,si!==null&&Pf(si)&&(si=null),ii!==null&&Pf(ii)&&(ii=null),oi!==null&&Pf(oi)&&(oi=null),Jc.forEach(RC),Zc.forEach(RC)}function tu(l,u){l.blockedOn===u&&(l.blockedOn=null,ug||(ug=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Fz)))}function nu(l){function u(C){return tu(C,l)}if(0<Ef.length){tu(Ef[0],l);for(var m=1;m<Ef.length;m++){var w=Ef[m];w.blockedOn===l&&(w.blockedOn=null)}}for(si!==null&&tu(si,l),ii!==null&&tu(ii,l),oi!==null&&tu(oi,l),Jc.forEach(u),Zc.forEach(u),m=0;m<li.length;m++)w=li[m],w.blockedOn===l&&(w.blockedOn=null);for(;0<li.length&&(m=li[0],m.blockedOn===null);)kC(m),m.blockedOn===null&&li.shift()}var Xo=P.ReactCurrentBatchConfig,Of=!0;function Bz(l,u,m,w){var C=Wt,E=Xo.transition;Xo.transition=null;try{Wt=1,dg(l,u,m,w)}finally{Wt=C,Xo.transition=E}}function zz(l,u,m,w){var C=Wt,E=Xo.transition;Xo.transition=null;try{Wt=4,dg(l,u,m,w)}finally{Wt=C,Xo.transition=E}}function dg(l,u,m,w){if(Of){var C=fg(l,u,m,w);if(C===null)Pg(l,u,w,kf,m),OC(l,w);else if(Lz(C,l,u,m,w))w.stopPropagation();else if(OC(l,w),u&4&&-1<Dz.indexOf(l)){for(;C!==null;){var E=hu(C);if(E!==null&&_C(E),E=fg(l,u,m,w),E===null&&Pg(l,u,w,kf,m),E===C)break;C=E}C!==null&&w.stopPropagation()}else Pg(l,u,w,null,m)}}var kf=null;function fg(l,u,m,w){if(kf=null,l=Fr(w),l=Xi(l),l!==null)if(u=De(l),u===null)l=null;else if(m=u.tag,m===13){if(l=ct(u),l!==null)return l;l=null}else if(m===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;l=null}else u!==l&&(l=null);return kf=l,null}function TC(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(sg()){case Yc:return 1;case Cf:return 4;case Yi:case ig:return 16;case _f:return 536870912;default:return 16}default:return 16}}var ci=null,pg=null,Rf=null;function IC(){if(Rf)return Rf;var l,u=pg,m=u.length,w,C="value"in ci?ci.value:ci.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 Rf=C.slice(l,1<w?1-w:void 0)}function Tf(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 If(){return!0}function MC(){return!1}function Ur(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)?If:MC,this.isPropagationStopped=MC,this}return X(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=If)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=If)},persist:function(){},isPersistent:If}),u}var Qo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hg=Ur(Qo),ru=X({},Qo,{view:0,detail:0}),Uz=Ur(ru),mg,vg,au,Mf=X({},ru,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yg,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!==au&&(au&&l.type==="mousemove"?(mg=l.screenX-au.screenX,vg=l.screenY-au.screenY):vg=mg=0,au=l),mg)},movementY:function(l){return"movementY"in l?l.movementY:vg}}),$C=Ur(Mf),qz=X({},Mf,{dataTransfer:0}),Wz=Ur(qz),Vz=X({},ru,{relatedTarget:0}),gg=Ur(Vz),Hz=X({},Qo,{animationName:0,elapsedTime:0,pseudoElement:0}),Kz=Ur(Hz),Gz=X({},Qo,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),Yz=Ur(Gz),Xz=X({},Qo,{data:0}),DC=Ur(Xz),Qz={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Jz={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"},Zz={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function e6(l){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(l):(l=Zz[l])?!!u[l]:!1}function yg(){return e6}var t6=X({},ru,{key:function(l){if(l.key){var u=Qz[l.key]||l.key;if(u!=="Unidentified")return u}return l.type==="keypress"?(l=Tf(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?Jz[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yg,charCode:function(l){return l.type==="keypress"?Tf(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?Tf(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),n6=Ur(t6),r6=X({},Mf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),LC=Ur(r6),a6=X({},ru,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yg}),s6=Ur(a6),i6=X({},Qo,{propertyName:0,elapsedTime:0,pseudoElement:0}),o6=Ur(i6),l6=X({},Mf,{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}),c6=Ur(l6),u6=[9,13,27,32],xg=c&&"CompositionEvent"in window,su=null;c&&"documentMode"in document&&(su=document.documentMode);var d6=c&&"TextEvent"in window&&!su,FC=c&&(!xg||su&&8<su&&11>=su),BC=" ",zC=!1;function UC(l,u){switch(l){case"keyup":return u6.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qC(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var Jo=!1;function f6(l,u){switch(l){case"compositionend":return qC(u);case"keypress":return u.which!==32?null:(zC=!0,BC);case"textInput":return l=u.data,l===BC&&zC?null:l;default:return null}}function p6(l,u){if(Jo)return l==="compositionend"||!xg&&UC(l,u)?(l=IC(),Rf=pg=ci=null,Jo=!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 FC&&u.locale!=="ko"?null:u.data;default:return null}}var h6={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 WC(l){var u=l&&l.nodeName&&l.nodeName.toLowerCase();return u==="input"?!!h6[l.type]:u==="textarea"}function VC(l,u,m,w){ue(w),u=Bf(u,"onChange"),0<u.length&&(m=new hg("onChange","change",null,m,w),l.push({event:m,listeners:u}))}var iu=null,ou=null;function m6(l){c_(l,0)}function $f(l){var u=rl(l);if(ne(u))return l}function v6(l,u){if(l==="change")return u}var HC=!1;if(c){var bg;if(c){var wg="oninput"in document;if(!wg){var KC=document.createElement("div");KC.setAttribute("oninput","return;"),wg=typeof KC.oninput=="function"}bg=wg}else bg=!1;HC=bg&&(!document.documentMode||9<document.documentMode)}function GC(){iu&&(iu.detachEvent("onpropertychange",YC),ou=iu=null)}function YC(l){if(l.propertyName==="value"&&$f(ou)){var u=[];VC(u,ou,l,Fr(l)),Yt(m6,u)}}function g6(l,u,m){l==="focusin"?(GC(),iu=u,ou=m,iu.attachEvent("onpropertychange",YC)):l==="focusout"&&GC()}function y6(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return $f(ou)}function x6(l,u){if(l==="click")return $f(u)}function b6(l,u){if(l==="input"||l==="change")return $f(u)}function w6(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var Pa=typeof Object.is=="function"?Object.is:w6;function lu(l,u){if(Pa(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)||!Pa(l[C],u[C]))return!1}return!0}function XC(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function QC(l,u){var m=XC(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=XC(m)}}function JC(l,u){return l&&u?l===u?!0:l&&l.nodeType===3?!1:u&&u.nodeType===3?JC(l,u.parentNode):"contains"in l?l.contains(u):l.compareDocumentPosition?!!(l.compareDocumentPosition(u)&16):!1:!1}function ZC(){for(var l=window,u=Te();u instanceof l.HTMLIFrameElement;){try{var m=typeof u.contentWindow.location.href=="string"}catch{m=!1}if(m)l=u.contentWindow;else break;u=Te(l.document)}return u}function jg(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 j6(l){var u=ZC(),m=l.focusedElem,w=l.selectionRange;if(u!==m&&m&&m.ownerDocument&&JC(m.ownerDocument.documentElement,m)){if(w!==null&&jg(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=QC(m,E);var I=QC(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 S6=c&&"documentMode"in document&&11>=document.documentMode,Zo=null,Sg=null,cu=null,Ng=!1;function e_(l,u,m){var w=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;Ng||Zo==null||Zo!==Te(w)||(w=Zo,"selectionStart"in w&&jg(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}),cu&&lu(cu,w)||(cu=w,w=Bf(Sg,"onSelect"),0<w.length&&(u=new hg("onSelect","select",null,u,m),l.push({event:u,listeners:w}),u.target=Zo)))}function Df(l,u){var m={};return m[l.toLowerCase()]=u.toLowerCase(),m["Webkit"+l]="webkit"+u,m["Moz"+l]="moz"+u,m}var el={animationend:Df("Animation","AnimationEnd"),animationiteration:Df("Animation","AnimationIteration"),animationstart:Df("Animation","AnimationStart"),transitionend:Df("Transition","TransitionEnd")},Cg={},t_={};c&&(t_=document.createElement("div").style,"AnimationEvent"in window||(delete el.animationend.animation,delete el.animationiteration.animation,delete el.animationstart.animation),"TransitionEvent"in window||delete el.transitionend.transition);function Lf(l){if(Cg[l])return Cg[l];if(!el[l])return l;var u=el[l],m;for(m in u)if(u.hasOwnProperty(m)&&m in t_)return Cg[l]=u[m];return l}var n_=Lf("animationend"),r_=Lf("animationiteration"),a_=Lf("animationstart"),s_=Lf("transitionend"),i_=new Map,o_="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 ui(l,u){i_.set(l,u),i(u,[l])}for(var _g=0;_g<o_.length;_g++){var Ag=o_[_g],N6=Ag.toLowerCase(),C6=Ag[0].toUpperCase()+Ag.slice(1);ui(N6,"on"+C6)}ui(n_,"onAnimationEnd"),ui(r_,"onAnimationIteration"),ui(a_,"onAnimationStart"),ui("dblclick","onDoubleClick"),ui("focusin","onFocus"),ui("focusout","onBlur"),ui(s_,"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 uu="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(" "),_6=new Set("cancel close invalid load scroll toggle".split(" ").concat(uu));function l_(l,u,m){var w=l.type||"unknown-event";l.currentTarget=m,he(w,u,void 0,l),l.currentTarget=null}function c_(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],te=Y.instance,me=Y.currentTarget;if(Y=Y.listener,te!==E&&C.isPropagationStopped())break e;l_(C,Y,me),E=te}else for(I=0;I<w.length;I++){if(Y=w[I],te=Y.instance,me=Y.currentTarget,Y=Y.listener,te!==E&&C.isPropagationStopped())break e;l_(C,Y,me),E=te}}}if(ri)throw l=ai,ri=!1,ai=null,l}function un(l,u){var m=u[Mg];m===void 0&&(m=u[Mg]=new Set);var w=l+"__bubble";m.has(w)||(u_(u,l,2,!1),m.add(w))}function Eg(l,u,m){var w=0;u&&(w|=4),u_(m,l,w,u)}var Ff="_reactListening"+Math.random().toString(36).slice(2);function du(l){if(!l[Ff]){l[Ff]=!0,r.forEach(function(m){m!=="selectionchange"&&(_6.has(m)||Eg(m,!1,l),Eg(m,!0,l))});var u=l.nodeType===9?l:l.ownerDocument;u===null||u[Ff]||(u[Ff]=!0,Eg("selectionchange",!1,u))}}function u_(l,u,m,w){switch(TC(u)){case 1:var C=Bz;break;case 4:C=zz;break;default:C=dg}m=C.bind(null,u,m,l),C=void 0,!dr||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 Pg(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 te=I.tag;if((te===3||te===4)&&(te=I.stateNode.containerInfo,te===C||te.nodeType===8&&te.parentNode===C))return;I=I.return}for(;Y!==null;){if(I=Xi(Y),I===null)return;if(te=I.tag,te===5||te===6){w=E=I;continue e}Y=Y.parentNode}}w=w.return}Yt(function(){var me=E,Ce=Fr(m),Pe=[];e:{var Ne=i_.get(l);if(Ne!==void 0){var Ve=hg,Ze=l;switch(l){case"keypress":if(Tf(m)===0)break e;case"keydown":case"keyup":Ve=n6;break;case"focusin":Ze="focus",Ve=gg;break;case"focusout":Ze="blur",Ve=gg;break;case"beforeblur":case"afterblur":Ve=gg;break;case"click":if(m.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ve=$C;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ve=Wz;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ve=s6;break;case n_:case r_:case a_:Ve=Kz;break;case s_:Ve=o6;break;case"scroll":Ve=Uz;break;case"wheel":Ve=c6;break;case"copy":case"cut":case"paste":Ve=Yz;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ve=LC}var et=(u&4)!==0,Rn=!et&&l==="scroll",de=et?Ne!==null?Ne+"Capture":null:Ne;et=[];for(var re=me,pe;re!==null;){pe=re;var Ie=pe.stateNode;if(pe.tag===5&&Ie!==null&&(pe=Ie,de!==null&&(Ie=Nn(re,de),Ie!=null&&et.push(fu(re,Ie,pe)))),Rn)break;re=re.return}0<et.length&&(Ne=new Ve(Ne,Ze,null,m,Ce),Pe.push({event:Ne,listeners:et}))}}if((u&7)===0){e:{if(Ne=l==="mouseover"||l==="pointerover",Ve=l==="mouseout"||l==="pointerout",Ne&&m!==Ar&&(Ze=m.relatedTarget||m.fromElement)&&(Xi(Ze)||Ze[Ns]))break e;if((Ve||Ne)&&(Ne=Ce.window===Ce?Ce:(Ne=Ce.ownerDocument)?Ne.defaultView||Ne.parentWindow:window,Ve?(Ze=m.relatedTarget||m.toElement,Ve=me,Ze=Ze?Xi(Ze):null,Ze!==null&&(Rn=De(Ze),Ze!==Rn||Ze.tag!==5&&Ze.tag!==6)&&(Ze=null)):(Ve=null,Ze=me),Ve!==Ze)){if(et=$C,Ie="onMouseLeave",de="onMouseEnter",re="mouse",(l==="pointerout"||l==="pointerover")&&(et=LC,Ie="onPointerLeave",de="onPointerEnter",re="pointer"),Rn=Ve==null?Ne:rl(Ve),pe=Ze==null?Ne:rl(Ze),Ne=new et(Ie,re+"leave",Ve,m,Ce),Ne.target=Rn,Ne.relatedTarget=pe,Ie=null,Xi(Ce)===me&&(et=new et(de,re+"enter",Ze,m,Ce),et.target=pe,et.relatedTarget=Rn,Ie=et),Rn=Ie,Ve&&Ze)t:{for(et=Ve,de=Ze,re=0,pe=et;pe;pe=tl(pe))re++;for(pe=0,Ie=de;Ie;Ie=tl(Ie))pe++;for(;0<re-pe;)et=tl(et),re--;for(;0<pe-re;)de=tl(de),pe--;for(;re--;){if(et===de||de!==null&&et===de.alternate)break t;et=tl(et),de=tl(de)}et=null}else et=null;Ve!==null&&d_(Pe,Ne,Ve,et,!1),Ze!==null&&Rn!==null&&d_(Pe,Rn,Ze,et,!0)}}e:{if(Ne=me?rl(me):window,Ve=Ne.nodeName&&Ne.nodeName.toLowerCase(),Ve==="select"||Ve==="input"&&Ne.type==="file")var at=v6;else if(WC(Ne))if(HC)at=b6;else{at=y6;var ft=g6}else(Ve=Ne.nodeName)&&Ve.toLowerCase()==="input"&&(Ne.type==="checkbox"||Ne.type==="radio")&&(at=x6);if(at&&(at=at(l,me))){VC(Pe,at,m,Ce);break e}ft&&ft(l,Ne,me),l==="focusout"&&(ft=Ne._wrapperState)&&ft.controlled&&Ne.type==="number"&&dt(Ne,"number",Ne.value)}switch(ft=me?rl(me):window,l){case"focusin":(WC(ft)||ft.contentEditable==="true")&&(Zo=ft,Sg=me,cu=null);break;case"focusout":cu=Sg=Zo=null;break;case"mousedown":Ng=!0;break;case"contextmenu":case"mouseup":case"dragend":Ng=!1,e_(Pe,m,Ce);break;case"selectionchange":if(S6)break;case"keydown":case"keyup":e_(Pe,m,Ce)}var pt;if(xg)e:{switch(l){case"compositionstart":var yt="onCompositionStart";break e;case"compositionend":yt="onCompositionEnd";break e;case"compositionupdate":yt="onCompositionUpdate";break e}yt=void 0}else Jo?UC(l,m)&&(yt="onCompositionEnd"):l==="keydown"&&m.keyCode===229&&(yt="onCompositionStart");yt&&(FC&&m.locale!=="ko"&&(Jo||yt!=="onCompositionStart"?yt==="onCompositionEnd"&&Jo&&(pt=IC()):(ci=Ce,pg="value"in ci?ci.value:ci.textContent,Jo=!0)),ft=Bf(me,yt),0<ft.length&&(yt=new DC(yt,l,null,m,Ce),Pe.push({event:yt,listeners:ft}),pt?yt.data=pt:(pt=qC(m),pt!==null&&(yt.data=pt)))),(pt=d6?f6(l,m):p6(l,m))&&(me=Bf(me,"onBeforeInput"),0<me.length&&(Ce=new DC("onBeforeInput","beforeinput",null,m,Ce),Pe.push({event:Ce,listeners:me}),Ce.data=pt))}c_(Pe,u)})}function fu(l,u,m){return{instance:l,listener:u,currentTarget:m}}function Bf(l,u){for(var m=u+"Capture",w=[];l!==null;){var C=l,E=C.stateNode;C.tag===5&&E!==null&&(C=E,E=Nn(l,m),E!=null&&w.unshift(fu(l,E,C)),E=Nn(l,u),E!=null&&w.push(fu(l,E,C))),l=l.return}return w}function tl(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function d_(l,u,m,w,C){for(var E=u._reactName,I=[];m!==null&&m!==w;){var Y=m,te=Y.alternate,me=Y.stateNode;if(te!==null&&te===w)break;Y.tag===5&&me!==null&&(Y=me,C?(te=Nn(m,E),te!=null&&I.unshift(fu(m,te,Y))):C||(te=Nn(m,E),te!=null&&I.push(fu(m,te,Y)))),m=m.return}I.length!==0&&l.push({event:u,listeners:I})}var A6=/\r\n?/g,E6=/\u0000|\uFFFD/g;function f_(l){return(typeof l=="string"?l:""+l).replace(A6,`
|
|
6
|
-
`).replace(E6,"")}function zf(l,u,m){if(u=f_(u),f_(l)!==u&&m)throw Error(n(425))}function Uf(){}var Og=null,kg=null;function Rg(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 Tg=typeof setTimeout=="function"?setTimeout:void 0,P6=typeof clearTimeout=="function"?clearTimeout:void 0,p_=typeof Promise=="function"?Promise:void 0,O6=typeof queueMicrotask=="function"?queueMicrotask:typeof p_<"u"?function(l){return p_.resolve(null).then(l).catch(k6)}:Tg;function k6(l){setTimeout(function(){throw l})}function Ig(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),nu(u);return}w--}else m!=="$"&&m!=="$?"&&m!=="$!"||w++;m=C}while(m);nu(u)}function di(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 h_(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 nl=Math.random().toString(36).slice(2),ns="__reactFiber$"+nl,pu="__reactProps$"+nl,Ns="__reactContainer$"+nl,Mg="__reactEvents$"+nl,R6="__reactListeners$"+nl,T6="__reactHandles$"+nl;function Xi(l){var u=l[ns];if(u)return u;for(var m=l.parentNode;m;){if(u=m[Ns]||m[ns]){if(m=u.alternate,u.child!==null||m!==null&&m.child!==null)for(l=h_(l);l!==null;){if(m=l[ns])return m;l=h_(l)}return u}l=m,m=l.parentNode}return null}function hu(l){return l=l[ns]||l[Ns],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function rl(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(n(33))}function qf(l){return l[pu]||null}var $g=[],al=-1;function fi(l){return{current:l}}function dn(l){0>al||(l.current=$g[al],$g[al]=null,al--)}function rn(l,u){al++,$g[al]=l.current,l.current=u}var pi={},fr=fi(pi),Pr=fi(!1),Qi=pi;function sl(l,u){var m=l.type.contextTypes;if(!m)return pi;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 Or(l){return l=l.childContextTypes,l!=null}function Wf(){dn(Pr),dn(fr)}function m_(l,u,m){if(fr.current!==pi)throw Error(n(168));rn(fr,u),rn(Pr,m)}function v_(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,ie(l)||"Unknown",C));return X({},m,w)}function Vf(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||pi,Qi=fr.current,rn(fr,l),rn(Pr,Pr.current),!0}function g_(l,u,m){var w=l.stateNode;if(!w)throw Error(n(169));m?(l=v_(l,u,Qi),w.__reactInternalMemoizedMergedChildContext=l,dn(Pr),dn(fr),rn(fr,l)):dn(Pr),rn(Pr,m)}var Cs=null,Hf=!1,Dg=!1;function y_(l){Cs===null?Cs=[l]:Cs.push(l)}function I6(l){Hf=!0,y_(l)}function hi(){if(!Dg&&Cs!==null){Dg=!0;var l=0,u=Wt;try{var m=Cs;for(Wt=1;l<m.length;l++){var w=m[l];do w=w(!0);while(w!==null)}Cs=null,Hf=!1}catch(C){throw Cs!==null&&(Cs=Cs.slice(l+1)),We(Yc,hi),C}finally{Wt=u,Dg=!1}}return null}var il=[],ol=0,Kf=null,Gf=0,oa=[],la=0,Ji=null,_s=1,As="";function Zi(l,u){il[ol++]=Gf,il[ol++]=Kf,Kf=l,Gf=u}function x_(l,u,m){oa[la++]=_s,oa[la++]=As,oa[la++]=Ji,Ji=l;var w=_s;l=As;var C=32-ve(w)-1;w&=~(1<<C),m+=1;var E=32-ve(u)+C;if(30<E){var I=C-C%5;E=(w&(1<<I)-1).toString(32),w>>=I,C-=I,_s=1<<32-ve(u)+C|m<<C|w,As=E+l}else _s=1<<E|m<<C|w,As=l}function Lg(l){l.return!==null&&(Zi(l,1),x_(l,1,0))}function Fg(l){for(;l===Kf;)Kf=il[--ol],il[ol]=null,Gf=il[--ol],il[ol]=null;for(;l===Ji;)Ji=oa[--la],oa[la]=null,As=oa[--la],oa[la]=null,_s=oa[--la],oa[la]=null}var qr=null,Wr=null,hn=!1,Oa=null;function b_(l,u){var m=fa(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 w_(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,qr=l,Wr=di(u.firstChild),!0):!1;case 6:return u=l.pendingProps===""||u.nodeType!==3?null:u,u!==null?(l.stateNode=u,qr=l,Wr=null,!0):!1;case 13:return u=u.nodeType!==8?null:u,u!==null?(m=Ji!==null?{id:_s,overflow:As}:null,l.memoizedState={dehydrated:u,treeContext:m,retryLane:1073741824},m=fa(18,null,null,0),m.stateNode=u,m.return=l,l.child=m,qr=l,Wr=null,!0):!1;default:return!1}}function Bg(l){return(l.mode&1)!==0&&(l.flags&128)===0}function zg(l){if(hn){var u=Wr;if(u){var m=u;if(!w_(l,u)){if(Bg(l))throw Error(n(418));u=di(m.nextSibling);var w=qr;u&&w_(l,u)?b_(w,m):(l.flags=l.flags&-4097|2,hn=!1,qr=l)}}else{if(Bg(l))throw Error(n(418));l.flags=l.flags&-4097|2,hn=!1,qr=l}}}function j_(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;qr=l}function Yf(l){if(l!==qr)return!1;if(!hn)return j_(l),hn=!0,!1;var u;if((u=l.tag!==3)&&!(u=l.tag!==5)&&(u=l.type,u=u!=="head"&&u!=="body"&&!Rg(l.type,l.memoizedProps)),u&&(u=Wr)){if(Bg(l))throw S_(),Error(n(418));for(;u;)b_(l,u),u=di(u.nextSibling)}if(j_(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){Wr=di(l.nextSibling);break e}u--}else m!=="$"&&m!=="$!"&&m!=="$?"||u++}l=l.nextSibling}Wr=null}}else Wr=qr?di(l.stateNode.nextSibling):null;return!0}function S_(){for(var l=Wr;l;)l=di(l.nextSibling)}function ll(){Wr=qr=null,hn=!1}function Ug(l){Oa===null?Oa=[l]:Oa.push(l)}var M6=P.ReactCurrentBatchConfig;function mu(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 Xf(l,u){throw l=Object.prototype.toString.call(u),Error(n(31,l==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":l))}function N_(l){var u=l._init;return u(l._payload)}function C_(l){function u(de,re){if(l){var pe=de.deletions;pe===null?(de.deletions=[re],de.flags|=16):pe.push(re)}}function m(de,re){if(!l)return null;for(;re!==null;)u(de,re),re=re.sibling;return null}function w(de,re){for(de=new Map;re!==null;)re.key!==null?de.set(re.key,re):de.set(re.index,re),re=re.sibling;return de}function C(de,re){return de=ji(de,re),de.index=0,de.sibling=null,de}function E(de,re,pe){return de.index=pe,l?(pe=de.alternate,pe!==null?(pe=pe.index,pe<re?(de.flags|=2,re):pe):(de.flags|=2,re)):(de.flags|=1048576,re)}function I(de){return l&&de.alternate===null&&(de.flags|=2),de}function Y(de,re,pe,Ie){return re===null||re.tag!==6?(re=Ty(pe,de.mode,Ie),re.return=de,re):(re=C(re,pe),re.return=de,re)}function te(de,re,pe,Ie){var at=pe.type;return at===k?Ce(de,re,pe.props.children,Ie,pe.key):re!==null&&(re.elementType===at||typeof at=="object"&&at!==null&&at.$$typeof===Q&&N_(at)===re.type)?(Ie=C(re,pe.props),Ie.ref=mu(de,re,pe),Ie.return=de,Ie):(Ie=bp(pe.type,pe.key,pe.props,null,de.mode,Ie),Ie.ref=mu(de,re,pe),Ie.return=de,Ie)}function me(de,re,pe,Ie){return re===null||re.tag!==4||re.stateNode.containerInfo!==pe.containerInfo||re.stateNode.implementation!==pe.implementation?(re=Iy(pe,de.mode,Ie),re.return=de,re):(re=C(re,pe.children||[]),re.return=de,re)}function Ce(de,re,pe,Ie,at){return re===null||re.tag!==7?(re=oo(pe,de.mode,Ie,at),re.return=de,re):(re=C(re,pe),re.return=de,re)}function Pe(de,re,pe){if(typeof re=="string"&&re!==""||typeof re=="number")return re=Ty(""+re,de.mode,pe),re.return=de,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case A:return pe=bp(re.type,re.key,re.props,null,de.mode,pe),pe.ref=mu(de,null,re),pe.return=de,pe;case O:return re=Iy(re,de.mode,pe),re.return=de,re;case Q:var Ie=re._init;return Pe(de,Ie(re._payload),pe)}if(be(re)||D(re))return re=oo(re,de.mode,pe,null),re.return=de,re;Xf(de,re)}return null}function Ne(de,re,pe,Ie){var at=re!==null?re.key:null;if(typeof pe=="string"&&pe!==""||typeof pe=="number")return at!==null?null:Y(de,re,""+pe,Ie);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case A:return pe.key===at?te(de,re,pe,Ie):null;case O:return pe.key===at?me(de,re,pe,Ie):null;case Q:return at=pe._init,Ne(de,re,at(pe._payload),Ie)}if(be(pe)||D(pe))return at!==null?null:Ce(de,re,pe,Ie,null);Xf(de,pe)}return null}function Ve(de,re,pe,Ie,at){if(typeof Ie=="string"&&Ie!==""||typeof Ie=="number")return de=de.get(pe)||null,Y(re,de,""+Ie,at);if(typeof Ie=="object"&&Ie!==null){switch(Ie.$$typeof){case A:return de=de.get(Ie.key===null?pe:Ie.key)||null,te(re,de,Ie,at);case O:return de=de.get(Ie.key===null?pe:Ie.key)||null,me(re,de,Ie,at);case Q:var ft=Ie._init;return Ve(de,re,pe,ft(Ie._payload),at)}if(be(Ie)||D(Ie))return de=de.get(pe)||null,Ce(re,de,Ie,at,null);Xf(re,Ie)}return null}function Ze(de,re,pe,Ie){for(var at=null,ft=null,pt=re,yt=re=0,Zn=null;pt!==null&&yt<pe.length;yt++){pt.index>yt?(Zn=pt,pt=null):Zn=pt.sibling;var $t=Ne(de,pt,pe[yt],Ie);if($t===null){pt===null&&(pt=Zn);break}l&&pt&&$t.alternate===null&&u(de,pt),re=E($t,re,yt),ft===null?at=$t:ft.sibling=$t,ft=$t,pt=Zn}if(yt===pe.length)return m(de,pt),hn&&Zi(de,yt),at;if(pt===null){for(;yt<pe.length;yt++)pt=Pe(de,pe[yt],Ie),pt!==null&&(re=E(pt,re,yt),ft===null?at=pt:ft.sibling=pt,ft=pt);return hn&&Zi(de,yt),at}for(pt=w(de,pt);yt<pe.length;yt++)Zn=Ve(pt,de,yt,pe[yt],Ie),Zn!==null&&(l&&Zn.alternate!==null&&pt.delete(Zn.key===null?yt:Zn.key),re=E(Zn,re,yt),ft===null?at=Zn:ft.sibling=Zn,ft=Zn);return l&&pt.forEach(function(Si){return u(de,Si)}),hn&&Zi(de,yt),at}function et(de,re,pe,Ie){var at=D(pe);if(typeof at!="function")throw Error(n(150));if(pe=at.call(pe),pe==null)throw Error(n(151));for(var ft=at=null,pt=re,yt=re=0,Zn=null,$t=pe.next();pt!==null&&!$t.done;yt++,$t=pe.next()){pt.index>yt?(Zn=pt,pt=null):Zn=pt.sibling;var Si=Ne(de,pt,$t.value,Ie);if(Si===null){pt===null&&(pt=Zn);break}l&&pt&&Si.alternate===null&&u(de,pt),re=E(Si,re,yt),ft===null?at=Si:ft.sibling=Si,ft=Si,pt=Zn}if($t.done)return m(de,pt),hn&&Zi(de,yt),at;if(pt===null){for(;!$t.done;yt++,$t=pe.next())$t=Pe(de,$t.value,Ie),$t!==null&&(re=E($t,re,yt),ft===null?at=$t:ft.sibling=$t,ft=$t);return hn&&Zi(de,yt),at}for(pt=w(de,pt);!$t.done;yt++,$t=pe.next())$t=Ve(pt,de,yt,$t.value,Ie),$t!==null&&(l&&$t.alternate!==null&&pt.delete($t.key===null?yt:$t.key),re=E($t,re,yt),ft===null?at=$t:ft.sibling=$t,ft=$t);return l&&pt.forEach(function(hU){return u(de,hU)}),hn&&Zi(de,yt),at}function Rn(de,re,pe,Ie){if(typeof pe=="object"&&pe!==null&&pe.type===k&&pe.key===null&&(pe=pe.props.children),typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case A:e:{for(var at=pe.key,ft=re;ft!==null;){if(ft.key===at){if(at=pe.type,at===k){if(ft.tag===7){m(de,ft.sibling),re=C(ft,pe.props.children),re.return=de,de=re;break e}}else if(ft.elementType===at||typeof at=="object"&&at!==null&&at.$$typeof===Q&&N_(at)===ft.type){m(de,ft.sibling),re=C(ft,pe.props),re.ref=mu(de,ft,pe),re.return=de,de=re;break e}m(de,ft);break}else u(de,ft);ft=ft.sibling}pe.type===k?(re=oo(pe.props.children,de.mode,Ie,pe.key),re.return=de,de=re):(Ie=bp(pe.type,pe.key,pe.props,null,de.mode,Ie),Ie.ref=mu(de,re,pe),Ie.return=de,de=Ie)}return I(de);case O:e:{for(ft=pe.key;re!==null;){if(re.key===ft)if(re.tag===4&&re.stateNode.containerInfo===pe.containerInfo&&re.stateNode.implementation===pe.implementation){m(de,re.sibling),re=C(re,pe.children||[]),re.return=de,de=re;break e}else{m(de,re);break}else u(de,re);re=re.sibling}re=Iy(pe,de.mode,Ie),re.return=de,de=re}return I(de);case Q:return ft=pe._init,Rn(de,re,ft(pe._payload),Ie)}if(be(pe))return Ze(de,re,pe,Ie);if(D(pe))return et(de,re,pe,Ie);Xf(de,pe)}return typeof pe=="string"&&pe!==""||typeof pe=="number"?(pe=""+pe,re!==null&&re.tag===6?(m(de,re.sibling),re=C(re,pe),re.return=de,de=re):(m(de,re),re=Ty(pe,de.mode,Ie),re.return=de,de=re),I(de)):m(de,re)}return Rn}var cl=C_(!0),__=C_(!1),Qf=fi(null),Jf=null,ul=null,qg=null;function Wg(){qg=ul=Jf=null}function Vg(l){var u=Qf.current;dn(Qf),l._currentValue=u}function Hg(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 dl(l,u){Jf=l,qg=ul=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&u)!==0&&(kr=!0),l.firstContext=null)}function ca(l){var u=l._currentValue;if(qg!==l)if(l={context:l,memoizedValue:u,next:null},ul===null){if(Jf===null)throw Error(n(308));ul=l,Jf.dependencies={lanes:0,firstContext:l}}else ul=ul.next=l;return u}var eo=null;function Kg(l){eo===null?eo=[l]:eo.push(l)}function A_(l,u,m,w){var C=u.interleaved;return C===null?(m.next=m,Kg(u)):(m.next=C.next,C.next=m),u.interleaved=m,Es(l,w)}function Es(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 mi=!1;function Gg(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function E_(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 Ps(l,u){return{eventTime:l,lane:u,tag:0,payload:null,callback:null,next:null}}function vi(l,u,m){var w=l.updateQueue;if(w===null)return null;if(w=w.shared,(It&2)!==0){var C=w.pending;return C===null?u.next=u:(u.next=C.next,C.next=u),w.pending=u,Es(l,m)}return C=w.interleaved,C===null?(u.next=u,Kg(w)):(u.next=C.next,C.next=u),w.interleaved=u,Es(l,m)}function Zf(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,lg(l,m)}}function P_(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 ep(l,u,m,w){var C=l.updateQueue;mi=!1;var E=C.firstBaseUpdate,I=C.lastBaseUpdate,Y=C.shared.pending;if(Y!==null){C.shared.pending=null;var te=Y,me=te.next;te.next=null,I===null?E=me:I.next=me,I=te;var Ce=l.alternate;Ce!==null&&(Ce=Ce.updateQueue,Y=Ce.lastBaseUpdate,Y!==I&&(Y===null?Ce.firstBaseUpdate=me:Y.next=me,Ce.lastBaseUpdate=te))}if(E!==null){var Pe=C.baseState;I=0,Ce=me=te=null,Y=E;do{var Ne=Y.lane,Ve=Y.eventTime;if((w&Ne)===Ne){Ce!==null&&(Ce=Ce.next={eventTime:Ve,lane:0,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null});e:{var Ze=l,et=Y;switch(Ne=u,Ve=m,et.tag){case 1:if(Ze=et.payload,typeof Ze=="function"){Pe=Ze.call(Ve,Pe,Ne);break e}Pe=Ze;break e;case 3:Ze.flags=Ze.flags&-65537|128;case 0:if(Ze=et.payload,Ne=typeof Ze=="function"?Ze.call(Ve,Pe,Ne):Ze,Ne==null)break e;Pe=X({},Pe,Ne);break e;case 2:mi=!0}}Y.callback!==null&&Y.lane!==0&&(l.flags|=64,Ne=C.effects,Ne===null?C.effects=[Y]:Ne.push(Y))}else Ve={eventTime:Ve,lane:Ne,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},Ce===null?(me=Ce=Ve,te=Pe):Ce=Ce.next=Ve,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&&(te=Pe),C.baseState=te,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);ro|=I,l.lanes=I,l.memoizedState=Pe}}function O_(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 vu={},rs=fi(vu),gu=fi(vu),yu=fi(vu);function to(l){if(l===vu)throw Error(n(174));return l}function Yg(l,u){switch(rn(yu,u),rn(gu,l),rn(rs,vu),l=u.nodeType,l){case 9:case 11:u=(u=u.documentElement)?u.namespaceURI:we(null,"");break;default:l=l===8?u.parentNode:u,u=l.namespaceURI||null,l=l.tagName,u=we(u,l)}dn(rs),rn(rs,u)}function fl(){dn(rs),dn(gu),dn(yu)}function k_(l){to(yu.current);var u=to(rs.current),m=we(u,l.type);u!==m&&(rn(gu,l),rn(rs,m))}function Xg(l){gu.current===l&&(dn(rs),dn(gu))}var xn=fi(0);function tp(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 Qg=[];function Jg(){for(var l=0;l<Qg.length;l++)Qg[l]._workInProgressVersionPrimary=null;Qg.length=0}var np=P.ReactCurrentDispatcher,Zg=P.ReactCurrentBatchConfig,no=0,bn=null,Fn=null,Qn=null,rp=!1,xu=!1,bu=0,$6=0;function pr(){throw Error(n(321))}function ey(l,u){if(u===null)return!1;for(var m=0;m<u.length&&m<l.length;m++)if(!Pa(l[m],u[m]))return!1;return!0}function ty(l,u,m,w,C,E){if(no=E,bn=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,np.current=l===null||l.memoizedState===null?B6:z6,l=m(w,C),xu){E=0;do{if(xu=!1,bu=0,25<=E)throw Error(n(301));E+=1,Qn=Fn=null,u.updateQueue=null,np.current=U6,l=m(w,C)}while(xu)}if(np.current=ip,u=Fn!==null&&Fn.next!==null,no=0,Qn=Fn=bn=null,rp=!1,u)throw Error(n(300));return l}function ny(){var l=bu!==0;return bu=0,l}function as(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qn===null?bn.memoizedState=Qn=l:Qn=Qn.next=l,Qn}function ua(){if(Fn===null){var l=bn.alternate;l=l!==null?l.memoizedState:null}else l=Fn.next;var u=Qn===null?bn.memoizedState:Qn.next;if(u!==null)Qn=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},Qn===null?bn.memoizedState=Qn=l:Qn=Qn.next=l}return Qn}function wu(l,u){return typeof u=="function"?u(l):u}function ry(l){var u=ua(),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,te=null,me=E;do{var Ce=me.lane;if((no&Ce)===Ce)te!==null&&(te=te.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 Pe={lane:Ce,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null};te===null?(Y=te=Pe,I=w):te=te.next=Pe,bn.lanes|=Ce,ro|=Ce}me=me.next}while(me!==null&&me!==E);te===null?I=w:te.next=Y,Pa(w,u.memoizedState)||(kr=!0),u.memoizedState=w,u.baseState=I,u.baseQueue=te,m.lastRenderedState=w}if(l=m.interleaved,l!==null){C=l;do E=C.lane,bn.lanes|=E,ro|=E,C=C.next;while(C!==l)}else C===null&&(m.lanes=0);return[u.memoizedState,m.dispatch]}function ay(l){var u=ua(),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);Pa(E,u.memoizedState)||(kr=!0),u.memoizedState=E,u.baseQueue===null&&(u.baseState=E),m.lastRenderedState=E}return[E,w]}function R_(){}function T_(l,u){var m=bn,w=ua(),C=u(),E=!Pa(w.memoizedState,C);if(E&&(w.memoizedState=C,kr=!0),w=w.queue,sy($_.bind(null,m,w,l),[l]),w.getSnapshot!==u||E||Qn!==null&&Qn.memoizedState.tag&1){if(m.flags|=2048,ju(9,M_.bind(null,m,w,C,u),void 0,null),Jn===null)throw Error(n(349));(no&30)!==0||I_(m,u,C)}return C}function I_(l,u,m){l.flags|=16384,l={getSnapshot:u,value:m},u=bn.updateQueue,u===null?(u={lastEffect:null,stores:null},bn.updateQueue=u,u.stores=[l]):(m=u.stores,m===null?u.stores=[l]:m.push(l))}function M_(l,u,m,w){u.value=m,u.getSnapshot=w,D_(u)&&L_(l)}function $_(l,u,m){return m(function(){D_(u)&&L_(l)})}function D_(l){var u=l.getSnapshot;l=l.value;try{var m=u();return!Pa(l,m)}catch{return!0}}function L_(l){var u=Es(l,1);u!==null&&Ia(u,l,1,-1)}function F_(l){var u=as();return typeof l=="function"&&(l=l()),u.memoizedState=u.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:wu,lastRenderedState:l},u.queue=l,l=l.dispatch=F6.bind(null,bn,l),[u.memoizedState,l]}function ju(l,u,m,w){return l={tag:l,create:u,destroy:m,deps:w,next:null},u=bn.updateQueue,u===null?(u={lastEffect:null,stores:null},bn.updateQueue=u,u.lastEffect=l.next=l):(m=u.lastEffect,m===null?u.lastEffect=l.next=l:(w=m.next,m.next=l,l.next=w,u.lastEffect=l)),l}function B_(){return ua().memoizedState}function ap(l,u,m,w){var C=as();bn.flags|=l,C.memoizedState=ju(1|u,m,void 0,w===void 0?null:w)}function sp(l,u,m,w){var C=ua();w=w===void 0?null:w;var E=void 0;if(Fn!==null){var I=Fn.memoizedState;if(E=I.destroy,w!==null&&ey(w,I.deps)){C.memoizedState=ju(u,m,E,w);return}}bn.flags|=l,C.memoizedState=ju(1|u,m,E,w)}function z_(l,u){return ap(8390656,8,l,u)}function sy(l,u){return sp(2048,8,l,u)}function U_(l,u){return sp(4,2,l,u)}function q_(l,u){return sp(4,4,l,u)}function W_(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 V_(l,u,m){return m=m!=null?m.concat([l]):null,sp(4,4,W_.bind(null,u,l),m)}function iy(){}function H_(l,u){var m=ua();u=u===void 0?null:u;var w=m.memoizedState;return w!==null&&u!==null&&ey(u,w[1])?w[0]:(m.memoizedState=[l,u],l)}function K_(l,u){var m=ua();u=u===void 0?null:u;var w=m.memoizedState;return w!==null&&u!==null&&ey(u,w[1])?w[0]:(l=l(),m.memoizedState=[l,u],l)}function G_(l,u,m){return(no&21)===0?(l.baseState&&(l.baseState=!1,kr=!0),l.memoizedState=m):(Pa(m,u)||(m=Yo(),bn.lanes|=m,ro|=m,l.baseState=!0),u)}function D6(l,u){var m=Wt;Wt=m!==0&&4>m?m:4,l(!0);var w=Zg.transition;Zg.transition={};try{l(!1),u()}finally{Wt=m,Zg.transition=w}}function Y_(){return ua().memoizedState}function L6(l,u,m){var w=bi(l);if(m={lane:w,action:m,hasEagerState:!1,eagerState:null,next:null},X_(l))Q_(u,m);else if(m=A_(l,u,m,w),m!==null){var C=br();Ia(m,l,w,C),J_(m,u,w)}}function F6(l,u,m){var w=bi(l),C={lane:w,action:m,hasEagerState:!1,eagerState:null,next:null};if(X_(l))Q_(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,Pa(Y,I)){var te=u.interleaved;te===null?(C.next=C,Kg(u)):(C.next=te.next,te.next=C),u.interleaved=C;return}}catch{}m=A_(l,u,C,w),m!==null&&(C=br(),Ia(m,l,w,C),J_(m,u,w))}}function X_(l){var u=l.alternate;return l===bn||u!==null&&u===bn}function Q_(l,u){xu=rp=!0;var m=l.pending;m===null?u.next=u:(u.next=m.next,m.next=u),l.pending=u}function J_(l,u,m){if((m&4194240)!==0){var w=u.lanes;w&=l.pendingLanes,m|=w,u.lanes=m,lg(l,m)}}var ip={readContext:ca,useCallback:pr,useContext:pr,useEffect:pr,useImperativeHandle:pr,useInsertionEffect:pr,useLayoutEffect:pr,useMemo:pr,useReducer:pr,useRef:pr,useState:pr,useDebugValue:pr,useDeferredValue:pr,useTransition:pr,useMutableSource:pr,useSyncExternalStore:pr,useId:pr,unstable_isNewReconciler:!1},B6={readContext:ca,useCallback:function(l,u){return as().memoizedState=[l,u===void 0?null:u],l},useContext:ca,useEffect:z_,useImperativeHandle:function(l,u,m){return m=m!=null?m.concat([l]):null,ap(4194308,4,W_.bind(null,u,l),m)},useLayoutEffect:function(l,u){return ap(4194308,4,l,u)},useInsertionEffect:function(l,u){return ap(4,2,l,u)},useMemo:function(l,u){var m=as();return u=u===void 0?null:u,l=l(),m.memoizedState=[l,u],l},useReducer:function(l,u,m){var w=as();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=L6.bind(null,bn,l),[w.memoizedState,l]},useRef:function(l){var u=as();return l={current:l},u.memoizedState=l},useState:F_,useDebugValue:iy,useDeferredValue:function(l){return as().memoizedState=l},useTransition:function(){var l=F_(!1),u=l[0];return l=D6.bind(null,l[1]),as().memoizedState=l,[u,l]},useMutableSource:function(){},useSyncExternalStore:function(l,u,m){var w=bn,C=as();if(hn){if(m===void 0)throw Error(n(407));m=m()}else{if(m=u(),Jn===null)throw Error(n(349));(no&30)!==0||I_(w,u,m)}C.memoizedState=m;var E={value:m,getSnapshot:u};return C.queue=E,z_($_.bind(null,w,E,l),[l]),w.flags|=2048,ju(9,M_.bind(null,w,E,m,u),void 0,null),m},useId:function(){var l=as(),u=Jn.identifierPrefix;if(hn){var m=As,w=_s;m=(w&~(1<<32-ve(w)-1)).toString(32)+m,u=":"+u+"R"+m,m=bu++,0<m&&(u+="H"+m.toString(32)),u+=":"}else m=$6++,u=":"+u+"r"+m.toString(32)+":";return l.memoizedState=u},unstable_isNewReconciler:!1},z6={readContext:ca,useCallback:H_,useContext:ca,useEffect:sy,useImperativeHandle:V_,useInsertionEffect:U_,useLayoutEffect:q_,useMemo:K_,useReducer:ry,useRef:B_,useState:function(){return ry(wu)},useDebugValue:iy,useDeferredValue:function(l){var u=ua();return G_(u,Fn.memoizedState,l)},useTransition:function(){var l=ry(wu)[0],u=ua().memoizedState;return[l,u]},useMutableSource:R_,useSyncExternalStore:T_,useId:Y_,unstable_isNewReconciler:!1},U6={readContext:ca,useCallback:H_,useContext:ca,useEffect:sy,useImperativeHandle:V_,useInsertionEffect:U_,useLayoutEffect:q_,useMemo:K_,useReducer:ay,useRef:B_,useState:function(){return ay(wu)},useDebugValue:iy,useDeferredValue:function(l){var u=ua();return Fn===null?u.memoizedState=l:G_(u,Fn.memoizedState,l)},useTransition:function(){var l=ay(wu)[0],u=ua().memoizedState;return[l,u]},useMutableSource:R_,useSyncExternalStore:T_,useId:Y_,unstable_isNewReconciler:!1};function ka(l,u){if(l&&l.defaultProps){u=X({},u),l=l.defaultProps;for(var m in l)u[m]===void 0&&(u[m]=l[m]);return u}return u}function oy(l,u,m,w){u=l.memoizedState,m=m(w,u),m=m==null?u:X({},u,m),l.memoizedState=m,l.lanes===0&&(l.updateQueue.baseState=m)}var op={isMounted:function(l){return(l=l._reactInternals)?De(l)===l:!1},enqueueSetState:function(l,u,m){l=l._reactInternals;var w=br(),C=bi(l),E=Ps(w,C);E.payload=u,m!=null&&(E.callback=m),u=vi(l,E,C),u!==null&&(Ia(u,l,C,w),Zf(u,l,C))},enqueueReplaceState:function(l,u,m){l=l._reactInternals;var w=br(),C=bi(l),E=Ps(w,C);E.tag=1,E.payload=u,m!=null&&(E.callback=m),u=vi(l,E,C),u!==null&&(Ia(u,l,C,w),Zf(u,l,C))},enqueueForceUpdate:function(l,u){l=l._reactInternals;var m=br(),w=bi(l),C=Ps(m,w);C.tag=2,u!=null&&(C.callback=u),u=vi(l,C,w),u!==null&&(Ia(u,l,w,m),Zf(u,l,w))}};function Z_(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?!lu(m,w)||!lu(C,E):!0}function eA(l,u,m){var w=!1,C=pi,E=u.contextType;return typeof E=="object"&&E!==null?E=ca(E):(C=Or(u)?Qi:fr.current,w=u.contextTypes,E=(w=w!=null)?sl(l,C):pi),u=new u(m,E),l.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=op,l.stateNode=u,u._reactInternals=l,w&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=C,l.__reactInternalMemoizedMaskedChildContext=E),u}function tA(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&&op.enqueueReplaceState(u,u.state,null)}function ly(l,u,m,w){var C=l.stateNode;C.props=m,C.state=l.memoizedState,C.refs={},Gg(l);var E=u.contextType;typeof E=="object"&&E!==null?C.context=ca(E):(E=Or(u)?Qi:fr.current,C.context=sl(l,E)),C.state=l.memoizedState,E=u.getDerivedStateFromProps,typeof E=="function"&&(oy(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&&op.enqueueReplaceState(C,C.state,null),ep(l,m,C,w),C.state=l.memoizedState),typeof C.componentDidMount=="function"&&(l.flags|=4194308)}function pl(l,u){try{var m="",w=u;do m+=K(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 cy(l,u,m){return{value:l,source:null,stack:m??null,digest:u??null}}function uy(l,u){try{console.error(u.value)}catch(m){setTimeout(function(){throw m})}}var q6=typeof WeakMap=="function"?WeakMap:Map;function nA(l,u,m){m=Ps(-1,m),m.tag=3,m.payload={element:null};var w=u.value;return m.callback=function(){hp||(hp=!0,Cy=w),uy(l,u)},m}function rA(l,u,m){m=Ps(-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(){uy(l,u)}}var E=l.stateNode;return E!==null&&typeof E.componentDidCatch=="function"&&(m.callback=function(){uy(l,u),typeof w!="function"&&(yi===null?yi=new Set([this]):yi.add(this));var I=u.stack;this.componentDidCatch(u.value,{componentStack:I!==null?I:""})}),m}function aA(l,u,m){var w=l.pingCache;if(w===null){w=l.pingCache=new q6;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=rU.bind(null,l,u,m),u.then(l,l))}function sA(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 iA(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=Ps(-1,1),u.tag=2,vi(m,u,1))),m.lanes|=1),l):(l.flags|=65536,l.lanes=C,l)}var W6=P.ReactCurrentOwner,kr=!1;function xr(l,u,m,w){u.child=l===null?__(u,null,m,w):cl(u,l.child,m,w)}function oA(l,u,m,w,C){m=m.render;var E=u.ref;return dl(u,C),w=ty(l,u,m,w,E,C),m=ny(),l!==null&&!kr?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~C,Os(l,u,C)):(hn&&m&&Lg(u),u.flags|=1,xr(l,u,w,C),u.child)}function lA(l,u,m,w,C){if(l===null){var E=m.type;return typeof E=="function"&&!Ry(E)&&E.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(u.tag=15,u.type=E,cA(l,u,E,w,C)):(l=bp(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:lu,m(I,w)&&l.ref===u.ref)return Os(l,u,C)}return u.flags|=1,l=ji(E,w),l.ref=u.ref,l.return=u,u.child=l}function cA(l,u,m,w,C){if(l!==null){var E=l.memoizedProps;if(lu(E,w)&&l.ref===u.ref)if(kr=!1,u.pendingProps=w=E,(l.lanes&C)!==0)(l.flags&131072)!==0&&(kr=!0);else return u.lanes=l.lanes,Os(l,u,C)}return dy(l,u,m,w,C)}function uA(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},rn(ml,Vr),Vr|=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,rn(ml,Vr),Vr|=l,null;u.memoizedState={baseLanes:0,cachePool:null,transitions:null},w=E!==null?E.baseLanes:m,rn(ml,Vr),Vr|=w}else E!==null?(w=E.baseLanes|m,u.memoizedState=null):w=m,rn(ml,Vr),Vr|=w;return xr(l,u,C,m),u.child}function dA(l,u){var m=u.ref;(l===null&&m!==null||l!==null&&l.ref!==m)&&(u.flags|=512,u.flags|=2097152)}function dy(l,u,m,w,C){var E=Or(m)?Qi:fr.current;return E=sl(u,E),dl(u,C),m=ty(l,u,m,w,E,C),w=ny(),l!==null&&!kr?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~C,Os(l,u,C)):(hn&&w&&Lg(u),u.flags|=1,xr(l,u,m,C),u.child)}function fA(l,u,m,w,C){if(Or(m)){var E=!0;Vf(u)}else E=!1;if(dl(u,C),u.stateNode===null)cp(l,u),eA(u,m,w),ly(u,m,w,C),w=!0;else if(l===null){var I=u.stateNode,Y=u.memoizedProps;I.props=Y;var te=I.context,me=m.contextType;typeof me=="object"&&me!==null?me=ca(me):(me=Or(m)?Qi:fr.current,me=sl(u,me));var Ce=m.getDerivedStateFromProps,Pe=typeof Ce=="function"||typeof I.getSnapshotBeforeUpdate=="function";Pe||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(Y!==w||te!==me)&&tA(u,I,w,me),mi=!1;var Ne=u.memoizedState;I.state=Ne,ep(u,w,I,C),te=u.memoizedState,Y!==w||Ne!==te||Pr.current||mi?(typeof Ce=="function"&&(oy(u,m,Ce,w),te=u.memoizedState),(Y=mi||Z_(u,m,Y,w,Ne,te,me))?(Pe||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=te),I.props=w,I.state=te,I.context=me,w=Y):(typeof I.componentDidMount=="function"&&(u.flags|=4194308),w=!1)}else{I=u.stateNode,E_(l,u),Y=u.memoizedProps,me=u.type===u.elementType?Y:ka(u.type,Y),I.props=me,Pe=u.pendingProps,Ne=I.context,te=m.contextType,typeof te=="object"&&te!==null?te=ca(te):(te=Or(m)?Qi:fr.current,te=sl(u,te));var Ve=m.getDerivedStateFromProps;(Ce=typeof Ve=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(Y!==Pe||Ne!==te)&&tA(u,I,w,te),mi=!1,Ne=u.memoizedState,I.state=Ne,ep(u,w,I,C);var Ze=u.memoizedState;Y!==Pe||Ne!==Ze||Pr.current||mi?(typeof Ve=="function"&&(oy(u,m,Ve,w),Ze=u.memoizedState),(me=mi||Z_(u,m,me,w,Ne,Ze,te)||!1)?(Ce||typeof I.UNSAFE_componentWillUpdate!="function"&&typeof I.componentWillUpdate!="function"||(typeof I.componentWillUpdate=="function"&&I.componentWillUpdate(w,Ze,te),typeof I.UNSAFE_componentWillUpdate=="function"&&I.UNSAFE_componentWillUpdate(w,Ze,te)),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=te,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 fy(l,u,m,w,E,C)}function fy(l,u,m,w,C,E){dA(l,u);var I=(u.flags&128)!==0;if(!w&&!I)return C&&g_(u,m,!1),Os(l,u,E);w=u.stateNode,W6.current=u;var Y=I&&typeof m.getDerivedStateFromError!="function"?null:w.render();return u.flags|=1,l!==null&&I?(u.child=cl(u,l.child,null,E),u.child=cl(u,null,Y,E)):xr(l,u,Y,E),u.memoizedState=w.state,C&&g_(u,m,!0),u.child}function pA(l){var u=l.stateNode;u.pendingContext?m_(l,u.pendingContext,u.pendingContext!==u.context):u.context&&m_(l,u.context,!1),Yg(l,u.containerInfo)}function hA(l,u,m,w,C){return ll(),Ug(C),u.flags|=256,xr(l,u,m,w),u.child}var py={dehydrated:null,treeContext:null,retryLane:0};function hy(l){return{baseLanes:l,cachePool:null,transitions:null}}function mA(l,u,m){var w=u.pendingProps,C=xn.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),rn(xn,C&1),l===null)return zg(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=wp(I,w,0,null),l=oo(l,w,m,null),E.return=u,l.return=u,E.sibling=l,u.child=E,u.child.memoizedState=hy(m),u.memoizedState=py,l):my(u,I));if(C=l.memoizedState,C!==null&&(Y=C.dehydrated,Y!==null))return V6(l,u,I,w,Y,C,m);if(E){E=w.fallback,I=u.mode,C=l.child,Y=C.sibling;var te={mode:"hidden",children:w.children};return(I&1)===0&&u.child!==C?(w=u.child,w.childLanes=0,w.pendingProps=te,u.deletions=null):(w=ji(C,te),w.subtreeFlags=C.subtreeFlags&14680064),Y!==null?E=ji(Y,E):(E=oo(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?hy(m):{baseLanes:I.baseLanes|m,cachePool:null,transitions:I.transitions},E.memoizedState=I,E.childLanes=l.childLanes&~m,u.memoizedState=py,w}return E=l.child,l=E.sibling,w=ji(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 my(l,u){return u=wp({mode:"visible",children:u},l.mode,0,null),u.return=l,l.child=u}function lp(l,u,m,w){return w!==null&&Ug(w),cl(u,l.child,null,m),l=my(u,u.pendingProps.children),l.flags|=2,u.memoizedState=null,l}function V6(l,u,m,w,C,E,I){if(m)return u.flags&256?(u.flags&=-257,w=cy(Error(n(422))),lp(l,u,I,w)):u.memoizedState!==null?(u.child=l.child,u.flags|=128,null):(E=w.fallback,C=u.mode,w=wp({mode:"visible",children:w.children},C,0,null),E=oo(E,C,I,null),E.flags|=2,w.return=u,E.return=u,w.sibling=E,u.child=w,(u.mode&1)!==0&&cl(u,l.child,null,I),u.child.memoizedState=hy(I),u.memoizedState=py,E);if((u.mode&1)===0)return lp(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=cy(E,w,void 0),lp(l,u,I,w)}if(Y=(I&l.childLanes)!==0,kr||Y){if(w=Jn,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,Es(l,C),Ia(w,l,C,-1))}return ky(),w=cy(Error(n(421))),lp(l,u,I,w)}return C.data==="$?"?(u.flags|=128,u.child=l.child,u=aU.bind(null,l),C._reactRetry=u,null):(l=E.treeContext,Wr=di(C.nextSibling),qr=u,hn=!0,Oa=null,l!==null&&(oa[la++]=_s,oa[la++]=As,oa[la++]=Ji,_s=l.id,As=l.overflow,Ji=u),u=my(u,w.children),u.flags|=4096,u)}function vA(l,u,m){l.lanes|=u;var w=l.alternate;w!==null&&(w.lanes|=u),Hg(l.return,u,m)}function vy(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 gA(l,u,m){var w=u.pendingProps,C=w.revealOrder,E=w.tail;if(xr(l,u,w.children,m),w=xn.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&&vA(l,m,u);else if(l.tag===19)vA(l,m,u);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===u)break e;for(;l.sibling===null;){if(l.return===null||l.return===u)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}w&=1}if(rn(xn,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&&tp(l)===null&&(C=m),m=m.sibling;m=C,m===null?(C=u.child,u.child=null):(C=m.sibling,m.sibling=null),vy(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&&tp(l)===null){u.child=C;break}l=C.sibling,C.sibling=m,m=C,C=l}vy(u,!0,m,null,E);break;case"together":vy(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function cp(l,u){(u.mode&1)===0&&l!==null&&(l.alternate=null,u.alternate=null,u.flags|=2)}function Os(l,u,m){if(l!==null&&(u.dependencies=l.dependencies),ro|=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=ji(l,l.pendingProps),u.child=m,m.return=u;l.sibling!==null;)l=l.sibling,m=m.sibling=ji(l,l.pendingProps),m.return=u;m.sibling=null}return u.child}function H6(l,u,m){switch(u.tag){case 3:pA(u),ll();break;case 5:k_(u);break;case 1:Or(u.type)&&Vf(u);break;case 4:Yg(u,u.stateNode.containerInfo);break;case 10:var w=u.type._context,C=u.memoizedProps.value;rn(Qf,w._currentValue),w._currentValue=C;break;case 13:if(w=u.memoizedState,w!==null)return w.dehydrated!==null?(rn(xn,xn.current&1),u.flags|=128,null):(m&u.child.childLanes)!==0?mA(l,u,m):(rn(xn,xn.current&1),l=Os(l,u,m),l!==null?l.sibling:null);rn(xn,xn.current&1);break;case 19:if(w=(m&u.childLanes)!==0,(l.flags&128)!==0){if(w)return gA(l,u,m);u.flags|=128}if(C=u.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),rn(xn,xn.current),w)break;return null;case 22:case 23:return u.lanes=0,uA(l,u,m)}return Os(l,u,m)}var yA,gy,xA,bA;yA=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}},gy=function(){},xA=function(l,u,m,w){var C=l.memoizedProps;if(C!==w){l=u.stateNode,to(rs.current);var E=null;switch(m){case"input":C=Ae(l,C),w=Ae(l,w),E=[];break;case"select":C=X({},C,{value:void 0}),w=X({},w,{value:void 0}),E=[];break;case"textarea":C=lt(l,C),w=lt(l,w),E=[];break;default:typeof C.onClick!="function"&&typeof w.onClick=="function"&&(l.onclick=Uf)}Ln(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 te=w[me];if(Y=C?.[me],w.hasOwnProperty(me)&&te!==Y&&(te!=null||Y!=null))if(me==="style")if(Y){for(I in Y)!Y.hasOwnProperty(I)||te&&te.hasOwnProperty(I)||(m||(m={}),m[I]="");for(I in te)te.hasOwnProperty(I)&&Y[I]!==te[I]&&(m||(m={}),m[I]=te[I])}else m||(E||(E=[]),E.push(me,m)),m=te;else me==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,Y=Y?Y.__html:void 0,te!=null&&Y!==te&&(E=E||[]).push(me,te)):me==="children"?typeof te!="string"&&typeof te!="number"||(E=E||[]).push(me,""+te):me!=="suppressContentEditableWarning"&&me!=="suppressHydrationWarning"&&(a.hasOwnProperty(me)?(te!=null&&me==="onScroll"&&un("scroll",l),E||Y===te||(E=[])):(E=E||[]).push(me,te))}m&&(E=E||[]).push("style",m);var me=E;(u.updateQueue=me)&&(u.flags|=4)}},bA=function(l,u,m,w){m!==w&&(u.flags|=4)};function Su(l,u){if(!hn)switch(l.tailMode){case"hidden":u=l.tail;for(var m=null;u!==null;)u.alternate!==null&&(m=u),u=u.sibling;m===null?l.tail=null:m.sibling=null;break;case"collapsed":m=l.tail;for(var w=null;m!==null;)m.alternate!==null&&(w=m),m=m.sibling;w===null?u||l.tail===null?l.tail=null:l.tail.sibling=null:w.sibling=null}}function hr(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 K6(l,u,m){var w=u.pendingProps;switch(Fg(u),u.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return hr(u),null;case 1:return Or(u.type)&&Wf(),hr(u),null;case 3:return w=u.stateNode,fl(),dn(Pr),dn(fr),Jg(),w.pendingContext&&(w.context=w.pendingContext,w.pendingContext=null),(l===null||l.child===null)&&(Yf(u)?u.flags|=4:l===null||l.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Oa!==null&&(Ey(Oa),Oa=null))),gy(l,u),hr(u),null;case 5:Xg(u);var C=to(yu.current);if(m=u.type,l!==null&&u.stateNode!=null)xA(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 hr(u),null}if(l=to(rs.current),Yf(u)){w=u.stateNode,m=u.type;var E=u.memoizedProps;switch(w[ns]=u,w[pu]=E,l=(u.mode&1)!==0,m){case"dialog":un("cancel",w),un("close",w);break;case"iframe":case"object":case"embed":un("load",w);break;case"video":case"audio":for(C=0;C<uu.length;C++)un(uu[C],w);break;case"source":un("error",w);break;case"img":case"image":case"link":un("error",w),un("load",w);break;case"details":un("toggle",w);break;case"input":Ye(w,E),un("invalid",w);break;case"select":w._wrapperState={wasMultiple:!!E.multiple},un("invalid",w);break;case"textarea":Rt(w,E),un("invalid",w)}Ln(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&&zf(w.textContent,Y,l),C=["children",Y]):typeof Y=="number"&&w.textContent!==""+Y&&(E.suppressHydrationWarning!==!0&&zf(w.textContent,Y,l),C=["children",""+Y]):a.hasOwnProperty(I)&&Y!=null&&I==="onScroll"&&un("scroll",w)}switch(m){case"input":Se(w),Be(w,E,!0);break;case"textarea":Se(w),Z(w);break;case"select":case"option":break;default:typeof E.onClick=="function"&&(w.onclick=Uf)}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=je(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[ns]=u,l[pu]=w,yA(l,u,!1,!1),u.stateNode=l;e:{switch(I=ur(m,w),m){case"dialog":un("cancel",l),un("close",l),C=w;break;case"iframe":case"object":case"embed":un("load",l),C=w;break;case"video":case"audio":for(C=0;C<uu.length;C++)un(uu[C],l);C=w;break;case"source":un("error",l),C=w;break;case"img":case"image":case"link":un("error",l),un("load",l),C=w;break;case"details":un("toggle",l),C=w;break;case"input":Ye(l,w),C=Ae(l,w),un("invalid",l);break;case"option":C=w;break;case"select":l._wrapperState={wasMultiple:!!w.multiple},C=X({},w,{value:void 0}),un("invalid",l);break;case"textarea":Rt(l,w),C=lt(l,w),un("invalid",l);break;default:C=w}Ln(m,C),Y=C;for(E in Y)if(Y.hasOwnProperty(E)){var te=Y[E];E==="style"?lr(l,te):E==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,te!=null&&Le(l,te)):E==="children"?typeof te=="string"?(m!=="textarea"||te!=="")&&Xe(l,te):typeof te=="number"&&Xe(l,""+te):E!=="suppressContentEditableWarning"&&E!=="suppressHydrationWarning"&&E!=="autoFocus"&&(a.hasOwnProperty(E)?te!=null&&E==="onScroll"&&un("scroll",l):te!=null&&_(l,E,te,I))}switch(m){case"input":Se(l),Be(l,w,!1);break;case"textarea":Se(l),Z(l);break;case"option":w.value!=null&&l.setAttribute("value",""+fe(w.value));break;case"select":l.multiple=!!w.multiple,E=w.value,E!=null?Je(l,!!w.multiple,E,!1):w.defaultValue!=null&&Je(l,!!w.multiple,w.defaultValue,!0);break;default:typeof C.onClick=="function"&&(l.onclick=Uf)}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 hr(u),null;case 6:if(l&&u.stateNode!=null)bA(l,u,l.memoizedProps,w);else{if(typeof w!="string"&&u.stateNode===null)throw Error(n(166));if(m=to(yu.current),to(rs.current),Yf(u)){if(w=u.stateNode,m=u.memoizedProps,w[ns]=u,(E=w.nodeValue!==m)&&(l=qr,l!==null))switch(l.tag){case 3:zf(w.nodeValue,m,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&zf(w.nodeValue,m,(l.mode&1)!==0)}E&&(u.flags|=4)}else w=(m.nodeType===9?m:m.ownerDocument).createTextNode(w),w[ns]=u,u.stateNode=w}return hr(u),null;case 13:if(dn(xn),w=u.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(hn&&Wr!==null&&(u.mode&1)!==0&&(u.flags&128)===0)S_(),ll(),u.flags|=98560,E=!1;else if(E=Yf(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[ns]=u}else ll(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;hr(u),E=!1}else Oa!==null&&(Ey(Oa),Oa=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||(xn.current&1)!==0?Bn===0&&(Bn=3):ky())),u.updateQueue!==null&&(u.flags|=4),hr(u),null);case 4:return fl(),gy(l,u),l===null&&du(u.stateNode.containerInfo),hr(u),null;case 10:return Vg(u.type._context),hr(u),null;case 17:return Or(u.type)&&Wf(),hr(u),null;case 19:if(dn(xn),E=u.memoizedState,E===null)return hr(u),null;if(w=(u.flags&128)!==0,I=E.rendering,I===null)if(w)Su(E,!1);else{if(Bn!==0||l!==null&&(l.flags&128)!==0)for(l=u.child;l!==null;){if(I=tp(l),I!==null){for(u.flags|=128,Su(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 rn(xn,xn.current&1|2),u.child}l=l.sibling}E.tail!==null&&nn()>vl&&(u.flags|=128,w=!0,Su(E,!1),u.lanes=4194304)}else{if(!w)if(l=tp(I),l!==null){if(u.flags|=128,w=!0,m=l.updateQueue,m!==null&&(u.updateQueue=m,u.flags|=4),Su(E,!0),E.tail===null&&E.tailMode==="hidden"&&!I.alternate&&!hn)return hr(u),null}else 2*nn()-E.renderingStartTime>vl&&m!==1073741824&&(u.flags|=128,w=!0,Su(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=nn(),u.sibling=null,m=xn.current,rn(xn,w?m&1|2:m&1),u):(hr(u),null);case 22:case 23:return Oy(),w=u.memoizedState!==null,l!==null&&l.memoizedState!==null!==w&&(u.flags|=8192),w&&(u.mode&1)!==0?(Vr&1073741824)!==0&&(hr(u),u.subtreeFlags&6&&(u.flags|=8192)):hr(u),null;case 24:return null;case 25:return null}throw Error(n(156,u.tag))}function G6(l,u){switch(Fg(u),u.tag){case 1:return Or(u.type)&&Wf(),l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 3:return fl(),dn(Pr),dn(fr),Jg(),l=u.flags,(l&65536)!==0&&(l&128)===0?(u.flags=l&-65537|128,u):null;case 5:return Xg(u),null;case 13:if(dn(xn),l=u.memoizedState,l!==null&&l.dehydrated!==null){if(u.alternate===null)throw Error(n(340));ll()}return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 19:return dn(xn),null;case 4:return fl(),null;case 10:return Vg(u.type._context),null;case 22:case 23:return Oy(),null;case 24:return null;default:return null}}var up=!1,mr=!1,Y6=typeof WeakSet=="function"?WeakSet:Set,Ke=null;function hl(l,u){var m=l.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(w){En(l,u,w)}else m.current=null}function yy(l,u,m){try{m()}catch(w){En(l,u,w)}}var wA=!1;function X6(l,u){if(Og=Of,l=ZC(),jg(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,te=-1,me=0,Ce=0,Pe=l,Ne=null;t:for(;;){for(var Ve;Pe!==m||C!==0&&Pe.nodeType!==3||(Y=I+C),Pe!==E||w!==0&&Pe.nodeType!==3||(te=I+w),Pe.nodeType===3&&(I+=Pe.nodeValue.length),(Ve=Pe.firstChild)!==null;)Ne=Pe,Pe=Ve;for(;;){if(Pe===l)break t;if(Ne===m&&++me===C&&(Y=I),Ne===E&&++Ce===w&&(te=I),(Ve=Pe.nextSibling)!==null)break;Pe=Ne,Ne=Pe.parentNode}Pe=Ve}m=Y===-1||te===-1?null:{start:Y,end:te}}else m=null}m=m||{start:0,end:0}}else m=null;for(kg={focusedElem:l,selectionRange:m},Of=!1,Ke=u;Ke!==null;)if(u=Ke,l=u.child,(u.subtreeFlags&1028)!==0&&l!==null)l.return=u,Ke=l;else for(;Ke!==null;){u=Ke;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,Rn=Ze.memoizedState,de=u.stateNode,re=de.getSnapshotBeforeUpdate(u.elementType===u.type?et:ka(u.type,et),Rn);de.__reactInternalSnapshotBeforeUpdate=re}break;case 3:var pe=u.stateNode.containerInfo;pe.nodeType===1?pe.textContent="":pe.nodeType===9&&pe.documentElement&&pe.removeChild(pe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Ie){En(u,u.return,Ie)}if(l=u.sibling,l!==null){l.return=u.return,Ke=l;break}Ke=u.return}return Ze=wA,wA=!1,Ze}function Nu(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&&yy(u,m,E)}C=C.next}while(C!==w)}}function dp(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 xy(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 jA(l){var u=l.alternate;u!==null&&(l.alternate=null,jA(u)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(u=l.stateNode,u!==null&&(delete u[ns],delete u[pu],delete u[Mg],delete u[R6],delete u[T6])),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 SA(l){return l.tag===5||l.tag===3||l.tag===4}function NA(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||SA(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 by(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=Uf));else if(w!==4&&(l=l.child,l!==null))for(by(l,u,m),l=l.sibling;l!==null;)by(l,u,m),l=l.sibling}function wy(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(wy(l,u,m),l=l.sibling;l!==null;)wy(l,u,m),l=l.sibling}var rr=null,Ra=!1;function gi(l,u,m){for(m=m.child;m!==null;)CA(l,u,m),m=m.sibling}function CA(l,u,m){if(ia&&typeof ia.onCommitFiberUnmount=="function")try{ia.onCommitFiberUnmount(Go,m)}catch{}switch(m.tag){case 5:mr||hl(m,u);case 6:var w=rr,C=Ra;rr=null,gi(l,u,m),rr=w,Ra=C,rr!==null&&(Ra?(l=rr,m=m.stateNode,l.nodeType===8?l.parentNode.removeChild(m):l.removeChild(m)):rr.removeChild(m.stateNode));break;case 18:rr!==null&&(Ra?(l=rr,m=m.stateNode,l.nodeType===8?Ig(l.parentNode,m):l.nodeType===1&&Ig(l,m),nu(l)):Ig(rr,m.stateNode));break;case 4:w=rr,C=Ra,rr=m.stateNode.containerInfo,Ra=!0,gi(l,u,m),rr=w,Ra=C;break;case 0:case 11:case 14:case 15:if(!mr&&(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)&&yy(m,u,I),C=C.next}while(C!==w)}gi(l,u,m);break;case 1:if(!mr&&(hl(m,u),w=m.stateNode,typeof w.componentWillUnmount=="function"))try{w.props=m.memoizedProps,w.state=m.memoizedState,w.componentWillUnmount()}catch(Y){En(m,u,Y)}gi(l,u,m);break;case 21:gi(l,u,m);break;case 22:m.mode&1?(mr=(w=mr)||m.memoizedState!==null,gi(l,u,m),mr=w):gi(l,u,m);break;default:gi(l,u,m)}}function _A(l){var u=l.updateQueue;if(u!==null){l.updateQueue=null;var m=l.stateNode;m===null&&(m=l.stateNode=new Y6),u.forEach(function(w){var C=sU.bind(null,l,w);m.has(w)||(m.add(w),w.then(C,C))})}}function Ta(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:rr=Y.stateNode,Ra=!1;break e;case 3:rr=Y.stateNode.containerInfo,Ra=!0;break e;case 4:rr=Y.stateNode.containerInfo,Ra=!0;break e}Y=Y.return}if(rr===null)throw Error(n(160));CA(E,I,C),rr=null,Ra=!1;var te=C.alternate;te!==null&&(te.return=null),C.return=null}catch(me){En(C,u,me)}}if(u.subtreeFlags&12854)for(u=u.child;u!==null;)AA(u,l),u=u.sibling}function AA(l,u){var m=l.alternate,w=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(Ta(u,l),ss(l),w&4){try{Nu(3,l,l.return),dp(3,l)}catch(et){En(l,l.return,et)}try{Nu(5,l,l.return)}catch(et){En(l,l.return,et)}}break;case 1:Ta(u,l),ss(l),w&512&&m!==null&&hl(m,m.return);break;case 5:if(Ta(u,l),ss(l),w&512&&m!==null&&hl(m,m.return),l.flags&32){var C=l.stateNode;try{Xe(C,"")}catch(et){En(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,te=l.updateQueue;if(l.updateQueue=null,te!==null)try{Y==="input"&&E.type==="radio"&&E.name!=null&&ge(C,E),ur(Y,I);var me=ur(Y,E);for(I=0;I<te.length;I+=2){var Ce=te[I],Pe=te[I+1];Ce==="style"?lr(C,Pe):Ce==="dangerouslySetInnerHTML"?Le(C,Pe):Ce==="children"?Xe(C,Pe):_(C,Ce,Pe,me)}switch(Y){case"input":Oe(C,E);break;case"textarea":qt(C,E);break;case"select":var Ne=C._wrapperState.wasMultiple;C._wrapperState.wasMultiple=!!E.multiple;var Ve=E.value;Ve!=null?Je(C,!!E.multiple,Ve,!1):Ne!==!!E.multiple&&(E.defaultValue!=null?Je(C,!!E.multiple,E.defaultValue,!0):Je(C,!!E.multiple,E.multiple?[]:"",!1))}C[pu]=E}catch(et){En(l,l.return,et)}}break;case 6:if(Ta(u,l),ss(l),w&4){if(l.stateNode===null)throw Error(n(162));C=l.stateNode,E=l.memoizedProps;try{C.nodeValue=E}catch(et){En(l,l.return,et)}}break;case 3:if(Ta(u,l),ss(l),w&4&&m!==null&&m.memoizedState.isDehydrated)try{nu(u.containerInfo)}catch(et){En(l,l.return,et)}break;case 4:Ta(u,l),ss(l);break;case 13:Ta(u,l),ss(l),C=l.child,C.flags&8192&&(E=C.memoizedState!==null,C.stateNode.isHidden=E,!E||C.alternate!==null&&C.alternate.memoizedState!==null||(Ny=nn())),w&4&&_A(l);break;case 22:if(Ce=m!==null&&m.memoizedState!==null,l.mode&1?(mr=(me=mr)||Ce,Ta(u,l),mr=me):Ta(u,l),ss(l),w&8192){if(me=l.memoizedState!==null,(l.stateNode.isHidden=me)&&!Ce&&(l.mode&1)!==0)for(Ke=l,Ce=l.child;Ce!==null;){for(Pe=Ke=Ce;Ke!==null;){switch(Ne=Ke,Ve=Ne.child,Ne.tag){case 0:case 11:case 14:case 15:Nu(4,Ne,Ne.return);break;case 1:hl(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){En(w,m,et)}}break;case 5:hl(Ne,Ne.return);break;case 22:if(Ne.memoizedState!==null){OA(Pe);continue}}Ve!==null?(Ve.return=Ne,Ke=Ve):OA(Pe)}Ce=Ce.sibling}e:for(Ce=null,Pe=l;;){if(Pe.tag===5){if(Ce===null){Ce=Pe;try{C=Pe.stateNode,me?(E=C.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none"):(Y=Pe.stateNode,te=Pe.memoizedProps.style,I=te!=null&&te.hasOwnProperty("display")?te.display:null,Y.style.display=Sn("display",I))}catch(et){En(l,l.return,et)}}}else if(Pe.tag===6){if(Ce===null)try{Pe.stateNode.nodeValue=me?"":Pe.memoizedProps}catch(et){En(l,l.return,et)}}else if((Pe.tag!==22&&Pe.tag!==23||Pe.memoizedState===null||Pe===l)&&Pe.child!==null){Pe.child.return=Pe,Pe=Pe.child;continue}if(Pe===l)break e;for(;Pe.sibling===null;){if(Pe.return===null||Pe.return===l)break e;Ce===Pe&&(Ce=null),Pe=Pe.return}Ce===Pe&&(Ce=null),Pe.sibling.return=Pe.return,Pe=Pe.sibling}}break;case 19:Ta(u,l),ss(l),w&4&&_A(l);break;case 21:break;default:Ta(u,l),ss(l)}}function ss(l){var u=l.flags;if(u&2){try{e:{for(var m=l.return;m!==null;){if(SA(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&&(Xe(C,""),w.flags&=-33);var E=NA(l);wy(l,E,C);break;case 3:case 4:var I=w.stateNode.containerInfo,Y=NA(l);by(l,Y,I);break;default:throw Error(n(161))}}catch(te){En(l,l.return,te)}l.flags&=-3}u&4096&&(l.flags&=-4097)}function Q6(l,u,m){Ke=l,EA(l)}function EA(l,u,m){for(var w=(l.mode&1)!==0;Ke!==null;){var C=Ke,E=C.child;if(C.tag===22&&w){var I=C.memoizedState!==null||up;if(!I){var Y=C.alternate,te=Y!==null&&Y.memoizedState!==null||mr;Y=up;var me=mr;if(up=I,(mr=te)&&!me)for(Ke=C;Ke!==null;)I=Ke,te=I.child,I.tag===22&&I.memoizedState!==null?kA(C):te!==null?(te.return=I,Ke=te):kA(C);for(;E!==null;)Ke=E,EA(E),E=E.sibling;Ke=C,up=Y,mr=me}PA(l)}else(C.subtreeFlags&8772)!==0&&E!==null?(E.return=C,Ke=E):PA(l)}}function PA(l){for(;Ke!==null;){var u=Ke;if((u.flags&8772)!==0){var m=u.alternate;try{if((u.flags&8772)!==0)switch(u.tag){case 0:case 11:case 15:mr||dp(5,u);break;case 1:var w=u.stateNode;if(u.flags&4&&!mr)if(m===null)w.componentDidMount();else{var C=u.elementType===u.type?m.memoizedProps:ka(u.type,m.memoizedProps);w.componentDidUpdate(C,m.memoizedState,w.__reactInternalSnapshotBeforeUpdate)}var E=u.updateQueue;E!==null&&O_(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}O_(u,I,m)}break;case 5:var Y=u.stateNode;if(m===null&&u.flags&4){m=Y;var te=u.memoizedProps;switch(u.type){case"button":case"input":case"select":case"textarea":te.autoFocus&&m.focus();break;case"img":te.src&&(m.src=te.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(u.memoizedState===null){var me=u.alternate;if(me!==null){var Ce=me.memoizedState;if(Ce!==null){var Pe=Ce.dehydrated;Pe!==null&&nu(Pe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}mr||u.flags&512&&xy(u)}catch(Ne){En(u,u.return,Ne)}}if(u===l){Ke=null;break}if(m=u.sibling,m!==null){m.return=u.return,Ke=m;break}Ke=u.return}}function OA(l){for(;Ke!==null;){var u=Ke;if(u===l){Ke=null;break}var m=u.sibling;if(m!==null){m.return=u.return,Ke=m;break}Ke=u.return}}function kA(l){for(;Ke!==null;){var u=Ke;try{switch(u.tag){case 0:case 11:case 15:var m=u.return;try{dp(4,u)}catch(te){En(u,m,te)}break;case 1:var w=u.stateNode;if(typeof w.componentDidMount=="function"){var C=u.return;try{w.componentDidMount()}catch(te){En(u,C,te)}}var E=u.return;try{xy(u)}catch(te){En(u,E,te)}break;case 5:var I=u.return;try{xy(u)}catch(te){En(u,I,te)}}}catch(te){En(u,u.return,te)}if(u===l){Ke=null;break}var Y=u.sibling;if(Y!==null){Y.return=u.return,Ke=Y;break}Ke=u.return}}var J6=Math.ceil,fp=P.ReactCurrentDispatcher,jy=P.ReactCurrentOwner,da=P.ReactCurrentBatchConfig,It=0,Jn=null,Mn=null,ar=0,Vr=0,ml=fi(0),Bn=0,Cu=null,ro=0,pp=0,Sy=0,_u=null,Rr=null,Ny=0,vl=1/0,ks=null,hp=!1,Cy=null,yi=null,mp=!1,xi=null,vp=0,Au=0,_y=null,gp=-1,yp=0;function br(){return(It&6)!==0?nn():gp!==-1?gp:gp=nn()}function bi(l){return(l.mode&1)===0?1:(It&2)!==0&&ar!==0?ar&-ar:M6.transition!==null?(yp===0&&(yp=Yo()),yp):(l=Wt,l!==0||(l=window.event,l=l===void 0?16:TC(l.type)),l)}function Ia(l,u,m,w){if(50<Au)throw Au=0,_y=null,Error(n(185));Qc(l,m,w),((It&2)===0||l!==Jn)&&(l===Jn&&((It&2)===0&&(pp|=m),Bn===4&&wi(l,ar)),Tr(l,w),m===1&&It===0&&(u.mode&1)===0&&(vl=nn()+500,Hf&&hi()))}function Tr(l,u){var m=l.callbackNode;Af(l,u);var w=Xt(l,l===Jn?ar:0);if(w===0)m!==null&&_n(m),l.callbackNode=null,l.callbackPriority=0;else if(u=w&-w,l.callbackPriority!==u){if(m!=null&&_n(m),u===1)l.tag===0?I6(TA.bind(null,l)):y_(TA.bind(null,l)),O6(function(){(It&6)===0&&hi()}),m=null;else{switch(CC(w)){case 1:m=Yc;break;case 4:m=Cf;break;case 16:m=Yi;break;case 536870912:m=_f;break;default:m=Yi}m=zA(m,RA.bind(null,l))}l.callbackPriority=u,l.callbackNode=m}}function RA(l,u){if(gp=-1,yp=0,(It&6)!==0)throw Error(n(327));var m=l.callbackNode;if(gl()&&l.callbackNode!==m)return null;var w=Xt(l,l===Jn?ar:0);if(w===0)return null;if((w&30)!==0||(w&l.expiredLanes)!==0||u)u=xp(l,w);else{u=w;var C=It;It|=2;var E=MA();(Jn!==l||ar!==u)&&(ks=null,vl=nn()+500,so(l,u));do try{tU();break}catch(Y){IA(l,Y)}while(!0);Wg(),fp.current=E,It=C,Mn!==null?u=0:(Jn=null,ar=0,u=Bn)}if(u!==0){if(u===2&&(C=Xc(l),C!==0&&(w=C,u=Ay(l,C))),u===1)throw m=Cu,so(l,0),wi(l,w),Tr(l,nn()),m;if(u===6)wi(l,w);else{if(C=l.current.alternate,(w&30)===0&&!Z6(C)&&(u=xp(l,w),u===2&&(E=Xc(l),E!==0&&(w=E,u=Ay(l,E))),u===1))throw m=Cu,so(l,0),wi(l,w),Tr(l,nn()),m;switch(l.finishedWork=C,l.finishedLanes=w,u){case 0:case 1:throw Error(n(345));case 2:io(l,Rr,ks);break;case 3:if(wi(l,w),(w&130023424)===w&&(u=Ny+500-nn(),10<u)){if(Xt(l,0)!==0)break;if(C=l.suspendedLanes,(C&w)!==w){br(),l.pingedLanes|=l.suspendedLanes&C;break}l.timeoutHandle=Tg(io.bind(null,l,Rr,ks),u);break}io(l,Rr,ks);break;case 4:if(wi(l,w),(w&4194240)===w)break;for(u=l.eventTimes,C=-1;0<w;){var I=31-ve(w);E=1<<I,I=u[I],I>C&&(C=I),w&=~E}if(w=C,w=nn()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*J6(w/1960))-w,10<w){l.timeoutHandle=Tg(io.bind(null,l,Rr,ks),w);break}io(l,Rr,ks);break;case 5:io(l,Rr,ks);break;default:throw Error(n(329))}}}return Tr(l,nn()),l.callbackNode===m?RA.bind(null,l):null}function Ay(l,u){var m=_u;return l.current.memoizedState.isDehydrated&&(so(l,u).flags|=256),l=xp(l,u),l!==2&&(u=Rr,Rr=m,u!==null&&Ey(u)),l}function Ey(l){Rr===null?Rr=l:Rr.push.apply(Rr,l)}function Z6(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(!Pa(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 wi(l,u){for(u&=~Sy,u&=~pp,l.suspendedLanes|=u,l.pingedLanes&=~u,l=l.expirationTimes;0<u;){var m=31-ve(u),w=1<<m;l[m]=-1,u&=~w}}function TA(l){if((It&6)!==0)throw Error(n(327));gl();var u=Xt(l,0);if((u&1)===0)return Tr(l,nn()),null;var m=xp(l,u);if(l.tag!==0&&m===2){var w=Xc(l);w!==0&&(u=w,m=Ay(l,w))}if(m===1)throw m=Cu,so(l,0),wi(l,u),Tr(l,nn()),m;if(m===6)throw Error(n(345));return l.finishedWork=l.current.alternate,l.finishedLanes=u,io(l,Rr,ks),Tr(l,nn()),null}function Py(l,u){var m=It;It|=1;try{return l(u)}finally{It=m,It===0&&(vl=nn()+500,Hf&&hi())}}function ao(l){xi!==null&&xi.tag===0&&(It&6)===0&&gl();var u=It;It|=1;var m=da.transition,w=Wt;try{if(da.transition=null,Wt=1,l)return l()}finally{Wt=w,da.transition=m,It=u,(It&6)===0&&hi()}}function Oy(){Vr=ml.current,dn(ml)}function so(l,u){l.finishedWork=null,l.finishedLanes=0;var m=l.timeoutHandle;if(m!==-1&&(l.timeoutHandle=-1,P6(m)),Mn!==null)for(m=Mn.return;m!==null;){var w=m;switch(Fg(w),w.tag){case 1:w=w.type.childContextTypes,w!=null&&Wf();break;case 3:fl(),dn(Pr),dn(fr),Jg();break;case 5:Xg(w);break;case 4:fl();break;case 13:dn(xn);break;case 19:dn(xn);break;case 10:Vg(w.type._context);break;case 22:case 23:Oy()}m=m.return}if(Jn=l,Mn=l=ji(l.current,null),ar=Vr=u,Bn=0,Cu=null,Sy=pp=ro=0,Rr=_u=null,eo!==null){for(u=0;u<eo.length;u++)if(m=eo[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}eo=null}return l}function IA(l,u){do{var m=Mn;try{if(Wg(),np.current=ip,rp){for(var w=bn.memoizedState;w!==null;){var C=w.queue;C!==null&&(C.pending=null),w=w.next}rp=!1}if(no=0,Qn=Fn=bn=null,xu=!1,bu=0,jy.current=null,m===null||m.return===null){Bn=1,Cu=u,Mn=null;break}e:{var E=l,I=m.return,Y=m,te=u;if(u=ar,Y.flags|=32768,te!==null&&typeof te=="object"&&typeof te.then=="function"){var me=te,Ce=Y,Pe=Ce.tag;if((Ce.mode&1)===0&&(Pe===0||Pe===11||Pe===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 Ve=sA(I);if(Ve!==null){Ve.flags&=-257,iA(Ve,I,Y,E,u),Ve.mode&1&&aA(E,me,u),u=Ve,te=me;var Ze=u.updateQueue;if(Ze===null){var et=new Set;et.add(te),u.updateQueue=et}else Ze.add(te);break e}else{if((u&1)===0){aA(E,me,u),ky();break e}te=Error(n(426))}}else if(hn&&Y.mode&1){var Rn=sA(I);if(Rn!==null){(Rn.flags&65536)===0&&(Rn.flags|=256),iA(Rn,I,Y,E,u),Ug(pl(te,Y));break e}}E=te=pl(te,Y),Bn!==4&&(Bn=2),_u===null?_u=[E]:_u.push(E),E=I;do{switch(E.tag){case 3:E.flags|=65536,u&=-u,E.lanes|=u;var de=nA(E,te,u);P_(E,de);break e;case 1:Y=te;var re=E.type,pe=E.stateNode;if((E.flags&128)===0&&(typeof re.getDerivedStateFromError=="function"||pe!==null&&typeof pe.componentDidCatch=="function"&&(yi===null||!yi.has(pe)))){E.flags|=65536,u&=-u,E.lanes|=u;var Ie=rA(E,Y,u);P_(E,Ie);break e}}E=E.return}while(E!==null)}DA(m)}catch(at){u=at,Mn===m&&m!==null&&(Mn=m=m.return);continue}break}while(!0)}function MA(){var l=fp.current;return fp.current=ip,l===null?ip:l}function ky(){(Bn===0||Bn===3||Bn===2)&&(Bn=4),Jn===null||(ro&268435455)===0&&(pp&268435455)===0||wi(Jn,ar)}function xp(l,u){var m=It;It|=2;var w=MA();(Jn!==l||ar!==u)&&(ks=null,so(l,u));do try{eU();break}catch(C){IA(l,C)}while(!0);if(Wg(),It=m,fp.current=w,Mn!==null)throw Error(n(261));return Jn=null,ar=0,Bn}function eU(){for(;Mn!==null;)$A(Mn)}function tU(){for(;Mn!==null&&!Tt();)$A(Mn)}function $A(l){var u=BA(l.alternate,l,Vr);l.memoizedProps=l.pendingProps,u===null?DA(l):Mn=u,jy.current=null}function DA(l){var u=l;do{var m=u.alternate;if(l=u.return,(u.flags&32768)===0){if(m=K6(m,u,Vr),m!==null){Mn=m;return}}else{if(m=G6(m,u),m!==null){m.flags&=32767,Mn=m;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{Bn=6,Mn=null;return}}if(u=u.sibling,u!==null){Mn=u;return}Mn=u=l}while(u!==null);Bn===0&&(Bn=5)}function io(l,u,m){var w=Wt,C=da.transition;try{da.transition=null,Wt=1,nU(l,u,m,w)}finally{da.transition=C,Wt=w}return null}function nU(l,u,m,w){do gl();while(xi!==null);if((It&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($z(l,E),l===Jn&&(Mn=Jn=null,ar=0),(m.subtreeFlags&2064)===0&&(m.flags&2064)===0||mp||(mp=!0,zA(Yi,function(){return gl(),null})),E=(m.flags&15990)!==0,(m.subtreeFlags&15990)!==0||E){E=da.transition,da.transition=null;var I=Wt;Wt=1;var Y=It;It|=4,jy.current=null,X6(l,m),AA(m,l),j6(kg),Of=!!Og,kg=Og=null,l.current=m,Q6(m),An(),It=Y,Wt=I,da.transition=E}else l.current=m;if(mp&&(mp=!1,xi=l,vp=C),E=l.pendingLanes,E===0&&(yi=null),V(m.stateNode),Tr(l,nn()),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(hp)throw hp=!1,l=Cy,Cy=null,l;return(vp&1)!==0&&l.tag!==0&&gl(),E=l.pendingLanes,(E&1)!==0?l===_y?Au++:(Au=0,_y=l):Au=0,hi(),null}function gl(){if(xi!==null){var l=CC(vp),u=da.transition,m=Wt;try{if(da.transition=null,Wt=16>l?16:l,xi===null)var w=!1;else{if(l=xi,xi=null,vp=0,(It&6)!==0)throw Error(n(331));var C=It;for(It|=4,Ke=l.current;Ke!==null;){var E=Ke,I=E.child;if((Ke.flags&16)!==0){var Y=E.deletions;if(Y!==null){for(var te=0;te<Y.length;te++){var me=Y[te];for(Ke=me;Ke!==null;){var Ce=Ke;switch(Ce.tag){case 0:case 11:case 15:Nu(8,Ce,E)}var Pe=Ce.child;if(Pe!==null)Pe.return=Ce,Ke=Pe;else for(;Ke!==null;){Ce=Ke;var Ne=Ce.sibling,Ve=Ce.return;if(jA(Ce),Ce===me){Ke=null;break}if(Ne!==null){Ne.return=Ve,Ke=Ne;break}Ke=Ve}}}var Ze=E.alternate;if(Ze!==null){var et=Ze.child;if(et!==null){Ze.child=null;do{var Rn=et.sibling;et.sibling=null,et=Rn}while(et!==null)}}Ke=E}}if((E.subtreeFlags&2064)!==0&&I!==null)I.return=E,Ke=I;else e:for(;Ke!==null;){if(E=Ke,(E.flags&2048)!==0)switch(E.tag){case 0:case 11:case 15:Nu(9,E,E.return)}var de=E.sibling;if(de!==null){de.return=E.return,Ke=de;break e}Ke=E.return}}var re=l.current;for(Ke=re;Ke!==null;){I=Ke;var pe=I.child;if((I.subtreeFlags&2064)!==0&&pe!==null)pe.return=I,Ke=pe;else e:for(I=re;Ke!==null;){if(Y=Ke,(Y.flags&2048)!==0)try{switch(Y.tag){case 0:case 11:case 15:dp(9,Y)}}catch(at){En(Y,Y.return,at)}if(Y===I){Ke=null;break e}var Ie=Y.sibling;if(Ie!==null){Ie.return=Y.return,Ke=Ie;break e}Ke=Y.return}}if(It=C,hi(),ia&&typeof ia.onPostCommitFiberRoot=="function")try{ia.onPostCommitFiberRoot(Go,l)}catch{}w=!0}return w}finally{Wt=m,da.transition=u}}return!1}function LA(l,u,m){u=pl(m,u),u=nA(l,u,1),l=vi(l,u,1),u=br(),l!==null&&(Qc(l,1,u),Tr(l,u))}function En(l,u,m){if(l.tag===3)LA(l,l,m);else for(;u!==null;){if(u.tag===3){LA(u,l,m);break}else if(u.tag===1){var w=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(yi===null||!yi.has(w))){l=pl(m,l),l=rA(u,l,1),u=vi(u,l,1),l=br(),u!==null&&(Qc(u,1,l),Tr(u,l));break}}u=u.return}}function rU(l,u,m){var w=l.pingCache;w!==null&&w.delete(u),u=br(),l.pingedLanes|=l.suspendedLanes&m,Jn===l&&(ar&m)===m&&(Bn===4||Bn===3&&(ar&130023424)===ar&&500>nn()-Ny?so(l,0):Sy|=m),Tr(l,u)}function FA(l,u){u===0&&((l.mode&1)===0?u=1:(u=yn,yn<<=1,(yn&130023424)===0&&(yn=4194304)));var m=br();l=Es(l,u),l!==null&&(Qc(l,u,m),Tr(l,m))}function aU(l){var u=l.memoizedState,m=0;u!==null&&(m=u.retryLane),FA(l,m)}function sU(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),FA(l,m)}var BA;BA=function(l,u,m){if(l!==null)if(l.memoizedProps!==u.pendingProps||Pr.current)kr=!0;else{if((l.lanes&m)===0&&(u.flags&128)===0)return kr=!1,H6(l,u,m);kr=(l.flags&131072)!==0}else kr=!1,hn&&(u.flags&1048576)!==0&&x_(u,Gf,u.index);switch(u.lanes=0,u.tag){case 2:var w=u.type;cp(l,u),l=u.pendingProps;var C=sl(u,fr.current);dl(u,m),C=ty(null,u,w,l,C,m);var E=ny();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,Or(w)?(E=!0,Vf(u)):E=!1,u.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,Gg(u),C.updater=op,u.stateNode=C,C._reactInternals=u,ly(u,w,l,m),u=fy(null,u,w,!0,E,m)):(u.tag=0,hn&&E&&Lg(u),xr(null,u,C,m),u=u.child),u;case 16:w=u.elementType;e:{switch(cp(l,u),l=u.pendingProps,C=w._init,w=C(w._payload),u.type=w,C=u.tag=oU(w),l=ka(w,l),C){case 0:u=dy(null,u,w,l,m);break e;case 1:u=fA(null,u,w,l,m);break e;case 11:u=oA(null,u,w,l,m);break e;case 14:u=lA(null,u,w,ka(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:ka(w,C),dy(l,u,w,C,m);case 1:return w=u.type,C=u.pendingProps,C=u.elementType===w?C:ka(w,C),fA(l,u,w,C,m);case 3:e:{if(pA(u),l===null)throw Error(n(387));w=u.pendingProps,E=u.memoizedState,C=E.element,E_(l,u),ep(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=pl(Error(n(423)),u),u=hA(l,u,w,m,C);break e}else if(w!==C){C=pl(Error(n(424)),u),u=hA(l,u,w,m,C);break e}else for(Wr=di(u.stateNode.containerInfo.firstChild),qr=u,hn=!0,Oa=null,m=__(u,null,w,m),u.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(ll(),w===C){u=Os(l,u,m);break e}xr(l,u,w,m)}u=u.child}return u;case 5:return k_(u),l===null&&zg(u),w=u.type,C=u.pendingProps,E=l!==null?l.memoizedProps:null,I=C.children,Rg(w,C)?I=null:E!==null&&Rg(w,E)&&(u.flags|=32),dA(l,u),xr(l,u,I,m),u.child;case 6:return l===null&&zg(u),null;case 13:return mA(l,u,m);case 4:return Yg(u,u.stateNode.containerInfo),w=u.pendingProps,l===null?u.child=cl(u,null,w,m):xr(l,u,w,m),u.child;case 11:return w=u.type,C=u.pendingProps,C=u.elementType===w?C:ka(w,C),oA(l,u,w,C,m);case 7:return xr(l,u,u.pendingProps,m),u.child;case 8:return xr(l,u,u.pendingProps.children,m),u.child;case 12:return xr(l,u,u.pendingProps.children,m),u.child;case 10:e:{if(w=u.type._context,C=u.pendingProps,E=u.memoizedProps,I=C.value,rn(Qf,w._currentValue),w._currentValue=I,E!==null)if(Pa(E.value,I)){if(E.children===C.children&&!Pr.current){u=Os(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 te=Y.firstContext;te!==null;){if(te.context===w){if(E.tag===1){te=Ps(-1,m&-m),te.tag=2;var me=E.updateQueue;if(me!==null){me=me.shared;var Ce=me.pending;Ce===null?te.next=te:(te.next=Ce.next,Ce.next=te),me.pending=te}}E.lanes|=m,te=E.alternate,te!==null&&(te.lanes|=m),Hg(E.return,m,u),Y.lanes|=m;break}te=te.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),Hg(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}xr(l,u,C.children,m),u=u.child}return u;case 9:return C=u.type,w=u.pendingProps.children,dl(u,m),C=ca(C),w=w(C),u.flags|=1,xr(l,u,w,m),u.child;case 14:return w=u.type,C=ka(w,u.pendingProps),C=ka(w.type,C),lA(l,u,w,C,m);case 15:return cA(l,u,u.type,u.pendingProps,m);case 17:return w=u.type,C=u.pendingProps,C=u.elementType===w?C:ka(w,C),cp(l,u),u.tag=1,Or(w)?(l=!0,Vf(u)):l=!1,dl(u,m),eA(u,w,C),ly(u,w,C,m),fy(null,u,w,!0,l,m);case 19:return gA(l,u,m);case 22:return uA(l,u,m)}throw Error(n(156,u.tag))};function zA(l,u){return We(l,u)}function iU(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 fa(l,u,m,w){return new iU(l,u,m,w)}function Ry(l){return l=l.prototype,!(!l||!l.isReactComponent)}function oU(l){if(typeof l=="function")return Ry(l)?1:0;if(l!=null){if(l=l.$$typeof,l===L)return 11;if(l===H)return 14}return 2}function ji(l,u){var m=l.alternate;return m===null?(m=fa(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 bp(l,u,m,w,C,E){var I=2;if(w=l,typeof l=="function")Ry(l)&&(I=1);else if(typeof l=="string")I=5;else e:switch(l){case k:return oo(m.children,C,E,u);case R:I=8,C|=8;break;case M:return l=fa(12,m,u,C|2),l.elementType=M,l.lanes=E,l;case G:return l=fa(13,m,u,C),l.elementType=G,l.lanes=E,l;case U:return l=fa(19,m,u,C),l.elementType=U,l.lanes=E,l;case J:return wp(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 L:I=11;break e;case H:I=14;break e;case Q:I=16,w=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return u=fa(I,m,u,C),u.elementType=l,u.type=w,u.lanes=E,u}function oo(l,u,m,w){return l=fa(7,l,w,u),l.lanes=m,l}function wp(l,u,m,w){return l=fa(22,l,w,u),l.elementType=J,l.lanes=m,l.stateNode={isHidden:!1},l}function Ty(l,u,m){return l=fa(6,l,null,u),l.lanes=m,l}function Iy(l,u,m){return u=fa(4,l.children!==null?l.children:[],l.key,u),u.lanes=m,u.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},u}function lU(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=og(0),this.expirationTimes=og(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=og(0),this.identifierPrefix=w,this.onRecoverableError=C,this.mutableSourceEagerHydrationData=null}function My(l,u,m,w,C,E,I,Y,te){return l=new lU(l,u,m,Y,te),u===1?(u=1,E===!0&&(u|=8)):u=0,E=fa(3,null,null,u),l.current=E,E.stateNode=l,E.memoizedState={element:w,isDehydrated:m,cache:null,transitions:null,pendingSuspenseBoundaries:null},Gg(E),l}function cU(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 UA(l){if(!l)return pi;l=l._reactInternals;e:{if(De(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(Or(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(Or(m))return v_(l,m,u)}return u}function qA(l,u,m,w,C,E,I,Y,te){return l=My(m,w,!0,l,C,E,I,Y,te),l.context=UA(null),m=l.current,w=br(),C=bi(m),E=Ps(w,C),E.callback=u??null,vi(m,E,C),l.current.lanes=C,Qc(l,C,w),Tr(l,w),l}function jp(l,u,m,w){var C=u.current,E=br(),I=bi(C);return m=UA(m),u.context===null?u.context=m:u.pendingContext=m,u=Ps(E,I),u.payload={element:l},w=w===void 0?null:w,w!==null&&(u.callback=w),l=vi(C,u,I),l!==null&&(Ia(l,C,I,E),Zf(l,C,I)),I}function Sp(l){return l=l.current,l.child?(l.child.tag===5,l.child.stateNode):null}function WA(l,u){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var m=l.retryLane;l.retryLane=m!==0&&m<u?m:u}}function $y(l,u){WA(l,u),(l=l.alternate)&&WA(l,u)}function uU(){return null}var VA=typeof reportError=="function"?reportError:function(l){console.error(l)};function Dy(l){this._internalRoot=l}Np.prototype.render=Dy.prototype.render=function(l){var u=this._internalRoot;if(u===null)throw Error(n(409));jp(l,u,null,null)},Np.prototype.unmount=Dy.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var u=l.containerInfo;ao(function(){jp(null,l,null,null)}),u[Ns]=null}};function Np(l){this._internalRoot=l}Np.prototype.unstable_scheduleHydration=function(l){if(l){var u=EC();l={blockedOn:null,target:l,priority:u};for(var m=0;m<li.length&&u!==0&&u<li[m].priority;m++);li.splice(m,0,l),m===0&&kC(l)}};function Ly(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function Cp(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function HA(){}function dU(l,u,m,w,C){if(C){if(typeof w=="function"){var E=w;w=function(){var me=Sp(I);E.call(me)}}var I=qA(u,w,l,0,null,!1,!1,"",HA);return l._reactRootContainer=I,l[Ns]=I.current,du(l.nodeType===8?l.parentNode:l),ao(),I}for(;C=l.lastChild;)l.removeChild(C);if(typeof w=="function"){var Y=w;w=function(){var me=Sp(te);Y.call(me)}}var te=My(l,0,!1,null,null,!1,!1,"",HA);return l._reactRootContainer=te,l[Ns]=te.current,du(l.nodeType===8?l.parentNode:l),ao(function(){jp(u,te,m,w)}),te}function _p(l,u,m,w,C){var E=m._reactRootContainer;if(E){var I=E;if(typeof C=="function"){var Y=C;C=function(){var te=Sp(I);Y.call(te)}}jp(u,I,l,C)}else I=dU(m,u,l,C,w);return Sp(I)}_C=function(l){switch(l.tag){case 3:var u=l.stateNode;if(u.current.memoizedState.isDehydrated){var m=zr(u.pendingLanes);m!==0&&(lg(u,m|1),Tr(u,nn()),(It&6)===0&&(vl=nn()+500,hi()))}break;case 13:ao(function(){var w=Es(l,1);if(w!==null){var C=br();Ia(w,l,1,C)}}),$y(l,1)}},cg=function(l){if(l.tag===13){var u=Es(l,134217728);if(u!==null){var m=br();Ia(u,l,134217728,m)}$y(l,134217728)}},AC=function(l){if(l.tag===13){var u=bi(l),m=Es(l,u);if(m!==null){var w=br();Ia(m,l,u,w)}$y(l,u)}},EC=function(){return Wt},PC=function(l,u){var m=Wt;try{return Wt=l,u()}finally{Wt=m}},Br=function(l,u,m){switch(u){case"input":if(Oe(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=qf(w);if(!C)throw Error(n(90));ne(w),Oe(w,C)}}}break;case"textarea":qt(l,m);break;case"select":u=m.value,u!=null&&Je(l,!!m.multiple,u,!1)}},nt=Py,xt=ao;var fU={usingClientEntryPoint:!1,Events:[hu,rl,qf,ue,Re,Py]},Eu={findFiberByHostInstance:Xi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},pU={bundleType:Eu.bundleType,version:Eu.version,rendererPackageName:Eu.rendererPackageName,rendererConfig:Eu.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=gn(l),l===null?null:l.stateNode},findFiberByHostInstance:Eu.findFiberByHostInstance||uU,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ap=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ap.isDisabled&&Ap.supportsFiber)try{Go=Ap.inject(pU),ia=Ap}catch{}}return Ir.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=fU,Ir.createPortal=function(l,u){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ly(u))throw Error(n(200));return cU(l,u,null,m)},Ir.createRoot=function(l,u){if(!Ly(l))throw Error(n(299));var m=!1,w="",C=VA;return u!=null&&(u.unstable_strictMode===!0&&(m=!0),u.identifierPrefix!==void 0&&(w=u.identifierPrefix),u.onRecoverableError!==void 0&&(C=u.onRecoverableError)),u=My(l,1,!1,null,null,m,!1,w,C),l[Ns]=u.current,du(l.nodeType===8?l.parentNode:l),new Dy(u)},Ir.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=gn(u),l=l===null?null:l.stateNode,l},Ir.flushSync=function(l){return ao(l)},Ir.hydrate=function(l,u,m){if(!Cp(u))throw Error(n(200));return _p(null,l,u,!0,m)},Ir.hydrateRoot=function(l,u,m){if(!Ly(l))throw Error(n(405));var w=m!=null&&m.hydratedSources||null,C=!1,E="",I=VA;if(m!=null&&(m.unstable_strictMode===!0&&(C=!0),m.identifierPrefix!==void 0&&(E=m.identifierPrefix),m.onRecoverableError!==void 0&&(I=m.onRecoverableError)),u=qA(u,null,l,1,m??null,C,!1,E,I),l[Ns]=u.current,du(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 Np(u)},Ir.render=function(l,u,m){if(!Cp(u))throw Error(n(200));return _p(null,l,u,!1,m)},Ir.unmountComponentAtNode=function(l){if(!Cp(l))throw Error(n(40));return l._reactRootContainer?(ao(function(){_p(null,null,l,!1,function(){l._reactRootContainer=null,l[Ns]=null})}),!0):!1},Ir.unstable_batchedUpdates=Py,Ir.unstable_renderSubtreeIntoContainer=function(l,u,m,w){if(!Cp(m))throw Error(n(200));if(l==null||l._reactInternals===void 0)throw Error(n(38));return _p(l,u,m,!1,w)},Ir.version="18.3.1-next-f1338f8080-20240426",Ir}var eE;function PM(){if(eE)return zy.exports;eE=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(),zy.exports=wU(),zy.exports}var tE;function jU(){if(tE)return Pp;tE=1;var e=PM();return Pp.createRoot=e.createRoot,Pp.hydrateRoot=e.hydrateRoot,Pp}var SU=jU(),v=SS();const q=Ht(v),Am=mU({__proto__:null,default:q},[v]),NU=1,CU=1e6;let Wy=0;function _U(){return Wy=(Wy+1)%Number.MAX_SAFE_INTEGER,Wy.toString()}const Vy=new Map,nE=e=>{if(Vy.has(e))return;const t=setTimeout(()=>{Vy.delete(e),Xu({type:"REMOVE_TOAST",toastId:e})},CU);Vy.set(e,t)},AU=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,NU)};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?nE(n):e.toasts.forEach(r=>{nE(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)}}},eh=[];let th={toasts:[]};function Xu(e){th=AU(th,e),eh.forEach(t=>{t(th)})}function _e({...e}){const t=_U(),n=a=>Xu({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>Xu({type:"DISMISS_TOAST",toastId:t});return Xu({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}}function EU(){const[e,t]=v.useState(th);return v.useEffect(()=>(eh.push(t),()=>{const n=eh.indexOf(t);n>-1&&eh.splice(n,1)}),[e]),{...e,toast:_e,dismiss:n=>Xu({type:"DISMISS_TOAST",toastId:n})}}var Ac=PM();const OM=Ht(Ac);function Ee(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),n===!1||!a.defaultPrevented)return t?.(a)}}function rE(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Cr(...e){return t=>{let n=!1;const r=e.map(a=>{const i=rE(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():rE(e[a],null)}}}}function mt(...e){return v.useCallback(Cr(...e),e)}function PU(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 or(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,OU(a,...t)]}function OU(...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 aE(e){const t=kU(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(TU);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 kU(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=MU(a),c=IU(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Cr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var RU=Symbol("radix.slottable");function TU(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===RU}function IU(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 MU(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Jd(e){const t=e+"CollectionProvider",[n,r]=or(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=aE(c),f=q.forwardRef((b,x)=>{const{scope:S,children:N}=b,_=i(c,S),P=mt(x,_.collectionRef);return s.jsx(d,{ref:P,children:N})});f.displayName=c;const h=e+"CollectionItemSlot",p="data-radix-collection-item",y=aE(h),g=q.forwardRef((b,x)=>{const{scope:S,children:N,..._}=b,P=q.useRef(null),A=mt(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 $U(e){const t=DU(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(FU);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 DU(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=zU(a),c=BU(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Cr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var LU=Symbol("radix.slottable");function FU(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===LU}function BU(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 zU(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 UU=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ze=UU.reduce((e,t)=>{const n=$U(`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 NS(e,t){e&&Ac.flushSync(()=>e.dispatchEvent(t))}function Tn(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>t.current?.(...n),[])}function qU(e,t=globalThis?.document){const n=Tn(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 WU="DismissableLayer",g1="dismissableLayer.update",VU="dismissableLayer.pointerDownOutside",HU="dismissableLayer.focusOutside",sE,kM=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$o=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:c,...d}=e,f=v.useContext(kM),[h,p]=v.useState(null),y=h?.ownerDocument??globalThis?.document,[,g]=v.useState({}),j=mt(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=GU(k=>{const R=k.target,M=[...f.branches].some(z=>z.contains(R));!P||M||(a?.(k),o?.(k),k.defaultPrevented||c?.())},y),O=YU(k=>{const R=k.target;[...f.branches].some(z=>z.contains(R))||(i?.(k),o?.(k),k.defaultPrevented||c?.())},y);return qU(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&&(sE=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),iE(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=sE)}},[h,y,n,f]),v.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),iE())},[h,f]),v.useEffect(()=>{const k=()=>g({});return document.addEventListener(g1,k),()=>document.removeEventListener(g1,k)},[]),s.jsx(ze.div,{...d,ref:j,style:{pointerEvents:_?P?"auto":"none":void 0,...e.style},onFocusCapture:Ee(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Ee(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Ee(e.onPointerDownCapture,A.onPointerDownCapture)})});$o.displayName=WU;var KU="DismissableLayerBranch",RM=v.forwardRef((e,t)=>{const n=v.useContext(kM),r=v.useRef(null),a=mt(t,r);return v.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),s.jsx(ze.div,{...e,ref:a})});RM.displayName=KU;function GU(e,t=globalThis?.document){const n=Tn(e),r=v.useRef(!1),a=v.useRef(()=>{});return v.useEffect(()=>{const i=c=>{if(c.target&&!r.current){let d=function(){TM(VU,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 YU(e,t=globalThis?.document){const n=Tn(e),r=v.useRef(!1);return v.useEffect(()=>{const a=i=>{i.target&&!r.current&&TM(HU,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 iE(){const e=new CustomEvent(g1);document.dispatchEvent(e)}function TM(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?NS(a,i):a.dispatchEvent(i)}var XU=$o,QU=RM,Hn=globalThis?.document?v.useLayoutEffect:()=>{},JU="Portal",Ec=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?OM.createPortal(s.jsx(ze.div,{...r,ref:t}),o):null});Ec.displayName=JU;function ZU(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var Kn=e=>{const{present:t,children:n}=e,r=e7(t),a=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),i=mt(r.ref,t7(a));return typeof n=="function"||r.isPresent?v.cloneElement(a,{ref:i}):null};Kn.displayName="Presence";function e7(e){const[t,n]=v.useState(),r=v.useRef(null),a=v.useRef(e),i=v.useRef("none"),o=e?"mounted":"unmounted",[c,d]=ZU(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const f=Op(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=Op(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=Op(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=Op(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 Op(e){return e?.animationName||"none"}function t7(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 n7=Am[" useInsertionEffect ".trim().toString()]||Hn;function sa({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,o]=r7({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=a7(h)?h(e):h;p!==e&&o.current?.(p)}else i(h)},[c,e,i,o]);return[d,f]}function r7({defaultProp:e,onChange:t}){const[n,r]=v.useState(e),a=v.useRef(n),i=v.useRef(t);return n7(()=>{i.current=t},[t]),v.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,r,i]}function a7(e){return typeof e=="function"}var IM=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"}),s7="VisuallyHidden",Em=v.forwardRef((e,t)=>s.jsx(ze.span,{...e,ref:t,style:{...IM,...e.style}}));Em.displayName=s7;var i7=Em,CS="ToastProvider",[_S,o7,l7]=Jd("Toast"),[MM]=or("Toast",[l7]),[c7,Pm]=MM(CS),$M=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 \`${CS}\`. Expected non-empty \`string\`.`),s.jsx(_S.Provider,{scope:t,children:s.jsx(c7,{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})})};$M.displayName=CS;var DM="ToastViewport",u7=["F8"],y1="toast.viewportPause",x1="toast.viewportResume",LM=v.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=u7,label:a="Notifications ({hotkey})",...i}=e,o=Pm(DM,n),c=o7(n),d=v.useRef(null),f=v.useRef(null),h=v.useRef(null),p=v.useRef(null),y=mt(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(y1);S.dispatchEvent(O),o.isClosePausedRef.current=!0}},_=()=>{if(o.isClosePausedRef.current){const O=new CustomEvent(x1);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,...S7(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);Hy(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(QU,{ref:d,role:"region","aria-label":a.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:j?void 0:"none"},children:[j&&s.jsx(b1,{ref:f,onFocusFromOutsideViewport:()=>{const x=b({tabbingDirection:"forwards"});Hy(x)}}),s.jsx(_S.Slot,{scope:n,children:s.jsx(ze.ol,{tabIndex:-1,...i,ref:y})}),j&&s.jsx(b1,{ref:h,onFocusFromOutsideViewport:()=>{const x=b({tabbingDirection:"backwards"});Hy(x)}})]})});LM.displayName=DM;var FM="ToastFocusProxy",b1=v.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,i=Pm(FM,n);return s.jsx(Em,{tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:o=>{const c=o.relatedTarget;!i.viewport?.contains(c)&&r()}})});b1.displayName=FM;var Zd="Toast",d7="toast.swipeStart",f7="toast.swipeMove",p7="toast.swipeCancel",h7="toast.swipeEnd",BM=v.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:i,...o}=e,[c,d]=sa({prop:r,defaultProp:a??!0,onChange:i,caller:Zd});return s.jsx(Kn,{present:n||c,children:s.jsx(g7,{open:c,...o,ref:t,onClose:()=>d(!1),onPause:Tn(e.onPause),onResume:Tn(e.onResume),onSwipeStart:Ee(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ee(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:Ee(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:Ee(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)})})})});BM.displayName=Zd;var[m7,v7]=MM(Zd,{onClose(){}}),g7=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=Pm(Zd,n),[x,S]=v.useState(null),N=mt(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=Tn(()=>{x?.contains(document.activeElement)&&b.viewport?.focus(),o()}),L=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 H=()=>{L(k.current),f?.()},Q=()=>{const J=new Date().getTime()-O.current;k.current=k.current-J,window.clearTimeout(R.current),d?.()};return U.addEventListener(y1,Q),U.addEventListener(x1,H),()=>{U.removeEventListener(y1,Q),U.removeEventListener(x1,H)}}},[b.viewport,A,d,f,L]),v.useEffect(()=>{i&&!b.isClosePausedRef.current&&L(A)},[i,A,b.isClosePausedRef,L]),v.useEffect(()=>(M(),()=>z()),[M,z]);const G=v.useMemo(()=>x?KM(x):null,[x]);return b.viewport?s.jsxs(s.Fragment,{children:[G&&s.jsx(y7,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:G}),s.jsx(m7,{scope:n,onClose:B,children:Ac.createPortal(s.jsx(_S.ItemSlot,{scope:n,children:s.jsx(XU,{asChild:!0,onEscapeKeyDown:Ee(c,()=>{b.isFocusedToastEscapeKeyDownRef.current||B(),b.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx(ze.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":b.swipeDirection,...j,ref:N,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Ee(e.onKeyDown,U=>{U.key==="Escape"&&(c?.(U.nativeEvent),U.nativeEvent.defaultPrevented||(b.isFocusedToastEscapeKeyDownRef.current=!0,B()))}),onPointerDown:Ee(e.onPointerDown,U=>{U.button===0&&(_.current={x:U.clientX,y:U.clientY})}),onPointerMove:Ee(e.onPointerMove,U=>{if(!_.current)return;const H=U.clientX-_.current.x,Q=U.clientY-_.current.y,J=!!P.current,T=["left","right"].includes(b.swipeDirection),D=["left","up"].includes(b.swipeDirection)?Math.min:Math.max,X=T?D(0,H):0,F=T?0:D(0,Q),$=U.pointerType==="touch"?10:2,ee={x:X,y:F},ae={originalEvent:U,delta:ee};J?(P.current=ee,kp(f7,p,ae,{discrete:!1})):oE(ee,b.swipeDirection,$)?(P.current=ee,kp(d7,h,ae,{discrete:!1}),U.target.setPointerCapture(U.pointerId)):(Math.abs(H)>$||Math.abs(Q)>$)&&(_.current=null)}),onPointerUp:Ee(e.onPointerUp,U=>{const H=P.current,Q=U.target;if(Q.hasPointerCapture(U.pointerId)&&Q.releasePointerCapture(U.pointerId),P.current=null,_.current=null,H){const J=U.currentTarget,T={originalEvent:U,delta:H};oE(H,b.swipeDirection,b.swipeThreshold)?kp(h7,g,T,{discrete:!0}):kp(p7,y,T,{discrete:!0}),J.addEventListener("click",D=>D.preventDefault(),{once:!0})}})})})}),b.viewport)})]}):null}),y7=e=>{const{__scopeToast:t,children:n,...r}=e,a=Pm(Zd,t),[i,o]=v.useState(!1),[c,d]=v.useState(!1);return w7(()=>o(!0)),v.useEffect(()=>{const f=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(f)},[]),c?null:s.jsx(Ec,{asChild:!0,children:s.jsx(Em,{...r,children:i&&s.jsxs(s.Fragment,{children:[a.label," ",n]})})})},x7="ToastTitle",zM=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(ze.div,{...r,ref:t})});zM.displayName=x7;var b7="ToastDescription",UM=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(ze.div,{...r,ref:t})});UM.displayName=b7;var qM="ToastAction",WM=v.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?s.jsx(HM,{altText:n,asChild:!0,children:s.jsx(AS,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${qM}\`. Expected non-empty \`string\`.`),null)});WM.displayName=qM;var VM="ToastClose",AS=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=v7(VM,n);return s.jsx(HM,{asChild:!0,children:s.jsx(ze.button,{type:"button",...r,ref:t,onClick:Ee(e.onClick,a.onClose)})})});AS.displayName=VM;var HM=v.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...a}=e;return s.jsx(ze.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function KM(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),j7(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(...KM(r))}}),t}function kp(e,t,n,{discrete:r}){const a=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?NS(a,i):a.dispatchEvent(i)}var oE=(e,t,n=0)=>{const r=Math.abs(e.x),a=Math.abs(e.y),i=r>a;return t==="left"||t==="right"?i&&r>n:!i&&a>n};function w7(e=()=>{}){const t=Tn(e);Hn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function j7(e){return e.nodeType===e.ELEMENT_NODE}function S7(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 Hy(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var N7=$M,GM=LM,YM=BM,XM=zM,QM=UM,JM=WM,ZM=AS;function e$(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=e$(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function St(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=e$(e))&&(r&&(r+=" "),r+=t);return r}const lE=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,cE=St,Do=(e,t)=>n=>{var r;if(t?.variants==null)return cE(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=lE(h)||lE(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 cE(e,o,d,n?.class,n?.className)};const C7=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),t$=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var _7={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 A7=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,..._7,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:t$("lucide",a),...c},[...o.map(([f,h])=>v.createElement(f,h)),...Array.isArray(i)?i:[i]]));const ot=(e,t)=>{const n=v.forwardRef(({className:r,...a},i)=>v.createElement(A7,{ref:i,iconNode:t,className:t$(`lucide-${C7(e)}`,r),...a}));return n.displayName=`${e}`,n};const n$=ot("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);const E7=ot("ArrowLeftRight",[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]]);const So=ot("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const ya=ot("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);const id=ot("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);const Yl=ot("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Vt=ot("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const r$=ot("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const cs=ot("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Ml=ot("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);const Ky=ot("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const $l=ot("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const P7=ot("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const nh=ot("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);const O7=ot("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const ef=ot("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const $i=ot("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const a$=ot("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);const wa=ot("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);const Om=ot("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);const ch=ot("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);const k7=ot("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const s$=ot("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);const uE=ot("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const i$=ot("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);const ES=ot("GitCompare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);const R7=ot("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);const w1=ot("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);const o$=ot("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);const T7=ot("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);const ir=ot("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const l$=ot("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]);const I7=ot("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);const c$=ot("NotebookTabs",[["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["path",{d:"M15 2v20",key:"dcj49h"}],["path",{d:"M15 7h5",key:"1xj5lc"}],["path",{d:"M15 12h5",key:"w5shd9"}],["path",{d:"M15 17h5",key:"1qaofu"}]]);const Pl=ot("NotepadText",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"16",height:"18",x:"4",y:"4",rx:"2",key:"1u9h20"}],["path",{d:"M8 10h6",key:"3oa6kw"}],["path",{d:"M8 14h8",key:"1fgep2"}],["path",{d:"M8 18h5",key:"17enja"}]]);const M7=ot("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);const Gy=ot("PanelRightClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]);const Yy=ot("PanelRightOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]]);const km=ot("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);const Dl=ot("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const ps=ot("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const u$=ot("RectangleEllipsis",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M17 12h.01",key:"1m0b6t"}],["path",{d:"M7 12h.01",key:"eqddd0"}]]);const Sa=ot("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);const $7=ot("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);const PS=ot("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const d$=ot("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);const OS=ot("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const va=ot("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);const rh=ot("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const f$=ot("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);const Na=ot("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const ah=ot("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const D7=ot("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);const kS=ot("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);const p$=ot("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);const Ds=ot("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);const Vs=ot("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),RS="-",L7=e=>{const t=B7(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const c=o.split(RS);return c[0]===""&&c.length!==1&&c.shift(),h$(c,t)||F7(o)},getConflictingClassGroupIds:(o,c)=>{const d=n[o]||[];return c&&r[o]?[...d,...r[o]]:d}}},h$=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?h$(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(RS);return t.validators.find(({validator:o})=>o(i))?.classGroupId},dE=/^\[(.+)\]$/,F7=e=>{if(dE.test(e)){const t=dE.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},B7=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return U7(Object.entries(e.classGroups),n).forEach(([i,o])=>{j1(o,r,i,t)}),r},j1=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:fE(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(z7(a)){j1(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,o])=>{j1(o,fE(t,i),n,r)})})},fE=(e,t)=>{let n=e;return t.split(RS).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},z7=e=>e.isThemeGetter,U7=(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,q7=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)}}},m$="!",W7=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(m$),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},V7=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},H7=e=>({cache:q7(e.cacheSize),parseClassName:W7(e),...L7(e)}),K7=/\s+/,G7=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],o=e.trim().split(K7);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=V7(h).join(":"),S=p?x+m$: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 Y7(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=v$(t))&&(r&&(r+=" "),r+=n);return r}const v$=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=v$(e[r]))&&(n&&(n+=" "),n+=t);return n};function X7(e,...t){let n,r,a,i=o;function o(d){const f=t.reduce((h,p)=>p(h),e());return n=H7(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=G7(d,n);return a(d,h),h}return function(){return i(Y7.apply(null,arguments))}}const fn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},g$=/^\[(?:([a-z-]+):)?(.+)\]$/i,Q7=/^\d+\/\d+$/,J7=new Set(["px","full","screen"]),Z7=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,eq=/\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$/,tq=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,nq=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,rq=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Rs=e=>Ll(e)||J7.has(e)||Q7.test(e),Ni=e=>Pc(e,"length",dq),Ll=e=>!!e&&!Number.isNaN(Number(e)),Xy=e=>Pc(e,"number",Ll),Ou=e=>!!e&&Number.isInteger(Number(e)),aq=e=>e.endsWith("%")&&Ll(e.slice(0,-1)),Nt=e=>g$.test(e),Ci=e=>Z7.test(e),sq=new Set(["length","size","percentage"]),iq=e=>Pc(e,sq,y$),oq=e=>Pc(e,"position",y$),lq=new Set(["image","url"]),cq=e=>Pc(e,lq,pq),uq=e=>Pc(e,"",fq),ku=()=>!0,Pc=(e,t,n)=>{const r=g$.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},dq=e=>eq.test(e)&&!tq.test(e),y$=()=>!1,fq=e=>nq.test(e),pq=e=>rq.test(e),hq=()=>{const e=fn("colors"),t=fn("spacing"),n=fn("blur"),r=fn("brightness"),a=fn("borderColor"),i=fn("borderRadius"),o=fn("borderSpacing"),c=fn("borderWidth"),d=fn("contrast"),f=fn("grayscale"),h=fn("hueRotate"),p=fn("invert"),y=fn("gap"),g=fn("gradientColorStops"),j=fn("gradientColorStopPositions"),b=fn("inset"),x=fn("margin"),S=fn("opacity"),N=fn("padding"),_=fn("saturate"),P=fn("scale"),A=fn("sepia"),O=fn("skew"),k=fn("space"),R=fn("translate"),M=()=>["auto","contain","none"],z=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto",Nt,t],L=()=>[Nt,t],G=()=>["",Rs,Ni],U=()=>["auto",Ll,Nt],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Q=()=>["solid","dashed","dotted","double","none"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],T=()=>["start","end","center","between","around","evenly","stretch"],D=()=>["","0",Nt],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>[Ll,Nt];return{cacheSize:500,separator:":",theme:{colors:[ku],spacing:[Rs,Ni],blur:["none","",Ci,Nt],brightness:F(),borderColor:[e],borderRadius:["none","","full",Ci,Nt],borderSpacing:L(),borderWidth:G(),contrast:F(),grayscale:D(),hueRotate:F(),invert:D(),gap:L(),gradientColorStops:[e],gradientColorStopPositions:[aq,Ni],inset:B(),margin:B(),opacity:F(),padding:L(),saturate:F(),scale:F(),sepia:D(),skew:F(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",Nt]}],container:["container"],columns:[{columns:[Ci]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...H(),Nt]}],overflow:[{overflow: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",Ou,Nt]}],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",Nt]}],grow:[{grow:D()}],shrink:[{shrink:D()}],order:[{order:["first","last","none",Ou,Nt]}],"grid-cols":[{"grid-cols":[ku]}],"col-start-end":[{col:["auto",{span:["full",Ou,Nt]},Nt]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[ku]}],"row-start-end":[{row:["auto",{span:[Ou,Nt]},Nt]}],"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",Nt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Nt]}],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",Nt,t]}],"min-w":[{"min-w":[Nt,t,"min","max","fit"]}],"max-w":[{"max-w":[Nt,t,"none","full","min","max","fit","prose",{screen:[Ci]},Ci]}],h:[{h:[Nt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Nt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Nt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Nt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ci,Ni]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Xy]}],"font-family":[{font:[ku]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Nt]}],"line-clamp":[{"line-clamp":["none",Ll,Xy]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Rs,Nt]}],"list-image":[{"list-image":["none",Nt]}],"list-style-type":[{list:["none","disc","decimal",Nt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Rs,Ni]}],"underline-offset":[{"underline-offset":["auto",Rs,Nt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Nt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Nt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...H(),oq]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",iq]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},cq]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[j]}],"gradient-via-pos":[{via:[j]}],"gradient-to-pos":[{to:[j]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...Q(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:Q()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...Q()]}],"outline-offset":[{"outline-offset":[Rs,Nt]}],"outline-w":[{outline:[Rs,Ni]}],"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":[Rs,Ni]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ci,uq]}],"shadow-color":[{shadow:[ku]}],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",Ci,Nt]}],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",Nt]}],duration:[{duration:F()}],ease:[{ease:["linear","in","out","in-out",Nt]}],delay:[{delay:F()}],animate:[{animate:["none","spin","ping","pulse","bounce",Nt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[P]}],"scale-x":[{"scale-x":[P]}],"scale-y":[{"scale-y":[P]}],rotate:[{rotate:[Ou,Nt]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Nt]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Nt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Nt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Rs,Ni,Xy]}],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"]}}},mq=X7(hq);function xe(...e){return mq(St(e))}const vq=N7,x$=v.forwardRef(({className:e,...t},n)=>s.jsx(GM,{ref:n,className:xe("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}));x$.displayName=GM.displayName;const gq=Do("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"}}),b$=v.forwardRef(({className:e,variant:t,...n},r)=>s.jsx(YM,{ref:r,className:xe(gq({variant:t}),e),...n}));b$.displayName=YM.displayName;const yq=v.forwardRef(({className:e,...t},n)=>s.jsx(JM,{ref:n,className:xe("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}));yq.displayName=JM.displayName;const w$=v.forwardRef(({className:e,...t},n)=>s.jsx(ZM,{ref:n,className:xe("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(Vs,{className:"h-4 w-4"})}));w$.displayName=ZM.displayName;const j$=v.forwardRef(({className:e,...t},n)=>s.jsx(XM,{ref:n,className:xe("text-sm font-semibold",e),...t}));j$.displayName=XM.displayName;const S$=v.forwardRef(({className:e,...t},n)=>s.jsx(QM,{ref:n,className:xe("text-sm opacity-90",e),...t}));S$.displayName=QM.displayName;function xq(){const{toasts:e}=EU();return s.jsxs(vq,{children:[e.map(function({id:t,title:n,description:r,action:a,...i}){return s.jsxs(b$,{...i,children:[s.jsxs("div",{className:"grid gap-1",children:[n&&s.jsx(j$,{children:n}),r&&s.jsx(S$,{children:r})]}),a,s.jsx(w$,{})]},t)}),s.jsx(x$,{})]})}var pE=["light","dark"],bq="(prefers-color-scheme: dark)",wq=v.createContext(void 0),jq={setTheme:e=>{},themes:[]},Sq=()=>{var e;return(e=v.useContext(wq))!=null?e:jq};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?pE.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&&pE.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='${bq}',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 Nq=e=>{switch(e){case"success":return Aq;case"info":return Pq;case"warning":return Eq;case"error":return Oq;default:return null}},Cq=Array(12).fill(0),_q=({visible:e,className:t})=>q.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},q.createElement("div",{className:"sonner-spinner"},Cq.map((n,r)=>q.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Aq=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"})),Eq=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"})),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-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"})),Oq=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"})),kq=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"})),Rq=()=>{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},S1=1,Tq=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:S1++,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(Mq(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||S1++;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}},Mr=new Tq,Iq=(e,t)=>{let n=t?.id||S1++;return Mr.addToast({title:e,...t,id:n}),n},Mq=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",$q=Iq,Dq=()=>Mr.toasts,Lq=()=>Mr.getActiveToasts();Object.assign($q,{success:Mr.success,info:Mr.info,warning:Mr.warning,error:Mr.error,custom:Mr.custom,message:Mr.message,promise:Mr.promise,dismiss:Mr.dismiss,loading:Mr.loading},{getHistory:Dq,getToasts:Lq});function Fq(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))}Fq(`: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 Rp(e){return e.label!==void 0}var Bq=3,zq="32px",Uq="16px",hE=4e3,qq=356,Wq=14,Vq=20,Hq=200;function Ma(...e){return e.filter(Boolean).join(" ")}function Kq(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var Gq=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:L="",descriptionClassName:G="",duration:U,position:H,gap:Q,loadingIcon:J,expandByDefault:T,classNames:D,icons:X,closeButtonAriaLabel:F="Close toast",pauseWhenPageIsHidden:$}=e,[ee,ae]=q.useState(null),[K,le]=q.useState(null),[ie,fe]=q.useState(!1),[oe,ce]=q.useState(!1),[Se,ne]=q.useState(!1),[Te,Ae]=q.useState(!1),[Ye,ge]=q.useState(!1),[Oe,Be]=q.useState(0),[dt,be]=q.useState(0),Je=q.useRef(g.duration||U||hE),lt=q.useRef(null),Rt=q.useRef(null),qt=_===0,Z=_+1<=S,je=g.type,we=g.dismissible!==!1,ke=g.className||"",Le=g.descriptionClassName||"",Xe=q.useMemo(()=>N.findIndex(Re=>Re.toastId===g.id)||0,[N,g.id]),At=q.useMemo(()=>{var Re;return(Re=g.closeButton)!=null?Re:R},[g.closeButton,R]),jn=q.useMemo(()=>g.duration||U||hE,[g.duration,U]),Sn=q.useRef(0),lr=q.useRef(0),cr=q.useRef(0),Ln=q.useRef(null),[ur,Ar]=H.split("-"),Fr=q.useMemo(()=>N.reduce((Re,nt,xt)=>xt>=Xe?Re:Re+nt.height,0),[N,Xe]),Br=Rq(),Yn=g.invert||y,Kt=je==="loading";lr.current=q.useMemo(()=>Xe*Q+Fr,[Xe,Fr]),q.useEffect(()=>{Je.current=jn},[jn]),q.useEffect(()=>{fe(!0)},[]),q.useEffect(()=>{let Re=Rt.current;if(Re){let nt=Re.getBoundingClientRect().height;return be(nt),x(xt=>[{toastId:g.id,height:nt,position:g.position},...xt]),()=>x(xt=>xt.filter(Ft=>Ft.toastId!==g.id))}},[x,g.id]),q.useLayoutEffect(()=>{if(!ie)return;let Re=Rt.current,nt=Re.style.height;Re.style.height="auto";let xt=Re.getBoundingClientRect().height;Re.style.height=nt,be(xt),x(Ft=>Ft.find(Yt=>Yt.toastId===g.id)?Ft.map(Yt=>Yt.toastId===g.id?{...Yt,height:xt}:Yt):[{toastId:g.id,height:xt,position:g.position},...Ft])},[ie,g.title,g.description,x,g.id]);let On=q.useCallback(()=>{ce(!0),Be(lr.current),x(Re=>Re.filter(nt=>nt.toastId!==g.id)),setTimeout(()=>{O(g)},Hq)},[g,O,x,lr]);q.useEffect(()=>{if(g.promise&&je==="loading"||g.duration===1/0||g.type==="loading")return;let Re;return A||b||$&&Br?(()=>{if(cr.current<Sn.current){let nt=new Date().getTime()-Sn.current;Je.current=Je.current-nt}cr.current=new Date().getTime()})():Je.current!==1/0&&(Sn.current=new Date().getTime(),Re=setTimeout(()=>{var nt;(nt=g.onAutoClose)==null||nt.call(g,g),On()},Je.current)),()=>clearTimeout(Re)},[A,b,g,je,$,Br,On]),q.useEffect(()=>{g.delete&&On()},[On,g.delete]);function ue(){var Re,nt,xt;return X!=null&&X.loading?q.createElement("div",{className:Ma(D?.loader,(Re=g?.classNames)==null?void 0:Re.loader,"sonner-loader"),"data-visible":je==="loading"},X.loading):J?q.createElement("div",{className:Ma(D?.loader,(nt=g?.classNames)==null?void 0:nt.loader,"sonner-loader"),"data-visible":je==="loading"},J):q.createElement(_q,{className:Ma(D?.loader,(xt=g?.classNames)==null?void 0:xt.loader),visible:je==="loading"})}return q.createElement("li",{tabIndex:0,ref:Rt,className:Ma(L,ke,D?.toast,(t=g?.classNames)==null?void 0:t.toast,D?.default,D?.[je],(n=g?.classNames)==null?void 0:n[je]),"data-sonner-toast":"","data-rich-colors":(r=g.richColors)!=null?r:k,"data-styled":!(g.jsx||g.unstyled||j),"data-mounted":ie,"data-promise":!!g.promise,"data-swiped":Ye,"data-removed":oe,"data-visible":Z,"data-y-position":ur,"data-x-position":Ar,"data-index":_,"data-front":qt,"data-swiping":Se,"data-dismissible":we,"data-type":je,"data-invert":Yn,"data-swipe-out":Te,"data-swipe-direction":K,"data-expanded":!!(A||T&&ie),style:{"--index":_,"--toasts-before":_,"--z-index":P.length-_,"--offset":`${oe?Oe:lr.current}px`,"--initial-height":T?"auto":`${dt}px`,...M,...g.style},onDragEnd:()=>{ne(!1),ae(null),Ln.current=null},onPointerDown:Re=>{Kt||!we||(lt.current=new Date,Be(lr.current),Re.target.setPointerCapture(Re.pointerId),Re.target.tagName!=="BUTTON"&&(ne(!0),Ln.current={x:Re.clientX,y:Re.clientY}))},onPointerUp:()=>{var Re,nt,xt,Ft;if(Te||!we)return;Ln.current=null;let Yt=Number(((Re=Rt.current)==null?void 0:Re.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Nn=Number(((nt=Rt.current)==null?void 0:nt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),dr=new Date().getTime()-((xt=lt.current)==null?void 0:xt.getTime()),vn=ee==="x"?Yt:Nn,Xn=Math.abs(vn)/dr;if(Math.abs(vn)>=Vq||Xn>.11){Be(lr.current),(Ft=g.onDismiss)==null||Ft.call(g,g),le(ee==="x"?Yt>0?"right":"left":Nn>0?"down":"up"),On(),Ae(!0),ge(!1);return}ne(!1),ae(null)},onPointerMove:Re=>{var nt,xt,Ft,Yt;if(!Ln.current||!we||((nt=window.getSelection())==null?void 0:nt.toString().length)>0)return;let Nn=Re.clientY-Ln.current.y,dr=Re.clientX-Ln.current.x,vn=(xt=e.swipeDirections)!=null?xt:Kq(H);!ee&&(Math.abs(dr)>1||Math.abs(Nn)>1)&&ae(Math.abs(dr)>Math.abs(Nn)?"x":"y");let Xn={x:0,y:0};ee==="y"?(vn.includes("top")||vn.includes("bottom"))&&(vn.includes("top")&&Nn<0||vn.includes("bottom")&&Nn>0)&&(Xn.y=Nn):ee==="x"&&(vn.includes("left")||vn.includes("right"))&&(vn.includes("left")&&dr<0||vn.includes("right")&&dr>0)&&(Xn.x=dr),(Math.abs(Xn.x)>0||Math.abs(Xn.y)>0)&&ge(!0),(Ft=Rt.current)==null||Ft.style.setProperty("--swipe-amount-x",`${Xn.x}px`),(Yt=Rt.current)==null||Yt.style.setProperty("--swipe-amount-y",`${Xn.y}px`)}},At&&!g.jsx?q.createElement("button",{"aria-label":F,"data-disabled":Kt,"data-close-button":!0,onClick:Kt||!we?()=>{}:()=>{var Re;On(),(Re=g.onDismiss)==null||Re.call(g,g)},className:Ma(D?.closeButton,(a=g?.classNames)==null?void 0:a.closeButton)},(i=X?.close)!=null?i:kq):null,g.jsx||v.isValidElement(g.title)?g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title:q.createElement(q.Fragment,null,je||g.icon||g.promise?q.createElement("div",{"data-icon":"",className:Ma(D?.icon,(o=g?.classNames)==null?void 0:o.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||ue():null,g.type!=="loading"?g.icon||X?.[je]||Nq(je):null):null,q.createElement("div",{"data-content":"",className:Ma(D?.content,(c=g?.classNames)==null?void 0:c.content)},q.createElement("div",{"data-title":"",className:Ma(D?.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:Ma(G,Le,D?.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&&Rp(g.cancel)?q.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||z,onClick:Re=>{var nt,xt;Rp(g.cancel)&&we&&((xt=(nt=g.cancel).onClick)==null||xt.call(nt,Re),On())},className:Ma(D?.cancelButton,(h=g?.classNames)==null?void 0:h.cancelButton)},g.cancel.label):null,v.isValidElement(g.action)?g.action:g.action&&Rp(g.action)?q.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||B,onClick:Re=>{var nt,xt;Rp(g.action)&&((xt=(nt=g.action).onClick)==null||xt.call(nt,Re),!Re.defaultPrevented&&On())},className:Ma(D?.actionButton,(p=g?.classNames)==null?void 0:p.actionButton)},g.action.label):null))};function mE(){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 Yq(e,t){let n={};return[e,t].forEach((r,a)=>{let i=a===1,o=i?"--mobile-offset":"--offset",c=i?Uq:zq;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 Xq=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=Bq,toastOptions:b,dir:x=mE(),gap:S=Wq,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,L]=q.useState(!1),[G,U]=q.useState(!1),[H,Q]=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,""),D=q.useRef(null),X=q.useRef(!1),F=q.useCallback($=>{k(ee=>{var ae;return(ae=ee.find(K=>K.id===$.id))!=null&&ae.delete||Mr.dismiss($.id),ee.filter(({id:K})=>K!==$.id)})},[]);return q.useEffect(()=>Mr.subscribe($=>{if($.dismiss){k(ee=>ee.map(ae=>ae.id===$.id?{...ae,delete:!0}:ae));return}setTimeout(()=>{OM.flushSync(()=>{k(ee=>{let ae=ee.findIndex(K=>K.id===$.id);return ae!==-1?[...ee.slice(0,ae),{...ee[ae],...$},...ee.slice(ae+1)]:[$,...ee]})})})}),[]),q.useEffect(()=>{if(h!=="system"){Q(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Q("dark"):Q("light")),typeof window>"u")return;let $=window.matchMedia("(prefers-color-scheme: dark)");try{$.addEventListener("change",({matches:ee})=>{Q(ee?"dark":"light")})}catch{$.addListener(({matches:ae})=>{try{Q(ae?"dark":"light")}catch(K){console.error(K)}})}},[h]),q.useEffect(()=>{O.length<=1&&L(!1)},[O]),q.useEffect(()=>{let $=ee=>{var ae,K;a.every(le=>ee[le]||ee.code===le)&&(L(!0),(ae=J.current)==null||ae.focus()),ee.code==="Escape"&&(document.activeElement===J.current||(K=J.current)!=null&&K.contains(document.activeElement))&&L(!1)};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[a]),q.useEffect(()=>{if(J.current)return()=>{D.current&&(D.current.focus({preventScroll:!0}),D.current=null,X.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(($,ee)=>{var ae;let[K,le]=$.split("-");return O.length?q.createElement("ol",{key:$,dir:x==="auto"?mE():x,tabIndex:-1,ref:J,className:c,"data-sonner-toaster":!0,"data-theme":H,"data-y-position":K,"data-lifted":B&&O.length>1&&!i,"data-x-position":le,style:{"--front-toast-height":`${((ae=M[0])==null?void 0:ae.height)||0}px`,"--width":`${qq}px`,"--gap":`${S}px`,...g,...Yq(d,f)},onBlur:ie=>{X.current&&!ie.currentTarget.contains(ie.relatedTarget)&&(X.current=!1,D.current&&(D.current.focus({preventScroll:!0}),D.current=null))},onFocus:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||X.current||(X.current=!0,D.current=ie.relatedTarget)},onMouseEnter:()=>L(!0),onMouseMove:()=>L(!0),onMouseLeave:()=>{G||L(!1)},onDragEnd:()=>L(!1),onPointerDown:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||U(!0)},onPointerUp:()=>U(!1)},O.filter(ie=>!ie.position&&ee===0||ie.position===$).map((ie,fe)=>{var oe,ce;return q.createElement(Gq,{key:ie.id,icons:_,index:fe,toast:ie,defaultRichColors:p,duration:(oe=b?.duration)!=null?oe:y,className:b?.className,descriptionClassName:b?.descriptionClassName,invert:n,visibleToasts:j,closeButton:(ce=b?.closeButton)!=null?ce:o,interacting:G,position:$,style:b?.style,unstyled:b?.unstyled,classNames:b?.classNames,cancelButtonStyle:b?.cancelButtonStyle,actionButtonStyle:b?.actionButtonStyle,removeToast:F,toasts:O.filter(Se=>Se.position==ie.position),heights:M.filter(Se=>Se.position==ie.position),setHeights:z,expandByDefault:i,gap:S,loadingIcon:N,expanded:B,pauseWhenPageIsHidden:A,swipeDirections:e.swipeDirections})})):null}))});const Qq=({...e})=>{const{theme:t="system"}=Sq();return s.jsx(Xq,{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 Jq=Am[" useId ".trim().toString()]||(()=>{}),Zq=0;function Vn(e){const[t,n]=v.useState(Jq());return Hn(()=>{n(r=>r??String(Zq++))},[e]),e||(t?`radix-${t}`:"")}const e9=["top","right","bottom","left"],Di=Math.min,Xr=Math.max,uh=Math.round,Tp=Math.floor,us=e=>({x:e,y:e}),t9={left:"right",right:"left",bottom:"top",top:"bottom"},n9={start:"end",end:"start"};function N1(e,t,n){return Xr(e,Di(t,n))}function Hs(e,t){return typeof e=="function"?e(t):e}function Ks(e){return e.split("-")[0]}function Oc(e){return e.split("-")[1]}function TS(e){return e==="x"?"y":"x"}function IS(e){return e==="y"?"height":"width"}const r9=new Set(["top","bottom"]);function os(e){return r9.has(Ks(e))?"y":"x"}function MS(e){return TS(os(e))}function a9(e,t,n){n===void 0&&(n=!1);const r=Oc(e),a=MS(e),i=IS(a);let o=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=dh(o)),[o,dh(o)]}function s9(e){const t=dh(e);return[C1(e),t,C1(t)]}function C1(e){return e.replace(/start|end/g,t=>n9[t])}const vE=["left","right"],gE=["right","left"],i9=["top","bottom"],o9=["bottom","top"];function l9(e,t,n){switch(e){case"top":case"bottom":return n?t?gE:vE:t?vE:gE;case"left":case"right":return t?i9:o9;default:return[]}}function c9(e,t,n,r){const a=Oc(e);let i=l9(Ks(e),n==="start",r);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(C1)))),i}function dh(e){return e.replace(/left|right|bottom|top/g,t=>t9[t])}function u9(e){return{top:0,right:0,bottom:0,left:0,...e}}function N$(e){return typeof e!="number"?u9(e):{top:e,right:e,bottom:e,left:e}}function fh(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 yE(e,t,n){let{reference:r,floating:a}=e;const i=os(t),o=MS(t),c=IS(o),d=Ks(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(Oc(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 d9(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}=Hs(t,e),j=N$(g),x=c[y?p==="floating"?"reference":"floating":p],S=fh(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=fh(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 f9=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}=yE(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:d9},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}=yE(f,y,d)),x=-1)}return{x:h,y:p,placement:y,strategy:a,middlewareData:g}},p9=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}=Hs(e,t)||{};if(f==null)return{};const p=N$(h),y={x:n,y:r},g=MS(a),j=IS(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=Di(p[S],M),B=Di(p[N],M),L=z,G=k-b[j]-B,U=k/2-b[j]/2+R,H=N1(L,U,G),Q=!d.arrow&&Oc(a)!=null&&U!==H&&i.reference[j]/2-(U<L?z:B)-b[j]/2<0,J=Q?U<L?U-L:U-G:0;return{[g]:y[g]+J,data:{[g]:H,centerOffset:U-H-J,...Q&&{alignmentOffset:J}},reset:Q}}}),h9=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}=Hs(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const S=Ks(a),N=os(c),_=Ks(c)===c,P=await(d.isRTL==null?void 0:d.isRTL(f.floating)),A=y||(_||!b?[dh(c)]:s9(c)),O=j!=="none";!y&&O&&A.push(...c9(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=a9(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,L;const U=(((B=i.flip)==null?void 0:B.index)||0)+1,H=k[U];if(H&&(!(p==="alignment"?N!==os(H):!1)||z.every(T=>os(T.placement)===N?T.overflows[0]>0:!0)))return{data:{index:U,overflows:z},reset:{placement:H}};let Q=(L=z.filter(J=>J.overflows[0]<=0).sort((J,T)=>J.overflows[1]-T.overflows[1])[0])==null?void 0:L.placement;if(!Q)switch(g){case"bestFit":{var G;const J=(G=z.filter(T=>{if(O){const D=os(T.placement);return D===N||D==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(D=>D>0).reduce((D,X)=>D+X,0)]).sort((T,D)=>T[1]-D[1])[0])==null?void 0:G[0];J&&(Q=J);break}case"initialPlacement":Q=c;break}if(a!==Q)return{reset:{placement:Q}}}return{}}}};function xE(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bE(e){return e9.some(t=>e[t]>=0)}const m9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...i}=Hs(e,t);switch(a){case"referenceHidden":{const o=await r.detectOverflow(t,{...i,elementContext:"reference"}),c=xE(o,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:bE(c)}}}case"escaped":{const o=await r.detectOverflow(t,{...i,altBoundary:!0}),c=xE(o,n.floating);return{data:{escapedOffsets:c,escaped:bE(c)}}}default:return{}}}}},C$=new Set(["left","top"]);async function v9(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),o=Ks(n),c=Oc(n),d=os(n)==="y",f=C$.has(o)?-1:1,h=i&&d?-1:1,p=Hs(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 g9=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 v9(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}}}}},y9=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}=Hs(e,t),h={x:n,y:r},p=await i.detectOverflow(t,f),y=os(Ks(a)),g=TS(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=N1(_,j,P)}if(c){const S=y==="y"?"top":"left",N=y==="y"?"bottom":"right",_=b+p[S],P=b-p[N];b=N1(_,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}}}}}},x9=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}=Hs(e,t),h={x:n,y:r},p=os(a),y=TS(p);let g=h[y],j=h[p];const b=Hs(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=C$.has(Ks(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}}}},b9=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}=Hs(e,t),h=await o.detectOverflow(t,f),p=Ks(a),y=Oc(a),g=os(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=Di(b-h[x],N),A=Di(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=Xr(h.left,0),B=Xr(h.right,0),L=Xr(h.top,0),G=Xr(h.bottom,0);g?R=j-2*(z!==0||B!==0?z+B:Xr(h.left,h.right)):k=b-2*(L!==0||G!==0?L+G:Xr(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 Rm(){return typeof window<"u"}function kc(e){return _$(e)?(e.nodeName||"").toLowerCase():"#document"}function na(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function gs(e){var t;return(t=(_$(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function _$(e){return Rm()?e instanceof Node||e instanceof na(e).Node:!1}function qa(e){return Rm()?e instanceof Element||e instanceof na(e).Element:!1}function hs(e){return Rm()?e instanceof HTMLElement||e instanceof na(e).HTMLElement:!1}function wE(e){return!Rm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof na(e).ShadowRoot}const w9=new Set(["inline","contents"]);function tf(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Wa(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!w9.has(a)}const j9=new Set(["table","td","th"]);function S9(e){return j9.has(kc(e))}const N9=[":popover-open",":modal"];function Tm(e){return N9.some(t=>{try{return e.matches(t)}catch{return!1}})}const C9=["transform","translate","scale","rotate","perspective"],_9=["transform","translate","scale","rotate","perspective","filter"],A9=["paint","layout","strict","content"];function $S(e){const t=DS(),n=qa(e)?Wa(e):e;return C9.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)||_9.some(r=>(n.willChange||"").includes(r))||A9.some(r=>(n.contain||"").includes(r))}function E9(e){let t=Li(e);for(;hs(t)&&!Xl(t);){if($S(t))return t;if(Tm(t))return null;t=Li(t)}return null}function DS(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const P9=new Set(["html","body","#document"]);function Xl(e){return P9.has(kc(e))}function Wa(e){return na(e).getComputedStyle(e)}function Im(e){return qa(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Li(e){if(kc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||wE(e)&&e.host||gs(e);return wE(t)?t.host:t}function A$(e){const t=Li(e);return Xl(t)?e.ownerDocument?e.ownerDocument.body:e.body:hs(t)&&tf(t)?t:A$(t)}function od(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=A$(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),o=na(a);if(i){const c=_1(o);return t.concat(o,o.visualViewport||[],tf(a)?a:[],c&&n?od(c):[])}return t.concat(a,od(a,[],n))}function _1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function E$(e){const t=Wa(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=hs(e),i=a?e.offsetWidth:n,o=a?e.offsetHeight:r,c=uh(n)!==i||uh(r)!==o;return c&&(n=i,r=o),{width:n,height:r,$:c}}function LS(e){return qa(e)?e:e.contextElement}function Fl(e){const t=LS(e);if(!hs(t))return us(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=E$(t);let o=(i?uh(n.width):n.width)/r,c=(i?uh(n.height):n.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!c||!Number.isFinite(c))&&(c=1),{x:o,y:c}}const O9=us(0);function P$(e){const t=na(e);return!DS()||!t.visualViewport?O9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function k9(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==na(e)?!1:t}function No(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=LS(e);let o=us(1);t&&(r?qa(r)&&(o=Fl(r)):o=Fl(e));const c=k9(i,n,r)?P$(i):us(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=na(i),g=r&&qa(r)?na(r):r;let j=y,b=_1(j);for(;b&&r&&g!==j;){const x=Fl(b),S=b.getBoundingClientRect(),N=Wa(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=na(b),b=_1(j)}}return fh({width:h,height:p,x:d,y:f})}function Mm(e,t){const n=Im(e).scrollLeft;return t?t.left+n:No(gs(e)).left+n}function O$(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Mm(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function R9(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",o=gs(r),c=t?Tm(t.floating):!1;if(r===o||c&&i)return n;let d={scrollLeft:0,scrollTop:0},f=us(1);const h=us(0),p=hs(r);if((p||!p&&!i)&&((kc(r)!=="body"||tf(o))&&(d=Im(r)),hs(r))){const g=No(r);f=Fl(r),h.x=g.x+r.clientLeft,h.y=g.y+r.clientTop}const y=o&&!p&&!i?O$(o,d):us(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 T9(e){return Array.from(e.getClientRects())}function I9(e){const t=gs(e),n=Im(e),r=e.ownerDocument.body,a=Xr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Xr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Mm(e);const c=-n.scrollTop;return Wa(r).direction==="rtl"&&(o+=Xr(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:o,y:c}}const jE=25;function M9(e,t){const n=na(e),r=gs(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=DS();(!h||h&&t==="fixed")&&(c=a.offsetLeft,d=a.offsetTop)}const f=Mm(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<=jE&&(i-=j)}else f<=jE&&(i+=f);return{width:i,height:o,x:c,y:d}}const $9=new Set(["absolute","fixed"]);function D9(e,t){const n=No(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=hs(e)?Fl(e):us(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 SE(e,t,n){let r;if(t==="viewport")r=M9(e,n);else if(t==="document")r=I9(gs(e));else if(qa(t))r=D9(t,n);else{const a=P$(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return fh(r)}function k$(e,t){const n=Li(e);return n===t||!qa(n)||Xl(n)?!1:Wa(n).position==="fixed"||k$(n,t)}function L9(e,t){const n=t.get(e);if(n)return n;let r=od(e,[],!1).filter(c=>qa(c)&&kc(c)!=="body"),a=null;const i=Wa(e).position==="fixed";let o=i?Li(e):e;for(;qa(o)&&!Xl(o);){const c=Wa(o),d=$S(o);!d&&c.position==="fixed"&&(a=null),(i?!d&&!a:!d&&c.position==="static"&&!!a&&$9.has(a.position)||tf(o)&&!d&&k$(e,o))?r=r.filter(h=>h!==o):a=c,o=Li(o)}return t.set(e,r),r}function F9(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[...n==="clippingAncestors"?Tm(t)?[]:L9(t,this._c):[].concat(n),r],c=o[0],d=o.reduce((f,h)=>{const p=SE(t,h,a);return f.top=Xr(p.top,f.top),f.right=Di(p.right,f.right),f.bottom=Di(p.bottom,f.bottom),f.left=Xr(p.left,f.left),f},SE(t,c,a));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function B9(e){const{width:t,height:n}=E$(e);return{width:t,height:n}}function z9(e,t,n){const r=hs(t),a=gs(t),i=n==="fixed",o=No(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const d=us(0);function f(){d.x=Mm(a)}if(r||!r&&!i)if((kc(t)!=="body"||tf(a))&&(c=Im(t)),r){const g=No(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?O$(a,c):us(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 Qy(e){return Wa(e).position==="static"}function NE(e,t){if(!hs(e)||Wa(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return gs(e)===n&&(n=n.ownerDocument.body),n}function R$(e,t){const n=na(e);if(Tm(e))return n;if(!hs(e)){let a=Li(e);for(;a&&!Xl(a);){if(qa(a)&&!Qy(a))return a;a=Li(a)}return n}let r=NE(e,t);for(;r&&S9(r)&&Qy(r);)r=NE(r,t);return r&&Xl(r)&&Qy(r)&&!$S(r)?n:r||E9(e)||n}const U9=async function(e){const t=this.getOffsetParent||R$,n=this.getDimensions,r=await n(e.floating);return{reference:z9(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function q9(e){return Wa(e).direction==="rtl"}const W9={convertOffsetParentRelativeRectToViewportRelativeRect:R9,getDocumentElement:gs,getClippingRect:F9,getOffsetParent:R$,getElementRects:U9,getClientRects:T9,getDimensions:B9,getScale:Fl,isElement:qa,isRTL:q9};function T$(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function V9(e,t){let n=null,r;const a=gs(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=Tp(p),b=Tp(a.clientWidth-(h+y)),x=Tp(a.clientHeight-(p+g)),S=Tp(h),_={rootMargin:-j+"px "+-b+"px "+-x+"px "+-S+"px",threshold:Xr(0,Di(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&&!T$(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 H9(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=LS(e),h=a||i?[...f?od(f):[],...od(t)]:[];h.forEach(S=>{a&&S.addEventListener("scroll",n,{passive:!0}),i&&S.addEventListener("resize",n)});const p=f&&c?V9(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?No(e):null;d&&x();function x(){const S=No(e);b&&!T$(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 K9=g9,G9=y9,Y9=h9,X9=b9,Q9=m9,CE=p9,J9=x9,Z9=(e,t,n)=>{const r=new Map,a={platform:W9,...n},i={...a.platform,_c:r};return f9(e,t,{...a,platform:i})};var eW=typeof document<"u",tW=function(){},sh=eW?v.useLayoutEffect:tW;function ph(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(!ph(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)&&!ph(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function I$(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function _E(e,t){const n=I$(e);return Math.round(t*n)/n}function Jy(e){const t=v.useRef(e);return sh(()=>{t.current=e}),t}function nW(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);ph(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=Jy(d),B=Jy(a),L=Jy(f),G=v.useCallback(()=>{if(!O.current||!k.current)return;const T={placement:t,strategy:n,middleware:y};B.current&&(T.platform=B.current),Z9(O.current,k.current,T).then(D=>{const X={...D,isPositioned:L.current!==!1};U.current&&!ph(R.current,X)&&(R.current=X,Ac.flushSync(()=>{p(X)}))})},[y,t,n,B,L]);sh(()=>{f===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,p(T=>({...T,isPositioned:!1})))},[f]);const U=v.useRef(!1);sh(()=>(U.current=!0,()=>{U.current=!1}),[]),sh(()=>{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 H=v.useMemo(()=>({reference:O,floating:k,setReference:N,setFloating:_}),[N,_]),Q=v.useMemo(()=>({reference:P,floating:A}),[P,A]),J=v.useMemo(()=>{const T={position:n,left:0,top:0};if(!Q.floating)return T;const D=_E(Q.floating,h.x),X=_E(Q.floating,h.y);return c?{...T,transform:"translate("+D+"px, "+X+"px)",...I$(Q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:D,top:X}},[n,c,Q.floating,h.x,h.y]);return v.useMemo(()=>({...h,update:G,refs:H,elements:Q,floatingStyles:J}),[h,G,H,Q,J])}const rW=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?CE({element:r.current,padding:a}).fn(n):{}:r?CE({element:r,padding:a}).fn(n):{}}}},aW=(e,t)=>({...K9(e),options:[e,t]}),sW=(e,t)=>({...G9(e),options:[e,t]}),iW=(e,t)=>({...J9(e),options:[e,t]}),oW=(e,t)=>({...Y9(e),options:[e,t]}),lW=(e,t)=>({...X9(e),options:[e,t]}),cW=(e,t)=>({...Q9(e),options:[e,t]}),uW=(e,t)=>({...rW(e),options:[e,t]});var dW="Arrow",M$=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return s.jsx(ze.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"})})});M$.displayName=dW;var fW=M$;function $m(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 FS="Popper",[$$,Bi]=or(FS),[pW,D$]=$$(FS),L$=e=>{const{__scopePopper:t,children:n}=e,[r,a]=v.useState(null);return s.jsx(pW,{scope:t,anchor:r,onAnchorChange:a,children:n})};L$.displayName=FS;var F$="PopperAnchor",B$=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=D$(F$,n),o=v.useRef(null),c=mt(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(ze.div,{...a,ref:c})});B$.displayName=F$;var BS="PopperContent",[hW,mW]=$$(BS),z$=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=D$(BS,n),[S,N]=v.useState(null),_=mt(t,ie=>N(ie)),[P,A]=v.useState(null),O=$m(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],L=B.length>0,G={padding:z,boundary:B.filter(gW),altBoundary:L},{refs:U,floatingStyles:H,placement:Q,isPositioned:J,middlewareData:T}=nW({strategy:"fixed",placement:M,whileElementsMounted:(...ie)=>H9(...ie,{animationFrame:g==="always"}),elements:{reference:x.anchor},middleware:[aW({mainAxis:a+R,alignmentAxis:o}),d&&sW({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?iW():void 0,...G}),d&&oW({...G}),lW({...G,apply:({elements:ie,rects:fe,availableWidth:oe,availableHeight:ce})=>{const{width:Se,height:ne}=fe.reference,Te=ie.floating.style;Te.setProperty("--radix-popper-available-width",`${oe}px`),Te.setProperty("--radix-popper-available-height",`${ce}px`),Te.setProperty("--radix-popper-anchor-width",`${Se}px`),Te.setProperty("--radix-popper-anchor-height",`${ne}px`)}}),P&&uW({element:P,padding:c}),yW({arrowWidth:k,arrowHeight:R}),y&&cW({strategy:"referenceHidden",...G})]}),[D,X]=W$(Q),F=Tn(j);Hn(()=>{J&&F?.()},[J,F]);const $=T.arrow?.x,ee=T.arrow?.y,ae=T.arrow?.centerOffset!==0,[K,le]=v.useState();return Hn(()=>{S&&le(window.getComputedStyle(S).zIndex)},[S]),s.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:J?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[T.transformOrigin?.x,T.transformOrigin?.y].join(" "),...T.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(hW,{scope:n,placedSide:D,onArrowChange:A,arrowX:$,arrowY:ee,shouldHideArrow:ae,children:s.jsx(ze.div,{"data-side":D,"data-align":X,...b,ref:_,style:{...b.style,animation:J?void 0:"none"}})})})});z$.displayName=BS;var U$="PopperArrow",vW={top:"bottom",right:"left",bottom:"top",left:"right"},q$=v.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=mW(U$,r),o=vW[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(fW,{...a,ref:n,style:{...a.style,display:"block"}})})});q$.displayName=U$;function gW(e){return e!==null}var yW=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]=W$(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 W$(e){const[t,n="center"]=e.split("-");return[t,n]}var Dm=L$,nf=B$,Lm=z$,Fm=q$,xW=Symbol("radix.slottable");function bW(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=xW,t}var[Bm]=or("Tooltip",[Bi]),zm=Bi(),V$="TooltipProvider",wW=700,A1="tooltip.open",[jW,zS]=Bm(V$),H$=e=>{const{__scopeTooltip:t,delayDuration:n=wW,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(jW,{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})};H$.displayName=V$;var ld="Tooltip",[SW,Um]=Bm(ld),K$=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:i,disableHoverableContent:o,delayDuration:c}=e,d=zS(ld,e.__scopeTooltip),f=zm(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]=sa({prop:r,defaultProp:a??!1,onChange:k=>{k?(d.onOpen(),document.dispatchEvent(new CustomEvent(A1))):d.onClose(),i?.(k)},caller:ld}),_=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(Dm,{...f,children:s.jsx(SW,{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})})};K$.displayName=ld;var E1="TooltipTrigger",G$=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Um(E1,n),i=zS(E1,n),o=zm(n),c=v.useRef(null),d=mt(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(nf,{asChild:!0,...o,children:s.jsx(ze.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:d,onPointerMove:Ee(e.onPointerMove,y=>{y.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),h.current=!0)}),onPointerLeave:Ee(e.onPointerLeave,()=>{a.onTriggerLeave(),h.current=!1}),onPointerDown:Ee(e.onPointerDown,()=>{a.open&&a.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Ee(e.onFocus,()=>{f.current||a.onOpen()}),onBlur:Ee(e.onBlur,a.onClose),onClick:Ee(e.onClick,a.onClose)})})});G$.displayName=E1;var NW="TooltipPortal",[Ege,CW]=Bm(NW,{forceMount:void 0}),Ql="TooltipContent",Y$=v.forwardRef((e,t)=>{const n=CW(Ql,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,o=Um(Ql,e.__scopeTooltip);return s.jsx(Kn,{present:r||o.open,children:o.disableHoverableContent?s.jsx(X$,{side:a,...i,ref:t}):s.jsx(_W,{side:a,...i,ref:t})})}),_W=v.forwardRef((e,t)=>{const n=Um(Ql,e.__scopeTooltip),r=zS(Ql,e.__scopeTooltip),a=v.useRef(null),i=mt(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=kW(S,x.getBoundingClientRect()),_=RW(S,N),P=TW(b.getBoundingClientRect()),A=MW([..._,...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),_=!IW(S,o);N?y():_&&(y(),f())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[d,h,o,f,y]),s.jsx(X$,{...e,ref:i})}),[AW,EW]=Bm(ld,{isInside:!1}),PW=bW("TooltipContent"),X$=v.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...c}=e,d=Um(Ql,n),f=zm(n),{onClose:h}=d;return v.useEffect(()=>(document.addEventListener(A1,h),()=>document.removeEventListener(A1,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($o,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:p=>p.preventDefault(),onDismiss:h,children:s.jsxs(Lm,{"data-state":d.stateAttribute,...f,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(PW,{children:r}),s.jsx(AW,{scope:n,isInside:!0,children:s.jsx(i7,{id:d.contentId,role:"tooltip",children:a||r})})]})})});Y$.displayName=Ql;var Q$="TooltipArrow",OW=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=zm(n);return EW(Q$,n).isInside?null:s.jsx(Fm,{...a,...r,ref:t})});OW.displayName=Q$;function kW(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 RW(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 TW(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 IW(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 MW(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),$W(t)}function $W(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 DW=H$,LW=K$,FW=G$,J$=Y$;const Z$=DW,eD=LW,tD=FW,US=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(J$,{ref:r,sideOffset:t,className:xe("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}));US.displayName=J$.displayName;var qm=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},BW={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},zW=class{#e=BW;#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)}},P1=new zW;function UW(e){setTimeout(e,0)}var Wm=typeof window>"u"||"Deno"in globalThis;function La(){}function qW(e,t){return typeof e=="function"?e(t):e}function WW(e){return typeof e=="number"&&e>=0&&e!==1/0}function VW(e,t){return Math.max(e+(t||0)-Date.now(),0)}function O1(e,t){return typeof e=="function"?e(t):e}function HW(e,t){return typeof e=="function"?e(t):e}function AE(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:i,queryKey:o,stale:c}=e;if(o){if(r){if(t.queryHash!==qS(o,t.options))return!1}else if(!ud(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 EE(e,t){const{exact:n,status:r,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(cd(t.options.mutationKey)!==cd(i))return!1}else if(!ud(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function qS(e,t){return(t?.queryKeyHashFn||cd)(e)}function cd(e){return JSON.stringify(e,(t,n)=>k1(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function ud(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>ud(e[n],t[n])):!1}var KW=Object.prototype.hasOwnProperty;function nD(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=PE(e)&&PE(t);if(!r&&!(k1(e)&&k1(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:KW.call(e,p))&&f++;continue}if(y===null||g===null||typeof y!="object"||typeof g!="object"){d[p]=g;continue}const j=nD(y,g,n+1);d[p]=j,j===y&&f++}return i===c&&f===i?e:d}function PE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function k1(e){if(!OE(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!OE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function OE(e){return Object.prototype.toString.call(e)==="[object Object]"}function GW(e){return new Promise(t=>{P1.setTimeout(t,e)})}function YW(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?nD(e,t):t}function XW(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function QW(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var WS=Symbol();function rD(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===WS?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function JW(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 ZW=class extends qm{#e;#n;#t;constructor(){super(),this.#t=e=>{if(!Wm&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#n||this.setEventListener(this.#t)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#t=e,this.#n?.(),this.#n=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},aD=new ZW;function eV(){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 tV=UW;function nV(){let e=[],t=0,n=c=>{c()},r=c=>{c()},a=tV;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 wr=nV(),rV=class extends qm{#e=!0;#n;#t;constructor(){super(),this.#t=e=>{if(!Wm&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#n||this.setEventListener(this.#t)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#t=e,this.#n?.(),this.#n=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},hh=new rV;function aV(e){return Math.min(1e3*2**e,3e4)}function sD(e){return(e??"online")==="online"?hh.isOnline():!0}var R1=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function iD(e){let t=!1,n=0,r;const a=eV(),i=()=>a.status!=="pending",o=b=>{if(!i()){const x=new R1(b);y(x),e.onCancel?.(x)}},c=()=>{t=!0},d=()=>{t=!1},f=()=>aD.isFocused()&&(e.networkMode==="always"||hh.isOnline())&&e.canRun(),h=()=>sD(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??(Wm?0:3),_=e.retryDelay??aV,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),GW(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 oD=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),WW(this.gcTime)&&(this.#e=P1.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Wm?1/0:300*1e3))}clearGcTimeout(){this.#e&&(P1.clearTimeout(this.#e),this.#e=void 0)}},sV=class extends oD{#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=RE(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=RE(this.options);t.data!==void 0&&(this.setState(kE(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#t.remove(this)}setData(e,t){const n=YW(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(La).catch(La):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>HW(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===WS||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>O1(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:!VW(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=rD(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=iD({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:c=>{c instanceof R1&&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 R1){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,...iV(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...kE(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),wr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#t.notify({query:this,type:"updated",action:e})})}};function iV(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:sD(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function kE(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function RE(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 TE(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=>{JW(j,()=>t.signal,()=>h=!0)},y=rD(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?QW:XW;return{pages:A(j.pages,_,P),pageParams:A(j.pageParams,b,P)}};if(a&&i.length){const j=a==="backward",b=j?oV:IE,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:IE(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 IE(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 oV(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var lV=class extends oD{#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||cV(),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=iD({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),wr.batch(()=>{this.#n.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function cV(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var uV=class extends qm{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#n=new Map,this.#t=0}#e;#n;#t;build(e,t,n){const r=new lV({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=Ip(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=Ip(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=Ip(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=Ip(e);return typeof t=="string"?this.#n.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){wr.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=>EE(t,n))}findAll(e={}){return this.getAll().filter(t=>EE(e,t))}notify(e){wr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return wr.batch(()=>Promise.all(e.map(t=>t.continue().catch(La))))}};function Ip(e){return e.options.scope?.id}var dV=class extends qm{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,a=t.queryHash??qS(r,t);let i=this.get(a);return i||(i=new sV({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(){wr.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=>AE(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>AE(e,n)):t}notify(e){wr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){wr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){wr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},fV=class{#e;#n;#t;#a;#r;#i;#o;#s;constructor(e={}){this.#e=e.queryCache||new dV,this.#n=e.mutationCache||new uV,this.#t=e.defaultOptions||{},this.#a=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=aD.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=hh.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(O1(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=qW(t,i);if(o!==void 0)return this.#e.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return wr.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;wr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return wr.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=wr.batch(()=>this.#e.findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(La).catch(La)}invalidateQueries(e,t={}){return wr.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=wr.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(La)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(La)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(O1(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(La).catch(La)}fetchInfiniteQuery(e){return e.behavior=TE(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(La).catch(La)}ensureInfiniteQueryData(e){return e.behavior=TE(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return hh.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#n}getDefaultOptions(){return this.#t}setDefaultOptions(e){this.#t=e}setQueryDefaults(e,t){this.#a.set(cd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#a.values()],n={};return t.forEach(r=>{ud(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(cd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{ud(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=qS(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===WS&&(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()}},pV=v.createContext(void 0),hV=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(pV.Provider,{value:e,children:t}));function dd(){return dd=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},dd.apply(this,arguments)}var Oi;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Oi||(Oi={}));const ME="popstate";function mV(e){e===void 0&&(e={});function t(r,a){let{pathname:i,search:o,hash:c}=r.location;return T1("",{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:mh(a)}return gV(t,n,null,e)}function wn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function VS(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function vV(){return Math.random().toString(36).substr(2,8)}function $E(e,t){return{usr:e.state,key:e.key,idx:t}}function T1(e,t,n,r){return n===void 0&&(n=null),dd({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Rc(t):t,{state:n,key:t&&t.key||r||vV()})}function mh(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 Rc(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 gV(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:i=!1}=r,o=a.history,c=Oi.Pop,d=null,f=h();f==null&&(f=0,o.replaceState(dd({},o.state,{idx:f}),""));function h(){return(o.state||{idx:null}).idx}function p(){c=Oi.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=Oi.Push;let N=T1(b.location,x,S);f=h()+1;let _=$E(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=Oi.Replace;let N=T1(b.location,x,S);f=h();let _=$E(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:mh(x);return N=N.replace(/ $/,"%20"),wn(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(ME,p),d=x,()=>{a.removeEventListener(ME,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 DE;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(DE||(DE={}));function yV(e,t,n){return n===void 0&&(n="/"),xV(e,t,n)}function xV(e,t,n,r){let a=typeof t=="string"?Rc(t):t,i=Jl(a.pathname||"/",n);if(i==null)return null;let o=lD(e);bV(o);let c=null;for(let d=0;c==null&&d<o.length;++d){let f=kV(i);c=PV(o[d],f)}return c}function lD(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("/")&&(wn(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=Ri([r,d.relativePath]),h=n.concat(d);i.children&&i.children.length>0&&(wn(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),lD(i.children,t,h,f)),!(i.path==null&&!i.index)&&t.push({path:f,score:AV(f,i.index),routesMeta:h})};return e.forEach((i,o)=>{var c;if(i.path===""||!((c=i.path)!=null&&c.includes("?")))a(i,o);else for(let d of cD(i.path))a(i,o,d)}),t}function cD(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=cD(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 bV(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:EV(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const wV=/^:[\w-]+$/,jV=3,SV=2,NV=1,CV=10,_V=-2,LE=e=>e==="*";function AV(e,t){let n=e.split("/"),r=n.length;return n.some(LE)&&(r+=_V),t&&(r+=SV),n.filter(a=>!LE(a)).reduce((a,i)=>a+(wV.test(i)?jV:i===""?NV:CV),r)}function EV(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function PV(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=Jt({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:Ri([i,p.pathname]),pathnameBase:$V(Ri([i,p.pathnameBase])),route:y}),p.pathnameBase!=="/"&&(i=Ri([i,p.pathnameBase]))}return o}function Jt(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=OV(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 OV(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),VS(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 kV(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return VS(!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 Jl(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 RV=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,TV=e=>RV.test(e);function IV(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Rc(e):e,i;if(n)if(TV(n))i=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),VS(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?i=FE(n.substring(1),"/"):i=FE(n,t)}else i=t;return{pathname:i,search:DV(r),hash:LV(a)}}function FE(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 Zy(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 MV(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function HS(e,t){let n=MV(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function KS(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=Rc(e):(a=dd({},e),wn(!a.pathname||!a.pathname.includes("?"),Zy("?","pathname","search",a)),wn(!a.pathname||!a.pathname.includes("#"),Zy("#","pathname","hash",a)),wn(!a.search||!a.search.includes("#"),Zy("#","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=IV(a,c),f=o&&o!=="/"&&o.endsWith("/"),h=(i||o===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||h)&&(d.pathname+="/"),d}const Ri=e=>e.join("/").replace(/\/\/+/g,"/"),$V=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),DV=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,LV=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function FV(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const uD=["post","put","patch","delete"];new Set(uD);const BV=["get",...uD];new Set(BV);function fd(){return fd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fd.apply(this,arguments)}const Vm=v.createContext(null),dD=v.createContext(null),Qs=v.createContext(null),Hm=v.createContext(null),ys=v.createContext({outlet:null,matches:[],isDataRoute:!1}),fD=v.createContext(null);function zV(e,t){let{relative:n}=t===void 0?{}:t;Tc()||wn(!1);let{basename:r,navigator:a}=v.useContext(Qs),{hash:i,pathname:o,search:c}=Km(e,{relative:n}),d=o;return r!=="/"&&(d=o==="/"?r:Ri([r,o])),a.createHref({pathname:d,search:c,hash:i})}function Tc(){return v.useContext(Hm)!=null}function xs(){return Tc()||wn(!1),v.useContext(Hm).location}function pD(e){v.useContext(Qs).static||v.useLayoutEffect(e)}function _a(){let{isDataRoute:e}=v.useContext(ys);return e?nH():UV()}function UV(){Tc()||wn(!1);let e=v.useContext(Vm),{basename:t,future:n,navigator:r}=v.useContext(Qs),{matches:a}=v.useContext(ys),{pathname:i}=xs(),o=JSON.stringify(HS(a,n.v7_relativeSplatPath)),c=v.useRef(!1);return pD(()=>{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=KS(f,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Ri([t,p.pathname])),(h.replace?r.replace:r.push)(p,h.state,h)},[t,r,o,i,e])}const qV=v.createContext(null);function WV(e){let t=v.useContext(ys).outlet;return t&&v.createElement(qV.Provider,{value:e},t)}function Lo(){let{matches:e}=v.useContext(ys),t=e[e.length-1];return t?t.params:{}}function Km(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=v.useContext(Qs),{matches:a}=v.useContext(ys),{pathname:i}=xs(),o=JSON.stringify(HS(a,r.v7_relativeSplatPath));return v.useMemo(()=>KS(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function VV(e,t){return HV(e,t)}function HV(e,t,n,r){Tc()||wn(!1);let{navigator:a}=v.useContext(Qs),{matches:i}=v.useContext(ys),o=i[i.length-1],c=o?o.params:{};o&&o.pathname;let d=o?o.pathnameBase:"/";o&&o.route;let f=xs(),h;if(t){var p;let x=typeof t=="string"?Rc(t):t;d==="/"||(p=x.pathname)!=null&&p.startsWith(d)||wn(!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=yV(e,{pathname:g}),b=QV(j&&j.map(x=>Object.assign({},x,{params:Object.assign({},c,x.params),pathname:Ri([d,a.encodeLocation?a.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?d:Ri([d,a.encodeLocation?a.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),i,n,r);return t&&b?v.createElement(Hm.Provider,{value:{location:fd({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:Oi.Pop}},b):b}function KV(){let e=tH(),t=FV(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 GV=v.createElement(KV,null);class YV 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(ys.Provider,{value:this.props.routeContext},v.createElement(fD.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function XV(e){let{routeContext:t,match:n,children:r}=e,a=v.useContext(Vm);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(ys.Provider,{value:t},r)}function QV(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||wn(!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||GV,d&&(f<0&&y===0?(rH("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(XV,{match:p,routeContext:{outlet:h,matches:S,isDataRoute:n!=null},children:_})};return n&&(p.route.ErrorBoundary||p.route.errorElement||y===0)?v.createElement(YV,{location:n.location,revalidation:n.revalidation,component:b,error:g,children:N(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):N()},null)}var hD=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(hD||{}),mD=(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})(mD||{});function JV(e){let t=v.useContext(Vm);return t||wn(!1),t}function ZV(e){let t=v.useContext(dD);return t||wn(!1),t}function eH(e){let t=v.useContext(ys);return t||wn(!1),t}function vD(e){let t=eH(),n=t.matches[t.matches.length-1];return n.route.id||wn(!1),n.route.id}function tH(){var e;let t=v.useContext(fD),n=ZV(),r=vD();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function nH(){let{router:e}=JV(hD.UseNavigateStable),t=vD(mD.UseNavigateStable),n=v.useRef(!1);return pD(()=>{n.current=!0}),v.useCallback(function(a,i){i===void 0&&(i={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,fd({fromRouteId:t},i)))},[e,t])}const BE={};function rH(e,t,n){BE[e]||(BE[e]=!0)}function aH(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function gD(e){let{to:t,replace:n,state:r,relative:a}=e;Tc()||wn(!1);let{future:i,static:o}=v.useContext(Qs),{matches:c}=v.useContext(ys),{pathname:d}=xs(),f=_a(),h=KS(t,HS(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 zE(e){return WV(e.context)}function Qt(e){wn(!1)}function sH(e){let{basename:t="/",children:n=null,location:r,navigationType:a=Oi.Pop,navigator:i,static:o=!1,future:c}=e;Tc()&&wn(!1);let d=t.replace(/^\/*/,"/"),f=v.useMemo(()=>({basename:d,navigator:i,static:o,future:fd({v7_relativeSplatPath:!1},c)}),[d,c,i,o]);typeof r=="string"&&(r=Rc(r));let{pathname:h="/",search:p="",hash:y="",state:g=null,key:j="default"}=r,b=v.useMemo(()=>{let x=Jl(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(Qs.Provider,{value:f},v.createElement(Hm.Provider,{children:n,value:b}))}function iH(e){let{children:t,location:n}=e;return VV(I1(t),n)}new Promise(()=>{});function I1(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,I1(r.props.children,i));return}r.type!==Qt&&wn(!1),!r.props.index||!r.props.children||wn(!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=I1(r.props.children,i)),n.push(o)}),n}function vh(){return vh=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},vh.apply(this,arguments)}function yD(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function oH(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function lH(e,t){return e.button===0&&(!t||t==="_self")&&!oH(e)}function M1(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 cH(e,t){let n=M1(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}const uH=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],dH=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],fH="6";try{window.__reactRouterVersion=fH}catch{}const pH=v.createContext({isTransitioning:!1}),hH="startTransition",UE=Am[hH];function mH(e){let{basename:t,children:n,future:r,window:a}=e,i=v.useRef();i.current==null&&(i.current=mV({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&&UE?UE(()=>d(p)):d(p)},[d,f]);return v.useLayoutEffect(()=>o.listen(h),[o,h]),v.useEffect(()=>aH(r),[r]),v.createElement(sH,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:o,future:r})}const vH=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",gH=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,bt=v.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:i,replace:o,state:c,target:d,to:f,preventScrollReset:h,viewTransition:p}=t,y=yD(t,uH),{basename:g}=v.useContext(Qs),j,b=!1;if(typeof f=="string"&&gH.test(f)&&(j=f,vH))try{let _=new URL(window.location.href),P=f.startsWith("//")?new URL(_.protocol+f):new URL(f),A=Jl(P.pathname,g);P.origin===_.origin&&A!=null?f=A+P.search+P.hash:b=!0}catch{}let x=zV(f,{relative:a}),S=bH(f,{replace:o,state:c,target:d,preventScrollReset:h,relative:a,viewTransition:p});function N(_){r&&r(_),_.defaultPrevented||S(_)}return v.createElement("a",vh({},y,{href:j||x,onClick:b||i?r:N,ref:n,target:d}))}),yH=v.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:a=!1,className:i="",end:o=!1,style:c,to:d,viewTransition:f,children:h}=t,p=yD(t,dH),y=Km(d,{relative:p.relative}),g=xs(),j=v.useContext(dD),{navigator:b,basename:x}=v.useContext(Qs),S=j!=null&&wH(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=Jl(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(bt,vh({},p,{"aria-current":M,className:z,ref:n,style:B,to:d,viewTransition:f}),typeof h=="function"?h(R):h)});var $1;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})($1||($1={}));var qE;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(qE||(qE={}));function xH(e){let t=v.useContext(Vm);return t||wn(!1),t}function bH(e,t){let{target:n,replace:r,state:a,preventScrollReset:i,relative:o,viewTransition:c}=t===void 0?{}:t,d=_a(),f=xs(),h=Km(e,{relative:o});return v.useCallback(p=>{if(lH(p,n)){p.preventDefault();let y=r!==void 0?r:mh(f)===mh(h);d(e,{replace:y,state:a,preventScrollReset:i,relative:o,viewTransition:c})}},[f,d,h,r,a,n,e,i,o,c])}function Ic(e){let t=v.useRef(M1(e)),n=v.useRef(!1),r=xs(),a=v.useMemo(()=>cH(r.search,n.current?null:t.current),[r.search]),i=_a(),o=v.useCallback((c,d)=>{const f=M1(typeof c=="function"?c(a):c);n.current=!0,i("?"+f,d)},[i,a]);return[a,o]}function wH(e,t){t===void 0&&(t={});let n=v.useContext(pH);n==null&&wn(!1);let{basename:r}=xH($1.useViewTransitionState),a=Km(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Jl(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Jl(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Jt(a.pathname,o)!=null||Jt(a.pathname,i)!=null}var jH=Symbol.for("react.lazy"),gh=Am[" use ".trim().toString()];function SH(e){return typeof e=="object"&&e!==null&&"then"in e}function xD(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===jH&&"_payload"in e&&SH(e._payload)}function Gm(e){const t=NH(e),n=v.forwardRef((r,a)=>{let{children:i,...o}=r;xD(i)&&typeof gh=="function"&&(i=gh(i._payload));const c=v.Children.toArray(i),d=c.find(_H);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 zi=Gm("Slot");function NH(e){const t=v.forwardRef((n,r)=>{let{children:a,...i}=n;if(xD(a)&&typeof gh=="function"&&(a=gh(a._payload)),v.isValidElement(a)){const o=EH(a),c=AH(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Cr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var CH=Symbol("radix.slottable");function _H(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===CH}function AH(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function EH(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const ex=768;function PH(){const[e,t]=v.useState(void 0);return v.useEffect(()=>{const n=window.matchMedia(`(max-width: ${ex-1}px)`),r=()=>{t(window.innerWidth<ex)};return n.addEventListener("change",r),t(window.innerWidth<ex),()=>n.removeEventListener("change",r)},[]),!!e}const GS=Do("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?zi:"button";return s.jsx(o,{className:xe(GS({variant:t,size:n,className:e})),ref:i,...a})});se.displayName="Button";const ht=v.forwardRef(({className:e,type:t,...n},r)=>s.jsx("input",{type:t,className:xe("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));ht.displayName="Input";var OH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],kH=OH.reduce((e,t)=>{const n=Gm(`Primitive.${t}`),r=v.forwardRef((a,i)=>{const{asChild:o,...c}=a,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),RH="Separator",WE="horizontal",TH=["horizontal","vertical"],bD=v.forwardRef((e,t)=>{const{decorative:n,orientation:r=WE,...a}=e,i=IH(r)?r:WE,c=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return s.jsx(kH.div,{"data-orientation":i,...c,...a,ref:t})});bD.displayName=RH;function IH(e){return TH.includes(e)}var wD=bD;const jD=v.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>s.jsx(wD,{ref:a,decorative:n,orientation:t,className:xe("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));jD.displayName=wD.displayName;var tx="focusScope.autoFocusOnMount",nx="focusScope.autoFocusOnUnmount",VE={bubbles:!1,cancelable:!0},MH="FocusScope",rf=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[c,d]=v.useState(null),f=Tn(a),h=Tn(i),p=v.useRef(null),y=mt(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:_i(p.current,{select:!0})},x=function(_){if(g.paused||!c)return;const P=_.relatedTarget;P!==null&&(c.contains(P)||_i(p.current,{select:!0}))},S=function(_){if(document.activeElement===document.body)for(const A of _)A.removedNodes.length>0&&_i(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){KE.add(g);const b=document.activeElement;if(!c.contains(b)){const S=new CustomEvent(tx,VE);c.addEventListener(tx,f),c.dispatchEvent(S),S.defaultPrevented||($H(zH(SD(c)),{select:!0}),document.activeElement===b&&_i(c))}return()=>{c.removeEventListener(tx,f),setTimeout(()=>{const S=new CustomEvent(nx,VE);c.addEventListener(nx,h),c.dispatchEvent(S),S.defaultPrevented||_i(b??document.body,{select:!0}),c.removeEventListener(nx,h),KE.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]=DH(N);_&&P?!b.shiftKey&&S===P?(b.preventDefault(),n&&_i(_,{select:!0})):b.shiftKey&&S===_&&(b.preventDefault(),n&&_i(P,{select:!0})):S===N&&b.preventDefault()}},[n,r,g.paused]);return s.jsx(ze.div,{tabIndex:-1,...o,ref:y,onKeyDown:j})});rf.displayName=MH;function $H(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(_i(r,{select:t}),document.activeElement!==n)return}function DH(e){const t=SD(e),n=HE(t,e),r=HE(t.reverse(),e);return[n,r]}function SD(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function HE(e,t){for(const n of e)if(!LH(n,{upTo:t}))return n}function LH(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 FH(e){return e instanceof HTMLInputElement&&"select"in e}function _i(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&FH(e)&&t&&e.select()}}var KE=BH();function BH(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=GE(e,t),e.unshift(t)},remove(t){e=GE(e,t),e[0]?.resume()}}}function GE(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function zH(e){return e.filter(t=>t.tagName!=="A")}var rx=0;function Ym(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??YE()),document.body.insertAdjacentElement("beforeend",e[1]??YE()),rx++,()=>{rx===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),rx--}},[])}function YE(){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 is=function(){return is=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},is.apply(this,arguments)};function ND(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function UH(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 ih="right-scroll-bar-position",oh="width-before-scroll-bar",qH="with-scroll-bars-hidden",WH="--removed-body-scroll-bar-size";function ax(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function VH(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 HH=typeof window<"u"?v.useLayoutEffect:v.useEffect,XE=new WeakMap;function KH(e,t){var n=VH(null,function(r){return e.forEach(function(a){return ax(a,r)})});return HH(function(){var r=XE.get(n);if(r){var a=new Set(r),i=new Set(e),o=n.current;a.forEach(function(c){i.has(c)||ax(c,null)}),i.forEach(function(c){a.has(c)||ax(c,o)})}XE.set(n,e)},[e]),n}function GH(e){return e}function YH(e,t){t===void 0&&(t=GH);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 XH(e){e===void 0&&(e={});var t=YH(null);return t.options=is({async:!0,ssr:!1},e),t}var CD=function(e){var t=e.sideCar,n=ND(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return v.createElement(r,is({},n))};CD.isSideCarExport=!0;function QH(e,t){return e.useMedium(t),CD}var _D=XH(),sx=function(){},Xm=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:sx,onWheelCapture:sx,onTouchMoveCapture:sx}),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=ND(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=y,O=KH([n,t]),k=is(is({},P),a);return v.createElement(v.Fragment,null,h&&v.createElement(A,{sideCar:_D,removeScrollBar:f,shards:p,noRelative:g,noIsolation:j,inert:b,setCallbacks:i,allowPinchZoom:!!x,lockRef:n,gapMode:_}),o?v.cloneElement(v.Children.only(c),is(is({},k),{ref:O})):v.createElement(N,is({},k,{className:d,ref:O}),c))});Xm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Xm.classNames={fullWidth:oh,zeroRight:ih};var JH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ZH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=JH();return t&&e.setAttribute("nonce",t),e}function eK(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function tK(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var nK=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ZH())&&(eK(t,n),tK(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},rK=function(){var e=nK();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},AD=function(){var e=rK(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},aK={left:0,top:0,right:0,gap:0},ix=function(e){return parseInt(e||"",10)||0},sK=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[ix(n),ix(r),ix(a)]},iK=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return aK;var t=sK(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])}},oK=AD(),Bl="data-scroll-locked",lK=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(qH,` {
|
|
11
|
-
overflow: hidden `).concat(r,`;
|
|
12
|
-
padding-right: `).concat(c,"px ").concat(r,`;
|
|
13
|
-
}
|
|
14
|
-
body[`).concat(Bl,`] {
|
|
15
|
-
overflow: hidden `).concat(r,`;
|
|
16
|
-
overscroll-behavior: contain;
|
|
17
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
18
|
-
padding-left: `.concat(a,`px;
|
|
19
|
-
padding-top: `).concat(i,`px;
|
|
20
|
-
padding-right: `).concat(o,`px;
|
|
21
|
-
margin-left:0;
|
|
22
|
-
margin-top:0;
|
|
23
|
-
margin-right: `).concat(c,"px ").concat(r,`;
|
|
24
|
-
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.`).concat(ih,` {
|
|
28
|
-
right: `).concat(c,"px ").concat(r,`;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.`).concat(oh,` {
|
|
32
|
-
margin-right: `).concat(c,"px ").concat(r,`;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.`).concat(ih," .").concat(ih,` {
|
|
36
|
-
right: 0 `).concat(r,`;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.`).concat(oh," .").concat(oh,` {
|
|
40
|
-
margin-right: 0 `).concat(r,`;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
body[`).concat(Bl,`] {
|
|
44
|
-
`).concat(WH,": ").concat(c,`px;
|
|
45
|
-
}
|
|
46
|
-
`)},QE=function(){var e=parseInt(document.body.getAttribute(Bl)||"0",10);return isFinite(e)?e:0},cK=function(){v.useEffect(function(){return document.body.setAttribute(Bl,(QE()+1).toString()),function(){var e=QE()-1;e<=0?document.body.removeAttribute(Bl):document.body.setAttribute(Bl,e.toString())}},[])},uK=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;cK();var i=v.useMemo(function(){return iK(a)},[a]);return v.createElement(oK,{styles:lK(i,!t,a,n?"":"!important")})},D1=!1;if(typeof window<"u")try{var Mp=Object.defineProperty({},"passive",{get:function(){return D1=!0,!0}});window.addEventListener("test",Mp,Mp),window.removeEventListener("test",Mp,Mp)}catch{D1=!1}var yl=D1?{passive:!1}:!1,dK=function(e){return e.tagName==="TEXTAREA"},ED=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!dK(e)&&n[t]==="visible")},fK=function(e){return ED(e,"overflowY")},pK=function(e){return ED(e,"overflowX")},JE=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=PD(e,r);if(a){var i=OD(e,r),o=i[1],c=i[2];if(o>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},hK=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},mK=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},PD=function(e,t){return e==="v"?fK(t):pK(t)},OD=function(e,t){return e==="v"?hK(t):mK(t)},vK=function(e,t){return e==="h"&&t==="rtl"?-1:1},gK=function(e,t,n,r,a){var i=vK(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=OD(e,c),j=g[0],b=g[1],x=g[2],S=b-x-i*j;(j||S)&&PD(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},$p=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ZE=function(e){return[e.deltaX,e.deltaY]},eP=function(e){return e&&"current"in e?e.current:e},yK=function(e,t){return e[0]===t[0]&&e[1]===t[1]},xK=function(e){return`
|
|
47
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
48
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
49
|
-
`)},bK=0,xl=[];function wK(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),a=v.useState(bK++)[0],i=v.useState(AD)[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=UH([e.lockRef.current],(e.shards||[]).map(eP),!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=$p(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=JE(k,O);if(!B)return!0;if(B?A=k:(A=k==="v"?"h":"v",B=JE(k,O)),!B)return!1;if(!r.current&&"changedTouches"in b&&(_||P)&&(r.current=A),!A)return!0;var L=r.current||A;return gK(L,x,b,L==="h"?_:P)},[]),d=v.useCallback(function(b){var x=b;if(!(!xl.length||xl[xl.length-1]!==i)){var S="deltaY"in x?ZE(x):$p(x),N=t.current.filter(function(A){return A.name===x.type&&(A.target===x.target||x.target===A.shadowParent)&&yK(A.delta,S)})[0];if(N&&N.should){x.cancelable&&x.preventDefault();return}if(!N){var _=(o.current.shards||[]).map(eP).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:jK(S)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(P){return P!==_})},1)},[]),h=v.useCallback(function(b){n.current=$p(b),r.current=void 0},[]),p=v.useCallback(function(b){f(b.type,ZE(b),b.target,c(b,e.lockRef.current))},[]),y=v.useCallback(function(b){f(b.type,$p(b),b.target,c(b,e.lockRef.current))},[]);v.useEffect(function(){return xl.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:y}),document.addEventListener("wheel",d,yl),document.addEventListener("touchmove",d,yl),document.addEventListener("touchstart",h,yl),function(){xl=xl.filter(function(b){return b!==i}),document.removeEventListener("wheel",d,yl),document.removeEventListener("touchmove",d,yl),document.removeEventListener("touchstart",h,yl)}},[]);var g=e.removeScrollBar,j=e.inert;return v.createElement(v.Fragment,null,j?v.createElement(i,{styles:xK(a)}):null,g?v.createElement(uK,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function jK(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const SK=QH(_D,wK);var af=v.forwardRef(function(e,t){return v.createElement(Xm,is({},e,{ref:t,sideCar:SK}))});af.classNames=Xm.classNames;var NK=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},bl=new WeakMap,Dp=new WeakMap,Lp={},ox=0,kD=function(e){return e&&(e.host||kD(e.parentNode))},CK=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=kD(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},_K=function(e,t,n,r){var a=CK(t,Array.isArray(e)?e:[e]);Lp[n]||(Lp[n]=new WeakMap);var i=Lp[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=(bl.get(y)||0)+1,x=(i.get(y)||0)+1;bl.set(y,b),i.set(y,x),o.push(y),b===1&&j&&Dp.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(),ox++,function(){o.forEach(function(p){var y=bl.get(p)-1,g=i.get(p)-1;bl.set(p,y),i.set(p,g),y||(Dp.has(p)||p.removeAttribute(r),Dp.delete(p)),g||p.removeAttribute(n)}),ox--,ox||(bl=new WeakMap,bl=new WeakMap,Dp=new WeakMap,Lp={})}},Qm=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=NK(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),_K(r,a,n,"aria-hidden")):function(){return null}};function AK(e){const t=EK(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(OK);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function EK(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=RK(a),c=kK(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Cr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var PK=Symbol("radix.slottable");function OK(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===PK}function kK(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 RK(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Jm="Dialog",[RD,TD]=or(Jm),[TK,Va]=RD(Jm),ID=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!0}=e,c=v.useRef(null),d=v.useRef(null),[f,h]=sa({prop:r,defaultProp:a??!1,onChange:i,caller:Jm});return s.jsx(TK,{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})};ID.displayName=Jm;var MD="DialogTrigger",$D=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Va(MD,n),i=mt(t,a.triggerRef);return s.jsx(ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":QS(a.open),...r,ref:i,onClick:Ee(e.onClick,a.onOpenToggle)})});$D.displayName=MD;var YS="DialogPortal",[IK,DD]=RD(YS,{forceMount:void 0}),LD=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=Va(YS,t);return s.jsx(IK,{scope:t,forceMount:n,children:v.Children.map(r,o=>s.jsx(Kn,{present:n||i.open,children:s.jsx(Ec,{asChild:!0,container:a,children:o})}))})};LD.displayName=YS;var yh="DialogOverlay",FD=v.forwardRef((e,t)=>{const n=DD(yh,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Va(yh,e.__scopeDialog);return i.modal?s.jsx(Kn,{present:r||i.open,children:s.jsx($K,{...a,ref:t})}):null});FD.displayName=yh;var MK=AK("DialogOverlay.RemoveScroll"),$K=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Va(yh,n);return s.jsx(af,{as:MK,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(ze.div,{"data-state":QS(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Co="DialogContent",BD=v.forwardRef((e,t)=>{const n=DD(Co,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Va(Co,e.__scopeDialog);return s.jsx(Kn,{present:r||i.open,children:i.modal?s.jsx(DK,{...a,ref:t}):s.jsx(LK,{...a,ref:t})})});BD.displayName=Co;var DK=v.forwardRef((e,t)=>{const n=Va(Co,e.__scopeDialog),r=v.useRef(null),a=mt(t,n.contentRef,r);return v.useEffect(()=>{const i=r.current;if(i)return Qm(i)},[]),s.jsx(zD,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ee(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Ee(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0;(o.button===2||c)&&i.preventDefault()}),onFocusOutside:Ee(e.onFocusOutside,i=>i.preventDefault())})}),LK=v.forwardRef((e,t)=>{const n=Va(Co,e.__scopeDialog),r=v.useRef(!1),a=v.useRef(!1);return s.jsx(zD,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;n.triggerRef.current?.contains(o)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),zD=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,c=Va(Co,n),d=v.useRef(null),f=mt(t,d);return Ym(),s.jsxs(s.Fragment,{children:[s.jsx(rf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx($o,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":QS(c.open),...o,ref:f,onDismiss:()=>c.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(BK,{titleId:c.titleId}),s.jsx(UK,{contentRef:d,descriptionId:c.descriptionId})]})]})}),XS="DialogTitle",UD=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Va(XS,n);return s.jsx(ze.h2,{id:a.titleId,...r,ref:t})});UD.displayName=XS;var qD="DialogDescription",WD=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Va(qD,n);return s.jsx(ze.p,{id:a.descriptionId,...r,ref:t})});WD.displayName=qD;var VD="DialogClose",HD=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Va(VD,n);return s.jsx(ze.button,{type:"button",...r,ref:t,onClick:Ee(e.onClick,()=>a.onOpenChange(!1))})});HD.displayName=VD;function QS(e){return e?"open":"closed"}var KD="DialogTitleWarning",[FK,GD]=PU(KD,{contentName:Co,titleName:XS,docsSlug:"dialog"}),BK=({titleId:e})=>{const t=GD(KD),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
50
|
-
|
|
51
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
52
|
-
|
|
53
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},zK="DialogDescriptionWarning",UK=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${GD(zK).contentName}}.`;return v.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Zm=ID,qK=$D,ev=LD,Mc=FD,$c=BD,sf=UD,of=WD,tv=HD;const YD=Zm,WK=ev,XD=v.forwardRef(({className:e,...t},n)=>s.jsx(Mc,{className:xe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));XD.displayName=Mc.displayName;const VK=Do("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"}}),JS=v.forwardRef(({side:e="right",className:t,children:n,...r},a)=>s.jsxs(WK,{children:[s.jsx(XD,{}),s.jsxs($c,{ref:a,className:xe(VK({side:e}),t),...r,children:[n,s.jsxs(tv,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[s.jsx(Vs,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));JS.displayName=$c.displayName;const QD=({className:e,...t})=>s.jsx("div",{className:xe("flex flex-col space-y-2 text-center sm:text-left",e),...t});QD.displayName="SheetHeader";const JD=v.forwardRef(({className:e,...t},n)=>s.jsx(sf,{ref:n,className:xe("text-lg font-semibold text-foreground",e),...t}));JD.displayName=sf.displayName;const HK=v.forwardRef(({className:e,...t},n)=>s.jsx(of,{ref:n,className:xe("text-sm text-muted-foreground",e),...t}));HK.displayName=of.displayName;function tP({className:e,...t}){return s.jsx("div",{className:xe("animate-pulse rounded-md bg-muted",e),...t})}const KK="sidebar:state",GK=3600*24*7,YK="16rem",XK="18rem",QK="3rem",JK="b",ZD=v.createContext(null);function lf(){const e=v.useContext(ZD);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const e3=v.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:i,...o},c)=>{const d=PH(),[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=`${KK}=${_}; path=/; max-age=${GK}`},[n,g]),b=v.useCallback(()=>d?h(N=>!N):j(N=>!N),[d,j,h]);v.useEffect(()=>{const N=_=>{_.key===JK&&(_.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(ZD.Provider,{value:S,children:s.jsx(Z$,{delayDuration:0,children:s.jsx("div",{style:{"--sidebar-width":YK,"--sidebar-width-icon":QK,...a},className:xe("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:c,...o,children:i})})})});e3.displayName="SidebarProvider";const t3=v.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:a,...i},o)=>{const{isMobile:c,state:d,openMobile:f,setOpenMobile:h}=lf();return n==="none"?s.jsx("div",{className:xe("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",r),ref:o,...i,children:a}):c?s.jsx(YD,{open:f,onOpenChange:h,...i,children:s.jsx(JS,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":XK},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:xe("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:xe("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...i,children:s.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:a})})]})});t3.displayName="Sidebar";const n3=v.forwardRef(({className:e,onClick:t,...n},r)=>{const{toggleSidebar:a}=lf();return s.jsxs(se,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:xe("h-7 w-7",e),onClick:i=>{t?.(i),a()},...n,children:[s.jsx(M7,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});n3.displayName="SidebarTrigger";const ZK=v.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=lf();return s.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:xe("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})});ZK.displayName="SidebarRail";const eG=v.forwardRef(({className:e,...t},n)=>s.jsx("main",{ref:n,className:xe("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}));eG.displayName="SidebarInset";const tG=v.forwardRef(({className:e,...t},n)=>s.jsx(ht,{ref:n,"data-sidebar":"input",className:xe("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));tG.displayName="SidebarInput";const r3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"header",className:xe("flex flex-col gap-2 p-2",e),...t}));r3.displayName="SidebarHeader";const a3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"footer",className:xe("flex flex-col gap-2 p-2",e),...t}));a3.displayName="SidebarFooter";const L1=v.forwardRef(({className:e,...t},n)=>s.jsx(jD,{ref:n,"data-sidebar":"separator",className:xe("mx-2 w-auto bg-sidebar-border",e),...t}));L1.displayName="SidebarSeparator";const s3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"content",className:xe("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));s3.displayName="SidebarContent";const i3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"group",className:xe("relative flex w-full min-w-0 flex-col p-2",e),...t}));i3.displayName="SidebarGroup";const o3=v.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const a=t?zi:"div";return s.jsx(a,{ref:r,"data-sidebar":"group-label",className:xe("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...n})});o3.displayName="SidebarGroupLabel";const nG=v.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const a=t?zi:"button";return s.jsx(a,{ref:r,"data-sidebar":"group-action",className:xe("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})});nG.displayName="SidebarGroupAction";const l3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"group-content",className:xe("w-full text-sm",e),...t}));l3.displayName="SidebarGroupContent";const c3=v.forwardRef(({className:e,...t},n)=>s.jsx("ul",{ref:n,"data-sidebar":"menu",className:xe("flex w-full min-w-0 flex-col gap-1",e),...t}));c3.displayName="SidebarMenu";const u3=v.forwardRef(({className:e,...t},n)=>s.jsx("li",{ref:n,"data-sidebar":"menu-item",className:xe("group/menu-item relative",e),...t}));u3.displayName="SidebarMenuItem";const rG=Do("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),d3=v.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:a,className:i,...o},c)=>{const d=e?zi:"button",{isMobile:f,state:h}=lf(),p=s.jsx(d,{ref:c,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:xe(rG({variant:n,size:r}),i),...o});return a?(typeof a=="string"&&(a={children:a}),s.jsxs(eD,{children:[s.jsx(tD,{asChild:!0,children:p}),s.jsx(US,{side:"right",align:"center",hidden:h!=="collapsed"||f,...a})]})):p});d3.displayName="SidebarMenuButton";const aG=v.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},a)=>{const i=t?zi:"button";return s.jsx(i,{ref:a,"data-sidebar":"menu-action",className:xe("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})});aG.displayName="SidebarMenuAction";const sG=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:xe("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}));sG.displayName="SidebarMenuBadge";const iG=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:xe("flex h-8 items-center gap-2 rounded-md px-2",e),...n,children:[t&&s.jsx(tP,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),s.jsx(tP,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":a}})]})});iG.displayName="SidebarMenuSkeleton";const oG=v.forwardRef(({className:e,...t},n)=>s.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:xe("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}));oG.displayName="SidebarMenuSub";const lG=v.forwardRef(({...e},t)=>s.jsx("li",{ref:t,...e}));lG.displayName="SidebarMenuSubItem";const cG=v.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...a},i)=>{const o=e?zi:"a";return s.jsx(o,{ref:i,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:xe("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})});cG.displayName="SidebarMenuSubButton";const f3=v.forwardRef(({className:e,activeClassName:t,pendingClassName:n,to:r,...a},i)=>s.jsx(yH,{ref:i,to:r,className:({isActive:o,isPending:c})=>xe(e,o&&t,c&&n),...a}));f3.displayName="NavLink";function uG({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 dG=[{title:"Home",items:[{title:"Dashboard",url:"/",icon:o$}]},{title:"Lab",items:[{title:"MCP Evaluations",url:"/mcp-evaluations",icon:i$},{title:"Analyze MCP",url:"/tool-analysis",icon:l$}]},{title:"Libraries",items:[{title:"Test Cases",url:"/libraries/test-cases",icon:s$},{title:"Servers",url:"/libraries/servers",icon:a$},{title:"Agents",url:"/libraries/agents",icon:ya}]},{title:"Execution",items:[{title:"Run Evaluation",url:"/run",icon:Dl},{title:"Evaluation Results",url:"/results",icon:id},{title:"Compare Evaluations",url:"/compare",icon:ES},{title:"MCP Analysis Results",url:"/tool-analysis-results",icon:c$},{title:"Custom Reports",url:"/markdown-reports",icon:Pl}]},{title:"Workspace",items:[{title:"Settings",url:"/settings",icon:OS}]}];function fG(e={version:null}){const t=e.version??null,{state:n}=lf(),r=n==="collapsed",a=xs(),i=v.useMemo(()=>dG,[]);return s.jsxs(t3,{collapsible:"icon",children:[s.jsx(r3,{className:`border-b border-sidebar-border py-3 ${r?"px-2":"px-4"}`,children:s.jsxs("div",{className:`flex items-center ${r?"justify-center":"gap-2.5"} overflow-hidden`,children:[s.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-sidebar-accent/50 border border-primary/60",children:s.jsx(uG,{width:22,height:22,from:"#f97316",to:"#fb923c"})}),!r&&s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{className:"text-sm font-semibold text-sidebar-foreground",children:"MCPLab"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"MCP Evaluation Lab"})]})]})}),s.jsx(s3,{children:i.map((o,c)=>s.jsxs("div",{children:[c>0&&!r&&s.jsx(L1,{className:"my-1.5"}),s.jsxs(i3,{className:r?"px-2":"px-3 py-2",children:[!r&&s.jsx(o3,{className:"px-1 pb-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground/90",children:o.title}),s.jsx(l3,{children:s.jsx(c3,{children:o.items.map(d=>s.jsx(u3,{children:s.jsx(d3,{asChild:!0,isActive:d.url==="/"?a.pathname==="/":a.pathname.startsWith(d.url),tooltip:d.title,children:s.jsxs(f3,{to:d.url,end:d.url==="/",activeClassName:"bg-sidebar-accent text-sidebar-accent-foreground",children:[s.jsx(d.icon,{className:"h-4 w-4"}),s.jsx("span",{children:d.title})]})})},d.title))})})]})]},o.title))}),s.jsxs(a3,{className:r?"px-2 py-2":"px-3 py-3",children:[s.jsx(L1,{className:"my-1.5"}),s.jsxs("div",{className:`flex ${r?"justify-center":"items-center justify-center gap-2"} w-full`,children:[s.jsxs("a",{href:"https://github.com/inspectr-hq/mcplab",target:"_blank",rel:"noreferrer",className:`inline-flex items-center rounded-md border border-sidebar-border/70 bg-sidebar-accent/20 text-sidebar-foreground/85 transition-colors hover:bg-sidebar-accent/35 hover:text-sidebar-foreground ${r?"justify-center p-2":"gap-2 px-2.5 py-1.5"}`,title:`GitHub${t?` · v${t}`:""}`,"aria-label":"GitHub repository",children:[s.jsx(R7,{className:"h-4 w-4 shrink-0"}),!r&&s.jsx("span",{className:"text-xs text-sidebar-foreground/85",children:`v${t??"unknown"}`})]}),!r&&s.jsxs("a",{href:"https://inspectr.dev",target:"_blank",rel:"noreferrer",className:"text-xs text-muted-foreground transition-colors hover:text-sidebar-foreground",children:["Built by ",s.jsx("span",{className:"text-[#00e5ff] hover:text-[#00b8d4]",children:"Inspectr"})]})]})]})]})}const p3=v.forwardRef(({...e},t)=>s.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));p3.displayName="Breadcrumb";const h3=v.forwardRef(({className:e,...t},n)=>s.jsx("ol",{ref:n,className:xe("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));h3.displayName="BreadcrumbList";const m3=v.forwardRef(({className:e,...t},n)=>s.jsx("li",{ref:n,className:xe("inline-flex items-center gap-1.5",e),...t}));m3.displayName="BreadcrumbItem";const v3=v.forwardRef(({asChild:e,className:t,...n},r)=>{const a=e?zi:"a";return s.jsx(a,{ref:r,className:xe("transition-colors hover:text-foreground",t),...n})});v3.displayName="BreadcrumbLink";const g3=v.forwardRef(({className:e,...t},n)=>s.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:xe("font-normal text-foreground",e),...t}));g3.displayName="BreadcrumbPage";const y3=({children:e,className:t,...n})=>s.jsx("li",{role:"presentation","aria-hidden":"true",className:xe("[&>svg]:size-3.5",t),...n,children:e??s.jsx(r$,{})});y3.displayName="BreadcrumbSeparator";function pG(e,t){return`${e}-${t+1}`}function Cl(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==="api_key"||p.auth?.type==="oauth_client_credentials"?"api-key":p.auth?.type==="oauth_authorization_code"?"oauth2":"none",b={id:g,name:String(p.name||y),transport:"streamable-http",url:p.url,authType:j,authValue:p.auth?.type==="bearer"?p.auth.token??(p.auth.env?`\${${p.auth.env}}`:void 0):p.auth?.type==="api_key"?p.auth.value:void 0,apiKeyHeaderName:p.auth?.type==="api_key"?p.auth.header_name:void 0,oauthClientId:p.auth?.type==="oauth_authorization_code"?p.auth.client_id:void 0,oauthClientSecret:p.auth?.type==="oauth_authorization_code"?p.auth.client_secret:void 0,oauthRedirectUrl:p.auth?.type==="oauth_authorization_code"?p.auth.redirect_url:void 0,oauthScope:p.auth?.type==="oauth_authorization_code"||p.auth?.type==="oauth_client_credentials"?p.auth.scope:void 0,oauthTokenUrl:p.auth?.type==="oauth_client_credentials"?p.auth.token_url:void 0,oauthClientIdEnv:p.auth?.type==="oauth_client_credentials"?p.auth.client_id_env:void 0,oauthClientSecretEnv:p.auth?.type==="oauth_client_credentials"?p.auth.client_secret_env:void 0,oauthAudience:p.auth?.type==="oauth_client_credentials"?p.auth.audience:void 0};i.push(b),o.push({kind:"inline",server:b})}const c=[],d=[];for(const p of r){if("ref"in p){const 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||pG("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==="api_key"||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.token||"")||(N.env?`\${${N.env}}`:void 0):N?.type==="api_key"?String(N.value||""):void 0,apiKeyHeaderName:N?.type==="api_key"?String(N.header_name||""):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 hG(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=Cl(t);return{servers:n.servers,agents:n.agents,scenarios:n.scenarios}}function nP(e){const t=new Map,n=g=>{const j=g.id,b=g.authValue?.trim()??"",x=g.apiKeyHeaderName?.trim()??"",S=g.authType==="bearer"?(()=>{if(!b)throw new Error(`Server '${j}' is missing bearer token value`);return{type:"bearer",token:b}})():g.authType==="api-key"&&!g.oauthTokenUrl?{type:"api_key",...x?{header_name:x}:{},value:(()=>{if(!b)throw new Error(`Server '${j}' is missing API key value`);return b})()}:g.authType==="api-key"?{type:"oauth_client_credentials",token_url:g.oauthTokenUrl||"",client_id_env:g.oauthClientIdEnv||"",client_secret_env:g.oauthClientSecretEnv||"",...g.oauthScope?{scope:g.oauthScope}:{},...g.oauthAudience?{audience:g.oauthAudience}:{}}:g.authType==="oauth2"?{type:"oauth_authorization_code",client_id:g.oauthClientId||"",client_secret:g.oauthClientSecret||void 0,redirect_url:g.oauthRedirectUrl||"http://localhost:6274/oauth/",scope:g.oauthScope||void 0}:void 0;return{id:j,...g.name&&g.name!==j?{name:g.name}:{},transport:"http",url:g.url||"http://localhost:3000/mcp",...S!==void 0?{auth:S}:{}}},r=e.serverEntries&&e.serverEntries.length>0?e.serverEntries:[...e.servers.map(g=>({kind:"inline",server:g}))],a=new Set,i=new Map,o=r.flatMap(g=>{if(g.kind==="referenced"){const b=String(g.ref||"").trim();return!b||a.has(b)?[]:(a.add(b),t.set(b,b),[{ref:b}])}const j=n(g.server);return t.set(g.server.id,j.id),i.set(j.id,j),[j]}),c=g=>{const j=g.id;return{id:j,...g.name&&g.name!==j?{name:g.name}:{},provider:g.provider==="azure"?"azure_openai":g.provider==="anthropic"?"anthropic":"openai",model:g.model,temperature:g.temperature,max_tokens:g.maxTokens,max_turns:g.maxTurns,system:g.systemPrompt}},d=e.agentEntries&&e.agentEntries.length>0?e.agentEntries:[...e.agents.map(g=>({kind:"inline",agent:g}))],f=new Set,h=d.flatMap(g=>{if(g.kind==="referenced"){const j=String(g.ref||"").trim();return!j||f.has(j)?[]:(f.add(j),[{ref:j}])}return[c(g.agent)]}),p=g=>{const j=g.evalRules.filter(S=>S.type==="required_tool").map(S=>S.value),b=g.evalRules.filter(S=>S.type==="forbidden_tool").map(S=>S.value),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 mG(e){const t=Object.fromEntries((e.servers??[]).map(r=>[r.id,(()=>{const a=r.authValue?.trim()??"",i=r.apiKeyHeaderName?.trim()??"";return{...r.name&&r.name!==r.id?{name:r.name}:{},transport:"http",url:r.url||"http://localhost:3000/mcp",auth:r.authType==="bearer"?(()=>{if(!a)throw new Error(`Server '${r.id}' is missing bearer token value`);return{type:"bearer",token:a}})():r.authType==="api-key"&&!r.oauthTokenUrl?{type:"api_key",...i?{header_name:i}:{},value:(()=>{if(!a)throw new Error(`Server '${r.id}' is missing API key value`);return a})()}:r.authType==="api-key"?{type:"oauth_client_credentials",token_url:r.oauthTokenUrl||"",client_id_env:r.oauthClientIdEnv||"",client_secret_env:r.oauthClientSecretEnv||"",...r.oauthScope?{scope:r.oauthScope}:{},...r.oauthAudience?{audience:r.oauthAudience}:{}}:r.authType==="oauth2"?{type:"oauth_authorization_code",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 vG(e,t){if(e)return`${e}::${t??""}`}function Fp(e){return e.type==="text"}function gG(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 yG(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(Fp);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:rP(y.input??{}),toolName:y.name,timestamp:o.ts});const g=h.get(y.id);if(!g)continue;const j=g.content.filter(Fp).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(Fp).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:rP(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(Fp).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 rP(e){try{return JSON.stringify(e)}catch{return String(e)}}function aP(e,t=[]){const n=new Map;for(const a of t){const i=vG(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:gG(h,y),finalAnswer:h.final_text,conversation:yG(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,runNote:e.metadata.run_note,mcpServerVersions:e.metadata.mcp_server_versions??{},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 xG(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}const Qu=xG();async function ut(e,t){const n=await fetch(`${Qu}${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 bG(e,t){const n=await fetch(`${Qu}${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:()=>ut("/api/health"),getSettings:()=>ut("/api/settings"),updateSettings:e=>ut("/api/settings",{method:"PUT",body:JSON.stringify(e)}),listConfigs:()=>ut("/api/evals"),createConfig:(e,t)=>ut("/api/evals",{method:"POST",body:JSON.stringify({fileName:e,config:t})}),updateConfig:(e,t,n)=>ut(`/api/evals/${e}`,{method:"PUT",body:JSON.stringify({config:t,fileName:n})}),deleteConfig:e=>ut(`/api/evals/${e}`,{method:"DELETE"}),listRuns:()=>ut("/api/runs"),listMarkdownReports:()=>ut("/api/markdown-reports").then(e=>e.items),getMarkdownReport:e=>ut(`/api/markdown-reports/content?path=${encodeURIComponent(e)}`),deleteMarkdownReport:e=>ut(`/api/markdown-reports?path=${encodeURIComponent(e)}`,{method:"DELETE"}).then(()=>{}),getRun:e=>ut(`/api/runs/${e}`),deleteRun:e=>ut(`/api/runs/${e}`,{method:"DELETE"}),updateRunNote:(e,t)=>ut(`/api/runs/${encodeURIComponent(e)}/note`,{method:"PATCH",body:JSON.stringify({runNote:t??""})}).then(()=>{}),getRunTrace:e=>ut(`/api/runs/${e}/trace`),listSnapshots:()=>ut("/api/snapshots"),createSnapshotFromRun:(e,t)=>ut("/api/snapshots",{method:"POST",body:JSON.stringify({runId:e,name:t})}),getSnapshot:e=>ut(`/api/snapshots/${e}`),compareSnapshot:(e,t)=>ut(`/api/snapshots/${e}/compare`,{method:"POST",body:JSON.stringify({runId:t})}),askResultAssistant:(e,t)=>ut(`/api/runs/${encodeURIComponent(e)}/assistant`,{method:"POST",body:JSON.stringify({messages:t})}),applyResultAssistantReport:e=>ut(`/api/runs/${encodeURIComponent(e.runId)}/assistant/apply-report`,{method:"POST",body:JSON.stringify({markdown:e.markdown,outputPath:e.outputPath,overwrite:e.overwrite})}),createResultAssistantSession:e=>ut("/api/result-assistant/sessions",{method:"POST",body:JSON.stringify({runId:e})}),getResultAssistantSession:e=>ut(`/api/result-assistant/sessions/${e}`),sendResultAssistantMessage:(e,t)=>ut(`/api/result-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t})}),approveResultAssistantToolCall:(e,t,n)=>ut(`/api/result-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify(n===void 0?{}:{argumentsOverride:n})}),denyResultAssistantToolCall:(e,t)=>ut(`/api/result-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),closeResultAssistantSession:e=>ut(`/api/result-assistant/sessions/${e}`,{method:"DELETE"}).then(()=>{}),generateSnapshotEvalBaseline:(e,t,n)=>ut("/api/snapshots/generate-eval",{method:"POST",body:JSON.stringify({runId:e,configId:t,name:n})}),updateSnapshotPolicy:(e,t)=>ut(`/api/evals/${e}/snapshot-policy`,{method:"POST",body:JSON.stringify(t)}),getLibraries:()=>ut("/api/libraries"),saveLibraries:e=>ut("/api/libraries",{method:"PUT",body:JSON.stringify(e)}),startRun:e=>ut("/api/runs",{method:"POST",body:JSON.stringify(e)}),listProviderModels:e=>ut(`/api/providers/models?provider=${encodeURIComponent(e)}`),createScenarioAssistantSession:e=>ut("/api/scenario-assistant/sessions",{method:"POST",body:JSON.stringify(e)}),getScenarioAssistantSession:e=>ut(`/api/scenario-assistant/sessions/${e}`),sendScenarioAssistantMessage:(e,t)=>ut(`/api/scenario-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t})}),approveScenarioAssistantToolCall:(e,t)=>ut(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify({})}),denyScenarioAssistantToolCall:(e,t)=>ut(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),approveAllScenarioAssistantToolCalls:e=>ut(`/api/scenario-assistant/sessions/${e}/tool-calls/approve-all`,{method:"POST",body:JSON.stringify({})}),closeScenarioAssistantSession:e=>ut(`/api/scenario-assistant/sessions/${e}`,{method:"DELETE"}),discoverToolsForAnalysis:e=>ut("/api/tool-analysis/discover-tools",{method:"POST",body:JSON.stringify(e)}),startToolAnalysis:e=>ut("/api/tool-analysis/jobs",{method:"POST",body:JSON.stringify(e)}),getToolAnalysisResult:e=>ut(`/api/tool-analysis/jobs/${e}/result`),stopToolAnalysis:e=>ut(`/api/tool-analysis/jobs/${e}/stop`,{method:"POST"}),subscribeToolAnalysisJob:(e,t)=>{const n=new EventSource(`${Qu}/api/tool-analysis/jobs/${e}/events`);let r=!1;const a=()=>{r||(r=!0,n.close())},i=o=>{if(!r&&!(typeof o.data!="string"||!o.data))try{const c=JSON.parse(o.data);t(c),(c.type==="completed"||c.type==="error")&&a()}catch{}};return n.addEventListener("started",i),n.addEventListener("log",i),n.addEventListener("completed",i),n.addEventListener("error",i),n.onerror=()=>{r||(t({type:"error",ts:new Date().toISOString(),payload:{message:"SSE connection error"}}),a())},()=>a()},listToolAnalysisResults:()=>ut("/api/tool-analysis-results").then(e=>e.items),getToolAnalysisSavedResult:e=>ut(`/api/tool-analysis-results/${e}`),deleteToolAnalysisSavedResult:e=>ut(`/api/tool-analysis-results/${e}`,{method:"DELETE"}).then(()=>{}),createOAuthDebuggerSession:e=>ut("/api/oauth-debugger/sessions",{method:"POST",body:JSON.stringify(e)}),getOAuthDebuggerSession:e=>ut(`/api/oauth-debugger/sessions/${e}`),startOAuthDebuggerSession:e=>ut(`/api/oauth-debugger/sessions/${e}/start`,{method:"POST",body:JSON.stringify({})}),subscribeOAuthDebuggerSession:(e,t)=>{const n=new EventSource(`${Qu}/api/oauth-debugger/sessions/${e}/events`);let r=!1;const a=()=>{r||(r=!0,n.close())},i=o=>{if(!r&&!(typeof o.data!="string"||!o.data))try{const c=JSON.parse(o.data);t(c),(c.type==="completed"||c.type==="error"||c.type==="stopped")&&a()}catch{}};return["started","step_started","step_completed","step_failed","http_request","http_response","validation","log","waiting_for_user","waiting_for_browser_callback","completed","error","stopped"].forEach(o=>n.addEventListener(o,i)),n.onerror=()=>{r||(t({type:"error",ts:new Date().toISOString(),payload:{message:"SSE connection error"}}),a())},()=>a()},submitOAuthDebuggerManualCallback:(e,t)=>ut(`/api/oauth-debugger/sessions/${e}/manual-callback`,{method:"POST",body:JSON.stringify(t)}),stopOAuthDebuggerSession:e=>ut(`/api/oauth-debugger/sessions/${e}/stop`,{method:"POST",body:JSON.stringify({})}),exportOAuthDebuggerSession:(e,t)=>t==="json"?ut(`/api/oauth-debugger/sessions/${e}/export?format=json`):bG(`/api/oauth-debugger/sessions/${e}/export?format=${t}`),stopRun:e=>ut(`/api/runs/jobs/${e}/stop`,{method:"POST"}),getRunQueue:()=>ut("/api/runs/queue"),removeQueuedRun:e=>ut(`/api/runs/queue/${e}`,{method:"DELETE"}).then(()=>{}),subscribeRunJob:(e,t)=>{const n=new EventSource(`${Qu}/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 wG(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 jG(e){return e||`config-${Date.now()}`}const SG={async listConfigs(){return(await rt.listConfigs()).map(Cl)},async createConfig(e){const t=await rt.createConfig(wG(e),nP(e));return Cl(t)},async updateConfig(e){const t=await rt.updateConfig(e.id,nP(e),jG(e.name));return Cl(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 aP(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 aP(t,n.records)}catch{return}},async deleteResult(e){await rt.deleteRun(e)},async updateRunNote(e,t){await rt.updateRunNote(e,t)},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:Cl(r.config)}},async updateSnapshotPolicy(e,t){const n=await rt.updateSnapshotPolicy(e,t);return Cl(n)},async getLibraries(){const e=await rt.getLibraries();return hG(e)},async saveLibraries(e){await rt.saveLibraries(mG(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)}},x3=v.createContext(null);function NG({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(()=>SG,[]);return s.jsx(x3.Provider,{value:{mode:t,connection:n,version:a,source:o},children:e})}function In(){const e=v.useContext(x3);if(!e)throw new Error("useDataSource must be used within DataSourceProvider");return e}const CG=e=>{if(e==="/")return[{label:"Dashboard"}];const t=[{label:"Dashboard",to:"/"}];if(Jt("/mcp-evaluations/:id",e))return t.push({label:"MCP Evaluations",to:"/mcp-evaluations"},{label:"MCP Evaluation"}),t;if(Jt("/mcp-evaluations",e))return t.push({label:"MCP Evaluations"}),t;if(Jt("/settings",e))return t.push({label:"Settings"}),t;if(Jt("/tool-analysis",e))return t.push({label:"Analyze MCP Tools"}),t;if(Jt("/tool-analysis-results/:id",e)){const n=Jt("/tool-analysis-results/:id",e);return t.push({label:"Tool Analysis Results",to:"/tool-analysis-results"},{label:n?.params.id??"Report"}),t}if(Jt("/tool-analysis-results",e))return t.push({label:"Tool Analysis Results"}),t;if(Jt("/markdown-reports/view",e))return t.push({label:"Markdown Reports",to:"/markdown-reports"},{label:"View Report"}),t;if(Jt("/markdown-reports",e))return t.push({label:"Markdown Reports"}),t;if(Jt("/oauth-debugger",e))return t.push({label:"OAuth Debugger"}),t;if(Jt("/results/:id",e))return t.push({label:"Evaluation Results",to:"/results"},{label:"Result"}),t;if(Jt("/results",e))return t.push({label:"Evaluation Results"}),t;if(Jt("/run",e))return t.push({label:"Run Evaluation"}),t;if(Jt("/libraries/servers/:serverId",e)){const n=Jt("/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(Jt("/libraries/servers",e))return t.push({label:"Libraries",to:"/libraries/servers"},{label:"Servers"}),t;if(Jt("/libraries/agents/:agentName",e)){const n=Jt("/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(Jt("/libraries/agents",e))return t.push({label:"Libraries",to:"/libraries/agents"},{label:"Agents"}),t;if(Jt("/libraries/test-cases/:testCaseId",e)){const n=Jt("/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 Jt("/libraries/test-cases",e)?(t.push({label:"Libraries",to:"/libraries/test-cases"},{label:"Test Cases"}),t):Jt("/compare",e)?(t.push({label:"Compare Evaluations"}),t):(Jt("/compare/results",e)&&t.push({label:"Compare Evaluations",to:"/compare"},{label:"Full Result Compare"}),t)};function _G(){const e=xs(),t=new URLSearchParams(e.search).get("embed")==="1",n=CG(e.pathname),{connection:r,version:a}=In();return t?s.jsx("main",{className:"min-h-screen overflow-auto bg-background p-4",children:s.jsx(zE,{})}):s.jsx(e3,{children:s.jsxs("div",{className:"flex min-h-screen w-full",children:[s.jsx(fG,{version:a}),s.jsxs("div",{className:"flex flex-1 flex-col",children:[s.jsxs("header",{className:"flex h-12 items-center gap-2 border-b bg-card px-4",children:[s.jsx(n3,{}),s.jsx(p3,{children:s.jsx(h3,{children:n.map((i,o)=>{const c=o===n.length-1;return s.jsxs(v.Fragment,{children:[s.jsx(m3,{children:i.to&&!c?s.jsx(v3,{asChild:!0,children:s.jsx(bt,{to:i.to,children:i.label})}):s.jsx(g3,{children:i.label})}),!c&&s.jsx(y3,{})]},`${i.label}-${o}`)})})}),s.jsx("div",{className:"ml-auto flex items-center gap-2",children:s.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border px-2.5 py-1",children:[s.jsx("span",{className:`h-2 w-2 rounded-full ${r==="connected"?"bg-emerald-500":r==="checking"?"bg-amber-400":"bg-rose-500"}`,"aria-hidden":"true"}),s.jsx("span",{className:`text-xs ${r==="connected"?"text-emerald-700":r==="checking"?"text-muted-foreground":"text-destructive"}`,children:r})]})})]}),s.jsx("main",{className:"flex-1 overflow-auto p-6",children:s.jsx(zE,{})})]})]})})}const b3=v.createContext(null);function AG({children:e}){const{source:t}=In(),[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(b3.Provider,{value:{configs:n,loading:a,getConfig:c,addConfig:d,updateConfig:f,deleteConfig:h,cloneConfig:p,reload:o},children:e})}function cf(){const e=v.useContext(b3);if(!e)throw new Error("useConfigs must be used within ConfigProvider");return e}const w3=v.createContext(null);function EG({children:e}){const{source:t}=In(),[n,r]=v.useState({servers:[],agents:[],scenarios:[]}),[a,i]=v.useState(!0),o=v.useCallback(async()=>{i(!0);try{const f=await t.getLibraries();r(f)}finally{i(!1)}},[t]);v.useEffect(()=>{o()},[t]),v.useEffect(()=>{const f=()=>{o()};return window.addEventListener("focus",f),()=>{window.removeEventListener("focus",f)}},[t]);const c=v.useCallback(async f=>{r(f),await t.saveLibraries(f)},[t]),d=v.useMemo(()=>({...n,loading:a,setServers:async f=>c({...n,servers:f}),setAgents:async f=>c({...n,agents:f}),setScenarios:async f=>c({...n,scenarios:f}),reload:o}),[n,a,o,c]);return s.jsx(w3.Provider,{value:d,children:e})}function Ha(){const e=v.useContext(w3);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:xe("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Ue.displayName="Card";const Ct=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:xe("flex flex-col space-y-1.5 p-6",e),...t}));Ct.displayName="CardHeader";const _t=v.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:xe("text-2xl font-semibold leading-none tracking-tight",e),...t}));_t.displayName="CardTitle";const Bs=v.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:xe("text-sm text-muted-foreground",e),...t}));Bs.displayName="CardDescription";const qe=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:xe("p-6 pt-0",e),...t}));qe.displayName="CardContent";const PG=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:xe("flex items-center p-6 pt-0",e),...t}));PG.displayName="CardFooter";const Zr=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:n,className:xe("w-full caption-bottom text-sm",e),...t})}));Zr.displayName="Table";const ea=v.forwardRef(({className:e,...t},n)=>s.jsx("thead",{ref:n,className:xe("[&_tr]:border-b",e),...t}));ea.displayName="TableHeader";const ta=v.forwardRef(({className:e,...t},n)=>s.jsx("tbody",{ref:n,className:xe("[&_tr:last-child]:border-0",e),...t}));ta.displayName="TableBody";const OG=v.forwardRef(({className:e,...t},n)=>s.jsx("tfoot",{ref:n,className:xe("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));OG.displayName="TableFooter";const Ut=v.forwardRef(({className:e,...t},n)=>s.jsx("tr",{ref:n,className:xe("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:xe("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));tt.displayName="TableHead";const He=v.forwardRef(({className:e,...t},n)=>s.jsx("td",{ref:n,className:xe("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));He.displayName="TableCell";const kG=v.forwardRef(({className:e,...t},n)=>s.jsx("caption",{ref:n,className:xe("mt-4 text-sm text-muted-foreground",e),...t}));kG.displayName="TableCaption";function $s({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 RG=Do("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Qe({className:e,variant:t,asChild:n,...r}){const a=n?zi:"div";return s.jsx(a,{className:xe(RG({variant:t}),e),...r})}function bo({rate:e,className:t}){const n=Math.round(e*100),r=n>=80?"default":n>=50?"secondary":"destructive";return s.jsxs(Qe,{variant:r,className:`font-mono text-xs ${n>=80?"bg-success/15 text-success hover:bg-success/20 border-0":n>=50?"bg-warning/15 text-warning hover:bg-warning/20 border-0":"bg-destructive/15 text-destructive hover:bg-destructive/20 border-0"} ${t??""}`,children:[n,"%"]})}var lx,sP;function Dr(){if(sP)return lx;sP=1;var e=Array.isArray;return lx=e,lx}var cx,iP;function j3(){if(iP)return cx;iP=1;var e=typeof Ep=="object"&&Ep&&Ep.Object===Object&&Ep;return cx=e,cx}var ux,oP;function bs(){if(oP)return ux;oP=1;var e=j3(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return ux=n,ux}var dx,lP;function uf(){if(lP)return dx;lP=1;var e=bs(),t=e.Symbol;return dx=t,dx}var fx,cP;function TG(){if(cP)return fx;cP=1;var e=uf(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,a=e?e.toStringTag:void 0;function i(o){var c=n.call(o,a),d=o[a];try{o[a]=void 0;var f=!0}catch{}var h=r.call(o);return f&&(c?o[a]=d:delete o[a]),h}return fx=i,fx}var px,uP;function IG(){if(uP)return px;uP=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return px=n,px}var hx,dP;function Js(){if(dP)return hx;dP=1;var e=uf(),t=TG(),n=IG(),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 hx=o,hx}var mx,fP;function Zs(){if(fP)return mx;fP=1;function e(t){return t!=null&&typeof t=="object"}return mx=e,mx}var vx,pP;function Dc(){if(pP)return vx;pP=1;var e=Js(),t=Zs(),n="[object Symbol]";function r(a){return typeof a=="symbol"||t(a)&&e(a)==n}return vx=r,vx}var gx,hP;function ZS(){if(hP)return gx;hP=1;var e=Dr(),t=Dc(),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 gx=a,gx}var yx,mP;function Ui(){if(mP)return yx;mP=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return yx=e,yx}var xx,vP;function eN(){if(vP)return xx;vP=1;var e=Js(),t=Ui(),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 xx=o,xx}var bx,gP;function MG(){if(gP)return bx;gP=1;var e=bs(),t=e["__core-js_shared__"];return bx=t,bx}var wx,yP;function $G(){if(yP)return wx;yP=1;var e=MG(),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 wx=n,wx}var jx,xP;function S3(){if(xP)return jx;xP=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 jx=n,jx}var Sx,bP;function DG(){if(bP)return Sx;bP=1;var e=eN(),t=$G(),n=Ui(),r=S3(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,c=Object.prototype,d=o.toString,f=c.hasOwnProperty,h=RegExp("^"+d.call(f).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(y){if(!n(y)||t(y))return!1;var g=e(y)?h:i;return g.test(r(y))}return Sx=p,Sx}var Nx,wP;function LG(){if(wP)return Nx;wP=1;function e(t,n){return t?.[n]}return Nx=e,Nx}var Cx,jP;function Fo(){if(jP)return Cx;jP=1;var e=DG(),t=LG();function n(r,a){var i=t(r,a);return e(i)?i:void 0}return Cx=n,Cx}var _x,SP;function nv(){if(SP)return _x;SP=1;var e=Fo(),t=e(Object,"create");return _x=t,_x}var Ax,NP;function FG(){if(NP)return Ax;NP=1;var e=nv();function t(){this.__data__=e?e(null):{},this.size=0}return Ax=t,Ax}var Ex,CP;function BG(){if(CP)return Ex;CP=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return Ex=e,Ex}var Px,_P;function zG(){if(_P)return Px;_P=1;var e=nv(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function a(i){var o=this.__data__;if(e){var c=o[i];return c===t?void 0:c}return r.call(o,i)?o[i]:void 0}return Px=a,Px}var Ox,AP;function UG(){if(AP)return Ox;AP=1;var e=nv(),t=Object.prototype,n=t.hasOwnProperty;function r(a){var i=this.__data__;return e?i[a]!==void 0:n.call(i,a)}return Ox=r,Ox}var kx,EP;function qG(){if(EP)return kx;EP=1;var e=nv(),t="__lodash_hash_undefined__";function n(r,a){var i=this.__data__;return this.size+=this.has(r)?0:1,i[r]=e&&a===void 0?t:a,this}return kx=n,kx}var Rx,PP;function WG(){if(PP)return Rx;PP=1;var e=FG(),t=BG(),n=zG(),r=UG(),a=qG();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,Rx=i,Rx}var Tx,OP;function VG(){if(OP)return Tx;OP=1;function e(){this.__data__=[],this.size=0}return Tx=e,Tx}var Ix,kP;function tN(){if(kP)return Ix;kP=1;function e(t,n){return t===n||t!==t&&n!==n}return Ix=e,Ix}var Mx,RP;function rv(){if(RP)return Mx;RP=1;var e=tN();function t(n,r){for(var a=n.length;a--;)if(e(n[a][0],r))return a;return-1}return Mx=t,Mx}var $x,TP;function HG(){if(TP)return $x;TP=1;var e=rv(),t=Array.prototype,n=t.splice;function r(a){var i=this.__data__,o=e(i,a);if(o<0)return!1;var c=i.length-1;return o==c?i.pop():n.call(i,o,1),--this.size,!0}return $x=r,$x}var Dx,IP;function KG(){if(IP)return Dx;IP=1;var e=rv();function t(n){var r=this.__data__,a=e(r,n);return a<0?void 0:r[a][1]}return Dx=t,Dx}var Lx,MP;function GG(){if(MP)return Lx;MP=1;var e=rv();function t(n){return e(this.__data__,n)>-1}return Lx=t,Lx}var Fx,$P;function YG(){if($P)return Fx;$P=1;var e=rv();function t(n,r){var a=this.__data__,i=e(a,n);return i<0?(++this.size,a.push([n,r])):a[i][1]=r,this}return Fx=t,Fx}var Bx,DP;function av(){if(DP)return Bx;DP=1;var e=VG(),t=HG(),n=KG(),r=GG(),a=YG();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,Bx=i,Bx}var zx,LP;function nN(){if(LP)return zx;LP=1;var e=Fo(),t=bs(),n=e(t,"Map");return zx=n,zx}var Ux,FP;function XG(){if(FP)return Ux;FP=1;var e=WG(),t=av(),n=nN();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return Ux=r,Ux}var qx,BP;function QG(){if(BP)return qx;BP=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return qx=e,qx}var Wx,zP;function sv(){if(zP)return Wx;zP=1;var e=QG();function t(n,r){var a=n.__data__;return e(r)?a[typeof r=="string"?"string":"hash"]:a.map}return Wx=t,Wx}var Vx,UP;function JG(){if(UP)return Vx;UP=1;var e=sv();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return Vx=t,Vx}var Hx,qP;function ZG(){if(qP)return Hx;qP=1;var e=sv();function t(n){return e(this,n).get(n)}return Hx=t,Hx}var Kx,WP;function eY(){if(WP)return Kx;WP=1;var e=sv();function t(n){return e(this,n).has(n)}return Kx=t,Kx}var Gx,VP;function tY(){if(VP)return Gx;VP=1;var e=sv();function t(n,r){var a=e(this,n),i=a.size;return a.set(n,r),this.size+=a.size==i?0:1,this}return Gx=t,Gx}var Yx,HP;function rN(){if(HP)return Yx;HP=1;var e=XG(),t=JG(),n=ZG(),r=eY(),a=tY();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,Yx=i,Yx}var Xx,KP;function N3(){if(KP)return Xx;KP=1;var e=rN(),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,Xx=n,Xx}var Qx,GP;function nY(){if(GP)return Qx;GP=1;var e=N3(),t=500;function n(r){var a=e(r,function(o){return i.size===t&&i.clear(),o}),i=a.cache;return a}return Qx=n,Qx}var Jx,YP;function rY(){if(YP)return Jx;YP=1;var e=nY(),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 Jx=r,Jx}var Zx,XP;function aN(){if(XP)return Zx;XP=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 Zx=e,Zx}var eb,QP;function aY(){if(QP)return eb;QP=1;var e=uf(),t=aN(),n=Dr(),r=Dc(),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 eb=o,eb}var tb,JP;function C3(){if(JP)return tb;JP=1;var e=aY();function t(n){return n==null?"":e(n)}return tb=t,tb}var nb,ZP;function _3(){if(ZP)return nb;ZP=1;var e=Dr(),t=ZS(),n=rY(),r=C3();function a(i,o){return e(i)?i:t(i,o)?[i]:n(r(i))}return nb=a,nb}var rb,eO;function iv(){if(eO)return rb;eO=1;var e=Dc();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return rb=t,rb}var ab,tO;function sN(){if(tO)return ab;tO=1;var e=_3(),t=iv();function n(r,a){a=e(a,r);for(var i=0,o=a.length;r!=null&&i<o;)r=r[t(a[i++])];return i&&i==o?r:void 0}return ab=n,ab}var sb,nO;function A3(){if(nO)return sb;nO=1;var e=sN();function t(n,r,a){var i=n==null?void 0:e(n,r);return i===void 0?a:i}return sb=t,sb}var sY=A3();const ra=Ht(sY);var ib,rO;function iY(){if(rO)return ib;rO=1;function e(t){return t==null}return ib=e,ib}var oY=iY();const jt=Ht(oY);var ob,aO;function lY(){if(aO)return ob;aO=1;var e=Js(),t=Dr(),n=Zs(),r="[object String]";function a(i){return typeof i=="string"||!t(i)&&n(i)&&e(i)==r}return ob=a,ob}var cY=lY();const _o=Ht(cY);var uY=eN();const wt=Ht(uY);var dY=Ui();const Lc=Ht(dY);var lb={exports:{}},Bt={};var sO;function fY(){if(sO)return Bt;sO=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 iO;function pY(){return iO||(iO=1,lb.exports=fY()),lb.exports}var hY=pY(),cb,oO;function E3(){if(oO)return cb;oO=1;var e=Js(),t=Zs(),n="[object Number]";function r(a){return typeof a=="number"||t(a)&&e(a)==n}return cb=r,cb}var ub,lO;function mY(){if(lO)return ub;lO=1;var e=E3();function t(n){return e(n)&&n!=+n}return ub=t,ub}var vY=mY();const df=Ht(vY);var gY=E3();const yY=Ht(gY);var jr=function(t){return t===0?0:t>0?1:-1},vo=function(t){return _o(t)&&t.indexOf("%")===t.length-1},Fe=function(t){return yY(t)&&!df(t)},xY=function(t){return jt(t)},Wn=function(t){return Fe(t)||_o(t)},bY=0,Fc=function(t){var n=++bY;return"".concat(t||"").concat(n)},Sr=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(!Fe(t)&&!_o(t))return r;var i;if(vo(t)){var o=t.indexOf("%");i=n*parseFloat(t.slice(0,o))/100}else i=+t;return df(i)&&(i=r),a&&i>n&&(i=n),i},_l=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},wY=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},Qr=function(t,n){return Fe(t)&&Fe(n)?function(r){return t+r*(n-t)}:function(){return n}};function xh(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):ra(r,t))===n})}var jY=function(t,n){return Fe(t)&&Fe(n)?t-n:_o(t)&&_o(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function zl(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}function F1(e){"@babel/helpers - typeof";return F1=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},F1(e)}var SY=["viewBox","children"],NY=["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"],cO=["points","pathLength"],db={svg:SY,polygon:cO,polyline:cO},iN=["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"],bh=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(v.isValidElement(t)&&(r=t.props),!Lc(r))return null;var a={};return Object.keys(r).forEach(function(i){iN.includes(i)&&(a[i]=n||function(o){return r[i](r,o)})}),a},CY=function(t,n,r){return function(a){return t(n,r,a),null}},Ao=function(t,n,r){if(!Lc(t)||F1(t)!=="object")return null;var a=null;return Object.keys(t).forEach(function(i){var o=t[i];iN.includes(i)&&typeof o=="function"&&(a||(a={}),a[i]=CY(o,n,r))}),a},_Y=["children"],AY=["children"];function uO(e,t){if(e==null)return{};var n=EY(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function EY(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function B1(e){"@babel/helpers - typeof";return B1=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},B1(e)}var dO={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"},zs=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},fO=null,fb=null,oN=function e(t){if(t===fO&&Array.isArray(fb))return fb;var n=[];return v.Children.forEach(t,function(r){jt(r)||(hY.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),fb=n,fO=t,n};function aa(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(a){return zs(a)}):r=[zs(t)],oN(e).forEach(function(a){var i=ra(a,"type.displayName")||ra(a,"type.name");r.indexOf(i)!==-1&&n.push(a)}),n}function Gr(e,t){var n=aa(e,t);return n&&n[0]}var pO=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,a=n.height;return!(!Fe(r)||r<=0||!Fe(a)||a<=0)},PY=["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"],OY=function(t){return t&&t.type&&_o(t.type)&&PY.indexOf(t.type)>=0},kY=function(t){return t&&B1(t)==="object"&&"clipDot"in t},RY=function(t,n,r,a){var i,o=(i=db?.[a])!==null&&i!==void 0?i:[];return n.startsWith("data-")||!wt(t)&&(a&&o.includes(n)||NY.includes(n))||r&&iN.includes(n)},vt=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(v.isValidElement(t)&&(a=t.props),!Lc(a))return null;var i={};return Object.keys(a).forEach(function(o){var c;RY((c=a)===null||c===void 0?void 0:c[o],o,n,r)&&(i[o]=a[o])}),i},z1=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 hO(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(!hO(i,o))return!1}return!0},hO=function(t,n){if(jt(t)&&jt(n))return!0;if(!jt(t)&&!jt(n)){var r=t.props||{},a=r.children,i=uO(r,_Y),o=n.props||{},c=o.children,d=uO(o,AY);return a&&c?zl(i,d)&&z1(a,c):!a&&!c?zl(i,d):!1}return!1},mO=function(t,n){var r=[],a={};return oN(t).forEach(function(i,o){if(OY(i))r.push(i);else if(i){var c=zs(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},TY=function(t){var n=t&&t.type;return n&&dO[n]?dO[n]:null},IY=function(t,n){return oN(n).indexOf(t)},MY=["children","width","height","viewBox","className","style","title","desc"];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 $Y(e,t){if(e==null)return{};var n=DY(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 DY(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 q1(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=$Y(e,MY),h=a||{width:n,height:r,x:0,y:0},p=St("recharts-surface",i);return q.createElement("svg",U1({},vt(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 LY=["children","className"];function W1(){return W1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},W1.apply(this,arguments)}function FY(e,t){if(e==null)return{};var n=BY(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 BY(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 Dt=q.forwardRef(function(e,t){var n=e.children,r=e.className,a=FY(e,LY),i=St("recharts-layer",r);return q.createElement("g",W1({className:i},vt(a,!0),{ref:t}),n)}),Us=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]},pb,vO;function zY(){if(vO)return pb;vO=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 pb=e,pb}var hb,gO;function UY(){if(gO)return hb;gO=1;var e=zY();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 hb=t,hb}var mb,yO;function P3(){if(yO)return mb;yO=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",a=t+n+r,i="\\ufe0e\\ufe0f",o="\\u200d",c=RegExp("["+o+e+a+i+"]");function d(f){return c.test(f)}return mb=d,mb}var vb,xO;function qY(){if(xO)return vb;xO=1;function e(t){return t.split("")}return vb=e,vb}var gb,bO;function WY(){if(bO)return gb;bO=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 gb=P,gb}var yb,wO;function VY(){if(wO)return yb;wO=1;var e=qY(),t=P3(),n=WY();function r(a){return t(a)?n(a):e(a)}return yb=r,yb}var xb,jO;function HY(){if(jO)return xb;jO=1;var e=UY(),t=P3(),n=VY(),r=C3();function a(i){return function(o){o=r(o);var c=t(o)?n(o):void 0,d=c?c[0]:o.charAt(0),f=c?e(c,1).join(""):o.slice(1);return d[i]()+f}}return xb=a,xb}var bb,SO;function KY(){if(SO)return bb;SO=1;var e=HY(),t=e("toUpperCase");return bb=t,bb}var GY=KY();const ov=Ht(GY);function sn(e){return function(){return e}}const O3=Math.cos,wh=Math.sin,Ka=Math.sqrt,jh=Math.PI,lv=2*jh,V1=Math.PI,H1=2*V1,po=1e-6,YY=H1-po;function k3(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function XY(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return k3;const n=10**t;return function(r){this._+=r[0];for(let a=1,i=r.length;a<i;++a)this._+=Math.round(arguments[a]*n)/n+r[a]}}class QY{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?k3:XY(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>po)if(!(Math.abs(p*d-f*h)>po)||!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((V1-Math.acos((b+y-x)/(2*S*N)))/2),P=_/N,A=_/S;Math.abs(P-1)>po&&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)>po||Math.abs(this._y1-h)>po)&&this._append`L${f},${h}`,r&&(y<0&&(y=y%H1+H1),y>YY?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>po&&this._append`A${r},${r},0,${+(y>=V1)},${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 lN(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 QY(t)}function cN(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function R3(e){this._context=e}R3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function cv(e){return new R3(e)}function T3(e){return e[0]}function I3(e){return e[1]}function M3(e,t){var n=sn(!0),r=null,a=cv,i=null,o=lN(c);e=typeof e=="function"?e:e===void 0?T3:sn(e),t=typeof t=="function"?t:t===void 0?I3:sn(t);function c(d){var f,h=(d=cN(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:sn(+d),c):e},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:sn(+d),c):t},c.defined=function(d){return arguments.length?(n=typeof d=="function"?d:sn(!!d),c):n},c.curve=function(d){return arguments.length?(a=d,r!=null&&(i=a(r)),c):a},c.context=function(d){return arguments.length?(d==null?r=i=null:i=a(r=d),c):r},c}function Bp(e,t,n){var r=null,a=sn(!0),i=null,o=cv,c=null,d=lN(f);e=typeof e=="function"?e:e===void 0?T3:sn(+e),t=typeof t=="function"?t:sn(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?I3:sn(+n);function f(p){var y,g,j,b=(p=cN(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 M3().defined(a).curve(o).context(i)}return f.x=function(p){return arguments.length?(e=typeof p=="function"?p:sn(+p),r=null,f):e},f.x0=function(p){return arguments.length?(e=typeof p=="function"?p:sn(+p),f):e},f.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:sn(+p),f):r},f.y=function(p){return arguments.length?(t=typeof p=="function"?p:sn(+p),n=null,f):t},f.y0=function(p){return arguments.length?(t=typeof p=="function"?p:sn(+p),f):t},f.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:sn(+p),f):n},f.lineX0=f.lineY0=function(){return h().x(e).y(t)},f.lineY1=function(){return h().x(e).y(n)},f.lineX1=function(){return h().x(r).y(t)},f.defined=function(p){return arguments.length?(a=typeof p=="function"?p:sn(!!p),f):a},f.curve=function(p){return arguments.length?(o=p,i!=null&&(c=o(i)),f):o},f.context=function(p){return arguments.length?(p==null?i=c=null:c=o(i=p),f):i},f}class $3{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function JY(e){return new $3(e,!0)}function ZY(e){return new $3(e,!1)}const uN={draw(e,t){const n=Ka(t/jh);e.moveTo(n,0),e.arc(0,0,n,0,lv)}},eX={draw(e,t){const n=Ka(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},D3=Ka(1/3),tX=D3*2,nX={draw(e,t){const n=Ka(t/tX),r=n*D3;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},rX={draw(e,t){const n=Ka(t),r=-n/2;e.rect(r,r,n,n)}},aX=.8908130915292852,L3=wh(jh/10)/wh(7*jh/10),sX=wh(lv/10)*L3,iX=-O3(lv/10)*L3,oX={draw(e,t){const n=Ka(t*aX),r=sX*n,a=iX*n;e.moveTo(0,-n),e.lineTo(r,a);for(let i=1;i<5;++i){const o=lv*i/5,c=O3(o),d=wh(o);e.lineTo(d*n,-c*n),e.lineTo(c*r-d*a,d*r+c*a)}e.closePath()}},wb=Ka(3),lX={draw(e,t){const n=-Ka(t/(wb*3));e.moveTo(0,n*2),e.lineTo(-wb*n,-n),e.lineTo(wb*n,-n),e.closePath()}},pa=-.5,ha=Ka(3)/2,K1=1/Ka(12),cX=(K1/2+1)*3,uX={draw(e,t){const n=Ka(t/cX),r=n/2,a=n*K1,i=r,o=n*K1+n,c=-i,d=o;e.moveTo(r,a),e.lineTo(i,o),e.lineTo(c,d),e.lineTo(pa*r-ha*a,ha*r+pa*a),e.lineTo(pa*i-ha*o,ha*i+pa*o),e.lineTo(pa*c-ha*d,ha*c+pa*d),e.lineTo(pa*r+ha*a,pa*a-ha*r),e.lineTo(pa*i+ha*o,pa*o-ha*i),e.lineTo(pa*c+ha*d,pa*d-ha*c),e.closePath()}};function dX(e,t){let n=null,r=lN(a);e=typeof e=="function"?e:sn(e||uN),t=typeof t=="function"?t:sn(t===void 0?64:+t);function a(){let i;if(n||(n=i=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:sn(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:sn(+i),a):t},a.context=function(i){return arguments.length?(n=i??null,a):n},a}function Sh(){}function Nh(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function F3(e){this._context=e}F3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Nh(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:Nh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function fX(e){return new F3(e)}function B3(e){this._context=e}B3.prototype={areaStart:Sh,areaEnd:Sh,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:Nh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function pX(e){return new B3(e)}function z3(e){this._context=e}z3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Nh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function hX(e){return new z3(e)}function U3(e){this._context=e}U3.prototype={areaStart:Sh,areaEnd:Sh,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 mX(e){return new U3(e)}function NO(e){return e<0?-1:1}function CO(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(NO(i)+NO(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(c))||0}function _O(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function jb(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 Ch(e){this._context=e}Ch.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:jb(this,this._t0,_O(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,jb(this,_O(this,n=CO(this,e,t)),n);break;default:jb(this,this._t0,n=CO(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function q3(e){this._context=new W3(e)}(q3.prototype=Object.create(Ch.prototype)).point=function(e,t){Ch.prototype.point.call(this,t,e)};function W3(e){this._context=e}W3.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,a,i){this._context.bezierCurveTo(t,e,r,n,i,a)}};function vX(e){return new Ch(e)}function gX(e){return new q3(e)}function V3(e){this._context=e}V3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=AO(e),a=AO(t),i=0,o=1;o<n;++i,++o)this._context.bezierCurveTo(r[0][i],a[0][i],r[1][i],a[1][i],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function AO(e){var t,n=e.length-1,r,a=new Array(n),i=new Array(n),o=new Array(n);for(a[0]=0,i[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)a[t]=1,i[t]=4,o[t]=4*e[t]+2*e[t+1];for(a[n-1]=2,i[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=a[t]/i[t-1],i[t]-=r,o[t]-=r*o[t-1];for(a[n-1]=o[n-1]/i[n-1],t=n-2;t>=0;--t)a[t]=(o[t]-a[t+1])/i[t];for(i[n-1]=(e[n]+a[n-1])/2,t=0;t<n-1;++t)i[t]=2*e[t+1]-a[t+1];return[a,i]}function yX(e){return new V3(e)}function uv(e,t){this._context=e,this._t=t}uv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function xX(e){return new uv(e,.5)}function bX(e){return new uv(e,0)}function wX(e){return new uv(e,1)}function Zl(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 G1(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function jX(e,t){return e[t]}function SX(e){const t=[];return t.key=e,t}function NX(){var e=sn([]),t=G1,n=Zl,r=jX;function a(i){var o=Array.from(e.apply(this,arguments),SX),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=cN(t(o));c<d;++c)o[h[c]].index=c;return n(o,h),o}return a.keys=function(i){return arguments.length?(e=typeof i=="function"?i:sn(Array.from(i)),a):e},a.value=function(i){return arguments.length?(r=typeof i=="function"?i:sn(+i),a):r},a.order=function(i){return arguments.length?(t=i==null?G1:typeof i=="function"?i:sn(Array.from(i)),a):t},a.offset=function(i){return arguments.length?(n=i??Zl,a):n},a}function CX(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}Zl(e,t)}}function _X(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}Zl(e,t)}}function AX(e,t){if(!(!((o=e.length)>0)||!((i=(a=e[t[0]]).length)>0))){for(var n=0,r=1,a,i,o;r<i;++r){for(var c=0,d=0,f=0;c<o;++c){for(var h=e[t[c]],p=h[r][1]||0,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,Zl(e,t)}}function pd(e){"@babel/helpers - typeof";return pd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pd(e)}var EX=["type","size","sizeType"];function Y1(){return Y1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y1.apply(this,arguments)}function EO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function PO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EO(Object(n),!0).forEach(function(r){PX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function PX(e,t,n){return t=OX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OX(e){var t=kX(e,"string");return pd(t)=="symbol"?t:t+""}function kX(e,t){if(pd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(pd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function RX(e,t){if(e==null)return{};var n=TX(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function TX(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var H3={symbolCircle:uN,symbolCross:eX,symbolDiamond:nX,symbolSquare:rX,symbolStar:oX,symbolTriangle:lX,symbolWye:uX},IX=Math.PI/180,MX=function(t){var n="symbol".concat(ov(t));return H3[n]||uN},$X=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*IX;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}},DX=function(t,n){H3["symbol".concat(ov(t))]=n},dN=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=RX(t,EX),f=PO(PO({},d),{},{type:r,size:i,sizeType:c}),h=function(){var x=MX(r),S=dX().type(x).size($X(i,c,r));return S()},p=f.className,y=f.cx,g=f.cy,j=vt(f,!0);return y===+y&&g===+g&&i===+i?q.createElement("path",Y1({},j,{className:St("recharts-symbols",p),transform:"translate(".concat(y,", ").concat(g,")"),d:h()})):null};dN.registerSymbol=DX;function ec(e){"@babel/helpers - typeof";return ec=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ec(e)}function X1(){return X1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},X1.apply(this,arguments)}function OO(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 LX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OO(Object(n),!0).forEach(function(r){hd(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function FX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function BX(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,G3(r.key),r)}}function zX(e,t,n){return t&&BX(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function UX(e,t,n){return t=_h(t),qX(e,K3()?Reflect.construct(t,n||[],_h(e).constructor):t.apply(e,n))}function qX(e,t){if(t&&(ec(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return WX(e)}function WX(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function K3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(K3=function(){return!!e})()}function _h(e){return _h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_h(e)}function VX(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Q1(e,t)}function Q1(e,t){return Q1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Q1(e,t)}function hd(e,t,n){return t=G3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G3(e){var t=HX(e,"string");return ec(t)=="symbol"?t:t+""}function HX(e,t){if(ec(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ec(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ma=32,fN=(function(e){function t(){return FX(this,t),UX(this,t,arguments)}return VX(t,e),zX(t,[{key:"renderIcon",value:function(r){var a=this.props.inactiveColor,i=ma/2,o=ma/6,c=ma/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:ma,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(ma,"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(ma/8,"h").concat(ma,"v").concat(ma*3/4,"h").concat(-ma,"z"),className:"recharts-legend-icon"});if(q.isValidElement(r.legendIcon)){var f=LX({},r);return delete f.legendIcon,q.cloneElement(r.legendIcon,f)}return q.createElement(dN,{fill:d,cx:i,cy:i,size:ma,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:ma,height:ma},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=St(hd(hd({"recharts-legend-item":!0},"legend-item-".concat(j),!0),"inactive",g.inactive));if(g.type==="none")return null;var S=wt(g.value)?null:g.value;Us(!wt(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",X1({className:x,style:p,key:"legend-item-".concat(j)},Ao(r.props,g,j)),q.createElement(q1,{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);hd(fN,"displayName","Legend");hd(fN,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Sb,kO;function KX(){if(kO)return Sb;kO=1;var e=av();function t(){this.__data__=new e,this.size=0}return Sb=t,Sb}var Nb,RO;function GX(){if(RO)return Nb;RO=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return Nb=e,Nb}var Cb,TO;function YX(){if(TO)return Cb;TO=1;function e(t){return this.__data__.get(t)}return Cb=e,Cb}var _b,IO;function XX(){if(IO)return _b;IO=1;function e(t){return this.__data__.has(t)}return _b=e,_b}var Ab,MO;function QX(){if(MO)return Ab;MO=1;var e=av(),t=nN(),n=rN(),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 Ab=a,Ab}var Eb,$O;function Y3(){if($O)return Eb;$O=1;var e=av(),t=KX(),n=GX(),r=YX(),a=XX(),i=QX();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,Eb=o,Eb}var Pb,DO;function JX(){if(DO)return Pb;DO=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return Pb=t,Pb}var Ob,LO;function ZX(){if(LO)return Ob;LO=1;function e(t){return this.__data__.has(t)}return Ob=e,Ob}var kb,FO;function X3(){if(FO)return kb;FO=1;var e=rN(),t=JX(),n=ZX();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,kb=r,kb}var Rb,BO;function Q3(){if(BO)return Rb;BO=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 Rb=e,Rb}var Tb,zO;function J3(){if(zO)return Tb;zO=1;function e(t,n){return t.has(n)}return Tb=e,Tb}var Ib,UO;function Z3(){if(UO)return Ib;UO=1;var e=X3(),t=Q3(),n=J3(),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 Ib=i,Ib}var Mb,qO;function eQ(){if(qO)return Mb;qO=1;var e=bs(),t=e.Uint8Array;return Mb=t,Mb}var $b,WO;function tQ(){if(WO)return $b;WO=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(a,i){r[++n]=[i,a]}),r}return $b=e,$b}var Db,VO;function pN(){if(VO)return Db;VO=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(a){r[++n]=a}),r}return Db=e,Db}var Lb,HO;function nQ(){if(HO)return Lb;HO=1;var e=uf(),t=eQ(),n=tN(),r=Z3(),a=tQ(),i=pN(),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,L){switch(R){case N:if(O.byteLength!=k.byteLength||O.byteOffset!=k.byteOffset)return!1;O=O.buffer,k=k.buffer;case S:return!(O.byteLength!=k.byteLength||!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 H=L.get(O);if(H)return H==k;M|=c,L.set(O,k);var Q=r(G(O),G(k),M,z,B,L);return L.delete(O),Q;case x:if(P)return P.call(O)==P.call(k)}return!1}return Lb=A,Lb}var Fb,KO;function e5(){if(KO)return Fb;KO=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 Fb=e,Fb}var Bb,GO;function rQ(){if(GO)return Bb;GO=1;var e=e5(),t=Dr();function n(r,a,i){var o=a(r);return t(r)?o:e(o,i(r))}return Bb=n,Bb}var zb,YO;function aQ(){if(YO)return zb;YO=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 zb=e,zb}var Ub,XO;function sQ(){if(XO)return Ub;XO=1;function e(){return[]}return Ub=e,Ub}var qb,QO;function iQ(){if(QO)return qb;QO=1;var e=aQ(),t=sQ(),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 qb=i,qb}var Wb,JO;function oQ(){if(JO)return Wb;JO=1;function e(t,n){for(var r=-1,a=Array(t);++r<t;)a[r]=n(r);return a}return Wb=e,Wb}var Vb,ZO;function lQ(){if(ZO)return Vb;ZO=1;var e=Js(),t=Zs(),n="[object Arguments]";function r(a){return t(a)&&e(a)==n}return Vb=r,Vb}var Hb,ek;function hN(){if(ek)return Hb;ek=1;var e=lQ(),t=Zs(),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 Hb=i,Hb}var Vu={exports:{}},Kb,tk;function cQ(){if(tk)return Kb;tk=1;function e(){return!1}return Kb=e,Kb}Vu.exports;var nk;function t5(){return nk||(nk=1,(function(e,t){var n=bs(),r=cQ(),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})(Vu,Vu.exports)),Vu.exports}var Gb,rk;function mN(){if(rk)return Gb;rk=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 Gb=n,Gb}var Yb,ak;function vN(){if(ak)return Yb;ak=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return Yb=t,Yb}var Xb,sk;function uQ(){if(sk)return Xb;sk=1;var e=Js(),t=vN(),n=Zs(),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 L(G){return n(G)&&t(G.length)&&!!B[e(G)]}return Xb=L,Xb}var Qb,ik;function n5(){if(ik)return Qb;ik=1;function e(t){return function(n){return t(n)}}return Qb=e,Qb}var Hu={exports:{}};Hu.exports;var ok;function dQ(){return ok||(ok=1,(function(e,t){var n=j3(),r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===r,o=i&&n.process,c=(function(){try{var d=a&&a.require&&a.require("util").types;return d||o&&o.binding&&o.binding("util")}catch{}})();e.exports=c})(Hu,Hu.exports)),Hu.exports}var Jb,lk;function r5(){if(lk)return Jb;lk=1;var e=uQ(),t=n5(),n=dQ(),r=n&&n.isTypedArray,a=r?t(r):e;return Jb=a,Jb}var Zb,ck;function fQ(){if(ck)return Zb;ck=1;var e=oQ(),t=hN(),n=Dr(),r=t5(),a=mN(),i=r5(),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 Zb=d,Zb}var e0,uk;function pQ(){if(uk)return e0;uk=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,a=typeof r=="function"&&r.prototype||e;return n===a}return e0=t,e0}var t0,dk;function a5(){if(dk)return t0;dk=1;function e(t,n){return function(r){return t(n(r))}}return t0=e,t0}var n0,fk;function hQ(){if(fk)return n0;fk=1;var e=a5(),t=e(Object.keys,Object);return n0=t,n0}var r0,pk;function mQ(){if(pk)return r0;pk=1;var e=pQ(),t=hQ(),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 r0=a,r0}var a0,hk;function ff(){if(hk)return a0;hk=1;var e=eN(),t=vN();function n(r){return r!=null&&t(r.length)&&!e(r)}return a0=n,a0}var s0,mk;function dv(){if(mk)return s0;mk=1;var e=fQ(),t=mQ(),n=ff();function r(a){return n(a)?e(a):t(a)}return s0=r,s0}var i0,vk;function vQ(){if(vk)return i0;vk=1;var e=rQ(),t=iQ(),n=dv();function r(a){return e(a,n,t)}return i0=r,i0}var o0,gk;function gQ(){if(gk)return o0;gk=1;var e=vQ(),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 o0=a,o0}var l0,yk;function yQ(){if(yk)return l0;yk=1;var e=Fo(),t=bs(),n=e(t,"DataView");return l0=n,l0}var c0,xk;function xQ(){if(xk)return c0;xk=1;var e=Fo(),t=bs(),n=e(t,"Promise");return c0=n,c0}var u0,bk;function s5(){if(bk)return u0;bk=1;var e=Fo(),t=bs(),n=e(t,"Set");return u0=n,u0}var d0,wk;function bQ(){if(wk)return d0;wk=1;var e=Fo(),t=bs(),n=e(t,"WeakMap");return d0=n,d0}var f0,jk;function wQ(){if(jk)return f0;jk=1;var e=yQ(),t=nN(),n=xQ(),r=s5(),a=bQ(),i=Js(),o=S3(),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}),f0=N,f0}var p0,Sk;function jQ(){if(Sk)return p0;Sk=1;var e=Y3(),t=Z3(),n=nQ(),r=gQ(),a=wQ(),i=Dr(),o=t5(),c=r5(),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 L=M&&g.call(b,"__wrapped__"),G=z&&g.call(x,"__wrapped__");if(L||G){var U=L?b.value():b,H=G?x.value():x;return P||(P=new e),_(U,H,S,N,P)}}return B?(P||(P=new e),r(b,x,S,N,_,P)):!1}return p0=j,p0}var h0,Nk;function gN(){if(Nk)return h0;Nk=1;var e=jQ(),t=Zs();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 h0=n,h0}var m0,Ck;function SQ(){if(Ck)return m0;Ck=1;var e=Y3(),t=gN(),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 m0=a,m0}var v0,_k;function i5(){if(_k)return v0;_k=1;var e=Ui();function t(n){return n===n&&!e(n)}return v0=t,v0}var g0,Ak;function NQ(){if(Ak)return g0;Ak=1;var e=i5(),t=dv();function n(r){for(var a=t(r),i=a.length;i--;){var o=a[i],c=r[o];a[i]=[o,c,e(c)]}return a}return g0=n,g0}var y0,Ek;function o5(){if(Ek)return y0;Ek=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return y0=e,y0}var x0,Pk;function CQ(){if(Pk)return x0;Pk=1;var e=SQ(),t=NQ(),n=o5();function r(a){var i=t(a);return i.length==1&&i[0][2]?n(i[0][0],i[0][1]):function(o){return o===a||e(o,a,i)}}return x0=r,x0}var b0,Ok;function _Q(){if(Ok)return b0;Ok=1;function e(t,n){return t!=null&&n in Object(t)}return b0=e,b0}var w0,kk;function AQ(){if(kk)return w0;kk=1;var e=_3(),t=hN(),n=Dr(),r=mN(),a=vN(),i=iv();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 w0=o,w0}var j0,Rk;function EQ(){if(Rk)return j0;Rk=1;var e=_Q(),t=AQ();function n(r,a){return r!=null&&t(r,a,e)}return j0=n,j0}var S0,Tk;function PQ(){if(Tk)return S0;Tk=1;var e=gN(),t=A3(),n=EQ(),r=ZS(),a=i5(),i=o5(),o=iv(),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 S0=f,S0}var N0,Ik;function Bc(){if(Ik)return N0;Ik=1;function e(t){return t}return N0=e,N0}var C0,Mk;function OQ(){if(Mk)return C0;Mk=1;function e(t){return function(n){return n?.[t]}}return C0=e,C0}var _0,$k;function kQ(){if($k)return _0;$k=1;var e=sN();function t(n){return function(r){return e(r,n)}}return _0=t,_0}var A0,Dk;function RQ(){if(Dk)return A0;Dk=1;var e=OQ(),t=kQ(),n=ZS(),r=iv();function a(i){return n(i)?e(r(i)):t(i)}return A0=a,A0}var E0,Lk;function ws(){if(Lk)return E0;Lk=1;var e=CQ(),t=PQ(),n=Bc(),r=Dr(),a=RQ();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 E0=i,E0}var P0,Fk;function l5(){if(Fk)return P0;Fk=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 P0=e,P0}var O0,Bk;function TQ(){if(Bk)return O0;Bk=1;function e(t){return t!==t}return O0=e,O0}var k0,zk;function IQ(){if(zk)return k0;zk=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 k0=e,k0}var R0,Uk;function MQ(){if(Uk)return R0;Uk=1;var e=l5(),t=TQ(),n=IQ();function r(a,i,o){return i===i?n(a,i,o):e(a,t,o)}return R0=r,R0}var T0,qk;function $Q(){if(qk)return T0;qk=1;var e=MQ();function t(n,r){var a=n==null?0:n.length;return!!a&&e(n,r,0)>-1}return T0=t,T0}var I0,Wk;function DQ(){if(Wk)return I0;Wk=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 I0=e,I0}var M0,Vk;function LQ(){if(Vk)return M0;Vk=1;function e(){}return M0=e,M0}var $0,Hk;function FQ(){if(Hk)return $0;Hk=1;var e=s5(),t=LQ(),n=pN(),r=1/0,a=e&&1/n(new e([,-0]))[1]==r?function(i){return new e(i)}:t;return $0=a,$0}var D0,Kk;function BQ(){if(Kk)return D0;Kk=1;var e=X3(),t=$Q(),n=DQ(),r=J3(),a=FQ(),i=pN(),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 D0=c,D0}var L0,Gk;function zQ(){if(Gk)return L0;Gk=1;var e=ws(),t=BQ();function n(r,a){return r&&r.length?t(r,e(a,2)):[]}return L0=n,L0}var UQ=zQ();const Yk=Ht(UQ);function c5(e,t,n){return t===!0?Yk(e,n):wt(t)?Yk(e,t):e}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)}var qQ=["ref"];function Xk(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 Ts(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Xk(Object(n),!0).forEach(function(r){fv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qk(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,d5(r.key),r)}}function VQ(e,t,n){return t&&Qk(e.prototype,t),n&&Qk(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function HQ(e,t,n){return t=Ah(t),KQ(e,u5()?Reflect.construct(t,n||[],Ah(e).constructor):t.apply(e,n))}function KQ(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 GQ(e)}function GQ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(u5=function(){return!!e})()}function Ah(e){return Ah=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ah(e)}function YQ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&J1(e,t)}function J1(e,t){return J1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},J1(e,t)}function fv(e,t,n){return t=d5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d5(e){var t=XQ(e,"string");return tc(t)=="symbol"?t:t+""}function XQ(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)}function QQ(e,t){if(e==null)return{};var n=JQ(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 JQ(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 ZQ(e){return e.value}function eJ(e,t){if(q.isValidElement(e))return q.cloneElement(e,t);if(typeof e=="function")return q.createElement(e,t);t.ref;var n=QQ(t,qQ);return q.createElement(fN,n)}var Jk=1,Ul=(function(e){function t(){var n;WQ(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=HQ(this,t,[].concat(a)),fv(n,"lastBoundingBox",{width:-1,height:-1}),n}return YQ(t,e),VQ(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)>Jk||Math.abs(a.height-this.lastBoundingBox.height)>Jk)&&(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?Ts({},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 Ts(Ts({},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=Ts(Ts({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}},eJ(i,Ts(Ts({},this.props),{},{payload:c5(h,f,ZQ)})))}}],[{key:"getWithHeight",value:function(r,a){var i=Ts(Ts({},this.defaultProps),r.props),o=i.layout;return o==="vertical"&&Fe(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||a}:null}}])})(v.PureComponent);fv(Ul,"displayName","Legend");fv(Ul,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var F0,Zk;function tJ(){if(Zk)return F0;Zk=1;var e=uf(),t=hN(),n=Dr(),r=e?e.isConcatSpreadable:void 0;function a(i){return n(i)||t(i)||!!(r&&i&&i[r])}return F0=a,F0}var B0,eR;function f5(){if(eR)return B0;eR=1;var e=e5(),t=tJ();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 B0=n,B0}var z0,tR;function nJ(){if(tR)return z0;tR=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 z0=e,z0}var U0,nR;function rJ(){if(nR)return U0;nR=1;var e=nJ(),t=e();return U0=t,U0}var q0,rR;function p5(){if(rR)return q0;rR=1;var e=rJ(),t=dv();function n(r,a){return r&&e(r,a,t)}return q0=n,q0}var W0,aR;function aJ(){if(aR)return W0;aR=1;var e=ff();function t(n,r){return function(a,i){if(a==null)return a;if(!e(a))return n(a,i);for(var o=a.length,c=r?o:-1,d=Object(a);(r?c--:++c<o)&&i(d[c],c,d)!==!1;);return a}}return W0=t,W0}var V0,sR;function yN(){if(sR)return V0;sR=1;var e=p5(),t=aJ(),n=t(e);return V0=n,V0}var H0,iR;function h5(){if(iR)return H0;iR=1;var e=yN(),t=ff();function n(r,a){var i=-1,o=t(r)?Array(r.length):[];return e(r,function(c,d,f){o[++i]=a(c,d,f)}),o}return H0=n,H0}var K0,oR;function sJ(){if(oR)return K0;oR=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return K0=e,K0}var G0,lR;function iJ(){if(lR)return G0;lR=1;var e=Dc();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 G0=t,G0}var Y0,cR;function oJ(){if(cR)return Y0;cR=1;var e=iJ();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 Y0=t,Y0}var X0,uR;function lJ(){if(uR)return X0;uR=1;var e=aN(),t=sN(),n=ws(),r=h5(),a=sJ(),i=n5(),o=oJ(),c=Bc(),d=Dr();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 X0=f,X0}var Q0,dR;function cJ(){if(dR)return Q0;dR=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 Q0=e,Q0}var J0,fR;function uJ(){if(fR)return J0;fR=1;var e=cJ(),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 J0=n,J0}var Z0,pR;function dJ(){if(pR)return Z0;pR=1;function e(t){return function(){return t}}return Z0=e,Z0}var ew,hR;function m5(){if(hR)return ew;hR=1;var e=Fo(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return ew=t,ew}var tw,mR;function fJ(){if(mR)return tw;mR=1;var e=dJ(),t=m5(),n=Bc(),r=t?function(a,i){return t(a,"toString",{configurable:!0,enumerable:!1,value:e(i),writable:!0})}:n;return tw=r,tw}var nw,vR;function pJ(){if(vR)return nw;vR=1;var e=800,t=16,n=Date.now;function r(a){var i=0,o=0;return function(){var c=n(),d=t-(c-o);if(o=c,d>0){if(++i>=e)return arguments[0]}else i=0;return a.apply(void 0,arguments)}}return nw=r,nw}var rw,gR;function hJ(){if(gR)return rw;gR=1;var e=fJ(),t=pJ(),n=t(e);return rw=n,rw}var aw,yR;function mJ(){if(yR)return aw;yR=1;var e=Bc(),t=uJ(),n=hJ();function r(a,i){return n(t(a,i,e),a+"")}return aw=r,aw}var sw,xR;function pv(){if(xR)return sw;xR=1;var e=tN(),t=ff(),n=mN(),r=Ui();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 sw=a,sw}var iw,bR;function vJ(){if(bR)return iw;bR=1;var e=f5(),t=lJ(),n=mJ(),r=pv(),a=n(function(i,o){if(i==null)return[];var c=o.length;return c>1&&r(i,o[0],o[1])?o=[]:c>2&&r(o[0],o[1],o[2])&&(o=[o[0]]),t(i,e(o,1),[])});return iw=a,iw}var gJ=vJ();const xN=Ht(gJ);function md(e){"@babel/helpers - typeof";return md=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},md(e)}function Z1(){return Z1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Z1.apply(this,arguments)}function yJ(e,t){return jJ(e)||wJ(e,t)||bJ(e,t)||xJ()}function xJ(){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 bJ(e,t){if(e){if(typeof e=="string")return wR(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 wR(e,t)}}function wR(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 wJ(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 jJ(e){if(Array.isArray(e))return e}function jR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ow(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jR(Object(n),!0).forEach(function(r){SJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function SJ(e,t,n){return t=NJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NJ(e){var t=CJ(e,"string");return md(t)=="symbol"?t:t+""}function CJ(e,t){if(md(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(md(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _J(e){return Array.isArray(e)&&Wn(e[0])&&Wn(e[1])?e.join(" ~ "):e}var AJ=function(t){var n=t.separator,r=n===void 0?" : ":n,a=t.contentStyle,i=a===void 0?{}:a,o=t.itemStyle,c=o===void 0?{}:o,d=t.labelStyle,f=d===void 0?{}:d,h=t.payload,p=t.formatter,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 L={padding:0,margin:0},G=(y?xN(h,y):h).map(function(U,H){if(U.type==="none")return null;var Q=ow({display:"block",paddingTop:4,paddingBottom:4,color:U.color||"#000"},c),J=U.formatter||p||_J,T=U.value,D=U.name,X=T,F=D;if(J&&X!=null&&F!=null){var $=J(T,D,U,H,h);if(Array.isArray($)){var ee=yJ($,2);X=ee[0],F=ee[1]}else X=$}return q.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(H),style:Q},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"},X),q.createElement("span",{className:"recharts-tooltip-item-unit"},U.unit||""))});return q.createElement("ul",{className:"recharts-tooltip-item-list",style:L},G)}return null},P=ow({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),A=ow({margin:0},f),O=!jt(b),k=O?b:"",R=St("recharts-default-tooltip",g),M=St("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",Z1({className:R,style:P},z),q.createElement("p",{className:M,style:A},q.isValidElement(k)?k:"".concat(k)),_())};function vd(e){"@babel/helpers - typeof";return vd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vd(e)}function zp(e,t,n){return t=EJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EJ(e){var t=PJ(e,"string");return vd(t)=="symbol"?t:t+""}function PJ(e,t){if(vd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(vd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ru="recharts-tooltip-wrapper",OJ={visibility:"hidden"};function kJ(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return St(Ru,zp(zp(zp(zp({},"".concat(Ru,"-right"),Fe(n)&&t&&Fe(t.x)&&n>=t.x),"".concat(Ru,"-left"),Fe(n)&&t&&Fe(t.x)&&n<t.x),"".concat(Ru,"-bottom"),Fe(r)&&t&&Fe(t.y)&&r>=t.y),"".concat(Ru,"-top"),Fe(r)&&t&&Fe(t.y)&&r<t.y))}function SR(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&&Fe(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 RJ(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 TJ(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=SR({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:o.width,viewBox:d,viewBoxDimension:d.width}),p=SR({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:o.height,viewBox:d,viewBoxDimension:d.height}),f=RJ({translateX:h,translateY:p,useTranslate3d:c})):f=OJ,{cssProperties:f,cssClasses:kJ({translateX:h,translateY:p,coordinate:n})}}function nc(e){"@babel/helpers - typeof";return nc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nc(e)}function NR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function CR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NR(Object(n),!0).forEach(function(r){tj(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function IJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MJ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,g5(r.key),r)}}function $J(e,t,n){return t&&MJ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function DJ(e,t,n){return t=Eh(t),LJ(e,v5()?Reflect.construct(t,n||[],Eh(e).constructor):t.apply(e,n))}function LJ(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 FJ(e)}function FJ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(v5=function(){return!!e})()}function Eh(e){return Eh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Eh(e)}function BJ(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&&ej(e,t)}function ej(e,t){return ej=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},ej(e,t)}function tj(e,t,n){return t=g5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g5(e){var t=zJ(e,"string");return nc(t)=="symbol"?t:t+""}function zJ(e,t){if(nc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(nc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var _R=1,UJ=(function(e){function t(){var n;IJ(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=DJ(this,t,[].concat(a)),tj(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),tj(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 BJ(t,e),$J(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>_R||Math.abs(r.height-this.state.lastBoundingBox.height)>_R)&&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,_=TJ({allowEscapeViewBox:o,coordinate:h,offsetTopLeft:g,position:j,reverseDirection:b,tooltipBox:this.state.lastBoundingBox,useTranslate3d:x,viewBox:S}),P=_.cssClasses,A=_.cssProperties,O=CR(CR({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),qJ=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Bo={isSsr:qJ()};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 AR(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 ER(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AR(Object(n),!0).forEach(function(r){bN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function VJ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,x5(r.key),r)}}function HJ(e,t,n){return t&&VJ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function KJ(e,t,n){return t=Ph(t),GJ(e,y5()?Reflect.construct(t,n||[],Ph(e).constructor):t.apply(e,n))}function GJ(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 YJ(e)}function YJ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(y5=function(){return!!e})()}function Ph(e){return Ph=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ph(e)}function XJ(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 bN(e,t,n){return t=x5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x5(e){var t=QJ(e,"string");return rc(t)=="symbol"?t:t+""}function QJ(e,t){if(rc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(rc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function JJ(e){return e.dataKey}function ZJ(e,t){return q.isValidElement(e)?q.cloneElement(e,t):typeof e=="function"?q.createElement(e,t):q.createElement(AJ,t)}var Yr=(function(e){function t(){return WJ(this,t),KJ(this,t,arguments)}return XJ(t,e),HJ(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=c5(j.filter(function(k){return k.value!=null&&(k.hide!==!0||r.props.includeHidden)}),b,JJ));var O=A.length>0;return q.createElement(UJ,{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},ZJ(f,ER(ER({},this.props),{},{payload:A})))}}])})(v.PureComponent);bN(Yr,"displayName","Tooltip");bN(Yr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Bo.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var lw,PR;function eZ(){if(PR)return lw;PR=1;var e=bs(),t=function(){return e.Date.now()};return lw=t,lw}var cw,OR;function tZ(){if(OR)return cw;OR=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return cw=t,cw}var uw,kR;function nZ(){if(kR)return uw;kR=1;var e=tZ(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return uw=n,uw}var dw,RR;function b5(){if(RR)return dw;RR=1;var e=nZ(),t=Ui(),n=Dc(),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 dw=d,dw}var fw,TR;function rZ(){if(TR)return fw;TR=1;var e=Ui(),t=eZ(),n=b5(),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,H=p;return h=p=void 0,x=G,g=c.apply(H,U),g}function A(G){return x=G,j=setTimeout(R,d),S?P(G):g}function O(G){var U=G-b,H=G-x,Q=d-U;return N?i(Q,y-H):Q}function k(G){var U=G-b,H=G-x;return b===void 0||U>=d||U<0||N&&H>=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 L(){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 L.cancel=z,L.flush=B,L}return fw=o,fw}var pw,IR;function aZ(){if(IR)return pw;IR=1;var e=rZ(),t=Ui(),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 pw=r,pw}var sZ=aZ();const w5=Ht(sZ);function gd(e){"@babel/helpers - typeof";return gd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gd(e)}function MR(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 Up(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MR(Object(n),!0).forEach(function(r){iZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function iZ(e,t,n){return t=oZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oZ(e){var t=lZ(e,"string");return gd(t)=="symbol"?t:t+""}function lZ(e,t){if(gd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(gd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cZ(e,t){return pZ(e)||fZ(e,t)||dZ(e,t)||uZ()}function uZ(){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 dZ(e,t){if(e){if(typeof e=="string")return $R(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 $R(e,t)}}function $R(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 fZ(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 pZ(e){if(Array.isArray(e))return e}var rj=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=cZ(k,2),M=R[0],z=R[1],B=v.useCallback(function(G,U){z(function(H){var Q=Math.round(G),J=Math.round(U);return H.containerWidth===Q&&H.containerHeight===J?H:{containerWidth:Q,containerHeight:J}})},[]);v.useEffect(function(){var G=function(D){var X,F=D[0].contentRect,$=F.width,ee=F.height;B($,ee),(X=O.current)===null||X===void 0||X.call(O,$,ee)};b>0&&(G=w5(G,b,{trailing:!0,leading:!1}));var U=new ResizeObserver(G),H=A.current.getBoundingClientRect(),Q=H.width,J=H.height;return B(Q,J),U.observe(A.current),function(){U.disconnect()}},[B,b]);var L=v.useMemo(function(){var G=M.containerWidth,U=M.containerHeight;if(G<0||U<0)return null;Us(vo(o)||vo(d),`The width(%s) and height(%s) are both fixed numbers,
|
|
62
|
-
maybe you don't need to use a ResponsiveContainer.`,o,d),Us(!n||n>0,"The aspect(%s) must be greater than zero.",n);var H=vo(o)?G:o,Q=vo(d)?U:d;n&&n>0&&(H?Q=H/n:Q&&(H=Q*n),y&&Q>y&&(Q=y)),Us(H>0||Q>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
63
|
-
please check the style of container, or the props width(%s) and height(%s),
|
|
64
|
-
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
65
|
-
height and width.`,H,Q,o,d,h,p,n);var J=!Array.isArray(g)&&zs(g.type).endsWith("Chart");return q.Children.map(g,function(T){return q.isValidElement(T)?v.cloneElement(T,Up({width:H,height:Q},J?{style:Up({height:"100%",width:"100%",maxHeight:Q,maxWidth:H},T.props.style)}:{})):T})},[n,g,d,y,p,h,M,o]);return q.createElement("div",{id:x?"".concat(x):void 0,className:St("recharts-responsive-container",S),style:Up(Up({},P),{},{width:o,height:d,minWidth:h,minHeight:p,maxHeight:y}),ref:A},L)}),hv=function(t){return null};hv.displayName="Cell";function yd(e){"@babel/helpers - typeof";return yd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yd(e)}function DR(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 aj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DR(Object(n),!0).forEach(function(r){hZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hZ(e,t,n){return t=mZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mZ(e){var t=vZ(e,"string");return yd(t)=="symbol"?t:t+""}function vZ(e,t){if(yd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(yd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var wl={widthCache:{},cacheCount:0},gZ=2e3,yZ={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},LR="recharts_measurement_span";function xZ(e){var t=aj({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var Ju=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Bo.isSsr)return{width:0,height:0};var r=xZ(n),a=JSON.stringify({text:t,copyStyle:r});if(wl.widthCache[a])return wl.widthCache[a];try{var i=document.getElementById(LR);i||(i=document.createElement("span"),i.setAttribute("id",LR),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=aj(aj({},yZ),r);Object.assign(i.style,o),i.textContent="".concat(t);var c=i.getBoundingClientRect(),d={width:c.width,height:c.height};return wl.widthCache[a]=d,++wl.cacheCount>gZ&&(wl.cacheCount=0,wl.widthCache={}),d}catch{return{width:0,height:0}}},bZ=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function xd(e){"@babel/helpers - typeof";return xd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xd(e)}function Oh(e,t){return NZ(e)||SZ(e,t)||jZ(e,t)||wZ()}function wZ(){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 jZ(e,t){if(e){if(typeof e=="string")return FR(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 FR(e,t)}}function FR(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 SZ(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 NZ(e){if(Array.isArray(e))return e}function CZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function BR(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,AZ(r.key),r)}}function _Z(e,t,n){return t&&BR(e.prototype,t),n&&BR(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function AZ(e){var t=EZ(e,"string");return xd(t)=="symbol"?t:t+""}function EZ(e,t){if(xd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(xd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var zR=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,UR=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,PZ=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,OZ=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,j5={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},kZ=Object.keys(j5),Ol="NaN";function RZ(e,t){return e*j5[t]}var qp=(function(){function e(t,n){CZ(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!PZ.test(n)&&(this.num=NaN,this.unit=""),kZ.includes(n)&&(this.num=RZ(t,n),this.unit="px")}return _Z(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=OZ.exec(n))!==null&&r!==void 0?r:[],i=Oh(a,3),o=i[1],c=i[2];return new e(parseFloat(o),c??"")}}])})();function S5(e){if(e.includes(Ol))return Ol;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=zR.exec(t))!==null&&n!==void 0?n:[],a=Oh(r,4),i=a[1],o=a[2],c=a[3],d=qp.parse(i??""),f=qp.parse(c??""),h=o==="*"?d.multiply(f):d.divide(f);if(h.isNaN())return Ol;t=t.replace(zR,h.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var p,y=(p=UR.exec(t))!==null&&p!==void 0?p:[],g=Oh(y,4),j=g[1],b=g[2],x=g[3],S=qp.parse(j??""),N=qp.parse(x??""),_=b==="+"?S.add(N):S.subtract(N);if(_.isNaN())return Ol;t=t.replace(UR,_.toString())}return t}var qR=/\(([^()]*)\)/;function TZ(e){for(var t=e;t.includes("(");){var n=qR.exec(t),r=Oh(n,2),a=r[1];t=t.replace(qR,S5(a))}return t}function IZ(e){var t=e.replace(/\s+/g,"");return t=TZ(t),t=S5(t),t}function MZ(e){try{return IZ(e)}catch{return Ol}}function hw(e){var t=MZ(e.slice(5,-1));return t===Ol?"":t}var $Z=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],DZ=["dx","dy","angle","className","breakAll"];function sj(){return sj=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},sj.apply(this,arguments)}function WR(e,t){if(e==null)return{};var n=LZ(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 LZ(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 VR(e,t){return UZ(e)||zZ(e,t)||BZ(e,t)||FZ()}function FZ(){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 BZ(e,t){if(e){if(typeof e=="string")return HR(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return HR(e,t)}}function HR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zZ(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 UZ(e){if(Array.isArray(e))return e}var N5=/[ \f\n\r\t\v\u2028\u2029]+/,C5=function(t){var n=t.children,r=t.breakAll,a=t.style;try{var i=[];jt(n)||(r?i=n.toString().split(""):i=n.toString().split(N5));var o=i.map(function(d){return{word:d,width:Ju(d,a).width}}),c=r?0:Ju(" ",a).width;return{wordsWithComputedWidth:o,spaceWidth:c}}catch{return null}},qZ=function(t,n,r,a,i){var o=t.maxLines,c=t.children,d=t.style,f=t.breakAll,h=Fe(o),p=c,y=function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return H.reduce(function(Q,J){var T=J.word,D=J.width,X=Q[Q.length-1];if(X&&(a==null||i||X.width+D+r<Number(a)))X.words.push(T),X.width+=D+r;else{var F={words:[T],width:D};Q.push(F)}return Q},[])},g=y(n),j=function(H){return H.reduce(function(Q,J){return Q.width>J.width?Q:J})};if(!h)return g;for(var b="…",x=function(H){var Q=p.slice(0,H),J=C5({breakAll:f,style:d,children:Q+b}).wordsWithComputedWidth,T=y(J),D=T.length>o||j(T).width>Number(a);return[D,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=VR(k,2),M=R[0],z=R[1],B=x(A),L=VR(B,1),G=L[0];if(!M&&!G&&(S=A+1),M&&G&&(N=A-1),!M&&G){P=z;break}_++}return P||g},KR=function(t){var n=jt(t)?[]:t.toString().split(N5);return[{words:n}]},WZ=function(t){var n=t.width,r=t.scaleToFit,a=t.children,i=t.style,o=t.breakAll,c=t.maxLines;if((n||r)&&!Bo.isSsr){var d,f,h=C5({breakAll:o,children:a,style:i});if(h){var p=h.wordsWithComputedWidth,y=h.spaceWidth;d=p,f=y}else return KR(a);return qZ({breakAll:o,children:a,maxLines:c,style:i},d,f,n,r)}return KR(a)},GR="#808080",Eo=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?GR:x,N=WR(t,$Z),_=v.useMemo(function(){return WZ({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=WR(N,DZ);if(!Wn(r)||!Wn(i))return null;var z=r+(Fe(P)?P:0),B=i+(Fe(A)?A:0),L;switch(b){case"start":L=hw("calc(".concat(f,")"));break;case"middle":L=hw("calc(".concat((_.length-1)/2," * -").concat(c," + (").concat(f," / 2))"));break;default:L=hw("calc(".concat(_.length-1," * -").concat(c,")"));break}var G=[];if(p){var U=_[0].width,H=N.width;G.push("scale(".concat((Fe(H)?H/U:1)/U,")"))}return O&&G.push("rotate(".concat(O,", ").concat(z,", ").concat(B,")")),G.length&&(M.transform=G.join(" ")),q.createElement("text",sj({},vt(M,!0),{x:z,y:B,className:St("recharts-text",k),textAnchor:g,fill:S.includes("url")?GR:S}),_.map(function(Q,J){var T=Q.words.join(R?"":" ");return q.createElement("tspan",{x:z,dy:J===0?L:c,key:"".concat(T,"-").concat(J)},T)}))};function Ti(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function VZ(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function wN(e){let t,n,r;e.length!==2?(t=Ti,n=(c,d)=>Ti(e(c),d),r=(c,d)=>e(c)-d):(t=e===Ti||e===VZ?e:HZ,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 HZ(){return 0}function _5(e){return e===null?NaN:+e}function*KZ(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const GZ=wN(Ti),pf=GZ.right;wN(_5).center;class YR extends Map{constructor(t,n=QZ){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(XR(this,t))}has(t){return super.has(XR(this,t))}set(t,n){return super.set(YZ(this,t),n)}delete(t){return super.delete(XZ(this,t))}}function XR({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function YZ({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function XZ({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function QZ(e){return e!==null&&typeof e=="object"?e.valueOf():e}function JZ(e=Ti){if(e===Ti)return A5;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 A5(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const ZZ=Math.sqrt(50),eee=Math.sqrt(10),tee=Math.sqrt(2);function kh(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>=ZZ?10:i>=eee?5:i>=tee?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?kh(e,t,n*2):[c,d,f]}function ij(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?kh(t,e,n):kh(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 oj(e,t,n){return t=+t,e=+e,n=+n,kh(e,t,n)[2]}function lj(e,t,n){t=+t,e=+e,n=+n;const r=t<e,a=r?oj(t,e,n):oj(e,t,n);return(r?-1:1)*(a<0?1/-a:a)}function QR(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function JR(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function E5(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?A5:JZ(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));E5(e,t,g,j,a)}const i=e[t];let o=n,c=r;for(Tu(e,n,t),a(e[r],i)>0&&Tu(e,n,r);o<c;){for(Tu(e,o,c),++o,--c;a(e[o],i)<0;)++o;for(;a(e[c],i)>0;)--c}a(e[n],i)===0?Tu(e,n,c):(++c,Tu(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function Tu(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function nee(e,t,n){if(e=Float64Array.from(KZ(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return JR(e);if(t>=1)return QR(e);var r,a=(r-1)*t,i=Math.floor(a),o=QR(E5(e,i).subarray(0,i+1)),c=JR(e.subarray(i+1));return o+(c-o)*(a-i)}}function ree(e,t,n=_5){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 aee(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 Aa(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function ei(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 cj=Symbol("implicit");function jN(){var e=new YR,t=[],n=[],r=cj;function a(i){let o=e.get(i);if(o===void 0){if(r!==cj)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 YR;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 jN(t,n).unknown(r)},Aa.apply(a,arguments),a}function bd(){var e=jN().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=aee(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 bd(t(),[r,a]).round(c).paddingInner(d).paddingOuter(f).align(h)},Aa.apply(p(),arguments)}function P5(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return P5(t())},e}function Zu(){return P5(bd.apply(null,arguments).paddingInner(1))}function SN(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function O5(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function hf(){}var wd=.7,Rh=1/wd,ql="\\s*([+-]?\\d+)\\s*",jd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ds="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",see=/^#([0-9a-f]{3,8})$/,iee=new RegExp(`^rgb\\(${ql},${ql},${ql}\\)$`),oee=new RegExp(`^rgb\\(${ds},${ds},${ds}\\)$`),lee=new RegExp(`^rgba\\(${ql},${ql},${ql},${jd}\\)$`),cee=new RegExp(`^rgba\\(${ds},${ds},${ds},${jd}\\)$`),uee=new RegExp(`^hsl\\(${jd},${ds},${ds}\\)$`),dee=new RegExp(`^hsla\\(${jd},${ds},${ds},${jd}\\)$`),ZR={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};SN(hf,Sd,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:e2,formatHex:e2,formatHex8:fee,formatHsl:pee,formatRgb:t2,toString:t2});function e2(){return this.rgb().formatHex()}function fee(){return this.rgb().formatHex8()}function pee(){return k5(this).formatHsl()}function t2(){return this.rgb().formatRgb()}function Sd(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=see.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?n2(t):n===3?new $r(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Wp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Wp(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=iee.exec(e))?new $r(t[1],t[2],t[3],1):(t=oee.exec(e))?new $r(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=lee.exec(e))?Wp(t[1],t[2],t[3],t[4]):(t=cee.exec(e))?Wp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=uee.exec(e))?s2(t[1],t[2]/100,t[3]/100,1):(t=dee.exec(e))?s2(t[1],t[2]/100,t[3]/100,t[4]):ZR.hasOwnProperty(e)?n2(ZR[e]):e==="transparent"?new $r(NaN,NaN,NaN,0):null}function n2(e){return new $r(e>>16&255,e>>8&255,e&255,1)}function Wp(e,t,n,r){return r<=0&&(e=t=n=NaN),new $r(e,t,n,r)}function hee(e){return e instanceof hf||(e=Sd(e)),e?(e=e.rgb(),new $r(e.r,e.g,e.b,e.opacity)):new $r}function uj(e,t,n,r){return arguments.length===1?hee(e):new $r(e,t,n,r??1)}function $r(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}SN($r,uj,O5(hf,{brighter(e){return e=e==null?Rh:Math.pow(Rh,e),new $r(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?wd:Math.pow(wd,e),new $r(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new $r(wo(this.r),wo(this.g),wo(this.b),Th(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:r2,formatHex:r2,formatHex8:mee,formatRgb:a2,toString:a2}));function r2(){return`#${go(this.r)}${go(this.g)}${go(this.b)}`}function mee(){return`#${go(this.r)}${go(this.g)}${go(this.b)}${go((isNaN(this.opacity)?1:this.opacity)*255)}`}function a2(){const e=Th(this.opacity);return`${e===1?"rgb(":"rgba("}${wo(this.r)}, ${wo(this.g)}, ${wo(this.b)}${e===1?")":`, ${e})`}`}function Th(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function wo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function go(e){return e=wo(e),(e<16?"0":"")+e.toString(16)}function s2(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new za(e,t,n,r)}function k5(e){if(e instanceof za)return new za(e.h,e.s,e.l,e.opacity);if(e instanceof hf||(e=Sd(e)),!e)return new za;if(e instanceof za)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 za(o,c,d,e.opacity)}function vee(e,t,n,r){return arguments.length===1?k5(e):new za(e,t,n,r??1)}function za(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}SN(za,vee,O5(hf,{brighter(e){return e=e==null?Rh:Math.pow(Rh,e),new za(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?wd:Math.pow(wd,e),new za(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 $r(mw(e>=240?e-240:e+120,a,r),mw(e,a,r),mw(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new za(i2(this.h),Vp(this.s),Vp(this.l),Th(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=Th(this.opacity);return`${e===1?"hsl(":"hsla("}${i2(this.h)}, ${Vp(this.s)*100}%, ${Vp(this.l)*100}%${e===1?")":`, ${e})`}`}}));function i2(e){return e=(e||0)%360,e<0?e+360:e}function Vp(e){return Math.max(0,Math.min(1,e||0))}function mw(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const NN=e=>()=>e;function gee(e,t){return function(n){return e+n*t}}function yee(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 xee(e){return(e=+e)==1?R5:function(t,n){return n-t?yee(t,n,e):NN(isNaN(t)?n:t)}}function R5(e,t){var n=t-e;return n?gee(e,n):NN(isNaN(e)?t:e)}const o2=(function e(t){var n=xee(t);function r(a,i){var o=n((a=uj(a)).r,(i=uj(i)).r),c=n(a.g,i.g),d=n(a.b,i.b),f=R5(a.opacity,i.opacity);return function(h){return a.r=o(h),a.g=c(h),a.b=d(h),a.opacity=f(h),a+""}}return r.gamma=e,r})(1);function bee(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 wee(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function jee(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]=zc(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 See(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ih(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Nee(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]=zc(e[a],t[a]):r[a]=t[a];return function(i){for(a in n)r[a]=n[a](i);return r}}var dj=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,vw=new RegExp(dj.source,"g");function Cee(e){return function(){return e}}function _ee(e){return function(t){return e(t)+""}}function Aee(e,t){var n=dj.lastIndex=vw.lastIndex=0,r,a,i,o=-1,c=[],d=[];for(e=e+"",t=t+"";(r=dj.exec(e))&&(a=vw.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:Ih(r,a)})),n=vw.lastIndex;return n<t.length&&(i=t.slice(n),c[o]?c[o]+=i:c[++o]=i),c.length<2?d[0]?_ee(d[0].x):Cee(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 zc(e,t){var n=typeof t,r;return t==null||n==="boolean"?NN(t):(n==="number"?Ih:n==="string"?(r=Sd(t))?(t=r,o2):Aee:t instanceof Sd?o2:t instanceof Date?See:wee(t)?bee:Array.isArray(t)?jee:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Nee:Ih)(e,t)}function CN(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Eee(e,t){t===void 0&&(t=e,e=zc);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 Pee(e){return function(){return e}}function Mh(e){return+e}var l2=[0,1];function Nr(e){return e}function fj(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Pee(isNaN(t)?NaN:.5)}function Oee(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function kee(e,t,n){var r=e[0],a=e[1],i=t[0],o=t[1];return a<r?(r=fj(a,r),i=n(o,i)):(r=fj(r,a),i=n(i,o)),function(c){return i(r(c))}}function Ree(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]=fj(e[o],e[o+1]),i[o]=n(t[o],t[o+1]);return function(c){var d=pf(e,c,1,r)-1;return i[d](a[d](c))}}function mf(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function mv(){var e=l2,t=l2,n=zc,r,a,i,o=Nr,c,d,f;function h(){var y=Math.min(e.length,t.length);return o!==Nr&&(o=Oee(e[0],e[y-1])),c=y>2?Ree:kee,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),Ih)))(y)))},p.domain=function(y){return arguments.length?(e=Array.from(y,Mh),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=CN,h()},p.clamp=function(y){return arguments.length?(o=y?!0:Nr,h()):o!==Nr},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 _N(){return mv()(Nr,Nr)}function Tee(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function $h(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 ac(e){return e=$h(Math.abs(e)),e?e[1]:NaN}function Iee(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 Mee(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var $ee=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Nd(e){if(!(t=$ee.exec(e)))throw new Error("invalid format: "+e);var t;return new AN({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]})}Nd.prototype=AN.prototype;function AN(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+""}AN.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 Dee(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 Dh;function Lee(e,t){var n=$h(e,t);if(!n)return Dh=void 0,e.toPrecision(t);var r=n[0],a=n[1],i=a-(Dh=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")+$h(e,Math.max(0,t+i-1))[0]}function c2(e,t){var n=$h(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 u2={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Tee,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)=>c2(e*100,t),r:c2,s:Lee,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function d2(e){return e}var f2=Array.prototype.map,p2=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Fee(e){var t=e.grouping===void 0||e.thousands===void 0?d2:Iee(f2.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?d2:Mee(f2.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=Nd(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"):u2[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=u2[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(L){var G=k,U=R,H,Q,J;if(O==="c")U=M(L)+U,L="";else{L=+L;var T=L<0||1/L<0;if(L=isNaN(L)?d:M(Math.abs(L),P),A&&(L=Dee(L)),T&&+L==0&&b!=="+"&&(T=!1),G=(T?b==="("?b:c:b==="-"||b==="("?"":b)+G,U=(O==="s"&&!isNaN(L)&&Dh!==void 0?p2[8+Dh/3]:"")+U+(T&&b==="("?")":""),z){for(H=-1,Q=L.length;++H<Q;)if(J=L.charCodeAt(H),48>J||J>57){U=(J===46?a+L.slice(H+1):L.slice(H))+U,L=L.slice(0,H);break}}}_&&!S&&(L=t(L,1/0));var D=G.length+L.length+U.length,X=D<N?new Array(N-D+1).join(g):"";switch(_&&S&&(L=t(X+L,X.length?N-U.length:1/0),X=""),j){case"<":L=G+L+U+X;break;case"=":L=G+X+L+U;break;case"^":L=X.slice(0,D=X.length>>1)+G+L+U+X.slice(D);break;default:L=X+G+L+U;break}return i(L)}return B.toString=function(){return p+""},B}function h(p,y){var g=Math.max(-8,Math.min(8,Math.floor(ac(y)/3)))*3,j=Math.pow(10,-g),b=f((p=Nd(p),p.type="f",p),{suffix:p2[8+g/3]});return function(x){return b(j*x)}}return{format:f,formatPrefix:h}}var Hp,EN,T5;Bee({thousands:",",grouping:[3],currency:["$",""]});function Bee(e){return Hp=Fee(e),EN=Hp.format,T5=Hp.formatPrefix,Hp}function zee(e){return Math.max(0,-ac(Math.abs(e)))}function Uee(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ac(t)/3)))*3-ac(Math.abs(e)))}function qee(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ac(t)-ac(e))+1}function I5(e,t,n,r){var a=lj(e,t,n),i;switch(r=Nd(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(i=Uee(a,o))&&(r.precision=i),T5(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=qee(a,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=zee(a))&&(r.precision=i-(r.type==="%")*2);break}}return EN(r)}function qi(e){var t=e.domain;return e.ticks=function(n){var r=t();return ij(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var a=t();return I5(a[0],a[a.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),a=0,i=r.length-1,o=r[a],c=r[i],d,f,h=10;for(c<o&&(f=o,o=c,c=f,f=a,a=i,i=f);h-- >0;){if(f=oj(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 Lh(){var e=_N();return e.copy=function(){return mf(e,Lh())},Aa.apply(e,arguments),qi(e)}function M5(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,Mh),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return M5(e).unknown(t)},e=arguments.length?Array.from(e,Mh):[0,1],qi(n)}function $5(e,t){e=e.slice();var n=0,r=e.length-1,a=e[n],i=e[r],o;return i<a&&(o=n,n=r,r=o,o=a,a=i,i=o),e[n]=t.floor(a),e[r]=t.ceil(i),e}function h2(e){return Math.log(e)}function m2(e){return Math.exp(e)}function Wee(e){return-Math.log(-e)}function Vee(e){return-Math.exp(-e)}function Hee(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Kee(e){return e===10?Hee:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Gee(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 v2(e){return(t,n)=>-e(-t,n)}function PN(e){const t=e(h2,m2),n=t.domain;let r=10,a,i;function o(){return a=Gee(r),i=Kee(r),n()[0]<0?(a=v2(a),i=v2(i),e(Wee,Vee)):e(h2,m2),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=ij(f,h,x))}else S=ij(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=Nd(d)).precision==null&&(d.trim=!0),d=EN(d)),c===1/0)return d;const f=Math.max(1,r*c/t.ticks().length);return h=>{let p=h/i(Math.round(a(h)));return p*r<r-.5&&(p*=r),p<=f?d(h):""}},t.nice=()=>n($5(n(),{floor:c=>i(Math.floor(a(c))),ceil:c=>i(Math.ceil(a(c)))})),t}function D5(){const e=PN(mv()).domain([1,10]);return e.copy=()=>mf(e,D5()).base(e.base()),Aa.apply(e,arguments),e}function g2(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function y2(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function ON(e){var t=1,n=e(g2(t),y2(t));return n.constant=function(r){return arguments.length?e(g2(t=+r),y2(t)):t},qi(n)}function L5(){var e=ON(mv());return e.copy=function(){return mf(e,L5()).constant(e.constant())},Aa.apply(e,arguments)}function x2(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Yee(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Xee(e){return e<0?-e*e:e*e}function kN(e){var t=e(Nr,Nr),n=1;function r(){return n===1?e(Nr,Nr):n===.5?e(Yee,Xee):e(x2(n),x2(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,r()):n},qi(t)}function RN(){var e=kN(mv());return e.copy=function(){return mf(e,RN()).exponent(e.exponent())},Aa.apply(e,arguments),e}function Qee(){return RN.apply(null,arguments).exponent(.5)}function b2(e){return Math.sign(e)*e*e}function Jee(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function F5(){var e=_N(),t=[0,1],n=!1,r;function a(i){var o=Jee(e(i));return isNaN(o)?r:n?Math.round(o):o}return a.invert=function(i){return e.invert(b2(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,Mh)).map(b2)),a):t.slice()},a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(n=!!i,a):n},a.clamp=function(i){return arguments.length?(e.clamp(i),a):e.clamp()},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return F5(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Aa.apply(a,arguments),qi(a)}function B5(){var e=[],t=[],n=[],r;function a(){var o=0,c=Math.max(1,t.length);for(n=new Array(c-1);++o<c;)n[o-1]=ree(e,o/c);return i}function i(o){return o==null||isNaN(o=+o)?r:t[pf(n,o)]}return i.invertExtent=function(o){var c=t.indexOf(o);return c<0?[NaN,NaN]:[c>0?n[c-1]:e[0],c<n.length?n[c]:e[e.length-1]]},i.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let c of o)c!=null&&!isNaN(c=+c)&&e.push(c);return e.sort(Ti),a()},i.range=function(o){return arguments.length?(t=Array.from(o),a()):t.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.quantiles=function(){return n.slice()},i.copy=function(){return B5().domain(e).range(t).unknown(r)},Aa.apply(i,arguments)}function z5(){var e=0,t=1,n=1,r=[.5],a=[0,1],i;function o(d){return d!=null&&d<=d?a[pf(r,d,0,n)]:i}function c(){var d=-1;for(r=new Array(n);++d<n;)r[d]=((d+1)*t-(d-n)*e)/(n+1);return o}return o.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,c()):[e,t]},o.range=function(d){return arguments.length?(n=(a=Array.from(d)).length-1,c()):a.slice()},o.invertExtent=function(d){var f=a.indexOf(d);return f<0?[NaN,NaN]:f<1?[e,r[0]]:f>=n?[r[n-1],t]:[r[f-1],r[f]]},o.unknown=function(d){return arguments.length&&(i=d),o},o.thresholds=function(){return r.slice()},o.copy=function(){return z5().domain([e,t]).range(a).unknown(i)},Aa.apply(qi(o),arguments)}function U5(){var e=[.5],t=[0,1],n,r=1;function a(i){return i!=null&&i<=i?t[pf(e,i,0,r)]:n}return a.domain=function(i){return arguments.length?(e=Array.from(i),r=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(i){return arguments.length?(t=Array.from(i),r=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(i){var o=t.indexOf(i);return[e[o-1],e[o]]},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return U5().domain(e).range(t).unknown(n)},Aa.apply(a,arguments)}const gw=new Date,yw=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)=>(gw.setTime(+i),yw.setTime(+o),e(gw),e(yw),Math.floor(n(gw,yw))),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 Fh=Gn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Fh.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):Fh);Fh.range;const Ls=1e3,xa=Ls*60,Fs=xa*60,Gs=Fs*24,TN=Gs*7,w2=Gs*30,xw=Gs*365,yo=Gn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ls)},(e,t)=>(t-e)/Ls,e=>e.getUTCSeconds());yo.range;const IN=Gn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ls)},(e,t)=>{e.setTime(+e+t*xa)},(e,t)=>(t-e)/xa,e=>e.getMinutes());IN.range;const MN=Gn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*xa)},(e,t)=>(t-e)/xa,e=>e.getUTCMinutes());MN.range;const $N=Gn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ls-e.getMinutes()*xa)},(e,t)=>{e.setTime(+e+t*Fs)},(e,t)=>(t-e)/Fs,e=>e.getHours());$N.range;const DN=Gn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Fs)},(e,t)=>(t-e)/Fs,e=>e.getUTCHours());DN.range;const vf=Gn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*xa)/Gs,e=>e.getDate()-1);vf.range;const vv=Gn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Gs,e=>e.getUTCDate()-1);vv.range;const q5=Gn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Gs,e=>Math.floor(e/Gs));q5.range;function zo(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())*xa)/TN)}const gv=zo(0),Bh=zo(1),Zee=zo(2),ete=zo(3),sc=zo(4),tte=zo(5),nte=zo(6);gv.range;Bh.range;Zee.range;ete.range;sc.range;tte.range;nte.range;function Uo(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)/TN)}const yv=Uo(0),zh=Uo(1),rte=Uo(2),ate=Uo(3),ic=Uo(4),ste=Uo(5),ite=Uo(6);yv.range;zh.range;rte.range;ate.range;ic.range;ste.range;ite.range;const LN=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());LN.range;const FN=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());FN.range;const Ys=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());Ys.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)});Ys.range;const Xs=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());Xs.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)});Xs.range;function W5(e,t,n,r,a,i){const o=[[yo,1,Ls],[yo,5,5*Ls],[yo,15,15*Ls],[yo,30,30*Ls],[i,1,xa],[i,5,5*xa],[i,15,15*xa],[i,30,30*xa],[a,1,Fs],[a,3,3*Fs],[a,6,6*Fs],[a,12,12*Fs],[r,1,Gs],[r,2,2*Gs],[n,1,TN],[t,1,w2],[t,3,3*w2],[e,1,xw]];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=wN(([,,x])=>x).right(o,y);if(g===o.length)return e.every(lj(f/xw,h/xw,p));if(g===0)return Fh.every(Math.max(lj(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[ote,lte]=W5(Xs,FN,yv,q5,DN,MN),[cte,ute]=W5(Ys,LN,gv,vf,$N,IN);function bw(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function ww(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 Iu(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function dte(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=Mu(a),h=$u(a),p=Mu(i),y=$u(i),g=Mu(o),j=$u(o),b=Mu(c),x=$u(c),S=Mu(d),N=$u(d),_={a:J,A:T,b:D,B:X,c:null,d:A2,e:A2,f:Ite,g:Wte,G:Hte,H:kte,I:Rte,j:Tte,L:V5,m:Mte,M:$te,p:F,q:$,Q:O2,s:k2,S:Dte,u:Lte,U:Fte,V:Bte,w:zte,W:Ute,x:null,X:null,y:qte,Y:Vte,Z:Kte,"%":P2},P={a:ee,A:ae,b:K,B:le,c:null,d:E2,e:E2,f:Qte,g:one,G:cne,H:Gte,I:Yte,j:Xte,L:K5,m:Jte,M:Zte,p:ie,q:fe,Q:O2,s:k2,S:ene,u:tne,U:nne,V:rne,w:ane,W:sne,x:null,X:null,y:ine,Y:lne,Z:une,"%":P2},A={a:z,A:B,b:L,B:G,c:U,d:C2,e:C2,f:Ate,g:N2,G:S2,H:_2,I:_2,j:Ste,L:_te,m:jte,M:Nte,p:M,q:wte,Q:Pte,s:Ote,S:Cte,u:vte,U:gte,V:yte,w:mte,W:xte,x:H,X:Q,y:N2,Y:S2,Z:bte,"%":Ete};_.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,ce){return function(Se){var ne=[],Te=-1,Ae=0,Ye=oe.length,ge,Oe,Be;for(Se instanceof Date||(Se=new Date(+Se));++Te<Ye;)oe.charCodeAt(Te)===37&&(ne.push(oe.slice(Ae,Te)),(Oe=j2[ge=oe.charAt(++Te)])!=null?ge=oe.charAt(++Te):Oe=ge==="e"?" ":"0",(Be=ce[ge])&&(ge=Be(Se,Oe)),ne.push(ge),Ae=Te+1);return ne.push(oe.slice(Ae,Te)),ne.join("")}}function k(oe,ce){return function(Se){var ne=Iu(1900,void 0,1),Te=R(ne,oe,Se+="",0),Ae,Ye;if(Te!=Se.length)return null;if("Q"in ne)return new Date(ne.Q);if("s"in ne)return new Date(ne.s*1e3+("L"in ne?ne.L:0));if(ce&&!("Z"in ne)&&(ne.Z=0),"p"in ne&&(ne.H=ne.H%12+ne.p*12),ne.m===void 0&&(ne.m="q"in ne?ne.q:0),"V"in ne){if(ne.V<1||ne.V>53)return null;"w"in ne||(ne.w=1),"Z"in ne?(Ae=ww(Iu(ne.y,0,1)),Ye=Ae.getUTCDay(),Ae=Ye>4||Ye===0?zh.ceil(Ae):zh(Ae),Ae=vv.offset(Ae,(ne.V-1)*7),ne.y=Ae.getUTCFullYear(),ne.m=Ae.getUTCMonth(),ne.d=Ae.getUTCDate()+(ne.w+6)%7):(Ae=bw(Iu(ne.y,0,1)),Ye=Ae.getDay(),Ae=Ye>4||Ye===0?Bh.ceil(Ae):Bh(Ae),Ae=vf.offset(Ae,(ne.V-1)*7),ne.y=Ae.getFullYear(),ne.m=Ae.getMonth(),ne.d=Ae.getDate()+(ne.w+6)%7)}else("W"in ne||"U"in ne)&&("w"in ne||(ne.w="u"in ne?ne.u%7:"W"in ne?1:0),Ye="Z"in ne?ww(Iu(ne.y,0,1)).getUTCDay():bw(Iu(ne.y,0,1)).getDay(),ne.m=0,ne.d="W"in ne?(ne.w+6)%7+ne.W*7-(Ye+5)%7:ne.w+ne.U*7-(Ye+6)%7);return"Z"in ne?(ne.H+=ne.Z/100|0,ne.M+=ne.Z%100,ww(ne)):bw(ne)}}function R(oe,ce,Se,ne){for(var Te=0,Ae=ce.length,Ye=Se.length,ge,Oe;Te<Ae;){if(ne>=Ye)return-1;if(ge=ce.charCodeAt(Te++),ge===37){if(ge=ce.charAt(Te++),Oe=A[ge in j2?ce.charAt(Te++):ge],!Oe||(ne=Oe(oe,Se,ne))<0)return-1}else if(ge!=Se.charCodeAt(ne++))return-1}return ne}function M(oe,ce,Se){var ne=f.exec(ce.slice(Se));return ne?(oe.p=h.get(ne[0].toLowerCase()),Se+ne[0].length):-1}function z(oe,ce,Se){var ne=g.exec(ce.slice(Se));return ne?(oe.w=j.get(ne[0].toLowerCase()),Se+ne[0].length):-1}function B(oe,ce,Se){var ne=p.exec(ce.slice(Se));return ne?(oe.w=y.get(ne[0].toLowerCase()),Se+ne[0].length):-1}function L(oe,ce,Se){var ne=S.exec(ce.slice(Se));return ne?(oe.m=N.get(ne[0].toLowerCase()),Se+ne[0].length):-1}function G(oe,ce,Se){var ne=b.exec(ce.slice(Se));return ne?(oe.m=x.get(ne[0].toLowerCase()),Se+ne[0].length):-1}function U(oe,ce,Se){return R(oe,t,ce,Se)}function H(oe,ce,Se){return R(oe,n,ce,Se)}function Q(oe,ce,Se){return R(oe,r,ce,Se)}function J(oe){return o[oe.getDay()]}function T(oe){return i[oe.getDay()]}function D(oe){return d[oe.getMonth()]}function X(oe){return c[oe.getMonth()]}function F(oe){return a[+(oe.getHours()>=12)]}function $(oe){return 1+~~(oe.getMonth()/3)}function ee(oe){return o[oe.getUTCDay()]}function ae(oe){return i[oe.getUTCDay()]}function K(oe){return d[oe.getUTCMonth()]}function le(oe){return c[oe.getUTCMonth()]}function ie(oe){return a[+(oe.getUTCHours()>=12)]}function fe(oe){return 1+~~(oe.getUTCMonth()/3)}return{format:function(oe){var ce=O(oe+="",_);return ce.toString=function(){return oe},ce},parse:function(oe){var ce=k(oe+="",!1);return ce.toString=function(){return oe},ce},utcFormat:function(oe){var ce=O(oe+="",P);return ce.toString=function(){return oe},ce},utcParse:function(oe){var ce=k(oe+="",!0);return ce.toString=function(){return oe},ce}}}var j2={"-":"",_:" ",0:"0"},nr=/^\s*\d+/,fte=/^%/,pte=/[\\^$*+?|[\]().{}]/g;function Lt(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 hte(e){return e.replace(pte,"\\$&")}function Mu(e){return new RegExp("^(?:"+e.map(hte).join("|")+")","i")}function $u(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function mte(e,t,n){var r=nr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function vte(e,t,n){var r=nr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function gte(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function yte(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function xte(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function S2(e,t,n){var r=nr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function N2(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function bte(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 wte(e,t,n){var r=nr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function jte(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function C2(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Ste(e,t,n){var r=nr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function _2(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Nte(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Cte(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function _te(e,t,n){var r=nr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Ate(e,t,n){var r=nr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Ete(e,t,n){var r=fte.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Pte(e,t,n){var r=nr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Ote(e,t,n){var r=nr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function A2(e,t){return Lt(e.getDate(),t,2)}function kte(e,t){return Lt(e.getHours(),t,2)}function Rte(e,t){return Lt(e.getHours()%12||12,t,2)}function Tte(e,t){return Lt(1+vf.count(Ys(e),e),t,3)}function V5(e,t){return Lt(e.getMilliseconds(),t,3)}function Ite(e,t){return V5(e,t)+"000"}function Mte(e,t){return Lt(e.getMonth()+1,t,2)}function $te(e,t){return Lt(e.getMinutes(),t,2)}function Dte(e,t){return Lt(e.getSeconds(),t,2)}function Lte(e){var t=e.getDay();return t===0?7:t}function Fte(e,t){return Lt(gv.count(Ys(e)-1,e),t,2)}function H5(e){var t=e.getDay();return t>=4||t===0?sc(e):sc.ceil(e)}function Bte(e,t){return e=H5(e),Lt(sc.count(Ys(e),e)+(Ys(e).getDay()===4),t,2)}function zte(e){return e.getDay()}function Ute(e,t){return Lt(Bh.count(Ys(e)-1,e),t,2)}function qte(e,t){return Lt(e.getFullYear()%100,t,2)}function Wte(e,t){return e=H5(e),Lt(e.getFullYear()%100,t,2)}function Vte(e,t){return Lt(e.getFullYear()%1e4,t,4)}function Hte(e,t){var n=e.getDay();return e=n>=4||n===0?sc(e):sc.ceil(e),Lt(e.getFullYear()%1e4,t,4)}function Kte(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Lt(t/60|0,"0",2)+Lt(t%60,"0",2)}function E2(e,t){return Lt(e.getUTCDate(),t,2)}function Gte(e,t){return Lt(e.getUTCHours(),t,2)}function Yte(e,t){return Lt(e.getUTCHours()%12||12,t,2)}function Xte(e,t){return Lt(1+vv.count(Xs(e),e),t,3)}function K5(e,t){return Lt(e.getUTCMilliseconds(),t,3)}function Qte(e,t){return K5(e,t)+"000"}function Jte(e,t){return Lt(e.getUTCMonth()+1,t,2)}function Zte(e,t){return Lt(e.getUTCMinutes(),t,2)}function ene(e,t){return Lt(e.getUTCSeconds(),t,2)}function tne(e){var t=e.getUTCDay();return t===0?7:t}function nne(e,t){return Lt(yv.count(Xs(e)-1,e),t,2)}function G5(e){var t=e.getUTCDay();return t>=4||t===0?ic(e):ic.ceil(e)}function rne(e,t){return e=G5(e),Lt(ic.count(Xs(e),e)+(Xs(e).getUTCDay()===4),t,2)}function ane(e){return e.getUTCDay()}function sne(e,t){return Lt(zh.count(Xs(e)-1,e),t,2)}function ine(e,t){return Lt(e.getUTCFullYear()%100,t,2)}function one(e,t){return e=G5(e),Lt(e.getUTCFullYear()%100,t,2)}function lne(e,t){return Lt(e.getUTCFullYear()%1e4,t,4)}function cne(e,t){var n=e.getUTCDay();return e=n>=4||n===0?ic(e):ic.ceil(e),Lt(e.getUTCFullYear()%1e4,t,4)}function une(){return"+0000"}function P2(){return"%"}function O2(e){return+e}function k2(e){return Math.floor(+e/1e3)}var jl,Y5,X5;dne({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 dne(e){return jl=dte(e),Y5=jl.format,jl.parse,X5=jl.utcFormat,jl.utcParse,jl}function fne(e){return new Date(e)}function pne(e){return e instanceof Date?+e:+new Date(+e)}function BN(e,t,n,r,a,i,o,c,d,f){var h=_N(),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,pne)):y().map(fne)},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($5(k,O)):h},h.copy=function(){return mf(h,BN(e,t,n,r,a,i,o,c,d,f))},h}function hne(){return Aa.apply(BN(cte,ute,Ys,LN,gv,vf,$N,IN,yo,Y5).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function mne(){return Aa.apply(BN(ote,lte,Xs,FN,yv,vv,DN,MN,yo,X5).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function xv(){var e=0,t=1,n,r,a,i,o=Nr,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(zc),f.rangeRound=h(CN),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 Wi(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Q5(){var e=qi(xv()(Nr));return e.copy=function(){return Wi(e,Q5())},ei.apply(e,arguments)}function J5(){var e=PN(xv()).domain([1,10]);return e.copy=function(){return Wi(e,J5()).base(e.base())},ei.apply(e,arguments)}function Z5(){var e=ON(xv());return e.copy=function(){return Wi(e,Z5()).constant(e.constant())},ei.apply(e,arguments)}function zN(){var e=kN(xv());return e.copy=function(){return Wi(e,zN()).exponent(e.exponent())},ei.apply(e,arguments)}function vne(){return zN.apply(null,arguments).exponent(.5)}function eL(){var e=[],t=Nr;function n(r){if(r!=null&&!isNaN(r=+r))return t((pf(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let a of r)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(Ti),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)=>nee(e,i/r))},n.copy=function(){return eL(t).domain(e)},ei.apply(n,arguments)}function bv(){var e=0,t=.5,n=1,r=1,a,i,o,c,d,f=Nr,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=Eee(b,[S,N,_]),g):[f(0),f(.5),f(1)]}}return g.range=j(zc),g.rangeRound=j(CN),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 tL(){var e=qi(bv()(Nr));return e.copy=function(){return Wi(e,tL())},ei.apply(e,arguments)}function nL(){var e=PN(bv()).domain([.1,1,10]);return e.copy=function(){return Wi(e,nL()).base(e.base())},ei.apply(e,arguments)}function rL(){var e=ON(bv());return e.copy=function(){return Wi(e,rL()).constant(e.constant())},ei.apply(e,arguments)}function UN(){var e=kN(bv());return e.copy=function(){return Wi(e,UN()).exponent(e.exponent())},ei.apply(e,arguments)}function gne(){return UN.apply(null,arguments).exponent(.5)}const R2=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:bd,scaleDiverging:tL,scaleDivergingLog:nL,scaleDivergingPow:UN,scaleDivergingSqrt:gne,scaleDivergingSymlog:rL,scaleIdentity:M5,scaleImplicit:cj,scaleLinear:Lh,scaleLog:D5,scaleOrdinal:jN,scalePoint:Zu,scalePow:RN,scaleQuantile:B5,scaleQuantize:z5,scaleRadial:F5,scaleSequential:Q5,scaleSequentialLog:J5,scaleSequentialPow:zN,scaleSequentialQuantile:eL,scaleSequentialSqrt:vne,scaleSequentialSymlog:Z5,scaleSqrt:Qee,scaleSymlog:L5,scaleThreshold:U5,scaleTime:hne,scaleUtc:mne,tickFormat:I5},Symbol.toStringTag,{value:"Module"}));var jw,T2;function wv(){if(T2)return jw;T2=1;var e=Dc();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 jw=t,jw}var Sw,I2;function aL(){if(I2)return Sw;I2=1;function e(t,n){return t>n}return Sw=e,Sw}var Nw,M2;function yne(){if(M2)return Nw;M2=1;var e=wv(),t=aL(),n=Bc();function r(a){return a&&a.length?e(a,n,t):void 0}return Nw=r,Nw}var xne=yne();const jv=Ht(xne);var Cw,$2;function sL(){if($2)return Cw;$2=1;function e(t,n){return t<n}return Cw=e,Cw}var _w,D2;function bne(){if(D2)return _w;D2=1;var e=wv(),t=sL(),n=Bc();function r(a){return a&&a.length?e(a,n,t):void 0}return _w=r,_w}var wne=bne();const Sv=Ht(wne);var Aw,L2;function jne(){if(L2)return Aw;L2=1;var e=aN(),t=ws(),n=h5(),r=Dr();function a(i,o){var c=r(i)?e:n;return c(i,t(o,3))}return Aw=a,Aw}var Ew,F2;function Sne(){if(F2)return Ew;F2=1;var e=f5(),t=jne();function n(r,a){return e(t(r,a),1)}return Ew=n,Ew}var Nne=Sne();const Cne=Ht(Nne);var Pw,B2;function _ne(){if(B2)return Pw;B2=1;var e=gN();function t(n,r){return e(n,r)}return Pw=t,Pw}var Ane=_ne();const gf=Ht(Ane);var Uc=1e9,Ene={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},WN,mn=!0,Ca="[DecimalError] ",jo=Ca+"Invalid argument: ",qN=Ca+"Exponent out of range: ",qc=Math.floor,ho=Math.pow,Pne=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Jr,er=1e7,pn=7,iL=9007199254740991,Uh=qc(iL/pn),Ge={};Ge.absoluteValue=Ge.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Ge.comparedTo=Ge.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};Ge.decimalPlaces=Ge.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*pn;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Ge.dividedBy=Ge.div=function(e){return qs(this,new this.constructor(e))};Ge.dividedToIntegerBy=Ge.idiv=function(e){var t=this,n=t.constructor;return tn(qs(t,new n(e),0,1),n.precision)};Ge.equals=Ge.eq=function(e){return!this.cmp(e)};Ge.exponent=function(){return Dn(this)};Ge.greaterThan=Ge.gt=function(e){return this.cmp(e)>0};Ge.greaterThanOrEqualTo=Ge.gte=function(e){return this.cmp(e)>=0};Ge.isInteger=Ge.isint=function(){return this.e>this.d.length-2};Ge.isNegative=Ge.isneg=function(){return this.s<0};Ge.isPositive=Ge.ispos=function(){return this.s>0};Ge.isZero=function(){return this.s===0};Ge.lessThan=Ge.lt=function(e){return this.cmp(e)<0};Ge.lessThanOrEqualTo=Ge.lte=function(e){return this.cmp(e)<1};Ge.logarithm=Ge.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(Jr))throw Error(Ca+"NaN");if(n.s<1)throw Error(Ca+(n.s?"NaN":"-Infinity"));return n.eq(Jr)?new r(0):(mn=!1,t=qs(Cd(n,i),Cd(e,i),i),mn=!0,tn(t,a))};Ge.minus=Ge.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?cL(t,e):oL(t,(e.s=-e.s,e))};Ge.modulo=Ge.mod=function(e){var t,n=this,r=n.constructor,a=r.precision;if(e=new r(e),!e.s)throw Error(Ca+"NaN");return n.s?(mn=!1,t=qs(n,e,0,1).times(e),mn=!0,n.minus(t)):tn(new r(n),a)};Ge.naturalExponential=Ge.exp=function(){return lL(this)};Ge.naturalLogarithm=Ge.ln=function(){return Cd(this)};Ge.negated=Ge.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Ge.plus=Ge.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?oL(t,e):cL(t,(e.s=-e.s,e))};Ge.precision=Ge.sd=function(e){var t,n,r,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(jo+e);if(t=Dn(a)+1,r=a.d.length-1,n=r*pn+1,r=a.d[r],r){for(;r%10==0;r/=10)n--;for(r=a.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Ge.squareRoot=Ge.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(Ca+"NaN")}for(e=Dn(c),mn=!1,a=Math.sqrt(+c),a==0||a==1/0?(t=ls(c.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=qc((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(qs(c,i,o+2)).times(.5),ls(i.d).slice(0,o)===(t=ls(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),a==o&&t=="4999"){if(tn(i,n+1,0),i.times(i).eq(c)){r=i;break}}else if(t!="9999")break;o+=4}return mn=!0,tn(r,n)};Ge.times=Ge.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%er|0,t=c/er|0;i[a]=(i[a]+t)%er|0}for(;!i[--o];)i.pop();return t?++n:i.shift(),e.d=i,e.e=n,mn?tn(e,p.precision):e};Ge.toDecimalPlaces=Ge.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(ms(e,0,Uc),t===void 0?t=r.rounding:ms(t,0,8),tn(n,e+Dn(n)+1,t))};Ge.toExponential=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=Po(r,!0):(ms(e,0,Uc),t===void 0?t=a.rounding:ms(t,0,8),r=tn(new a(r),e+1,t),n=Po(r,!0,e+1)),n};Ge.toFixed=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?Po(a):(ms(e,0,Uc),t===void 0?t=i.rounding:ms(t,0,8),r=tn(new i(a),e+Dn(a)+1,t),n=Po(r.abs(),!1,e+Dn(r)+1),a.isneg()&&!a.isZero()?"-"+n:n)};Ge.toInteger=Ge.toint=function(){var e=this,t=e.constructor;return tn(new t(e),Dn(e)+1,t.rounding)};Ge.toNumber=function(){return+this};Ge.toPower=Ge.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(Jr);if(c=new d(c),!c.s){if(e.s<1)throw Error(Ca+"Infinity");return c}if(c.eq(Jr))return c;if(r=d.precision,e.eq(Jr))return tn(c,r);if(t=e.e,n=e.d.length-1,o=t>=n,i=c.s,o){if((n=h<0?-h:h)<=iL){for(a=new d(Jr),t=Math.ceil(r/pn+4),mn=!1;n%2&&(a=a.times(c),U2(a.d,t)),n=qc(n/2),n!==0;)c=c.times(c),U2(c.d,t);return mn=!0,e.s<0?new d(Jr).div(a):tn(a,r)}}else if(i<0)throw Error(Ca+"NaN");return i=i<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,mn=!1,a=e.times(Cd(c,r+f)),mn=!0,a=lL(a),a.s=i,a};Ge.toPrecision=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?(n=Dn(a),r=Po(a,n<=i.toExpNeg||n>=i.toExpPos)):(ms(e,1,Uc),t===void 0?t=i.rounding:ms(t,0,8),a=tn(new i(a),e,t),n=Dn(a),r=Po(a,e<=n||n<=i.toExpNeg,e)),r};Ge.toSignificantDigits=Ge.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(ms(e,1,Uc),t===void 0?t=r.rounding:ms(t,0,8)),tn(new r(n),e,t)};Ge.toString=Ge.valueOf=Ge.val=Ge.toJSON=Ge[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Dn(e),n=e.constructor;return Po(e,t<=n.toExpNeg||t>=n.toExpPos)};function oL(e,t){var n,r,a,i,o,c,d,f,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s||(t=new h(e)),mn?tn(t,p):t;if(d=e.d,f=t.d,o=e.e,a=t.e,d=d.slice(),i=o-a,i){for(i<0?(r=d,i=-i,c=f.length):(r=f,a=o,c=d.length),o=Math.ceil(p/pn),c=o>c?o+1:c+1,i>c&&(i=c,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(c=d.length,i=f.length,c-i<0&&(i=c,r=f,f=d,d=r),n=0;i;)n=(d[--i]=d[i]+f[i]+n)/er|0,d[i]%=er;for(n&&(d.unshift(n),++a),c=d.length;d[--c]==0;)d.pop();return t.d=d,t.e=a,mn?tn(t,p):t}function ms(e,t,n){if(e!==~~e||e<t||e>n)throw Error(jo+e)}function ls(e){var t,n,r,a=e.length-1,i="",o=e[0];if(a>0){for(i+=o,t=1;t<a;t++)r=e[t]+"",n=pn-r.length,n&&(i+=Ai(n)),i+=r;o=e[t],r=o+"",n=pn-r.length,n&&(i+=Ai(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var qs=(function(){function e(r,a){var i,o=0,c=r.length;for(r=r.slice();c--;)i=r[c]*a+o,r[c]=i%er|0,o=i/er|0;return o&&r.unshift(o),r}function t(r,a,i,o){var c,d;if(i!=o)d=i>o?1:-1;else for(c=d=0;c<i;c++)if(r[c]!=a[c]){d=r[c]>a[c]?1:-1;break}return d}function n(r,a,i){for(var o=0;i--;)r[i]-=o,o=r[i]<a[i]?1:0,r[i]=o*er+r[i]-a[i];for(;!r[0]&&r.length>1;)r.shift()}return function(r,a,i,o){var c,d,f,h,p,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,L=a.d;if(!r.s)return new M(r);if(!a.s)throw Error(Ca+"Division by zero");for(d=r.e-a.e,k=L.length,A=B.length,g=new M(z),j=g.d=[],f=0;L[f]==(B[f]||0);)++f;if(L[f]>(B[f]||0)&&--d,i==null?N=i=M.precision:o?N=i+(Dn(r)-Dn(a))+1:N=i,N<0)return new M(0);if(N=N/pn+2|0,f=0,k==1)for(h=0,L=L[0],N++;(f<A||h)&&N--;f++)_=h*er+(B[f]||0),j[f]=_/L|0,h=_%L|0;else{for(h=er/(L[0]+1)|0,h>1&&(L=e(L,h),B=e(B,h),k=L.length,A=B.length),P=k,b=B.slice(0,k),x=b.length;x<k;)b[x++]=0;R=L.slice(),R.unshift(0),O=L[0],L[1]>=er/2&&++O;do h=0,c=t(L,b,k,x),c<0?(S=b[0],k!=x&&(S=S*er+(b[1]||0)),h=S/O|0,h>1?(h>=er&&(h=er-1),p=e(L,h),y=p.length,x=b.length,c=t(p,b,y,x),c==1&&(h--,n(p,k<y?R:L,y))):(h==0&&(c=h=1),p=L.slice()),y=p.length,y<x&&p.unshift(0),n(b,p,x),c==-1&&(x=b.length,c=t(L,b,k,x),c<1&&(h++,n(b,k<x?R:L,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,tn(g,o?i+Dn(g)+1:i)}})();function lL(e,t){var n,r,a,i,o,c,d=0,f=0,h=e.constructor,p=h.precision;if(Dn(e)>16)throw Error(qN+Dn(e));if(!e.s)return new h(Jr);for(mn=!1,c=p,o=new h(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(r=Math.log(ho(2,f))/Math.LN10*2+5|0,c+=r,n=a=i=new h(Jr),h.precision=c;;){if(a=tn(a.times(e),c),n=n.times(++d),o=i.plus(qs(a,n,c)),ls(o.d).slice(0,c)===ls(i.d).slice(0,c)){for(;f--;)i=tn(i.times(i),c);return h.precision=p,t==null?(mn=!0,tn(i,p)):i}i=o}}function Dn(e){for(var t=e.e*pn,n=e.d[0];n>=10;n/=10)t++;return t}function Ow(e,t,n){if(t>e.LN10.sd())throw mn=!0,n&&(e.precision=n),Error(Ca+"LN10 precision limit exceeded");return tn(new e(e.LN10),t)}function Ai(e){for(var t="";e--;)t+="0";return t}function Cd(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(Ca+(g.s?"NaN":"-Infinity"));if(g.eq(Jr))return new b(0);if(t==null?(mn=!1,f=x):f=t,g.eq(10))return t==null&&(mn=!0),Ow(b,f);if(f+=y,b.precision=f,n=ls(j),r=n.charAt(0),i=Dn(g),Math.abs(i)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=ls(g.d),r=n.charAt(0),p++;i=Dn(g),r>1?(g=new b("0."+n),i++):g=new b(r+"."+n.slice(1))}else return d=Ow(b,f+2,x).times(i+""),g=Cd(new b(r+"."+n.slice(1)),f-y).plus(d),b.precision=x,t==null?(mn=!0,tn(g,x)):g;for(c=o=g=qs(g.minus(Jr),g.plus(Jr),f),h=tn(g.times(g),f),a=3;;){if(o=tn(o.times(h),f),d=c.plus(qs(o,new b(a),f)),ls(d.d).slice(0,f)===ls(c.d).slice(0,f))return c=c.times(2),i!==0&&(c=c.plus(Ow(b,f+2,x).times(i+""))),c=qs(c,new b(p),f),b.precision=x,t==null?(mn=!0,tn(c,x)):c;c=d,a+=2}}function z2(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=qc(n/pn),e.d=[],r=(n+1)%pn,n<0&&(r+=pn),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=pn;r<a;)e.d.push(+t.slice(r,r+=pn));t=t.slice(r),r=pn-t.length}else r-=a;for(;r--;)t+="0";if(e.d.push(+t),mn&&(e.e>Uh||e.e<-Uh))throw Error(qN+n)}else e.s=0,e.e=0,e.d=[0];return e}function tn(e,t,n){var r,a,i,o,c,d,f,h,p=e.d;for(o=1,i=p[0];i>=10;i/=10)o++;if(r=t-o,r<0)r+=pn,a=t,f=p[h=0];else{if(h=Math.ceil((r+1)/pn),i=p.length,h>=i)return e;for(f=i=p[h],o=1;i>=10;i/=10)o++;r%=pn,a=r-pn+o}if(n!==void 0&&(i=ho(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/ho(10,o-a):0:p[h-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return d?(i=Dn(e),p.length=1,t=t-i-1,p[0]=ho(10,(pn-t%pn)%pn),e.e=qc(-t/pn)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(r==0?(p.length=h,i=1,h--):(p.length=h+1,i=ho(10,pn-r),p[h]=a>0?(f/ho(10,o-a)%ho(10,a)|0)*i:0),d)for(;;)if(h==0){(p[0]+=i)==er&&(p[0]=1,++e.e);break}else{if(p[h]+=i,p[h]!=er)break;p[h--]=0,i=1}for(r=p.length;p[--r]===0;)p.pop();if(mn&&(e.e>Uh||e.e<-Uh))throw Error(qN+Dn(e));return e}function cL(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),mn?tn(t,g):t;if(d=e.d,p=t.d,r=t.e,f=e.e,d=d.slice(),o=f-r,o){for(h=o<0,h?(n=d,o=-o,c=p.length):(n=p,r=f,c=d.length),a=Math.max(Math.ceil(g/pn),c)+2,o>a&&(o=a,n.length=1),n.reverse(),a=o;a--;)n.push(0);n.reverse()}else{for(a=d.length,c=p.length,h=a<c,h&&(c=a),a=0;a<c;a++)if(d[a]!=p[a]){h=d[a]<p[a];break}o=0}for(h&&(n=d,d=p,p=n,t.s=-t.s),c=d.length,a=p.length-c;a>0;--a)d[c++]=0;for(a=p.length;a>o;){if(d[--a]<p[a]){for(i=a;i&&d[--i]===0;)d[i]=er-1;--d[i],d[a]+=er}d[a]-=p[a]}for(;d[--c]===0;)d.pop();for(;d[0]===0;d.shift())--r;return d[0]?(t.d=d,t.e=r,mn?tn(t,g):t):new y(0)}function Po(e,t,n){var r,a=Dn(e),i=ls(e.d),o=i.length;return t?(n&&(r=n-o)>0?i=i.charAt(0)+"."+i.slice(1)+Ai(r):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+Ai(-a-1)+i,n&&(r=n-o)>0&&(i+=Ai(r))):a>=o?(i+=Ai(a+1-o),n&&(r=n-a-1)>0&&(i=i+"."+Ai(r))):((r=a+1)<o&&(i=i.slice(0,r)+"."+i.slice(r)),n&&(r=n-o)>0&&(a+1===o&&(i+="."),i+=Ai(r))),e.s<0?"-"+i:i}function U2(e,t){if(e.length>t)return e.length=t,!0}function uL(e){var t,n,r;function a(i){var o=this;if(!(o instanceof a))return new a(i);if(o.constructor=a,i instanceof a){o.s=i.s,o.e=i.e,o.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(jo+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 z2(o,i.toString())}else if(typeof i!="string")throw Error(jo+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,Pne.test(i))z2(o,i);else throw Error(jo+i)}if(a.prototype=Ge,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=uL,a.config=a.set=One,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 One(e){if(!e||typeof e!="object")throw Error(Ca+"Object expected");var t,n,r,a=["precision",1,Uc,"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(qc(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(jo+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(jo+n+": "+r);return this}var WN=uL(Ene);Jr=new WN(1);const Gt=WN;function kne(e){return Mne(e)||Ine(e)||Tne(e)||Rne()}function Rne(){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 Tne(e,t){if(e){if(typeof e=="string")return pj(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 pj(e,t)}}function Ine(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Mne(e){if(Array.isArray(e))return pj(e)}function pj(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 $ne=function(t){return t},dL={},fL=function(t){return t===dL},q2=function(t){return function n(){return arguments.length===0||arguments.length===1&&fL(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},Dne=function e(t,n){return t===1?n:q2(function(){for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];var o=a.filter(function(c){return c!==dL}).length;return o>=t?n.apply(void 0,a):e(t-o,q2(function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];var h=a.map(function(p){return fL(p)?d.shift():p});return n.apply(void 0,kne(h).concat(d))}))})},Nv=function(t){return Dne(t.length,t)},hj=function(t,n){for(var r=[],a=t;a<n;++a)r[a-t]=a;return r},Lne=Nv(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),Fne=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return $ne;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))}},mj=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},pL=function(t){var n=null,r=null;return function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return n&&i.every(function(c,d){return c===n[d]})||(n=i,r=t.apply(void 0,i)),r}};function Bne(e){var t;return e===0?t=1:t=Math.floor(new Gt(e).abs().log(10).toNumber())+1,t}function zne(e,t,n){for(var r=new Gt(e),a=0,i=[];r.lt(t)&&a<1e5;)i.push(r.toNumber()),r=r.add(n),a++;return i}var Une=Nv(function(e,t,n){var r=+e,a=+t;return r+n*(a-r)}),qne=Nv(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),Wne=Nv(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const Cv={rangeStep:zne,getDigitCount:Bne,interpolateNumber:Une,uninterpolateNumber:qne,uninterpolateTruncation:Wne};function vj(e){return Kne(e)||Hne(e)||hL(e)||Vne()}function Vne(){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 Hne(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Kne(e){if(Array.isArray(e))return gj(e)}function _d(e,t){return Xne(e)||Yne(e,t)||hL(e,t)||Gne()}function Gne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
70
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hL(e,t){if(e){if(typeof e=="string")return gj(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 gj(e,t)}}function gj(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 Yne(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 Xne(e){if(Array.isArray(e))return e}function mL(e){var t=_d(e,2),n=t[0],r=t[1],a=n,i=r;return n>r&&(a=r,i=n),[a,i]}function vL(e,t,n){if(e.lte(0))return new Gt(0);var r=Cv.getDigitCount(e.toNumber()),a=new Gt(10).pow(r),i=e.div(a),o=r!==1?.05:.1,c=new Gt(Math.ceil(i.div(o).toNumber())).add(n).mul(o),d=c.mul(a);return t?d:new Gt(Math.ceil(d))}function Qne(e,t,n){var r=1,a=new Gt(e);if(!a.isint()&&n){var i=Math.abs(e);i<1?(r=new Gt(10).pow(Cv.getDigitCount(e)-1),a=new Gt(Math.floor(a.div(r).toNumber())).mul(r)):i>1&&(a=new Gt(Math.floor(e)))}else e===0?a=new Gt(Math.floor((t-1)/2)):n||(a=new Gt(Math.floor(e)));var o=Math.floor((t-1)/2),c=Fne(Lne(function(d){return a.add(new Gt(d-o).mul(r)).toNumber()}),hj);return c(0,t)}function gL(e,t,n,r){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new Gt(0),tickMin:new Gt(0),tickMax:new Gt(0)};var i=vL(new Gt(t).sub(e).div(n-1),r,a),o;e<=0&&t>=0?o=new Gt(0):(o=new Gt(e).add(t).div(2),o=o.sub(new Gt(o).mod(i)));var c=Math.ceil(o.sub(e).div(i).toNumber()),d=Math.ceil(new Gt(t).sub(o).div(i).toNumber()),f=c+d+1;return f>n?gL(e,t,n,r,a+1):(f<n&&(d=t>0?d+(n-f):d,c=t>0?c:c+(n-f)),{step:i,tickMin:o.sub(new Gt(c).mul(i)),tickMax:o.add(new Gt(d).mul(i))})}function Jne(e){var t=_d(e,2),n=t[0],r=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(a,2),c=mL([n,r]),d=_d(c,2),f=d[0],h=d[1];if(f===-1/0||h===1/0){var p=h===1/0?[f].concat(vj(hj(0,a-1).map(function(){return 1/0}))):[].concat(vj(hj(0,a-1).map(function(){return-1/0})),[h]);return n>r?mj(p):p}if(f===h)return Qne(f,a,i);var y=gL(f,h,o,i),g=y.step,j=y.tickMin,b=y.tickMax,x=Cv.rangeStep(j,b.add(new Gt(.1).mul(g)),g);return n>r?mj(x):x}function Zne(e,t){var n=_d(e,2),r=n[0],a=n[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=mL([r,a]),c=_d(o,2),d=c[0],f=c[1];if(d===-1/0||f===1/0)return[r,a];if(d===f)return[d];var h=Math.max(t,2),p=vL(new Gt(f).sub(d).div(h-1),i,0),y=[].concat(vj(Cv.rangeStep(new Gt(d),new Gt(f).sub(new Gt(.99).mul(p)),p)),[f]);return r>a?mj(y):y}var ere=pL(Jne),tre=pL(Zne),nre="Invariant failed";function Oo(e,t){throw new Error(nre)}var rre=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function oc(e){"@babel/helpers - typeof";return oc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oc(e)}function 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 are(e,t){return lre(e)||ore(e,t)||ire(e,t)||sre()}function sre(){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 ire(e,t){if(e){if(typeof e=="string")return W2(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 W2(e,t)}}function W2(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 ore(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 lre(e){if(Array.isArray(e))return e}function cre(e,t){if(e==null)return{};var n=ure(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 ure(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 dre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fre(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 pre(e,t,n){return t&&fre(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function hre(e,t,n){return t=Wh(t),mre(e,yL()?Reflect.construct(t,n||[],Wh(e).constructor):t.apply(e,n))}function mre(e,t){if(t&&(oc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vre(e)}function vre(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yL=function(){return!!e})()}function Wh(e){return Wh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Wh(e)}function gre(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yj(e,t)}function yj(e,t){return yj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},yj(e,t)}function xL(e,t,n){return t=bL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bL(e){var t=yre(e,"string");return oc(t)=="symbol"?t:t+""}function yre(e,t){if(oc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(oc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var yf=(function(e){function t(){return dre(this,t),hre(this,t,arguments)}return gre(t,e),pre(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=cre(r,rre),g=vt(y,!1);this.props.direction==="x"&&h.type!=="number"&&Oo();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=are(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,L=z-o,G=M(_-O),U=M(_+k);A.push({x1:U,y1:B,x2:U,y2:L}),A.push({x1:G,y1:z,x2:U,y2:z}),A.push({x1:G,y1:B,x2:G,y2:L})}else if(i==="horizontal"){var H=p.scale,Q=S+a,J=Q-o,T=Q+o,D=H(_-O),X=H(_+k);A.push({x1:J,y1:X,x2:T,y2:X}),A.push({x1:Q,y1:D,x2:Q,y2:X}),A.push({x1:J,y1:D,x2:T,y2:D})}return q.createElement(Dt,qh({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",qh({},F,{key:"line-".concat(F.x1,"-").concat(F.x2,"-").concat(F.y1,"-").concat(F.y2)}))}))});return q.createElement(Dt,{className:"recharts-errorBars"},j)}}])})(q.Component);xL(yf,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});xL(yf,"displayName","ErrorBar");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 V2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function lo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?V2(Object(n),!0).forEach(function(r){xre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xre(e,t,n){return t=bre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bre(e){var t=wre(e,"string");return Ad(t)=="symbol"?t:t+""}function wre(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 wL=function(t){var n=t.children,r=t.formattedGraphicalItems,a=t.legendWidth,i=t.legendContent,o=Gr(n,Ul);if(!o)return null;var c=Ul.defaultProps,d=c!==void 0?lo(lo({},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?lo(lo({},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:VN(p),value:b||j,payload:g}}),lo(lo(lo({},d),Ul.getWithHeight(o,a)),{},{payload:f,item:o})};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 H2(e){return Cre(e)||Nre(e)||Sre(e)||jre()}function jre(){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 Sre(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 Nre(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Cre(e){if(Array.isArray(e))return xj(e)}function xj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function K2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Pn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?K2(Object(n),!0).forEach(function(r){Wl(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wl(e,t,n){return t=_re(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _re(e){var t=Are(e,"string");return Ed(t)=="symbol"?t:t+""}function Are(e,t){if(Ed(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ed(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qn(e,t,n){return jt(e)||jt(t)?n:Wn(t)?ra(e,t,n):wt(t)?t(e):n}function ed(e,t,n,r){var a=Cne(e,function(c){return qn(c,t)});if(n==="number"){var i=a.filter(function(c){return Fe(c)||parseFloat(c)});return i.length?[Sv(i),jv(i)]:[1/0,-1/0]}var o=r?a.filter(function(c){return!jt(c)}):a;return o.map(function(c){return Wn(c)||c instanceof Date?c:""})}var Ere=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,c=(n=r?.length)!==null&&n!==void 0?n:0;if(c<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var d=i.range,f=0;f<c;f++){var h=f>0?a[f-1].coordinate:a[c-1].coordinate,p=a[f].coordinate,y=f>=c-1?a[0].coordinate:a[f+1].coordinate,g=void 0;if(jr(p-h)!==jr(y-p)){var j=[];if(jr(y-p)===jr(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},VN=function(t){var n,r=t,a=r.type.displayName,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Pn(Pn({},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},Pre=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 zs(k.type).indexOf("Bar")>=0});if(S&&S.length){var N=S[0].type.defaultProps,_=N!==void 0?Pn(Pn({},N),S[0].props):S[0].props,P=_.barSize,A=_[x];o[A]||(o[A]=[]);var O=jt(P)?n:P;o[A].push({item:S[0],stackList:S.slice(1),barSize:jt(O)?void 0:Sr(O,r,0)})}}return o},Ore=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=Sr(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(H2(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=Sr(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(H2(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},kre=function(t,n,r,a){var i=r.children,o=r.width,c=r.margin,d=o-(c.left||0)-(c.right||0),f=wL({children:i,legendWidth:d});if(f){var h=a||{},p=h.width,y=h.height,g=f.align,j=f.verticalAlign,b=f.layout;if((b==="vertical"||b==="horizontal"&&j==="middle")&&g!=="center"&&Fe(t[g]))return Pn(Pn({},t),{},Wl({},g,t[g]+(p||0)));if((b==="horizontal"||b==="vertical"&&g==="center")&&j!=="middle"&&Fe(t[j]))return Pn(Pn({},t),{},Wl({},j,t[j]+(y||0)))}return t},Rre=function(t,n,r){return jt(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},jL=function(t,n,r,a,i){var o=n.props.children,c=aa(o,yf).filter(function(f){return Rre(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(jt(p))return f;var y=Array.isArray(p)?[Sv(p),jv(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},Tre=function(t,n,r,a,i){var o=n.map(function(c){return jL(t,c,r,i,a)}).filter(function(c){return!jt(c)});return o&&o.length?o.reduce(function(c,d){return[Math.min(c[0],d[0]),Math.max(c[1],d[1])]},[1/0,-1/0]):null},SL=function(t,n,r,a,i){var o=n.map(function(d){var f=d.props.dataKey;return r==="number"&&f&&jL(t,d,f,a)||ed(t,f,r,i)});if(r==="number")return o.reduce(function(d,f){return[Math.min(d[0],f[0]),Math.max(d[1],f[1])]},[1/0,-1/0]);var c={};return o.reduce(function(d,f){for(var h=0,p=f.length;h<p;h++)c[f[h]]||(c[f[h]]=!0,d.push(f[h]));return d},[])},NL=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},xo=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?jr(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!df(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}})},kw=new WeakMap,Kp=function(t,n){if(typeof n!="function")return t;kw.has(t)||kw.set(t,new WeakMap);var r=kw.get(t);if(r.has(n))return r.get(n);var a=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,a),a},CL=function(t,n,r){var a=t.scale,i=t.type,o=t.layout,c=t.axisType;if(a==="auto")return o==="radial"&&c==="radiusAxis"?{scale:bd(),realScaleType:"band"}:o==="radial"&&c==="angleAxis"?{scale:Lh(),realScaleType:"linear"}:i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:Zu(),realScaleType:"point"}:i==="category"?{scale:bd(),realScaleType:"band"}:{scale:Lh(),realScaleType:"linear"};if(_o(a)){var d="scale".concat(ov(a));return{scale:(R2[d]||Zu)(),realScaleType:R2[d]?d:"point"}}return wt(a)?{scale:a}:{scale:Zu(),realScaleType:"point"}},G2=1e-4,_L=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])-G2,o=Math.max(a[0],a[1])+G2,c=t(n[0]),d=t(n[r-1]);(c<i||c>o||d<i||d>o)&&t.domain([n[0],n[r-1]])}},Ire=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},Mre=function(t,n){if(!n||n.length!==2||!Fe(n[0])||!Fe(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(!Fe(t[0])||t[0]<r)&&(i[0]=r),(!Fe(t[1])||t[1]>a)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]<r&&(i[1]=r),i},$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,c=0;c<n;++c){var d=df(t[c][r][1])?t[c][r][0]:t[c][r][1];d>=0?(t[c][r][0]=i,t[c][r][1]=i+d,i=t[c][r][1]):(t[c][r][0]=o,t[c][r][1]=o+d,o=t[c][r][1])}},Dre=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r<a;++r)for(var i=0,o=0;o<n;++o){var c=df(t[o][r][1])?t[o][r][0]:t[o][r][1];c>=0?(t[o][r][0]=i,t[o][r][1]=i+c,i=t[o][r][1]):(t[o][r][0]=0,t[o][r][1]=0)}},Lre={sign:$re,expand:CX,none:Zl,silhouette:_X,wiggle:AX,positive:Dre},Fre=function(t,n,r){var a=n.map(function(c){return c.props.dataKey}),i=Lre[r],o=NX().keys(a).value(function(c,d){return+qn(c,d,0)}).order(G1).offset(i);return o(t)},Bre=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?Pn(Pn({},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[Fc("_stackId_")]={numericAxisId:r,cateAxisId:a,items:[y]};return Pn(Pn({},p),{},Wl({},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 Pn(Pn({},b),{},Wl({},x,{numericAxisId:r,cateAxisId:a,items:S.items,stackedData:Fre(t,S.items,i)}))},j)}return Pn(Pn({},p),{},Wl({},y,g))},h)},AL=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=ere(f,i,c);return t.domain([Sv(h),jv(h)]),{niceTicks:h}}if(i&&a==="number"){var p=t.domain(),y=tre(p,i,c);return{niceTicks:y}}return null};function Y2(e){var t=e.axis,n=e.ticks,r=e.bandSize,a=e.entry,i=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!jt(a[t.dataKey])){var c=xh(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,jt(o)?t.dataKey:o);return jt(d)?null:t.scale(d)}var X2=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 jt(d)?null:n.scale(d)-i/2+a},zre=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]},Ure=function(t,n){var r,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Pn(Pn({},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},qre=function(t){return t.reduce(function(n,r){return[Sv(r.concat([n[0]]).filter(Fe)),jv(r.concat([n[1]]).filter(Fe))]},[1/0,-1/0])},EL=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=qre(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})},Q2=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,J2=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,bj=function(t,n,r){if(wt(t))return t(n,r);if(!Array.isArray(t))return n;var a=[];if(Fe(t[0]))a[0]=r?t[0]:Math.min(t[0],n[0]);else if(Q2.test(t[0])){var i=+Q2.exec(t[0])[1];a[0]=n[0]-i}else wt(t[0])?a[0]=t[0](n[0]):a[0]=n[0];if(Fe(t[1]))a[1]=r?t[1]:Math.max(t[1],n[1]);else if(J2.test(t[1])){var o=+J2.exec(t[1])[1];a[1]=n[1]+o}else wt(t[1])?a[1]=t[1](n[1]):a[1]=n[1];return a},Vh=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=xN(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},Z2=function(t,n,r){return!t||!t.length||gf(t,ra(r,"type.defaultProps.domain"))?n:t},PL=function(t,n){var r=t.type.defaultProps?Pn(Pn({},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 Pn(Pn({},vt(t,!1)),{},{dataKey:a,unit:o,formatter:c,name:i||a,color:VN(t),value:qn(n,a),type:d,payload:n,chartType:f,hide:h})};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 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 Is(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){OL(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 OL(e,t,n){return t=Wre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wre(e){var t=Vre(e,"string");return Pd(t)=="symbol"?t:t+""}function Vre(e,t){if(Pd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Pd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Hre(e,t){return Xre(e)||Yre(e,t)||Gre(e,t)||Kre()}function Kre(){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 Gre(e,t){if(e){if(typeof e=="string")return tT(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 tT(e,t)}}function tT(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 Yre(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 Xre(e){if(Array.isArray(e))return e}var Hh=Math.PI/180,Qre=function(t){return t*180/Math.PI},cn=function(t,n,r,a){return{x:t+Math.cos(-Hh*a)*r,y:n+Math.sin(-Hh*a)*r}},kL=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},Jre=function(t,n,r,a,i){var o=t.width,c=t.height,d=t.startAngle,f=t.endAngle,h=Sr(t.cx,o,o/2),p=Sr(t.cy,c,c/2),y=kL(o,c,r),g=Sr(t.innerRadius,y,0),j=Sr(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(jt(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=Hre(O,2);d=k[0],f=k[1]}var R=CL(N,i),M=R.realScaleType,z=R.scale;z.domain(_).range(A),_L(z);var B=AL(z,Is(Is({},N),{},{realScaleType:M})),L=Is(Is(Is({},N),B),{},{range:A,radius:j,realScaleType:M,scale:z,cx:h,cy:p,innerRadius:g,outerRadius:j,startAngle:d,endAngle:f});return Is(Is({},x),{},OL({},S,L))},{})},Zre=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))},eae=function(t,n){var r=t.x,a=t.y,i=n.cx,o=n.cy,c=Zre({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:Qre(f),angleInRadian:f}},tae=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}},nae=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},nT=function(t,n){var r=t.x,a=t.y,i=eae({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=tae(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?Is(Is({},n),{},{radius:o,angle:nae(g,n)}):null},RL=function(t){return!v.isValidElement(t)&&!wt(t)&&typeof t!="boolean"?t.className:""};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 rae=["offset"];function aae(e){return lae(e)||oae(e)||iae(e)||sae()}function sae(){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 iae(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 oae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lae(e){if(Array.isArray(e))return wj(e)}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 cae(e,t){if(e==null)return{};var n=uae(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 uae(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 rT(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?rT(Object(n),!0).forEach(function(r){dae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dae(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=pae(e,"string");return Od(t)=="symbol"?t:t+""}function pae(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 kd(){return kd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kd.apply(this,arguments)}var hae=function(t){var n=t.value,r=t.formatter,a=jt(t.children)?n:t.children;return wt(r)?r(a):a},mae=function(t,n){var r=jr(n-t),a=Math.min(Math.abs(n-t),360);return r*a},vae=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=mae(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=cn(f,h,x,_),O=cn(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=jt(t.id)?Fc("recharts-radial-line-"):t.id;return q.createElement("text",kd({},r,{dominantBaseline:"central",className:St("recharts-radial-bar-label",c)}),q.createElement("defs",null,q.createElement("path",{id:R,d:k})),q.createElement("textPath",{xlinkHref:"#".concat(R)},n))},gae=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=cn(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=cn(o,c,x,y),N=S.x,_=S.y;return{x:N,y:_,textAnchor:"middle",verticalAnchor:"middle"}},yae=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):Lc(i)&&(Fe(i.x)||vo(i.x))&&(Fe(i.y)||vo(i.y))?Un({x:c+Sr(i.x,f),y:d+Sr(i.y,h),textAnchor:"end",verticalAnchor:"end"},k):Un({x:c+f/2,y:d+h/2,textAnchor:"middle",verticalAnchor:"middle"},k)},xae=function(t){return"cx"in t&&Fe(t.cx)};function tr(e){var t=e.offset,n=t===void 0?5:t,r=cae(e,rae),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||jt(c)&&jt(d)&&!v.isValidElement(f)&&!wt(f))return null;if(v.isValidElement(f))return v.cloneElement(f,a);var g;if(wt(f)){if(g=v.createElement(f,a),v.isValidElement(g))return g}else g=hae(a);var j=xae(i),b=vt(a,!0);if(j&&(o==="insideStart"||o==="insideEnd"||o==="end"))return vae(a,g,b);var x=j?gae(a):yae(a);return q.createElement(Eo,kd({className:St("recharts-label",p)},b,x,{breakAll:y}),g)}tr.displayName="Label";var TL=function(t){var n=t.cx,r=t.cy,a=t.angle,i=t.startAngle,o=t.endAngle,c=t.r,d=t.radius,f=t.innerRadius,h=t.outerRadius,p=t.x,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(Fe(b)&&Fe(x)){if(Fe(p)&&Fe(y))return{x:p,y,width:b,height:x};if(Fe(g)&&Fe(j))return{x:g,y:j,width:b,height:x}}return Fe(p)&&Fe(y)?{x:p,y,width:0,height:0}:Fe(n)&&Fe(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:{}},bae=function(t,n){return t?t===!0?q.createElement(tr,{key:"label-implicit",viewBox:n}):Wn(t)?q.createElement(tr,{key:"label-implicit",viewBox:n,value:t}):v.isValidElement(t)?t.type===tr?v.cloneElement(t,{key:"label-implicit",viewBox:n}):q.createElement(tr,{key:"label-implicit",content:t,viewBox:n}):wt(t)?q.createElement(tr,{key:"label-implicit",content:t,viewBox:n}):Lc(t)?q.createElement(tr,kd({viewBox:n},t,{key:"label-implicit"})):null:null},wae=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var a=t.children,i=TL(t),o=aa(a,tr).map(function(d,f){return v.cloneElement(d,{viewBox:n||i,key:"label-".concat(f)})});if(!r)return o;var c=bae(t.label,n||i);return[c].concat(aae(o))};tr.parseViewBox=TL;tr.renderCallByParent=wae;var Rw,aT;function jae(){if(aT)return Rw;aT=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return Rw=e,Rw}var Sae=jae();const Nae=Ht(Sae);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 Cae=["valueAccessor"],_ae=["data","dataKey","clockWise","id","textBreakAll"];function Aae(e){return kae(e)||Oae(e)||Pae(e)||Eae()}function Eae(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
77
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pae(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 Oae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kae(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 Kh(){return Kh=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},Kh.apply(this,arguments)}function sT(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 iT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sT(Object(n),!0).forEach(function(r){Rae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rae(e,t,n){return t=Tae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tae(e){var t=Iae(e,"string");return Rd(t)=="symbol"?t:t+""}function Iae(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 oT(e,t){if(e==null)return{};var n=Mae(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 Mae(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 $ae=function(t){return Array.isArray(t.value)?Nae(t.value):t.value};function Ws(e){var t=e.valueAccessor,n=t===void 0?$ae:t,r=oT(e,Cae),a=r.data,i=r.dataKey,o=r.clockWise,c=r.id,d=r.textBreakAll,f=oT(r,_ae);return!a||!a.length?null:q.createElement(Dt,{className:"recharts-label-list"},a.map(function(h,p){var y=jt(i)?n(h,p):qn(h&&h.payload,i),g=jt(c)?{}:{id:"".concat(c,"-").concat(p)};return q.createElement(tr,Kh({},vt(h,!0),f,g,{parentViewBox:h.parentViewBox,value:y,textBreakAll:d,viewBox:tr.parseViewBox(jt(o)?h:iT(iT({},h),{},{clockWise:o})),key:"label-".concat(p),index:p}))}))}Ws.displayName="LabelList";function Dae(e,t){return e?e===!0?q.createElement(Ws,{key:"labelList-implicit",data:t}):q.isValidElement(e)||wt(e)?q.createElement(Ws,{key:"labelList-implicit",data:t,content:e}):Lc(e)?q.createElement(Ws,Kh({data:t},e,{key:"labelList-implicit"})):null:null}function Lae(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=aa(r,Ws).map(function(o,c){return v.cloneElement(o,{data:t,key:"labelList-".concat(c)})});if(!n)return a;var i=Dae(e.label,t);return[i].concat(Aae(a))}Ws.renderCallByParent=Lae;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 Sj(){return Sj=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},Sj.apply(this,arguments)}function lT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function cT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lT(Object(n),!0).forEach(function(r){Fae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fae(e,t,n){return t=Bae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bae(e){var t=zae(e,"string");return Td(t)=="symbol"?t:t+""}function zae(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 Uae=function(t,n){var r=jr(n-t),a=Math.min(Math.abs(n-t),359.999);return r*a},Gp=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)/Hh,y=f?i:i+o*p,g=cn(n,r,h,y),j=cn(n,r,a,y),b=f?i-o*p:i,x=cn(n,r,h*Math.cos(p*Hh),b);return{center:g,circleTangency:j,lineTangency:x,theta:p}},IL=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.startAngle,c=t.endAngle,d=Uae(o,c),f=o+d,h=cn(n,r,i,o),p=cn(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=cn(n,r,a,o),j=cn(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},qae=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=jr(h-f),y=Gp({cx:n,cy:r,radius:i,angle:f,sign:p,cornerRadius:o,cornerIsExternal:d}),g=y.circleTangency,j=y.lineTangency,b=y.theta,x=Gp({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
|
-
`):IL({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=Gp({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=Gp({cx:n,cy:r,radius:a,angle:h,sign:-p,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),B=z.circleTangency,L=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(L.x,",").concat(L.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},Wae={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},ML=function(t){var n=cT(cT({},Wae),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=St("recharts-sector",y),j=o-i,b=Sr(c,j,0,!0),x;return b>0&&Math.abs(h-p)<360?x=qae({cx:r,cy:a,innerRadius:i,outerRadius:o,cornerRadius:Math.min(b,j/2),forceCornerRadius:d,cornerIsExternal:f,startAngle:h,endAngle:p}):x=IL({cx:r,cy:a,innerRadius:i,outerRadius:o,startAngle:h,endAngle:p}),q.createElement("path",Sj({},vt(n,!0),{className:g,d:x,role:"img"}))};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 Nj(){return Nj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nj.apply(this,arguments)}function uT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function dT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uT(Object(n),!0).forEach(function(r){Vae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vae(e,t,n){return t=Hae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hae(e){var t=Kae(e,"string");return Id(t)=="symbol"?t:t+""}function Kae(e,t){if(Id(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Id(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var fT={curveBasisClosed:pX,curveBasisOpen:hX,curveBasis:fX,curveBumpX:JY,curveBumpY:ZY,curveLinearClosed:mX,curveLinear:cv,curveMonotoneX:vX,curveMonotoneY:gX,curveNatural:yX,curveStep:xX,curveStepAfter:wX,curveStepBefore:bX},Yp=function(t){return t.x===+t.x&&t.y===+t.y},Du=function(t){return t.x},Lu=function(t){return t.y},Gae=function(t,n){if(wt(t))return t;var r="curve".concat(ov(t));return(r==="curveMonotone"||r==="curveBump")&&n?fT["".concat(r).concat(n==="vertical"?"Y":"X")]:fT[r]||cv},Yae=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=Gae(r,c),p=f?i.filter(function(b){return Yp(b)}):i,y;if(Array.isArray(o)){var g=f?o.filter(function(b){return Yp(b)}):o,j=p.map(function(b,x){return dT(dT({},b),{},{base:g[x]})});return c==="vertical"?y=Bp().y(Lu).x1(Du).x0(function(b){return b.base.x}):y=Bp().x(Du).y1(Lu).y0(function(b){return b.base.y}),y.defined(Yp).curve(h),y(j)}return c==="vertical"&&Fe(o)?y=Bp().y(Lu).x1(Du).x0(o):Fe(o)?y=Bp().x(Du).y1(Lu).y0(o):y=M3().x(Du).y(Lu),y.defined(Yp).curve(h),y(p)},Gh=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?Yae(t):a;return v.createElement("path",Nj({},vt(t,!1),bh(t),{className:St("recharts-curve",n),d:o,ref:i}))},Tw={exports:{}},Iw,pT;function Xae(){if(pT)return Iw;pT=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Iw=e,Iw}var Mw,hT;function Qae(){if(hT)return Mw;hT=1;var e=Xae();function t(){}function n(){}return n.resetWarningCache=t,Mw=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},Mw}var mT;function Jae(){return mT||(mT=1,Tw.exports=Qae()()),Tw.exports}var Zae=Jae();const zt=Ht(Zae),{getOwnPropertyNames:ese,getOwnPropertySymbols:tse}=Object,{hasOwnProperty:nse}=Object.prototype;function $w(e,t){return function(r,a,i){return e(r,a,i)&&t(r,a,i)}}function Xp(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 rse(e){return e?.[Symbol.toStringTag]}function vT(e){return ese(e).concat(tse(e))}const ase=Object.hasOwn||((e,t)=>nse.call(e,t));function qo(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const sse="__v",ise="__o",ose="_owner",{getOwnPropertyDescriptor:gT,keys:yT}=Object;function lse(e,t){return e.byteLength===t.byteLength&&Yh(new Uint8Array(e),new Uint8Array(t))}function cse(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 use(e,t){return e.byteLength===t.byteLength&&Yh(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function dse(e,t){return qo(e.getTime(),t.getTime())}function fse(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function pse(e,t){return e===t}function xT(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const a=new Array(r),i=e.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 hse=qo;function mse(e,t,n){const r=yT(e);let a=r.length;if(yT(t).length!==a)return!1;for(;a-- >0;)if(!$L(e,t,n,r[a]))return!1;return!0}function Fu(e,t,n){const r=vT(e);let a=r.length;if(vT(t).length!==a)return!1;let i,o,c;for(;a-- >0;)if(i=r[a],!$L(e,t,n,i)||(o=gT(e,i),c=gT(t,i),(o||c)&&(!o||!c||o.configurable!==c.configurable||o.enumerable!==c.enumerable||o.writable!==c.writable)))return!1;return!0}function vse(e,t){return qo(e.valueOf(),t.valueOf())}function gse(e,t){return e.source===t.source&&e.flags===t.flags}function bT(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 Yh(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 yse(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function $L(e,t,n,r){return(r===ose||r===ise||r===sse)&&(e.$$typeof||t.$$typeof)?!0:ase(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const xse="[object ArrayBuffer]",bse="[object Arguments]",wse="[object Boolean]",jse="[object DataView]",Sse="[object Date]",Nse="[object Error]",Cse="[object Map]",_se="[object Number]",Ase="[object Object]",Ese="[object RegExp]",Pse="[object Set]",Ose="[object String]",kse={"[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},Rse="[object URL]",Tse=Object.prototype.toString;function Ise({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=Tse.call(x);if(A===Sse)return r(x,S,N);if(A===Ese)return h(x,S,N);if(A===Cse)return o(x,S,N);if(A===Pse)return p(x,S,N);if(A===Ase)return typeof x.then!="function"&&typeof S.then!="function"&&d(x,S,N);if(A===Rse)return g(x,S,N);if(A===Nse)return a(x,S,N);if(A===bse)return d(x,S,N);if(kse[A])return y(x,S,N);if(A===xse)return e(x,S,N);if(A===jse)return n(x,S,N);if(A===wse||A===_se||A===Ose)return f(x,S,N);if(j){let O=j[A];if(!O){const k=rse(x);k&&(O=j[k])}if(O)return O(x,S,N)}return!1}}function Mse({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:lse,areArraysEqual:n?Fu:cse,areDataViewsEqual:use,areDatesEqual:dse,areErrorsEqual:fse,areFunctionsEqual:pse,areMapsEqual:n?$w(xT,Fu):xT,areNumbersEqual:hse,areObjectsEqual:n?Fu:mse,arePrimitiveWrappersEqual:vse,areRegExpsEqual:gse,areSetsEqual:n?$w(bT,Fu):bT,areTypedArraysEqual:n?$w(Yh,Fu):Yh,areUrlsEqual:yse,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const a=Xp(r.areArraysEqual),i=Xp(r.areMapsEqual),o=Xp(r.areObjectsEqual),c=Xp(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:c})}return r}function $se(e){return function(t,n,r,a,i,o,c){return e(t,n,c)}}function Dse({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 Lse=Vi();Vi({strict:!0});Vi({circular:!0});Vi({circular:!0,strict:!0});Vi({createInternalComparator:()=>qo});Vi({strict:!0,createInternalComparator:()=>qo});Vi({circular:!0,createInternalComparator:()=>qo});Vi({circular:!0,createInternalComparator:()=>qo,strict:!0});function Vi(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:a=!1}=e,i=Mse(e),o=Ise(i),c=n?n(o):$se(o);return Dse({circular:t,comparator:o,createState:r,equals:c,strict:a})}function Fse(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function wT(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):Fse(a)};requestAnimationFrame(r)}function Cj(e){"@babel/helpers - typeof";return Cj=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},Cj(e)}function Bse(e){return Wse(e)||qse(e)||Use(e)||zse()}function zse(){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 Use(e,t){if(e){if(typeof e=="string")return jT(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 jT(e,t)}}function jT(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 qse(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Wse(e){if(Array.isArray(e))return e}function Vse(){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=Bse(o),d=c[0],f=c.slice(1);if(typeof d=="number"){wT(a.bind(null,f),d);return}a(d),wT(a.bind(null,f));return}Cj(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 Md(e){"@babel/helpers - typeof";return Md=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Md(e)}function ST(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?ST(Object(n),!0).forEach(function(r){DL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ST(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function DL(e,t,n){return t=Hse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hse(e){var t=Kse(e,"string");return Md(t)==="symbol"?t:String(t)}function Kse(e,t){if(Md(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Md(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Gse=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,a){return r.filter(function(i){return a.includes(i)})})},Yse=function(t){return t},Xse=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},td=function(t,n){return Object.keys(n).reduce(function(r,a){return NT(NT({},r),{},DL({},a,t(a,n[a])))},{})},CT=function(t,n,r){return t.map(function(a){return"".concat(Xse(a)," ").concat(n,"ms ").concat(r)}).join(",")};function Qse(e,t){return eie(e)||Zse(e,t)||LL(e,t)||Jse()}function Jse(){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 Zse(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 eie(e){if(Array.isArray(e))return e}function tie(e){return aie(e)||rie(e)||LL(e)||nie()}function nie(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
97
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LL(e,t){if(e){if(typeof e=="string")return _j(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 _j(e,t)}}function rie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function aie(e){if(Array.isArray(e))return _j(e)}function _j(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 Xh=1e-4,FL=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},BL=function(t,n){return t.map(function(r,a){return r*Math.pow(n,a)}).reduce(function(r,a){return r+a})},_T=function(t,n){return function(r){var a=FL(t,n);return BL(a,r)}},sie=function(t,n){return function(r){var a=FL(t,n),i=[].concat(tie(a.map(function(o,c){return o*c}).slice(1)),[0]);return BL(i,r)}},AT=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0],i=n[1],o=n[2],c=n[3];if(n.length===1)switch(n[0]){case"linear":a=0,i=0,o=1,c=1;break;case"ease":a=.25,i=.1,o=.25,c=1;break;case"ease-in":a=.42,i=0,o=1,c=1;break;case"ease-out":a=.42,i=0,o=.58,c=1;break;case"ease-in-out":a=0,i=0,o=.58,c=1;break;default:{var d=n[0].split("(");if(d[0]==="cubic-bezier"&&d[1].split(")")[0].split(",").length===4){var f=d[1].split(")")[0].split(",").map(function(x){return parseFloat(x)}),h=Qse(f,4);a=h[0],i=h[1],o=h[2],c=h[3]}}}var p=_T(a,o),y=_T(i,c),g=sie(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)<Xh||O<Xh)return y(_);_=j(_-A/O)}return y(_)};return b.isStepper=!1,b},iie=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)<Xh&&Math.abs(b)<Xh?[p,0]:[x,b]};return d.isStepper=!0,d.dt=c,d},oie=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0];if(typeof a=="string")switch(a){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return AT(a);case"spring":return iie();default:if(a.split("(")[0]==="cubic-bezier")return AT(a)}return typeof a=="function"?a:null};function $d(e){"@babel/helpers - typeof";return $d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$d(e)}function ET(e){return uie(e)||cie(e)||zL(e)||lie()}function lie(){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 cie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function uie(e){if(Array.isArray(e))return Ej(e)}function PT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function sr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PT(Object(n),!0).forEach(function(r){Aj(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Aj(e,t,n){return t=die(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function die(e){var t=fie(e,"string");return $d(t)==="symbol"?t:String(t)}function fie(e,t){if($d(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if($d(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pie(e,t){return vie(e)||mie(e,t)||zL(e,t)||hie()}function hie(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
99
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zL(e,t){if(e){if(typeof e=="string")return Ej(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ej(e,t)}}function Ej(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function 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 vie(e){if(Array.isArray(e))return e}var Qh=function(t,n,r){return t+(n-t)*r},Pj=function(t){var n=t.from,r=t.to;return n!==r},gie=function e(t,n,r){var a=td(function(i,o){if(Pj(o)){var c=t(o.from,o.to,o.velocity),d=pie(c,2),f=d[0],h=d[1];return sr(sr({},o),{},{from:f,velocity:h})}return o},n);return r<1?td(function(i,o){return Pj(o)?sr(sr({},o),{},{velocity:Qh(o.velocity,a[i].velocity,r),from:Qh(o.from,a[i].from,r)}):o},n):e(t,a,r-1)};const yie=(function(e,t,n,r,a){var i=Gse(e,t),o=i.reduce(function(x,S){return sr(sr({},x),{},Aj({},S,[e[S],t[S]]))},{}),c=i.reduce(function(x,S){return sr(sr({},x),{},Aj({},S,{from:e[S],velocity:0,to:t[S]}))},{}),d=-1,f,h,p=function(){return null},y=function(){return td(function(S,N){return N.from},c)},g=function(){return!Object.values(c).filter(Pj).length},j=function(S){f||(f=S);var N=S-f,_=N/n.dt;c=gie(n,c,_),a(sr(sr(sr({},e),t),y())),f=S,g()||(d=requestAnimationFrame(p))},b=function(S){h||(h=S);var N=(S-h)/r,_=td(function(A,O){return Qh.apply(void 0,ET(O).concat([n(N)]))},o);if(a(sr(sr(sr({},e),t),_)),N<1)d=requestAnimationFrame(p);else{var P=td(function(A,O){return Qh.apply(void 0,ET(O).concat([n(1)]))},o);a(sr(sr(sr({},e),t),P))}};return p=n.isStepper?j:b,function(){return requestAnimationFrame(p),function(){cancelAnimationFrame(d)}}});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)}var xie=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function bie(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={},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 Dw(e){return Cie(e)||Nie(e)||Sie(e)||jie()}function jie(){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 Sie(e,t){if(e){if(typeof e=="string")return Oj(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 Oj(e,t)}}function Nie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Cie(e){if(Array.isArray(e))return Oj(e)}function Oj(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 OT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function $a(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OT(Object(n),!0).forEach(function(r){Ku(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ku(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 _ie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Aie(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,UL(r.key),r)}}function Eie(e,t,n){return t&&Aie(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function UL(e){var t=Pie(e,"string");return lc(t)==="symbol"?t:String(t)}function Pie(e,t){if(lc(e)!=="object"||e===null)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(t==="string"?String:Number)(e)}function Oie(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 kie(e){var t=Rie();return function(){var r=Jh(e),a;if(t){var i=Jh(this).constructor;a=Reflect.construct(r,arguments,i)}else a=r.apply(this,arguments);return Rj(this,a)}}function Rj(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 Tj(e)}function Tj(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rie(){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 Jh(e){return Jh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Jh(e)}var vs=(function(e){Oie(n,e);var t=kie(n);function n(r,a){var i;_ie(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(Tj(i)),i.changeStyle=i.changeStyle.bind(Tj(i)),!c||g<=0)return i.state={style:{}},typeof y=="function"&&(i.state={style:h}),Rj(i);if(p&&p.length)i.state={style:p[0].style};else if(f){if(typeof y=="function")return i.state={style:f},Rj(i);i.state={style:d?Ku({},d,f):f}}else i.state={style:{}};return i}return Eie(n,[{key:"componentDidMount",value:function(){var a=this.props,i=a.isActive,o=a.canBegin;this.mounted=!0,!(!i||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var i=this.props,o=i.isActive,c=i.canBegin,d=i.attributeName,f=i.shouldReAnimate,h=i.to,p=i.from,y=this.state.style;if(c){if(!o){var g={style:d?Ku({},d,h):h};this.state&&y&&(d&&y[d]!==h||!d&&y!==h)&&this.setState(g);return}if(!(Lse(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?Ku({},d,b):b};(d&&y[d]!==b||!d&&y!==b)&&this.setState(x)}this.runAnimation($a($a({},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=yie(o,c,oie(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(Dw(b),[i.runJSAnimation.bind(i,{from:R.style,to:A,duration:N,easing:P}),N]);var z=CT(M,N,P),B=$a($a($a({},R.style),A),{},{transition:z});return[].concat(Dw(b),[B,N,k]).filter(Yse)};return this.manager.start([d].concat(Dw(o.reduce(g,[h,Math.max(y,c)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=Vse());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?Ku({},c,d):d,x=CT(Object.keys(b),o,f);j.start([h,i,$a($a({},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=bie(a,xie),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,$a($a({},d),{},{style:$a($a({},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);vs.displayName="Animate";vs.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};vs.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 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 Zh(){return Zh=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},Zh.apply(this,arguments)}function Tie(e,t){return Die(e)||$ie(e,t)||Mie(e,t)||Iie()}function Iie(){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 Mie(e,t){if(e){if(typeof e=="string")return kT(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 kT(e,t)}}function kT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $ie(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function Die(e){if(Array.isArray(e))return e}function RT(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 TT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RT(Object(n),!0).forEach(function(r){Lie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lie(e,t,n){return t=Fie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fie(e){var t=Bie(e,"string");return Dd(t)=="symbol"?t:t+""}function Bie(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)}var IT=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},zie=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},Uie={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},HN=function(t){var n=TT(TT({},Uie),t),r=v.useRef(),a=v.useState(-1),i=Tie(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 _=St("recharts-rectangle",g);return N?q.createElement(vs,{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(vs,{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",Zh({},vt(n,!0),{className:_,d:IT(k,R,A,O,y),ref:r})))}):q.createElement("path",Zh({},vt(n,!0),{className:_,d:IT(d,f,h,p,y)}))},qie=["points","className","baseLinePoints","connectNulls"];function kl(){return kl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kl.apply(this,arguments)}function Wie(e,t){if(e==null)return{};var n=Vie(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 Vie(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 MT(e){return Yie(e)||Gie(e)||Kie(e)||Hie()}function Hie(){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 Kie(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 Gie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Yie(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 $T=function(t){return t&&t.x===+t.x&&t.y===+t.y},Xie=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){$T(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),$T(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},nd=function(t,n){var r=Xie(t);n&&(r=[r.reduce(function(i,o){return[].concat(MT(i),MT(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},Qie=function(t,n,r){var a=nd(t,r);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(nd(n.reverse(),r).slice(1))},Jie=function(t){var n=t.points,r=t.className,a=t.baseLinePoints,i=t.connectNulls,o=Wie(t,qie);if(!n||!n.length)return null;var c=St("recharts-polygon",r);if(a&&a.length){var d=o.stroke&&o.stroke!=="none",f=Qie(n,a,i);return q.createElement("g",{className:c},q.createElement("path",kl({},vt(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:f})),d?q.createElement("path",kl({},vt(o,!0),{fill:"none",d:nd(n,i)})):null,d?q.createElement("path",kl({},vt(o,!0),{fill:"none",d:nd(a,i)})):null)}var h=nd(n,i);return q.createElement("path",kl({},vt(o,!0),{fill:h.slice(-1)==="Z"?o.fill:"none",className:c,d:h}))};function Mj(){return Mj=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},Mj.apply(this,arguments)}var _v=function(t){var n=t.cx,r=t.cy,a=t.r,i=t.className,o=St("recharts-dot",i);return n===+n&&r===+r&&a===+a?v.createElement("circle",Mj({},vt(t,!1),bh(t),{className:o,cx:n,cy:r,r:a})):null};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)}var Zie=["x","y","top","left","width","height","className"];function $j(){return $j=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},$j.apply(this,arguments)}function DT(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 eoe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DT(Object(n),!0).forEach(function(r){toe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function toe(e,t,n){return t=noe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function noe(e){var t=roe(e,"string");return Ld(t)=="symbol"?t:t+""}function roe(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)}function aoe(e,t){if(e==null)return{};var n=soe(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 soe(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 ioe=function(t,n,r,a,i,o){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(o,",").concat(n,"h").concat(r)},ooe=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=aoe(t,Zie),x=eoe({x:r,y:i,top:c,left:f,width:p,height:g},b);return!Fe(r)||!Fe(i)||!Fe(p)||!Fe(g)||!Fe(c)||!Fe(f)?null:q.createElement("path",$j({},vt(x,!0),{className:St("recharts-cross",j),d:ioe(r,i,p,g,c,f)}))},Lw,LT;function loe(){if(LT)return Lw;LT=1;var e=wv(),t=aL(),n=ws();function r(a,i){return a&&a.length?e(a,n(i,2),t):void 0}return Lw=r,Lw}var coe=loe();const uoe=Ht(coe);var Fw,FT;function doe(){if(FT)return Fw;FT=1;var e=wv(),t=ws(),n=sL();function r(a,i){return a&&a.length?e(a,t(i,2),n):void 0}return Fw=r,Fw}var foe=doe();const poe=Ht(foe);var hoe=["cx","cy","angle","ticks","axisLine"],moe=["ticks","tick","angle","tickFormatter","stroke"];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 rd(){return rd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rd.apply(this,arguments)}function BT(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?BT(Object(n),!0).forEach(function(r){Av(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zT(e,t){if(e==null)return{};var n=voe(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 voe(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 goe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UT(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,WL(r.key),r)}}function yoe(e,t,n){return t&&UT(e.prototype,t),n&&UT(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function xoe(e,t,n){return t=em(t),boe(e,qL()?Reflect.construct(t,n||[],em(e).constructor):t.apply(e,n))}function boe(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 woe(e)}function woe(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 em(e){return em=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},em(e)}function joe(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 Av(e,t,n){return t=WL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WL(e){var t=Soe(e,"string");return cc(t)=="symbol"?t:t+""}function Soe(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(t==="string"?String:Number)(e)}var Ev=(function(e){function t(){return goe(this,t),xoe(this,t,arguments)}return joe(t,e),yoe(t,[{key:"getTickValueCoord",value:function(r){var a=r.coordinate,i=this.props,o=i.angle,c=i.cx,d=i.cy;return cn(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=uoe(c,function(h){return h.coordinate||0}),f=poe(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=zT(r,hoe),h=c.reduce(function(j,b){return[Math.min(j[0],b.coordinate),Math.max(j[1],b.coordinate)]},[1/0,-1/0]),p=cn(a,i,h[0],o),y=cn(a,i,h[1],o),g=co(co(co({},vt(f,!1)),{},{fill:"none"},vt(d,!1)),{},{x1:p.x,y1:p.y,x2:y.x,y2:y.y});return q.createElement("line",rd({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=zT(a,moe),p=this.getTickTextAnchor(),y=vt(h,!1),g=vt(o,!1),j=i.map(function(b,x){var S=r.getTickValueCoord(b),N=co(co(co(co({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(Dt,rd({className:St("recharts-polar-radius-axis-tick",RL(o)),key:"tick-".concat(b.coordinate)},Ao(r.props,b,x)),t.renderTickItem(o,N,d?d(b.value,x):b.value))});return q.createElement(Dt,{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(Dt,{className:St("recharts-polar-radius-axis",this.props.className)},i&&this.renderAxisLine(),o&&this.renderTicks(),tr.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,a,i){var o;return q.isValidElement(r)?o=q.cloneElement(r,a):wt(r)?o=r(a):o=q.createElement(Eo,rd({},a,{className:"recharts-polar-radius-axis-tick-value"}),i),o}}])})(v.PureComponent);Av(Ev,"displayName","PolarRadiusAxis");Av(Ev,"axisType","radiusAxis");Av(Ev,"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 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 mo(){return mo=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},mo.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 uo(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){Pv(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 Noe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WT(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,HL(r.key),r)}}function Coe(e,t,n){return t&&WT(e.prototype,t),n&&WT(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _oe(e,t,n){return t=tm(t),Aoe(e,VL()?Reflect.construct(t,n||[],tm(e).constructor):t.apply(e,n))}function Aoe(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 Eoe(e)}function Eoe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function VL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(VL=function(){return!!e})()}function tm(e){return tm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},tm(e)}function Poe(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&&Lj(e,t)}function Lj(e,t){return Lj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Lj(e,t)}function Pv(e,t,n){return t=HL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HL(e){var t=Ooe(e,"string");return uc(t)=="symbol"?t:t+""}function Ooe(e,t){if(uc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(uc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var koe=Math.PI/180,VT=1e-5,Ov=(function(e){function t(){return Noe(this,t),_oe(this,t,arguments)}return Poe(t,e),Coe(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=cn(i,o,c,r.coordinate),y=cn(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*koe),o;return i>VT?o=a==="outer"?"start":"end":i<-VT?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=uo(uo({},vt(this.props,!1)),{},{fill:"none"},vt(c,!1));if(d==="circle")return q.createElement(_v,mo({className:"recharts-polar-angle-axis-line"},f,{cx:a,cy:i,r:o}));var h=this.props.ticks,p=h.map(function(y){return cn(a,i,o,y.coordinate)});return q.createElement(Jie,mo({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=vt(this.props,!1),p=vt(o,!1),y=uo(uo({},h),{},{fill:"none"},vt(c,!1)),g=i.map(function(j,b){var x=r.getTickLineCoord(j),S=r.getTickTextAnchor(j),N=uo(uo(uo({textAnchor:S},h),{},{stroke:"none",fill:f},p),{},{index:b,payload:j,x:x.x2,y:x.y2});return q.createElement(Dt,mo({className:St("recharts-polar-angle-axis-tick",RL(o)),key:"tick-".concat(j.coordinate)},Ao(r.props,j,b)),c&&q.createElement("line",mo({className:"recharts-polar-angle-axis-tick-line"},y,x)),o&&t.renderTickItem(o,N,d?d(j.value,b):j.value))});return q.createElement(Dt,{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(Dt,{className:St("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):wt(r)?o=r(a):o=q.createElement(Eo,mo({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])})(v.PureComponent);Pv(Ov,"displayName","PolarAngleAxis");Pv(Ov,"axisType","angleAxis");Pv(Ov,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var Bw,HT;function Roe(){if(HT)return Bw;HT=1;var e=a5(),t=e(Object.getPrototypeOf,Object);return Bw=t,Bw}var zw,KT;function Toe(){if(KT)return zw;KT=1;var e=Js(),t=Roe(),n=Zs(),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 zw=f,zw}var Ioe=Toe();const Moe=Ht(Ioe);var Uw,GT;function $oe(){if(GT)return Uw;GT=1;var e=Js(),t=Zs(),n="[object Boolean]";function r(a){return a===!0||a===!1||t(a)&&e(a)==n}return Uw=r,Uw}var Doe=$oe();const Loe=Ht(Doe);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 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 Foe(e,t){return qoe(e)||Uoe(e,t)||zoe(e,t)||Boe()}function Boe(){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 zoe(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 Uoe(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 qoe(e){if(Array.isArray(e))return 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 QT(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){Woe(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 Woe(e,t,n){return t=Voe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Voe(e){var t=Hoe(e,"string");return Fd(t)=="symbol"?t:t+""}function Hoe(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 JT=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},Koe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Goe=function(t){var n=QT(QT({},Koe),t),r=v.useRef(),a=v.useState(-1),i=Foe(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=St("recharts-trapezoid",g);return S?q.createElement(vs,{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(vs,{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",nm({},vt(n,!0),{className:N,d:JT(k,R,P,A,O),ref:r})))}):q.createElement("g",null,q.createElement("path",nm({},vt(n,!0),{className:N,d:JT(d,f,h,p,y)})))},Yoe=["option","shapeType","propTransformer","activeClassName","isActive"];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 Xoe(e,t){if(e==null)return{};var n=Qoe(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 Qoe(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 ZT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function rm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZT(Object(n),!0).forEach(function(r){Joe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Joe(e,t,n){return t=Zoe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zoe(e){var t=ele(e,"string");return Bd(t)=="symbol"?t:t+""}function ele(e,t){if(Bd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Bd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tle(e,t){return rm(rm({},t),e)}function nle(e,t){return e==="symbols"}function eI(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return q.createElement(HN,n);case"trapezoid":return q.createElement(Goe,n);case"sector":return q.createElement(ML,n);case"symbols":if(nle(t))return q.createElement(dN,n);break;default:return null}}function rle(e){return v.isValidElement(e)?e.props:e}function KL(e){var t=e.option,n=e.shapeType,r=e.propTransformer,a=r===void 0?tle:r,i=e.activeClassName,o=i===void 0?"recharts-active-shape":i,c=e.isActive,d=Xoe(e,Yoe),f;if(v.isValidElement(t))f=v.cloneElement(t,rm(rm({},d),rle(t)));else if(wt(t))f=t(d);else if(Moe(t)&&!Loe(t)){var h=a(t,d);f=q.createElement(eI,{shapeType:n,elementProps:h})}else{var p=d;f=q.createElement(eI,{shapeType:n,elementProps:p})}return c?q.createElement(Dt,{className:o},f):f}function kv(e,t){return t!=null&&"trapezoids"in e.props}function Rv(e,t){return t!=null&&"sectors"in e.props}function zd(e,t){return t!=null&&"points"in e.props}function ale(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 sle(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function ile(e,t){var n=e.x===t.x,r=e.y===t.y,a=e.z===t.z;return n&&r&&a}function ole(e,t){var n;return kv(e,t)?n=ale:Rv(e,t)?n=sle:zd(e,t)&&(n=ile),n}function lle(e,t){var n;return kv(e,t)?n="trapezoids":Rv(e,t)?n="sectors":zd(e,t)&&(n="points"),n}function cle(e,t){if(kv(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}if(Rv(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}return zd(e,t)?t.payload:{}}function ule(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,a=lle(n,t),i=cle(n,t),o=r.filter(function(d,f){var h=gf(i,d),p=n.props[a].filter(function(j){var b=ole(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 lh;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 Rl(){return Rl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rl.apply(this,arguments)}function 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 an(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){ga(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 dle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nI(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 fle(e,t,n){return t&&nI(e.prototype,t),n&&nI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ple(e,t,n){return t=am(t),hle(e,GL()?Reflect.construct(t,n||[],am(e).constructor):t.apply(e,n))}function hle(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 mle(e)}function mle(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 am(e){return am=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},am(e)}function vle(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 ga(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=gle(e,"string");return dc(t)=="symbol"?t:t+""}function gle(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 ti=(function(e){function t(n){var r;return dle(this,t),r=ple(this,t,[n]),ga(r,"pieRef",null),ga(r,"sectorRefs",[]),ga(r,"id",Fc("recharts-pie-")),ga(r,"handleAnimationEnd",function(){var a=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),wt(a)&&a()}),ga(r,"handleAnimationStart",function(){var a=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),wt(a)&&a()}),r.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},r}return vle(t,e),fle(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=vt(this.props,!1),p=vt(o,!1),y=vt(c,!1),g=o&&o.offsetRadius||20,j=r.map(function(b,x){var S=(b.startAngle+b.endAngle)/2,N=cn(b.cx,b.cy,b.outerRadius+g,S),_=an(an(an(an({},h),b),{},{stroke:"none"},p),{},{index:x,textAnchor:t.getTextAnchor(N.x,b.cx)},N),P=an(an(an(an({},h),b),{},{fill:"none",stroke:b.fill},y),{},{index:x,points:[cn(b.cx,b.cy,b.outerRadius,S),N]}),A=d;return jt(d)&&jt(f)?A="value":jt(d)&&(A=f),q.createElement(Dt,{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(Dt,{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=an(an({},f),{},{stroke:c?f.fill:f.stroke,tabIndex:-1});return q.createElement(Dt,Rl({ref:function(x){x&&!a.sectorRefs.includes(x)&&a.sectorRefs.push(x)},tabIndex:-1,className:"recharts-pie-sector"},Ao(a.props,f,h),{key:"sector-".concat(f?.startAngle,"-").concat(f?.endAngle,"-").concat(f.midAngle,"-").concat(h)}),q.createElement(KL,Rl({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(vs,{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?ra(_,"paddingAngle",0):0;if(A){var k=Qr(A.endAngle-A.startAngle,_.endAngle-_.startAngle),R=an(an({},_),{},{startAngle:N+O,endAngle:N+k(b)+O});x.push(R),N=R.endAngle}else{var M=_.endAngle,z=_.startAngle,B=Qr(0,M-z),L=B(b),G=an(an({},_),{},{startAngle:N+O,endAngle:N+L+O});x.push(G),N=G.endAngle}}),q.createElement(Dt,null,r.renderSectorsStatically(x))})}},{key:"attachKeyboardHandlers",value:function(r){var a=this;r.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var o=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[o].focus(),a.setState({sectorToFocus:o});break}case"ArrowRight":{var c=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[c].focus(),a.setState({sectorToFocus:c});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,a=r.sectors,i=r.isAnimationActive,o=this.state.prevSectors;return i&&a&&a.length&&(!o||!gf(o,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,a=this.props,i=a.hide,o=a.sectors,c=a.className,d=a.label,f=a.cx,h=a.cy,p=a.innerRadius,y=a.outerRadius,g=a.isAnimationActive,j=this.state.isAnimationFinished;if(i||!o||!o.length||!Fe(f)||!Fe(h)||!Fe(p)||!Fe(y))return null;var b=St("recharts-pie",c);return q.createElement(Dt,{tabIndex:this.props.rootTabIndex,className:b,ref:function(S){r.pieRef=S}},this.renderSectors(),d&&this.renderLabels(o),tr.renderCallByParent(this.props,null,!1),(!g||j)&&Ws.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(wt(r))return r(a);var o=St("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return q.createElement(Gh,Rl({},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(wt(r)&&(o=r(a),q.isValidElement(o)))return o;var c=St("recharts-pie-label-text",typeof r!="boolean"&&!wt(r)?r.className:"");return q.createElement(Eo,Rl({},a,{alignmentBaseline:"middle",className:c}),o)}}])})(v.PureComponent);lh=ti;ga(ti,"displayName","Pie");ga(ti,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!Bo.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});ga(ti,"parseDeltaAngle",function(e,t){var n=jr(t-e),r=Math.min(Math.abs(t-e),360);return n*r});ga(ti,"getRealPieData",function(e){var t=e.data,n=e.children,r=vt(e,!1),a=aa(n,hv);return t&&t.length?t.map(function(i,o){return an(an(an({payload:i},r),i),a&&a[o]&&a[o].props)}):a&&a.length?a.map(function(i){return an(an({},r),i.props)}):[]});ga(ti,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,a=t.width,i=t.height,o=kL(a,i),c=r+Sr(e.cx,a,a/2),d=n+Sr(e.cy,i,i/2),f=Sr(e.innerRadius,o,0),h=Sr(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}});ga(ti,"getComposedData",function(e){var t=e.item,n=e.offset,r=t.type.defaultProps!==void 0?an(an({},t.type.defaultProps),t.props):t.props,a=lh.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=lh.parseCoordinateOfPie(r,n),b=lh.parseDeltaAngle(o,c),x=Math.abs(b),S=f;jt(f)&&jt(p)?(Us(!1,`Use "dataKey" to specify the value of pie,
|
|
114
|
-
the props "valueKey" will be deprecated in 1.1.0`),S="value"):jt(f)&&(Us(!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+(Fe(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),L=(Fe(z)?z:0)/A,G;M?G=k.endAngle+jr(b)*d*(z!==0?1:0):G=o;var U=G+jr(b)*((z!==0?g:0)+L*P),H=(G+U)/2,Q=(j.innerRadius+j.outerRadius)/2,J=[{name:B,value:z,payload:R,dataKey:S,type:y}],T=cn(j.cx,j.cy,Q,H);return k=an(an(an({percent:L,cornerRadius:i,name:B,tooltipPayload:J,midAngle:H,middleRadius:Q,tooltipPosition:T},R),j),{},{value:qn(R,S),startAngle:G,endAngle:U,payload:R,paddingAngle:jr(b)*d}),k})}return an(an({},j),{},{sectors:O,data:a})});var qw,rI;function yle(){if(rI)return qw;rI=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 qw=n,qw}var Ww,aI;function XL(){if(aI)return Ww;aI=1;var e=b5(),t=1/0,n=17976931348623157e292;function r(a){if(!a)return a===0?a:0;if(a=e(a),a===t||a===-t){var i=a<0?-1:1;return i*n}return a===a?a:0}return Ww=r,Ww}var Vw,sI;function xle(){if(sI)return Vw;sI=1;var e=yle(),t=pv(),n=XL();function r(a){return function(i,o,c){return c&&typeof c!="number"&&t(i,o,c)&&(o=c=void 0),i=n(i),o===void 0?(o=i,i=0):o=n(o),c=c===void 0?i<o?1:-1:n(c),e(i,o,c,a)}}return Vw=r,Vw}var Hw,iI;function ble(){if(iI)return Hw;iI=1;var e=xle(),t=e();return Hw=t,Hw}var wle=ble();const sm=Ht(wle);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 oI(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 lI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oI(Object(n),!0).forEach(function(r){QL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function QL(e,t,n){return t=jle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jle(e){var t=Sle(e,"string");return Ud(t)=="symbol"?t:t+""}function Sle(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 Nle=["Webkit","Moz","O","ms"],Cle=function(t,n){var r=t.replace(/(\w)/,function(i){return i.toUpperCase()}),a=Nle.reduce(function(i,o){return lI(lI({},i),{},QL({},o+r,n))},{});return a[t]=n,a};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 im(){return im=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},im.apply(this,arguments)}function cI(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 Kw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cI(Object(n),!0).forEach(function(r){Kr(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _le(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ZL(r.key),r)}}function Ale(e,t,n){return t&&uI(e.prototype,t),n&&uI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ele(e,t,n){return t=om(t),Ple(e,JL()?Reflect.construct(t,n||[],om(e).constructor):t.apply(e,n))}function Ple(e,t){if(t&&(fc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ole(e)}function Ole(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function JL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(JL=function(){return!!e})()}function om(e){return om=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},om(e)}function kle(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bj(e,t)}function Bj(e,t){return Bj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Bj(e,t)}function Kr(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=Rle(e,"string");return fc(t)=="symbol"?t:t+""}function Rle(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 Tle=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=Zu().domain(sm(0,d)).range([i,i+o-c]),h=f.domain().map(function(p){return f(p)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:f(r),endX:f(a),scale:f,scaleValues:h}},dI=function(t){return t.changedTouches&&!!t.changedTouches.length},pc=(function(e){function t(n){var r;return _le(this,t),r=Ele(this,t,[n]),Kr(r,"handleDrag",function(a){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(a):r.state.isSlideMoving&&r.handleSlideDrag(a)}),Kr(r,"handleTouchMove",function(a){a.changedTouches!=null&&a.changedTouches.length>0&&r.handleDrag(a.changedTouches[0])}),Kr(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()}),Kr(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Kr(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Kr(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Kr(r,"handleSlideDragStart",function(a){var i=dI(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 kle(t,e),Ale(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var a=r.startX,i=r.endX,o=this.state.scaleValues,c=this.props,d=c.gap,f=c.data,h=f.length-1,p=Math.min(a,i),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 wt(o)?o(d,r):d}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var a=this.state,i=a.slideMoveStartX,o=a.startX,c=a.endX,d=this.props,f=d.x,h=d.width,p=d.travellerWidth,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=dI(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(Kr(Kr({},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(Kr({},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=Kw(Kw({},vt(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(Dt,{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(Dt,{className:"recharts-brush-texts"},q.createElement(Eo,im({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,y)-g,y:o+c/2},j),this.getTextOfTick(a)),q.createElement(Eo,im({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||!Fe(c)||!Fe(d)||!Fe(f)||!Fe(h)||f<=0||h<=0)return null;var _=St("recharts-brush",i),P=q.Children.count(o)===1,A=Cle("userSelect","none");return q.createElement(Dt,{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):wt(r)?i=r(a):i=t.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(r,a){var i=r.data,o=r.width,c=r.x,d=r.travellerWidth,f=r.updateId,h=r.startIndex,p=r.endIndex;if(i!==a.prevData||f!==a.prevUpdateId)return Kw({prevData:i,prevTravellerWidth:d,prevUpdateId:f,prevX:c,prevWidth:o},i&&i.length?Tle({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);Kr(pc,"displayName","Brush");Kr(pc,"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 Gw,fI;function Ile(){if(fI)return Gw;fI=1;var e=yN();function t(n,r){var a;return e(n,function(i,o,c){return a=r(i,o,c),!a}),!!a}return Gw=t,Gw}var Yw,pI;function Mle(){if(pI)return Yw;pI=1;var e=Q3(),t=ws(),n=Ile(),r=Dr(),a=pv();function i(o,c,d){var f=r(o)?e:n;return d&&a(o,c,d)&&(c=void 0),f(o,t(c,3))}return Yw=i,Yw}var $le=Mle();const Dle=Ht($le);var fs=function(t,n){var r=t.alwaysShow,a=t.ifOverflow;return r&&(a="extendDomain"),a===n},Xw,hI;function Lle(){if(hI)return Xw;hI=1;var e=m5();function t(n,r,a){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):n[r]=a}return Xw=t,Xw}var Qw,mI;function Fle(){if(mI)return Qw;mI=1;var e=Lle(),t=p5(),n=ws();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 Qw=r,Qw}var Ble=Fle();const zle=Ht(Ble);var Jw,vI;function Ule(){if(vI)return Jw;vI=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 Jw=e,Jw}var Zw,gI;function qle(){if(gI)return Zw;gI=1;var e=yN();function t(n,r){var a=!0;return e(n,function(i,o,c){return a=!!r(i,o,c),a}),a}return Zw=t,Zw}var e1,yI;function Wle(){if(yI)return e1;yI=1;var e=Ule(),t=qle(),n=ws(),r=Dr(),a=pv();function i(o,c,d){var f=r(o)?e:t;return d&&a(o,c,d)&&(c=void 0),f(o,n(c,3))}return e1=i,e1}var Vle=Wle();const Hle=Ht(Vle);var Kle=["x","y"];function qd(e){"@babel/helpers - typeof";return qd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qd(e)}function zj(){return zj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zj.apply(this,arguments)}function xI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Bu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xI(Object(n),!0).forEach(function(r){Gle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Gle(e,t,n){return t=Yle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yle(e){var t=Xle(e,"string");return qd(t)=="symbol"?t:t+""}function Xle(e,t){if(qd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(qd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qle(e,t){if(e==null)return{};var n=Jle(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 Jle(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 Zle(e,t){var n=e.x,r=e.y,a=Qle(e,Kle),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 Bu(Bu(Bu(Bu(Bu({},t),a),o?{x:o}:{}),d?{y:d}:{}),{},{height:h,width:y,name:t.name,radius:t.radius})}function bI(e){return q.createElement(KL,zj({shapeType:"rectangle",propTransformer:Zle,activeClassName:"recharts-active-bar"},e))}var ece=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=Fe(r)||xY(r);return i?t(r,a):(i||Oo(),n)}},tce=["value","background"],e4;function hc(e){"@babel/helpers - typeof";return hc=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},hc(e)}function nce(e,t){if(e==null)return{};var n=rce(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 rce(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 lm(){return lm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lm.apply(this,arguments)}function 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 $n(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){ki(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 ace(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,n4(r.key),r)}}function sce(e,t,n){return t&&jI(e.prototype,t),n&&jI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ice(e,t,n){return t=cm(t),oce(e,t4()?Reflect.construct(t,n||[],cm(e).constructor):t.apply(e,n))}function oce(e,t){if(t&&(hc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lce(e)}function lce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(t4=function(){return!!e})()}function cm(e){return cm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},cm(e)}function cce(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 ki(e,t,n){return t=n4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n4(e){var t=uce(e,"string");return hc(t)=="symbol"?t:t+""}function uce(e,t){if(hc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(hc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Wo=(function(e){function t(){var n;ace(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=ice(this,t,[].concat(a)),ki(n,"state",{isAnimationFinished:!1}),ki(n,"id",Fc("recharts-bar-")),ki(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),ki(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return cce(t,e),sce(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=vt(this.props,!1);return r&&r.map(function(p,y){var g=y===d,j=g?f:o,b=$n($n($n({},h),p),{},{isActive:g,option:j,index:y,dataKey:c,onAnimationStart:a.handleAnimationStart,onAnimationEnd:a.handleAnimationEnd});return q.createElement(Dt,lm({className:"recharts-bar-rectangle"},Ao(a.props,p,y),{key:"rectangle-".concat(p?.x,"-").concat(p?.y,"-").concat(p?.value,"-").concat(y)}),q.createElement(bI,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(vs,{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 _=Qr(N.x,x.x),P=Qr(N.y,x.y),A=Qr(N.width,x.width),O=Qr(N.height,x.height);return $n($n({},x),{},{x:_(j),y:P(j),width:A(j),height:O(j)})}if(o==="horizontal"){var k=Qr(0,x.height),R=k(j);return $n($n({},x),{},{y:x.y+x.height-R,height:R})}var M=Qr(0,x.width),z=M(j);return $n($n({},x),{},{width:z})});return q.createElement(Dt,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||!gf(o,a))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(a)}},{key:"renderBackground",value:function(){var r=this,a=this.props,i=a.data,o=a.dataKey,c=a.activeIndex,d=vt(this.props.background,!1);return i.map(function(f,h){f.value;var p=f.background,y=nce(f,tce);if(!p)return null;var g=$n($n($n($n($n({},y),{},{fill:"#eee"},p),d),Ao(r.props,f,h)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:h,className:"recharts-bar-background-rectangle"});return q.createElement(bI,lm({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=aa(h,yf);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(Dt,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=St("recharts-bar",o),N=c&&c.allowDataOverflow,_=d&&d.allowDataOverflow,P=N||_,A=jt(b)?this.id:b;return q.createElement(Dt,{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(Dt,{className:"recharts-bar-rectangles",clipPath:P?"url(#clipPath-".concat(A,")"):null},j?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(P,A),(!g||x)&&Ws.renderCallByParent(this.props,i))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:a.curData}:r.data!==a.curData?{curData:r.data}:null}}])})(v.PureComponent);e4=Wo;ki(Wo,"displayName","Bar");ki(Wo,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!Bo.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});ki(Wo,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,a=e.bandSize,i=e.xAxis,o=e.yAxis,c=e.xAxisTicks,d=e.yAxisTicks,f=e.stackedData,h=e.dataStartIndex,p=e.displayedData,y=e.offset,g=Ire(r,n);if(!g)return null;var j=t.layout,b=n.type.defaultProps,x=b!==void 0?$n($n({},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=zre({numericAxis:P}),k=aa(N,hv),R=p.map(function(M,z){var B,L,G,U,H,Q;f?B=Mre(f[h+z],A):(B=qn(M,S),Array.isArray(B)||(B=[O,B]));var J=ece(_,e4.defaultProps.minPointSize)(B[1],z);if(j==="horizontal"){var T,D=[o.scale(B[0]),o.scale(B[1])],X=D[0],F=D[1];L=X2({axis:i,ticks:c,bandSize:a,offset:g.offset,entry:M,index:z}),G=(T=F??X)!==null&&T!==void 0?T:void 0,U=g.size;var $=X-F;if(H=Number.isNaN($)?0:$,Q={x:L,y:o.y,width:U,height:o.height},Math.abs(J)>0&&Math.abs(H)<Math.abs(J)){var ee=jr(H||J)*(Math.abs(J)-Math.abs(H));G-=ee,H+=ee}}else{var ae=[i.scale(B[0]),i.scale(B[1])],K=ae[0],le=ae[1];if(L=K,G=X2({axis:o,ticks:d,bandSize:a,offset:g.offset,entry:M,index:z}),U=le-K,H=g.size,Q={x:i.x,y:G,width:i.width,height:H},Math.abs(J)>0&&Math.abs(U)<Math.abs(J)){var ie=jr(U||J)*(Math.abs(J)-Math.abs(U));U+=ie}}return $n($n($n({},M),{},{x:L,y:G,width:U,height:H,value:f?B:B[1],payload:M,background:Q},k&&k[z]&&k[z].props),{},{tooltipPayload:[PL(n,M)],tooltipPosition:{x:L+U/2,y:G+H/2}})});return $n({data:R,layout:j},y)});function Wd(e){"@babel/helpers - typeof";return Wd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wd(e)}function dce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function SI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r4(r.key),r)}}function fce(e,t,n){return t&&SI(e.prototype,t),n&&SI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function NI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Fa(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NI(Object(n),!0).forEach(function(r){Tv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tv(e,t,n){return t=r4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r4(e){var t=pce(e,"string");return Wd(t)=="symbol"?t:t+""}function pce(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 a4=function(t,n,r,a,i){var o=t.width,c=t.height,d=t.layout,f=t.children,h=Object.keys(n),p={left:r.left,leftMirror:r.left,right:o-r.right,rightMirror:o-r.right,top:r.top,topMirror:r.top,bottom:c-r.bottom,bottomMirror:c-r.bottom},y=!!Gr(f,Wo);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 L=S[1]-S[0],G=1/0,U=b.categoricalDomain.sort(jY);if(U.forEach(function(ae,K){K>0&&(G=Math.min((ae||0)-(U[K-1]||0),G))}),Number.isFinite(G)){var H=G/L,Q=b.layout==="vertical"?r.height:r.width;if(b.padding==="gap"&&(k=H*Q/2),b.padding==="no-gap"){var J=Sr(t.barCategoryGap,H*Q),T=H*Q/2;k=T-J-(T-J)/Q*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 D=CL(b,i,y),X=D.scale,F=D.realScaleType;X.domain(S).range(R),_L(X);var $=AL(X,Fa(Fa({},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 ee=Fa(Fa(Fa({},b),$),{},{realScaleType:F,x:M,y:z,scale:X,width:a==="xAxis"?r.width:b.width,height:a==="yAxis"?r.height:b.height});return ee.bandSize=Vh(ee,$),!b.hide&&a==="xAxis"?p[O]+=(B?-1:1)*ee.height:b.hide||(p[O]+=(B?-1:1)*ee.width),Fa(Fa({},g),{},Tv({},j,ee))},{})},s4=function(t,n){var r=t.x,a=t.y,i=n.x,o=n.y;return{x:Math.min(r,i),y:Math.min(a,o),width:Math.abs(i-r),height:Math.abs(o-a)}},hce=function(t){var n=t.x1,r=t.y1,a=t.x2,i=t.y2;return s4({x:n,y:r},{x:a,y:i})},i4=(function(){function e(t){dce(this,e),this.scale=t}return fce(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.bandAware,i=r.position;if(n!==void 0){if(i)switch(i){case"start":return this.scale(n);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+o}case"end":{var c=this.bandwidth?this.bandwidth():0;return this.scale(n)+c}default:return this.scale(n)}if(a){var d=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+d}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),a=r[0],i=r[r.length-1];return a<=i?n>=a&&n<=i:n>=i&&n<=a}}],[{key:"create",value:function(n){return new e(n)}}])})();Tv(i4,"EPS",1e-4);var KN=function(t){var n=Object.keys(t).reduce(function(r,a){return Fa(Fa({},r),{},Tv({},a,i4.create(t[a])))},{});return Fa(Fa({},n),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,c=i.position;return zle(a,function(d,f){return n[f].apply(d,{bandAware:o,position:c})})},isInRange:function(a){return Hle(a,function(i,o){return n[o].isInRange(i)})}})};function mce(e){return(e%180+180)%180}var vce=function(t){var n=t.width,r=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=mce(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)},t1,CI;function gce(){if(CI)return t1;CI=1;var e=ws(),t=ff(),n=dv();function r(a){return function(i,o,c){var d=Object(i);if(!t(i)){var f=e(o,3);i=n(i),o=function(p){return f(d[p],p,d)}}var h=a(i,o,c);return h>-1?d[f?i[h]:h]:void 0}}return t1=r,t1}var n1,_I;function yce(){if(_I)return n1;_I=1;var e=XL();function t(n){var r=e(n),a=r%1;return r===r?a?r-a:r:0}return n1=t,n1}var r1,AI;function xce(){if(AI)return r1;AI=1;var e=l5(),t=ws(),n=yce(),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 r1=a,r1}var a1,EI;function bce(){if(EI)return a1;EI=1;var e=gce(),t=xce(),n=e(t);return a1=n,a1}bce();var wce=N3();const jce=Ht(wce);var Sce=jce(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),o4=v.createContext(void 0),l4=v.createContext(void 0),c4=v.createContext(void 0),Nce=v.createContext({}),u4=v.createContext(void 0),d4=v.createContext(0),f4=v.createContext(0),PI=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=Sce(i);return q.createElement(o4.Provider,{value:r},q.createElement(l4.Provider,{value:a},q.createElement(Nce.Provider,{value:i},q.createElement(c4.Provider,{value:h},q.createElement(u4.Provider,{value:o},q.createElement(d4.Provider,{value:f},q.createElement(f4.Provider,{value:d},c)))))))},Cce=function(){return v.useContext(u4)},p4=function(t){var n=v.useContext(o4);n==null&&Oo();var r=n[t];return r==null&&Oo(),r},h4=function(t){var n=v.useContext(l4);n==null&&Oo();var r=n[t];return r==null&&Oo(),r},_ce=function(){var t=v.useContext(c4);return t},m4=function(){return v.useContext(f4)},v4=function(){return v.useContext(d4)};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 Ace(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ece(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,y4(r.key),r)}}function Pce(e,t,n){return t&&Ece(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Oce(e,t,n){return t=um(t),kce(e,g4()?Reflect.construct(t,n||[],um(e).constructor):t.apply(e,n))}function kce(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 Rce(e)}function Rce(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 um(e){return um=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},um(e)}function Tce(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 OI(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 kI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OI(Object(n),!0).forEach(function(r){GN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function GN(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=Ice(e,"string");return mc(t)=="symbol"?t:t+""}function Ice(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 Mce(e,t){return Fce(e)||Lce(e,t)||Dce(e,t)||$ce()}function $ce(){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 Dce(e,t){if(e){if(typeof e=="string")return RI(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 RI(e,t)}}function RI(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 Lce(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 Fce(e){if(Array.isArray(e))return e}function Wj(){return Wj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wj.apply(this,arguments)}var Bce=function(t,n){var r;return q.isValidElement(t)?r=q.cloneElement(t,n):wt(t)?r=t(n):r=q.createElement("line",Wj({},n,{className:"recharts-reference-line-line"})),r},zce=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(fs(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(fs(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 fs(f,"discard")&&Dle(A,function(O){return!t.isInRange(O)})?null:A}return null};function Uce(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=Cce(),h=p4(a),p=h4(i),y=_ce();if(!f||!y)return null;Us(d===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var g=KN({x:h.scale,y:p.scale}),j=Wn(t),b=Wn(n),x=r&&r.length===2,S=zce(g,j,b,x,y,e.position,h.orientation,p.orientation,e);if(!S)return null;var N=Mce(S,2),_=N[0],P=_.x,A=_.y,O=N[1],k=O.x,R=O.y,M=fs(e,"hidden")?"url(#".concat(f,")"):void 0,z=kI(kI({clipPath:M},vt(e,!0)),{},{x1:P,y1:A,x2:k,y2:R});return q.createElement(Dt,{className:St("recharts-reference-line",c)},Bce(o,z),tr.renderCallByParent(e,hce({x1:P,y1:A,x2:k,y2:R})))}var YN=(function(e){function t(){return Ace(this,t),Oce(this,t,arguments)}return Tce(t,e),Pce(t,[{key:"render",value:function(){return q.createElement(Uce,this.props)}}])})(q.Component);GN(YN,"displayName","ReferenceLine");GN(YN,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});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 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 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 II(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){Iv(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 qce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wce(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,b4(r.key),r)}}function Vce(e,t,n){return t&&Wce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Hce(e,t,n){return t=dm(t),Kce(e,x4()?Reflect.construct(t,n||[],dm(e).constructor):t.apply(e,n))}function Kce(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 Gce(e)}function Gce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function x4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(x4=function(){return!!e})()}function dm(e){return dm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},dm(e)}function Yce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hj(e,t)}function Hj(e,t){return Hj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Hj(e,t)}function Iv(e,t,n){return t=b4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b4(e){var t=Xce(e,"string");return vc(t)=="symbol"?t:t+""}function Xce(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)}var Qce=function(t){var n=t.x,r=t.y,a=t.xAxis,i=t.yAxis,o=KN({x:a.scale,y:i.scale}),c=o.apply({x:n,y:r},{bandAware:!0});return fs(t,"discard")&&!o.isInRange(c)?null:c},Mv=(function(e){function t(){return qce(this,t),Hce(this,t,arguments)}return Yce(t,e),Vce(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(Us(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!f||!h)return null;var p=Qce(this.props);if(!p)return null;var y=p.x,g=p.y,j=this.props,b=j.shape,x=j.className,S=fs(this.props,"hidden")?"url(#".concat(d,")"):void 0,N=II(II({clipPath:S},vt(this.props,!0)),{},{cx:y,cy:g});return q.createElement(Dt,{className:St("recharts-reference-dot",x)},t.renderDot(b,N),tr.renderCallByParent(this.props,{x:y-o,y:g-o,width:2*o,height:2*o}))}}])})(q.Component);Iv(Mv,"displayName","ReferenceDot");Iv(Mv,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Iv(Mv,"renderDot",function(e,t){var n;return q.isValidElement(e)?n=q.cloneElement(e,t):wt(e)?n=e(t):n=q.createElement(_v,Vj({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function Kj(){return Kj=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},Kj.apply(this,arguments)}function gc(e){"@babel/helpers - typeof";return gc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gc(e)}function 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 $I(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){$v(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 Jce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zce(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,j4(r.key),r)}}function eue(e,t,n){return t&&Zce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function tue(e,t,n){return t=fm(t),nue(e,w4()?Reflect.construct(t,n||[],fm(e).constructor):t.apply(e,n))}function nue(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 rue(e)}function rue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function w4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(w4=function(){return!!e})()}function fm(e){return fm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},fm(e)}function aue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gj(e,t)}function Gj(e,t){return Gj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Gj(e,t)}function $v(e,t,n){return t=j4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j4(e){var t=sue(e,"string");return gc(t)=="symbol"?t:t+""}function sue(e,t){if(gc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(gc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var iue=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=KN({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 fs(i,"discard")&&(!y.isInRange(g)||!y.isInRange(j))?null:s4(g,j)},Dv=(function(e){function t(){return Jce(this,t),tue(this,t,arguments)}return aue(t,e),eue(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;Us(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=iue(p,y,g,j,this.props);if(!x&&!b)return null;var S=fs(this.props,"hidden")?"url(#".concat(h,")"):void 0;return q.createElement(Dt,{className:St("recharts-reference-area",d)},t.renderRect(b,$I($I({clipPath:S},vt(this.props,!0)),x)),tr.renderCallByParent(this.props,x))}}])})(q.Component);$v(Dv,"displayName","ReferenceArea");$v(Dv,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});$v(Dv,"renderRect",function(e,t){var n;return q.isValidElement(e)?n=q.cloneElement(e,t):wt(e)?n=e(t):n=q.createElement(HN,Kj({},t,{className:"recharts-reference-area-rect"})),n});function S4(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],a=0;a<e.length;a+=t)r.push(e[a]);return r}function oue(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return vce(r,n)}function lue(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 pm(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 cue(e,t){return S4(e,t+1)}function uue(e,t,n,r,a){for(var i=(r||[]).slice(),o=t.start,c=t.end,d=0,f=1,h=o,p=function(){var j=r?.[d];if(j===void 0)return{v:S4(r,f)};var b=d,x,S=function(){return x===void 0&&(x=n(j,b)),x},N=j.coordinate,_=d===0||pm(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 Vd(e){"@babel/helpers - typeof";return Vd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vd(e)}function 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 vr(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){due(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 due(e,t,n){return t=fue(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fue(e){var t=pue(e,"string");return Vd(t)=="symbol"?t:t+""}function pue(e,t){if(Vd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Vd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hue(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=vr(vr({},g),{},{tickCoord:x>0?g.coordinate-x*e:g.coordinate})}else i[y]=g=vr(vr({},g),{},{tickCoord:g.coordinate});var S=pm(e,g.tickCoord,b,c,d);S&&(d=g.tickCoord-e*(b()/2+a),i[y]=vr(vr({},g),{},{isShow:!0}))},h=o-1;h>=0;h--)f(h);return i}function mue(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=vr(vr({},h),{},{tickCoord:y>0?h.coordinate-y*e:h.coordinate});var g=pm(e,h.tickCoord,function(){return p},d,f);g&&(f=h.tickCoord-e*(p/2+a),o[c-1]=vr(vr({},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]=_=vr(vr({},_),{},{tickCoord:O<0?_.coordinate-O*e:_.coordinate})}else o[N]=_=vr(vr({},_),{},{tickCoord:_.coordinate});var k=pm(e,_.tickCoord,A,d,f);k&&(d=_.tickCoord+e*(A()/2+a),o[N]=vr(vr({},_),{},{isShow:!0}))},x=0;x<j;x++)b(x);return o}function vue(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(Fe(d)||Bo.isSsr)return cue(a,typeof d=="number"&&Fe(d)?d:0);var y=[],g=c==="top"||c==="bottom"?"width":"height",j=h&&g==="width"?Ju(h,{fontSize:t,letterSpacing:n}):{width:0,height:0},b=function(_,P){var A=wt(f)?f(_.value,P):_.value;return g==="width"?oue(Ju(A,{fontSize:t,letterSpacing:n}),j,p):Ju(A,{fontSize:t,letterSpacing:n})[g]},x=a.length>=2?jr(a[1].coordinate-a[0].coordinate):1,S=lue(i,x,g);return d==="equidistantPreserveStart"?uue(x,S,b,a,o):(d==="preserveStart"||d==="preserveStartEnd"?y=mue(x,S,b,a,o,d==="preserveStartEnd"):y=hue(x,S,b,a,o),y.filter(function(N){return N.isShow}))}var gue=["viewBox"],yue=["viewBox"],xue=["ticks"];function yc(e){"@babel/helpers - typeof";return yc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yc(e)}function Tl(){return Tl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tl.apply(this,arguments)}function LI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function zn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LI(Object(n),!0).forEach(function(r){XN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function s1(e,t){if(e==null)return{};var n=bue(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 bue(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 wue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,C4(r.key),r)}}function jue(e,t,n){return t&&FI(e.prototype,t),n&&FI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Sue(e,t,n){return t=hm(t),Nue(e,N4()?Reflect.construct(t,n||[],hm(e).constructor):t.apply(e,n))}function Nue(e,t){if(t&&(yc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Cue(e)}function Cue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function N4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(N4=function(){return!!e})()}function hm(e){return hm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},hm(e)}function _ue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yj(e,t)}function Yj(e,t){return Yj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Yj(e,t)}function XN(e,t,n){return t=C4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C4(e){var t=Aue(e,"string");return yc(t)=="symbol"?t:t+""}function Aue(e,t){if(yc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(yc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Lv=(function(e){function t(n){var r;return wue(this,t),r=Sue(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return _ue(t,e),jue(t,[{key:"shouldComponentUpdate",value:function(r,a){var i=r.viewBox,o=s1(r,gue),c=this.props,d=c.viewBox,f=s1(c,yue);return!zl(i,d)||!zl(o,f)||!zl(a,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var a=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];a&&this.setState({fontSize:window.getComputedStyle(a).fontSize,letterSpacing:window.getComputedStyle(a).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var a=this.props,i=a.x,o=a.y,c=a.width,d=a.height,f=a.orientation,h=a.tickSize,p=a.mirror,y=a.tickMargin,g,j,b,x,S,N,_=p?-1:1,P=r.tickSize||h,A=Fe(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({},vt(this.props,!1)),vt(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",Tl({},p,{className:St("recharts-cartesian-axis-line",ra(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=vue(zn(zn({},this.props),{},{ticks:r}),a,i),j=this.getTickTextAnchor(),b=this.getTickVerticalAnchor(),x=vt(this.props,!1),S=vt(h,!1),N=zn(zn({},x),{},{fill:"none"},vt(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(Dt,Tl({className:"recharts-cartesian-axis-tick",key:"tick-".concat(P.value,"-").concat(P.coordinate,"-").concat(P.tickCoord)},Ao(o.props,P,A)),d&&q.createElement("line",Tl({},N,k,{className:St("recharts-cartesian-axis-tick-line",ra(d,"className"))})),h&&t.renderTickItem(h,M,"".concat(wt(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=s1(p,xue),j=y;return wt(d)&&(j=y&&y.length>0?d(this.props):d(g)),o<=0||c<=0||!j||!j.length?null:q.createElement(Dt,{className:St("recharts-cartesian-axis",f),ref:function(x){r.layerReference=x}},i&&this.renderAxisLine(),this.renderTicks(j,this.state.fontSize,this.state.letterSpacing),tr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,a,i){var o,c=St(a.className,"recharts-cartesian-axis-tick-value");return q.isValidElement(r)?o=q.cloneElement(r,zn(zn({},a),{},{className:c})):wt(r)?o=r(zn(zn({},a),{},{className:c})):o=q.createElement(Eo,Tl({},a,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])})(v.Component);XN(Lv,"displayName","CartesianAxis");XN(Lv,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var Eue=["type","layout","connectNulls","ref"],Pue=["key"];function xc(e){"@babel/helpers - typeof";return xc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xc(e)}function BI(e,t){if(e==null)return{};var n=Oue(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 Oue(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 ad(){return ad=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ad.apply(this,arguments)}function 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 Hr(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){Ba(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 Sl(e){return Iue(e)||Tue(e)||Rue(e)||kue()}function kue(){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 Rue(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 Tue(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Iue(e){if(Array.isArray(e))return Xj(e)}function Xj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Mue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,A4(r.key),r)}}function $ue(e,t,n){return t&&UI(e.prototype,t),n&&UI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Due(e,t,n){return t=mm(t),Lue(e,_4()?Reflect.construct(t,n||[],mm(e).constructor):t.apply(e,n))}function Lue(e,t){if(t&&(xc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Fue(e)}function Fue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_4=function(){return!!e})()}function mm(e){return mm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},mm(e)}function Bue(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 Ba(e,t,n){return t=A4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A4(e){var t=zue(e,"string");return xc(t)=="symbol"?t:t+""}function zue(e,t){if(xc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(xc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var bc=(function(e){function t(){var n;Mue(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=Due(this,t,[].concat(a)),Ba(n,"state",{isAnimationFinished:!0,totalLength:0}),Ba(n,"generateSimpleStrokeDasharray",function(o,c){return"".concat(c,"px ").concat(o-c,"px")}),Ba(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(Sl(d.slice(0,j)),[p-b]);break}var x=g.length%2===0?[0,y]:[y];return[].concat(Sl(t.repeat(d,h)),Sl(g),x).map(function(S){return"".concat(S,"px")}).join(", ")}),Ba(n,"id",Fc("recharts-line-")),Ba(n,"pathRef",function(o){n.mainCurve=o}),Ba(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Ba(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return Bue(t,e),$ue(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=aa(h,yf);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(Dt,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=vt(this.props,!1),y=vt(d,!0),g=f.map(function(b,x){var S=Hr(Hr(Hr({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(Dt,ad({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=BI(c,Eue),y=Hr(Hr(Hr({},vt(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(Gh,ad({},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(vs,{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(L,G){var U=Math.floor(G*O);if(N[U]){var H=N[U],Q=Qr(H.x,L.x),J=Qr(H.y,L.y);return Hr(Hr({},L),{},{x:Q(A),y:J(A)})}if(j){var T=Qr(b*2,L.x),D=Qr(x/2,L.y);return Hr(Hr({},L),{},{x:T(A),y:D(A)})}return Hr(Hr({},L),{},{x:L.x,y:L.y})});return i.renderCurveStatically(k,r,a)}var R=Qr(0,_),M=R(A),z;if(d){var B="".concat(d).split(/[,\s]+/gim).map(function(L){return parseFloat(L)});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||!gf(f,o))?this.renderCurveWithAnimation(r,a):this.renderCurveStatically(o,r,a)}},{key:"render",value:function(){var r,a=this.props,i=a.hide,o=a.dot,c=a.points,d=a.className,f=a.xAxis,h=a.yAxis,p=a.top,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,_=St("recharts-line",d),P=f&&f.allowDataOverflow,A=h&&h.allowDataOverflow,O=P||A,k=jt(x)?this.id:x,R=(r=vt(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},M=R.r,z=M===void 0?3:M,B=R.strokeWidth,L=B===void 0?2:B,G=kY(o)?o:{},U=G.clipDot,H=U===void 0?!0:U,Q=z*2+L;return q.createElement(Dt,{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})),!H&&q.createElement("clipPath",{id:"clipPath-dots-".concat(k)},q.createElement("rect",{x:y-Q/2,y:p-Q/2,width:g+Q,height:j+Q}))):null,!N&&this.renderCurve(O,k),this.renderErrorBar(O,k),(N||o)&&this.renderDots(O,H,k),(!b||S)&&Ws.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(Sl(r),[0]):r,o=[],c=0;c<a;++c)o=[].concat(Sl(o),Sl(i));return o}},{key:"renderDotItem",value:function(r,a){var i;if(q.isValidElement(r))i=q.cloneElement(r,a);else if(wt(r))i=r(a);else{var o=a.key,c=BI(a,Pue),d=St("recharts-line-dot",typeof r!="boolean"?r.className:"");i=q.createElement(_v,ad({key:o},c,{className:d}))}return i}}])})(v.PureComponent);Ba(bc,"displayName","Line");Ba(bc,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!Bo.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Ba(bc,"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:Y2({axis:n,ticks:a,bandSize:c,entry:y,index:g}),y:jt(j)?null:r.scale(j),value:j,payload:y}:{x:jt(j)?null:n.scale(j),y:Y2({axis:r,ticks:i,bandSize:c,entry:y,index:g}),value:j,payload:y}});return Hr({points:p,layout:h},f)});function wc(e){"@babel/helpers - typeof";return wc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wc(e)}function Uue(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,O4(r.key),r)}}function Wue(e,t,n){return t&&que(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Vue(e,t,n){return t=vm(t),Hue(e,E4()?Reflect.construct(t,n||[],vm(e).constructor):t.apply(e,n))}function Hue(e,t){if(t&&(wc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Kue(e)}function Kue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(E4=function(){return!!e})()}function vm(e){return vm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},vm(e)}function Gue(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&&Jj(e,t)}function Jj(e,t){return Jj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Jj(e,t)}function P4(e,t,n){return t=O4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O4(e){var t=Yue(e,"string");return wc(t)=="symbol"?t:t+""}function Yue(e,t){if(wc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(wc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Zj(){return Zj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zj.apply(this,arguments)}function Xue(e){var t=e.xAxisId,n=m4(),r=v4(),a=p4(t);return a==null?null:v.createElement(Lv,Zj({},a,{className:St("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return xo(o,!0)}}))}var ko=(function(e){function t(){return Uue(this,t),Vue(this,t,arguments)}return Gue(t,e),Wue(t,[{key:"render",value:function(){return v.createElement(Xue,this.props)}}])})(v.Component);P4(ko,"displayName","XAxis");P4(ko,"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 jc(e){"@babel/helpers - typeof";return jc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jc(e)}function Que(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jue(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,T4(r.key),r)}}function Zue(e,t,n){return t&&Jue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ede(e,t,n){return t=gm(t),tde(e,k4()?Reflect.construct(t,n||[],gm(e).constructor):t.apply(e,n))}function tde(e,t){if(t&&(jc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nde(e)}function nde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function k4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(k4=function(){return!!e})()}function gm(e){return gm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},gm(e)}function rde(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eS(e,t)}function eS(e,t){return eS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},eS(e,t)}function R4(e,t,n){return t=T4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T4(e){var t=ade(e,"string");return jc(t)=="symbol"?t:t+""}function ade(e,t){if(jc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(jc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function tS(){return tS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tS.apply(this,arguments)}var sde=function(t){var n=t.yAxisId,r=m4(),a=v4(),i=h4(n);return i==null?null:v.createElement(Lv,tS({},i,{className:St("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:a},ticksGenerator:function(c){return xo(c,!0)}}))},Ro=(function(e){function t(){return Que(this,t),ede(this,t,arguments)}return rde(t,e),Zue(t,[{key:"render",value:function(){return v.createElement(sde,this.props)}}])})(v.Component);R4(Ro,"displayName","YAxis");R4(Ro,"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 qI(e){return cde(e)||lde(e)||ode(e)||ide()}function ide(){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 ode(e,t){if(e){if(typeof e=="string")return nS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nS(e,t)}}function lde(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function cde(e){if(Array.isArray(e))return nS(e)}function nS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var rS=function(t,n,r,a,i){var o=aa(t,YN),c=aa(t,Mv),d=[].concat(qI(o),qI(c)),f=aa(t,Dv),h="".concat(a,"Id"),p=a[0],y=n;if(d.length&&(y=d.reduce(function(b,x){if(x.props[h]===r&&fs(x.props,"extendDomain")&&Fe(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&&fs(x.props,"extendDomain")&&Fe(x.props[g])&&Fe(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 Fe(x)?[Math.min(b[0],x),Math.max(b[1],x)]:b},y)),y},i1={exports:{}},WI;function ude(){return WI||(WI=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})(i1)),i1.exports}var dde=ude();const fde=Ht(dde);var o1=new fde,l1="recharts.syncMouseEvents";function Hd(e){"@babel/helpers - typeof";return Hd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hd(e)}function pde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hde(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 mde(e,t,n){return t&&hde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function c1(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=vde(e,"string");return Hd(t)=="symbol"?t:t+""}function vde(e,t){if(Hd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Hd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var gde=(function(){function e(){pde(this,e),c1(this,"activeIndex",0),c1(this,"coordinateList",[]),c1(this,"layout","horizontal")}return mde(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 yde(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e?.[0],a=e?.[1];if(r&&a&&Fe(r)&&Fe(a))return!0}return!1}function xde(e,t,n,r){var a=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-a:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-a,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function M4(e){var t=e.cx,n=e.cy,r=e.radius,a=e.startAngle,i=e.endAngle,o=cn(t,n,r,a),c=cn(t,n,r,i);return{points:[o,c],cx:t,cy:n,radius:r,startAngle:a,endAngle:i}}function bde(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=cn(c,d,f,p),g=cn(c,d,h,p);r=y.x,a=y.y,i=g.x,o=g.y}else return M4(t);return[{x:r,y:a},{x:i,y:o}]}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 VI(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 Qp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VI(Object(n),!0).forEach(function(r){wde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wde(e,t,n){return t=jde(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jde(e){var t=Sde(e,"string");return Kd(t)=="symbol"?t:t+""}function Sde(e,t){if(Kd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Kd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Nde(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=Gh;if(y==="ScatterChart")j=o,b=ooe;else if(y==="BarChart")j=xde(p,o,d,h),b=HN;else if(p==="radial"){var x=M4(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=ML}else j={points:bde(p,o,d)},b=Gh;var O=Qp(Qp(Qp(Qp({stroke:"#ccc",pointerEvents:"none"},d),j),vt(g,!1)),{},{payload:c,payloadIndex:f,className:St("recharts-tooltip-cursor",g.className)});return v.isValidElement(g)?v.cloneElement(g,O):v.createElement(b,O)}var Cde=["item"],_de=["children","className","width","height","style","compact","title","desc"];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 Il(){return Il=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Il.apply(this,arguments)}function HI(e,t){return Pde(e)||Ede(e,t)||D4(e,t)||Ade()}function Ade(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
119
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ede(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function Pde(e){if(Array.isArray(e))return e}function KI(e,t){if(e==null)return{};var n=Ode(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 Ode(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 kde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rde(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,L4(r.key),r)}}function Tde(e,t,n){return t&&Rde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ide(e,t,n){return t=ym(t),Mde(e,$4()?Reflect.construct(t,n||[],ym(e).constructor):t.apply(e,n))}function Mde(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 $de(e)}function $de(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($4=function(){return!!e})()}function ym(e){return ym=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ym(e)}function Dde(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&aS(e,t)}function aS(e,t){return aS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},aS(e,t)}function Nc(e){return Bde(e)||Fde(e)||D4(e)||Lde()}function Lde(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
120
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D4(e,t){if(e){if(typeof e=="string")return sS(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 sS(e,t)}}function Fde(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Bde(e){if(Array.isArray(e))return sS(e)}function sS(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 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 ye(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){gt(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 gt(e,t,n){return t=L4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L4(e){var t=zde(e,"string");return Sc(t)=="symbol"?t:t+""}function zde(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(t==="string"?String:Number)(e)}var Ude={xAxis:["bottom","top"],yAxis:["left","right"]},qde={width:"100%",height:"100%"},F4={x:0,y:0};function Jp(e){return e}var Wde=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},Vde=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 ye(ye(ye({},a),cn(a.cx,a.cy,c,o)),{},{angle:o,radius:c})}var d=i.coordinate,f=a.angle;return ye(ye(ye({},a),cn(a.cx,a.cy,d,f)),{},{angle:f,radius:d})}return F4},Fv=function(t,n){var r=n.graphicalItems,a=n.dataStartIndex,i=n.dataEndIndex,o=(r??[]).reduce(function(c,d){var f=d.props.data;return f&&f.length?[].concat(Nc(c),Nc(f)):c},[]);return o.length>0?o:t&&t.length&&Fe(a)&&Fe(i)?t.slice(a,i+1):[]};function B4(e){return e==="number"?[0,"auto"]:void 0}var iS=function(t,n,r,a){var i=t.graphicalItems,o=t.tooltipAxis,c=Fv(n,t);return r<0||!i||!i.length||r>=c.length?null:i.reduce(function(d,f){var h,p=(h=f.props.data)!==null&&h!==void 0?h:n;p&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(p=p.slice(t.dataStartIndex,t.dataEndIndex+1));var y;if(o.dataKey&&!o.allowDuplicatedCategory){var g=p===void 0?c:p;y=xh(g,o.dataKey,a)}else y=p&&p[r]||c[r];return y?[].concat(Nc(d),[PL(f,y)]):d},[])},YI=function(t,n,r,a){var i=a||{x:t.chartX,y:t.chartY},o=Wde(i,r),c=t.orderedTooltipTicks,d=t.tooltipAxis,f=t.tooltipTicks,h=Ere(o,c,f,d);if(h>=0&&f){var p=f[h]&&f[h].value,y=iS(t,n,h,p),g=Vde(r,c,h,i);return{activeTooltipIndex:h,activeLabel:p,activePayload:y,activeCoordinate:g}}return null},Hde=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=NL(h,i);return r.reduce(function(j,b){var x,S=b.type.defaultProps!==void 0?ye(ye({},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=Fv(t.data,{graphicalItems:a.filter(function($){var ee,ae=o in $.props?$.props[o]:(ee=$.type.defaultProps)===null||ee===void 0?void 0:ee[o];return ae===M}),dataStartIndex:d,dataEndIndex:f}),B=z.length,L,G,U;yde(S.domain,P,N)&&(L=bj(S.domain,null,P),g&&(N==="number"||O!=="auto")&&(U=ed(z,_,"category")));var H=B4(N);if(!L||L.length===0){var Q,J=(Q=S.domain)!==null&&Q!==void 0?Q:H;if(_){if(L=ed(z,_,N),N==="category"&&g){var T=wY(L);A&&T?(G=L,L=sm(0,B)):A||(L=Z2(J,L,b).reduce(function($,ee){return $.indexOf(ee)>=0?$:[].concat(Nc($),[ee])},[]))}else if(N==="category")A?L=L.filter(function($){return $!==""&&!jt($)}):L=Z2(J,L,b).reduce(function($,ee){return $.indexOf(ee)>=0||ee===""||jt(ee)?$:[].concat(Nc($),[ee])},[]);else if(N==="number"){var D=Tre(z,a.filter(function($){var ee,ae,K=o in $.props?$.props[o]:(ee=$.type.defaultProps)===null||ee===void 0?void 0:ee[o],le="hide"in $.props?$.props.hide:(ae=$.type.defaultProps)===null||ae===void 0?void 0:ae.hide;return K===M&&(R||!le)}),_,i,h);D&&(L=D)}g&&(N==="number"||O!=="auto")&&(U=ed(z,_,"category"))}else g?L=sm(0,B):c&&c[M]&&c[M].hasStack&&N==="number"?L=y==="expand"?[0,1]:EL(c[M].stackGroups,d,f):L=SL(z,a.filter(function($){var ee=o in $.props?$.props[o]:$.type.defaultProps[o],ae="hide"in $.props?$.props.hide:$.type.defaultProps.hide;return ee===M&&(R||!ae)}),N,h,!0);if(N==="number")L=rS(p,L,M,i,k),J&&(L=bj(J,L,P));else if(N==="category"&&J){var X=J,F=L.every(function($){return X.indexOf($)>=0});F&&(L=X)}}return ye(ye({},j),{},gt({},M,ye(ye({},S),{},{axisType:i,domain:L,categoricalDomain:U,duplicateDomain:G,originalDomain:(x=S.domain)!==null&&x!==void 0?x:H,isCategorical:g,layout:h})))},{})},Kde=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=Fv(t.data,{graphicalItems:r,dataStartIndex:d,dataEndIndex:f}),g=y.length,j=NL(h,i),b=-1;return r.reduce(function(x,S){var N=S.type.defaultProps!==void 0?ye(ye({},S.type.defaultProps),S.props):S.props,_=N[o],P=B4("number");if(!x[_]){b++;var A;return j?A=sm(0,g):c&&c[_]&&c[_].hasStack?(A=EL(c[_].stackGroups,d,f),A=rS(p,A,_,i)):(A=bj(P,SL(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=rS(p,A,_,i)),ye(ye({},x),{},gt({},_,ye(ye({axisType:i},a.defaultProps),{},{hide:!0,orientation:ra(Ude,"".concat(i,".").concat(b%2),null),domain:A,originalDomain:P,isCategorical:j,layout:h})))}return x},{})},Gde=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=aa(h,i),g={};return y&&y.length?g=Hde(t,{axes:y,graphicalItems:o,axisType:a,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f}):o&&o.length&&(g=Kde(t,{Axis:i,graphicalItems:o,axisType:a,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f})),g},Yde=function(t){var n=_l(t),r=xo(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:xN(r,function(a){return a.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Vh(n,r)}},XI=function(t){var n=t.children,r=t.defaultShowTooltip,a=Gr(n,pc),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}},Xde=function(t){return!t||!t.length?!1:t.some(function(n){var r=zs(n&&n.type);return r&&r.indexOf("Bar")>=0})},QI=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"}},Qde=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=Gr(p,pc),j=Gr(p,Ul),b=Object.keys(d).reduce(function(A,O){var k=d[O],R=k.orientation;return!k.mirror&&!k.hide?ye(ye({},A),{},gt({},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?ye(ye({},A),{},gt({},R,ra(A,"".concat(R))+k.height)):A},{top:y.top||0,bottom:y.bottom||0}),S=ye(ye({},x),b),N=S.bottom;g&&(S.bottom+=g.props.height||pc.defaultProps.height),j&&n&&(S=kre(S,a,r,n));var _=f-S.left-S.right,P=h-S.top-S.bottom;return ye(ye({brushBottom:N},S),{},{width:Math.max(_,0),height:Math.max(P,0)})},Jde=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},QN=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,L=S.barCategoryGap,G=S.maxBarSize,U=QI(z),H=U.numericAxisName,Q=U.cateAxisName,J=Xde(_),T=[];return _.forEach(function(D,X){var F=Fv(S.data,{graphicalItems:[D],dataStartIndex:k,dataEndIndex:R}),$=D.type.defaultProps!==void 0?ye(ye({},D.type.defaultProps),D.props):D.props,ee=$.dataKey,ae=$.maxBarSize,K=$["".concat(H,"Id")],le=$["".concat(Q,"Id")],ie={},fe=d.reduce(function(Je,lt){var Rt=N["".concat(lt.axisType,"Map")],qt=$["".concat(lt.axisType,"Id")];Rt&&Rt[qt]||lt.axisType==="zAxis"||Oo();var Z=Rt[qt];return ye(ye({},Je),{},gt(gt({},lt.axisType,Z),"".concat(lt.axisType,"Ticks"),xo(Z)))},ie),oe=fe[Q],ce=fe["".concat(Q,"Ticks")],Se=P&&P[K]&&P[K].hasStack&&Ure(D,P[K].stackGroups),ne=zs(D.type).indexOf("Bar")>=0,Te=Vh(oe,ce),Ae=[],Ye=J&&Pre({barSize:M,stackGroups:P,totalSize:Jde(fe,Q)});if(ne){var ge,Oe,Be=jt(ae)?G:ae,dt=(ge=(Oe=Vh(oe,ce,!0))!==null&&Oe!==void 0?Oe:Be)!==null&&ge!==void 0?ge:0;Ae=Ore({barGap:B,barCategoryGap:L,bandSize:dt!==Te?dt:Te,sizeList:Ye[le],maxBarSize:Be}),dt!==Te&&(Ae=Ae.map(function(Je){return ye(ye({},Je),{},{position:ye(ye({},Je.position),{},{offset:Je.position.offset-dt/2})})}))}var be=D&&D.type&&D.type.getComposedData;be&&T.push({props:ye(ye({},be(ye(ye({},fe),{},{displayedData:F,props:S,dataKey:ee,item:D,bandSize:Te,barPosition:Ae,offset:A,stackedData:Se,layout:z,dataStartIndex:k,dataEndIndex:R}))),{},gt(gt(gt({key:D.key||"item-".concat(X)},H,fe[H]),Q,fe[Q]),"animationId",O)),childIndex:IY(D,S.children),item:D})}),T},g=function(S,N){var _=S.props,P=S.dataStartIndex,A=S.dataEndIndex,O=S.updateId;if(!pO({props:_}))return null;var k=_.children,R=_.layout,M=_.stackOffset,z=_.data,B=_.reverseStackOrder,L=QI(R),G=L.numericAxisName,U=L.cateAxisName,H=aa(k,r),Q=Bre(z,H,"".concat(G,"Id"),"".concat(U,"Id"),M,B),J=d.reduce(function($,ee){var ae="".concat(ee.axisType,"Map");return ye(ye({},$),{},gt({},ae,Gde(_,ye(ye({},ee),{},{graphicalItems:H,stackGroups:ee.axisType===G&&Q,dataStartIndex:P,dataEndIndex:A}))))},{}),T=Qde(ye(ye({},J),{},{props:_,graphicalItems:H}),N?.legendBBox);Object.keys(J).forEach(function($){J[$]=h(_,J[$],T,$.replace("Map",""),n)});var D=J["".concat(U,"Map")],X=Yde(D),F=y(_,ye(ye({},J),{},{dataStartIndex:P,dataEndIndex:A,updateId:O,graphicalItems:H,stackGroups:Q,offset:T}));return ye(ye({formattedGraphicalItems:F,graphicalItems:H,offset:T,stackGroups:Q},X),J)},j=(function(x){function S(N){var _,P,A;return kde(this,S),A=Ide(this,S,[N]),gt(A,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),gt(A,"accessibilityManager",new gde),gt(A,"handleLegendBBoxUpdate",function(O){if(O){var k=A.state,R=k.dataStartIndex,M=k.dataEndIndex,z=k.updateId;A.setState(ye({legendBBox:O},g({props:A.props,dataStartIndex:R,dataEndIndex:M,updateId:z},ye(ye({},A.state),{},{legendBBox:O}))))}}),gt(A,"handleReceiveSyncEvent",function(O,k,R){if(A.props.syncId===O){if(R===A.eventEmitterSymbol&&typeof A.props.syncMethod!="function")return;A.applySyncEvent(k)}}),gt(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 ye({dataStartIndex:k,dataEndIndex:R},g({props:A.props,dataStartIndex:k,dataEndIndex:R,updateId:M},A.state))}),A.triggerSyncEvent({dataStartIndex:k,dataEndIndex:R})}}),gt(A,"handleMouseEnter",function(O){var k=A.getMouseInfo(O);if(k){var R=ye(ye({},k),{},{isTooltipActive:!0});A.setState(R),A.triggerSyncEvent(R);var M=A.props.onMouseEnter;wt(M)&&M(R,O)}}),gt(A,"triggeredAfterMouseMove",function(O){var k=A.getMouseInfo(O),R=k?ye(ye({},k),{},{isTooltipActive:!0}):{isTooltipActive:!1};A.setState(R),A.triggerSyncEvent(R);var M=A.props.onMouseMove;wt(M)&&M(R,O)}),gt(A,"handleItemMouseEnter",function(O){A.setState(function(){return{isTooltipActive:!0,activeItem:O,activePayload:O.tooltipPayload,activeCoordinate:O.tooltipPosition||{x:O.cx,y:O.cy}}})}),gt(A,"handleItemMouseLeave",function(){A.setState(function(){return{isTooltipActive:!1}})}),gt(A,"handleMouseMove",function(O){O.persist(),A.throttleTriggeredAfterMouseMove(O)}),gt(A,"handleMouseLeave",function(O){A.throttleTriggeredAfterMouseMove.cancel();var k={isTooltipActive:!1};A.setState(k),A.triggerSyncEvent(k);var R=A.props.onMouseLeave;wt(R)&&R(k,O)}),gt(A,"handleOuterEvent",function(O){var k=TY(O),R=ra(A.props,"".concat(k));if(k&&wt(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)}}),gt(A,"handleClick",function(O){var k=A.getMouseInfo(O);if(k){var R=ye(ye({},k),{},{isTooltipActive:!0});A.setState(R),A.triggerSyncEvent(R);var M=A.props.onClick;wt(M)&&M(R,O)}}),gt(A,"handleMouseDown",function(O){var k=A.props.onMouseDown;if(wt(k)){var R=A.getMouseInfo(O);k(R,O)}}),gt(A,"handleMouseUp",function(O){var k=A.props.onMouseUp;if(wt(k)){var R=A.getMouseInfo(O);k(R,O)}}),gt(A,"handleTouchMove",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&A.throttleTriggeredAfterMouseMove(O.changedTouches[0])}),gt(A,"handleTouchStart",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&A.handleMouseDown(O.changedTouches[0])}),gt(A,"handleTouchEnd",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&A.handleMouseUp(O.changedTouches[0])}),gt(A,"handleDoubleClick",function(O){var k=A.props.onDoubleClick;if(wt(k)){var R=A.getMouseInfo(O);k(R,O)}}),gt(A,"handleContextMenu",function(O){var k=A.props.onContextMenu;if(wt(k)){var R=A.getMouseInfo(O);k(R,O)}}),gt(A,"triggerSyncEvent",function(O){A.props.syncId!==void 0&&o1.emit(l1,A.props.syncId,O,A.eventEmitterSymbol)}),gt(A,"applySyncEvent",function(O){var k=A.props,R=k.layout,M=k.syncMethod,z=A.state.updateId,B=O.dataStartIndex,L=O.dataEndIndex;if(O.dataStartIndex!==void 0||O.dataEndIndex!==void 0)A.setState(ye({dataStartIndex:B,dataEndIndex:L},g({props:A.props,dataStartIndex:B,dataEndIndex:L,updateId:z},A.state)));else if(O.activeTooltipIndex!==void 0){var G=O.chartX,U=O.chartY,H=O.activeTooltipIndex,Q=A.state,J=Q.offset,T=Q.tooltipTicks;if(!J)return;if(typeof M=="function")H=M(T,O);else if(M==="value"){H=-1;for(var D=0;D<T.length;D++)if(T[D].value===O.activeLabel){H=D;break}}var X=ye(ye({},J),{},{x:J.left,y:J.top}),F=Math.min(G,X.x+X.width),$=Math.min(U,X.y+X.height),ee=T[H]&&T[H].value,ae=iS(A.state,A.props.data,H),K=T[H]?{x:R==="horizontal"?T[H].coordinate:F,y:R==="horizontal"?$:T[H].coordinate}:F4;A.setState(ye(ye({},O),{},{activeLabel:ee,activeCoordinate:K,activePayload:ae,activeTooltipIndex:H}))}else A.setState(O)}),gt(A,"renderCursor",function(O){var k,R=A.state,M=R.isTooltipActive,z=R.activeCoordinate,B=R.activePayload,L=R.offset,G=R.activeTooltipIndex,U=R.tooltipAxisBandSize,H=A.getTooltipEventType(),Q=(k=O.props.active)!==null&&k!==void 0?k:M,J=A.props.layout,T=O.key||"_recharts-cursor";return q.createElement(Nde,{key:T,activeCoordinate:z,activePayload:B,activeTooltipIndex:G,chartName:n,element:O,isActive:Q,layout:J,offset:L,tooltipAxisBandSize:U,tooltipEventType:H})}),gt(A,"renderPolarAxis",function(O,k,R){var M=ra(O,"type.axisType"),z=ra(A.state,"".concat(M,"Map")),B=O.type.defaultProps,L=B!==void 0?ye(ye({},B),O.props):O.props,G=z&&z[L["".concat(M,"Id")]];return v.cloneElement(O,ye(ye({},G),{},{className:St(M,G.className),key:O.key||"".concat(k,"-").concat(R),ticks:xo(G,!0)}))}),gt(A,"renderPolarGrid",function(O){var k=O.props,R=k.radialLines,M=k.polarAngles,z=k.polarRadius,B=A.state,L=B.radiusAxisMap,G=B.angleAxisMap,U=_l(L),H=_l(G),Q=H.cx,J=H.cy,T=H.innerRadius,D=H.outerRadius;return v.cloneElement(O,{polarAngles:Array.isArray(M)?M:xo(H,!0).map(function(X){return X.coordinate}),polarRadius:Array.isArray(z)?z:xo(U,!0).map(function(X){return X.coordinate}),cx:Q,cy:J,innerRadius:T,outerRadius:D,key:O.key||"polar-grid",radialLines:R})}),gt(A,"renderLegend",function(){var O=A.state.formattedGraphicalItems,k=A.props,R=k.children,M=k.width,z=k.height,B=A.props.margin||{},L=M-(B.left||0)-(B.right||0),G=wL({children:R,formattedGraphicalItems:O,legendWidth:L,legendContent:f});if(!G)return null;var U=G.item,H=KI(G,Cde);return v.cloneElement(U,ye(ye({},H),{},{chartWidth:M,chartHeight:z,margin:B,onBBoxUpdate:A.handleLegendBBoxUpdate}))}),gt(A,"renderTooltip",function(){var O,k=A.props,R=k.children,M=k.accessibilityLayer,z=Gr(R,Yr);if(!z)return null;var B=A.state,L=B.isTooltipActive,G=B.activeCoordinate,U=B.activePayload,H=B.activeLabel,Q=B.offset,J=(O=z.props.active)!==null&&O!==void 0?O:L;return v.cloneElement(z,{viewBox:ye(ye({},Q),{},{x:Q.left,y:Q.top}),active:J,label:H,payload:J?U:[],coordinate:G,accessibilityLayer:M})}),gt(A,"renderBrush",function(O){var k=A.props,R=k.margin,M=k.data,z=A.state,B=z.offset,L=z.dataStartIndex,G=z.dataEndIndex,U=z.updateId;return v.cloneElement(O,{key:O.key||"_recharts-brush",onChange:Kp(A.handleBrushChange,O.props.onChange),data:M,x:Fe(O.props.x)?O.props.x:B.left,y:Fe(O.props.y)?O.props.y:B.top+B.height+B.brushBottom-(R.bottom||0),width:Fe(O.props.width)?O.props.width:B.width,startIndex:L,endIndex:G,updateId:"brush-".concat(U)})}),gt(A,"renderReferenceElement",function(O,k,R){if(!O)return null;var M=A,z=M.clipPathId,B=A.state,L=B.xAxisMap,G=B.yAxisMap,U=B.offset,H=O.type.defaultProps||{},Q=O.props,J=Q.xAxisId,T=J===void 0?H.xAxisId:J,D=Q.yAxisId,X=D===void 0?H.yAxisId:D;return v.cloneElement(O,{key:O.key||"".concat(k,"-").concat(R),xAxis:L[T],yAxis:G[X],viewBox:{x:U.left,y:U.top,width:U.width,height:U.height},clipPathId:z})}),gt(A,"renderActivePoints",function(O){var k=O.item,R=O.activePoint,M=O.basePoint,z=O.childIndex,B=O.isRange,L=[],G=k.props.key,U=k.item.type.defaultProps!==void 0?ye(ye({},k.item.type.defaultProps),k.item.props):k.item.props,H=U.activeDot,Q=U.dataKey,J=ye(ye({index:z,dataKey:Q,cx:R.x,cy:R.y,r:4,fill:VN(k.item),strokeWidth:2,stroke:"#fff",payload:R.payload,value:R.value},vt(H,!1)),bh(H));return L.push(S.renderActiveDot(H,J,"".concat(G,"-activePoint-").concat(z))),M?L.push(S.renderActiveDot(H,ye(ye({},J),{},{cx:M.x,cy:M.y}),"".concat(G,"-basePoint-").concat(z))):B&&L.push(null),L}),gt(A,"renderGraphicChild",function(O,k,R){var M=A.filterFormatItem(O,k,R);if(!M)return null;var z=A.getTooltipEventType(),B=A.state,L=B.isTooltipActive,G=B.tooltipAxis,U=B.activeTooltipIndex,H=B.activeLabel,Q=A.props.children,J=Gr(Q,Yr),T=M.props,D=T.points,X=T.isRange,F=T.baseLine,$=M.item.type.defaultProps!==void 0?ye(ye({},M.item.type.defaultProps),M.item.props):M.item.props,ee=$.activeDot,ae=$.hide,K=$.activeBar,le=$.activeShape,ie=!!(!ae&&L&&J&&(ee||K||le)),fe={};z!=="axis"&&J&&J.props.trigger==="click"?fe={onClick:Kp(A.handleItemMouseEnter,O.props.onClick)}:z!=="axis"&&(fe={onMouseLeave:Kp(A.handleItemMouseLeave,O.props.onMouseLeave),onMouseEnter:Kp(A.handleItemMouseEnter,O.props.onMouseEnter)});var oe=v.cloneElement(O,ye(ye({},M.props),fe));function ce(lt){return typeof G.dataKey=="function"?G.dataKey(lt.payload):null}if(ie)if(U>=0){var Se,ne;if(G.dataKey&&!G.allowDuplicatedCategory){var Te=typeof G.dataKey=="function"?ce:"payload.".concat(G.dataKey.toString());Se=xh(D,Te,H),ne=X&&F&&xh(F,Te,H)}else Se=D?.[U],ne=X&&F&&F[U];if(le||K){var Ae=O.props.activeIndex!==void 0?O.props.activeIndex:U;return[v.cloneElement(O,ye(ye(ye({},M.props),fe),{},{activeIndex:Ae})),null,null]}if(!jt(Se))return[oe].concat(Nc(A.renderActivePoints({item:M,activePoint:Se,basePoint:ne,childIndex:U,isRange:X})))}else{var Ye,ge=(Ye=A.getItemByXY(A.state.activeCoordinate))!==null&&Ye!==void 0?Ye:{graphicalItem:oe},Oe=ge.graphicalItem,Be=Oe.item,dt=Be===void 0?O:Be,be=Oe.childIndex,Je=ye(ye(ye({},M.props),fe),{},{activeIndex:be});return[v.cloneElement(dt,Je),null,null]}return X?[oe,null,null]:[oe,null]}),gt(A,"renderCustomized",function(O,k,R){return v.cloneElement(O,ye(ye({key:"recharts-customized-".concat(R)},A.props),A.state))}),gt(A,"renderMap",{CartesianGrid:{handler:Jp,once:!0},ReferenceArea:{handler:A.renderReferenceElement},ReferenceLine:{handler:Jp},ReferenceDot:{handler:A.renderReferenceElement},XAxis:{handler:Jp},YAxis:{handler:Jp},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?_:Fc("recharts"),"-clip"),A.throttleTriggeredAfterMouseMove=w5(A.triggeredAfterMouseMove,(P=N.throttleDelay)!==null&&P!==void 0?P:1e3/60),A.state={},A}return Dde(S,x),Tde(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=Gr(P,Yr);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=iS(this.state,A,M,z),L=this.state.tooltipTicks[M].coordinate,G=(this.state.offset.top+O)/2,U=k==="horizontal",H=U?{x:L,y:G}:{y:L,x:G},Q=this.state.formattedGraphicalItems.find(function(T){var D=T.item;return D.type.name==="Scatter"});Q&&(H=ye(ye({},H),Q.props.points[M].tooltipPosition),B=Q.props.points[M].tooltipPayload);var J={activeTooltipIndex:M,isTooltipActive:!0,activeLabel:z,activePayload:B,activeCoordinate:H};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(_){z1([Gr(_.children,Yr)],[Gr(this.props.children,Yr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var _=Gr(this.props.children,Yr);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=bZ(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,L=z.yAxisMap,G=this.getTooltipEventType(),U=YI(this.state,this.props.data,this.props.layout,M);if(G!=="axis"&&B&&L){var H=_l(B).scale,Q=_l(L).scale,J=H&&H.invert?H.invert(k.chartX):null,T=Q&&Q.invert?Q.invert(k.chartY):null;return ye(ye({},k),{},{xValue:J,yValue:T},U)}return U?ye(ye({},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,L=B.angleAxisMap,G=B.radiusAxisMap;if(L&&G){var U=_l(L);return nT({x:k,y:R},U)}return null}},{key:"parseEventsOfWrapper",value:function(){var _=this.props.children,P=this.getTooltipEventType(),A=Gr(_,Yr),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=bh(this.props,this.handleOuterEvent);return ye(ye({},k),O)}},{key:"addListener",value:function(){o1.on(l1,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){o1.removeListener(l1,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===zs(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=HI(A,2),k=O[0],R=O[1];return ye(ye({},P),{},gt({},k,R.scale))},{}):null}},{key:"getYScales",value:function(){var _=this.state.yAxisMap;return _?Object.entries(_).reduce(function(P,A){var O=HI(A,2),k=O[0],R=O[1];return ye(ye({},P),{},gt({},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,L=B.type.defaultProps!==void 0?ye(ye({},B.type.defaultProps),B.props):B.props,G=zs(B.type);if(G==="Bar"){var U=(z.data||[]).find(function(T){return zie(_,T)});if(U)return{graphicalItem:M,payload:U}}else if(G==="RadialBar"){var H=(z.data||[]).find(function(T){return nT(_,T)});if(H)return{graphicalItem:M,payload:H}}else if(kv(M,O)||Rv(M,O)||zd(M,O)){var Q=ule({graphicalItem:M,activeTooltipItem:O,itemData:L.data}),J=L.activeIndex===void 0?Q:L.activeIndex;return{graphicalItem:ye(ye({},M),{},{childIndex:J}),payload:zd(M,O)?L.data[Q]:M.props.data[Q]}}}return null}},{key:"render",value:function(){var _=this;if(!pO(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,L=P.desc,G=KI(P,_de),U=vt(G,!1);if(z)return q.createElement(PI,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},q.createElement(q1,Il({},U,{width:k,height:R,title:B,desc:L}),this.renderClipPath(),mO(A,this.renderMap)));if(this.props.accessibilityLayer){var H,Q;U.tabIndex=(H=this.props.tabIndex)!==null&&H!==void 0?H:0,U.role=(Q=this.props.role)!==null&&Q!==void 0?Q:"application",U.onKeyDown=function(T){_.accessibilityManager.keyboardEvent(T)},U.onFocus=function(){_.accessibilityManager.focus()}}var J=this.parseEventsOfWrapper();return q.createElement(PI,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},q.createElement("div",Il({className:St("recharts-wrapper",O),style:ye({position:"relative",cursor:"default",width:k,height:R},M)},J,{ref:function(D){_.container=D}}),q.createElement(q1,Il({},U,{width:k,height:R,title:B,desc:L,style:qde}),this.renderClipPath(),mO(A,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(v.Component);gt(j,"displayName",n),gt(j,"defaultProps",ye({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},p)),gt(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 L=XI(x);return ye(ye(ye({},L),{},{updateId:0},g(ye(ye({props:x},L),{},{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||!zl(M,S.prevMargin)){var G=XI(x),U={chartX:S.chartX,chartY:S.chartY,isTooltipActive:S.isTooltipActive},H=ye(ye({},YI(S,_,k)),{},{updateId:S.updateId+1}),Q=ye(ye(ye({},G),U),H);return ye(ye(ye({},Q),g(ye({props:x},Q),S)),{},{prevDataKey:N,prevData:_,prevWidth:A,prevHeight:O,prevLayout:k,prevStackOffset:R,prevMargin:M,prevChildren:P})}if(!z1(P,S.prevChildren)){var J,T,D,X,F=Gr(P,pc),$=F&&(J=(T=F.props)===null||T===void 0?void 0:T.startIndex)!==null&&J!==void 0?J:z,ee=F&&(D=(X=F.props)===null||X===void 0?void 0:X.endIndex)!==null&&D!==void 0?D:B,ae=$!==z||ee!==B,K=!jt(_),le=K&&!ae?S.updateId:S.updateId+1;return ye(ye({updateId:le},g(ye(ye({props:x},S),{},{updateId:le,dataStartIndex:$,dataEndIndex:ee}),S)),{},{prevChildren:P,dataStartIndex:$,dataEndIndex:ee})}return null}),gt(j,"renderActiveDot",function(x,S,N){var _;return v.isValidElement(x)?_=v.cloneElement(x,S):wt(x)?_=x(S):_=q.createElement(_v,S),q.createElement(Dt,{className:"recharts-active-dot",key:N},_)});var b=v.forwardRef(function(S,N){return q.createElement(j,Il({},S,{ref:N}))});return b.displayName=j.displayName,b},JI=QN({chartName:"LineChart",GraphicalChild:bc,axisComponents:[{axisType:"xAxis",AxisComp:ko},{axisType:"yAxis",AxisComp:Ro}],formatAxisMap:a4}),Zde=QN({chartName:"BarChart",GraphicalChild:Wo,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:ko},{axisType:"yAxis",AxisComp:Ro}],formatAxisMap:a4}),efe=QN({chartName:"PieChart",GraphicalChild:ti,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Ov},{axisType:"radiusAxis",AxisComp:Ev}],formatAxisMap:Jre,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const tfe=()=>{const{configs:e}=cf(),{source:t}=In(),[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(o$,{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(bt,{to:"/mcp-evaluations/new",children:[s.jsx(OS,{className:"mr-2 h-4 w-4"}),"New MCP Evaluation"]})}),s.jsx(se,{variant:"outline",asChild:!0,children:s.jsxs(bt,{to:"/run",children:[s.jsx(Dl,{className:"mr-2 h-4 w-4"}),"Run Evaluation"]})}),s.jsx(se,{variant:"outline",asChild:!0,children:s.jsxs(bt,{to:"/results",children:[s.jsx(id,{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($s,{title:"MCP Evaluations",value:f,icon:w1,subtitle:`${f} active`}),s.jsx($s,{title:"Total Runs",value:h,icon:n$,subtitle:"Last 30 days"}),s.jsx($s,{title:"Pass Rate",value:`${Math.round(p*100)}%`,icon:id,subtitle:"+5% from last week",trend:"up"}),s.jsx($s,{title:"Avg Latency",value:`${y}ms`,icon:f$,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(Ct,{className:"pb-3",children:s.jsx(_t,{className:"text-base",children:"Pass Rate Trend"})}),s.jsx(qe,{children:s.jsx(rj,{width:"100%",height:200,children:s.jsxs(JI,{data:j,children:[s.jsx(ko,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(Ro,{domain:[0,100],tick:{fontSize:11},tickLine:!1,axisLine:!1,tickFormatter:x=>`${x}%`}),s.jsx(Yr,{formatter:x=>[`${x}%`,"Pass Rate"]}),s.jsx(bc,{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(Ct,{className:"pb-3",children:s.jsx(_t,{className:"text-base",children:"Recent Tool Latency (ms)"})}),s.jsx(qe,{children:s.jsx(rj,{width:"100%",height:200,children:s.jsxs(JI,{data:j,children:[s.jsx(ko,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(Ro,{tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(Yr,{formatter:x=>[`${x}ms`,"Latency"]}),s.jsx(bc,{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(Ct,{className:"pb-3",children:s.jsx(_t,{className:"text-base",children:"Recent Runs"})}),s.jsx(qe,{className:"p-0",children:s.jsxs(Zr,{children:[s.jsx(ea,{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(cs,{className:"h-3.5 w-3.5"}):s.jsx(Vt,{className:"h-3.5 w-3.5"}):s.jsx(Ml,{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(cs,{className:"h-3.5 w-3.5"}):s.jsx(Vt,{className:"h-3.5 w-3.5"}):s.jsx(Ml,{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(cs,{className:"h-3.5 w-3.5"}):s.jsx(Vt,{className:"h-3.5 w-3.5"}):s.jsx(Ml,{className:"h-3.5 w-3.5 text-muted-foreground"})]})})]})}),s.jsx(ta,{children:g.map(x=>s.jsxs(Ut,{className:"cursor-pointer",children:[s.jsx(He,{children:s.jsx(bt,{to:`/results/${x.id}`,className:"font-mono text-xs text-primary hover:underline",children:x.id})}),s.jsx(He,{className:"text-[11px] text-muted-foreground",children:(()=>{const S=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(He,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(ef,{className:"h-3 w-3"}),new Date(x.timestamp).toLocaleString()]})}),s.jsx(He,{children:s.jsx(bo,{rate:x.overallPassRate})}),s.jsx(He,{className:"text-right font-mono text-sm",children:x.totalScenarios})]},x.id))})]})})]})})]})};var nfe=v.createContext(void 0);function Wc(e){const t=v.useContext(nfe);return e||t||"ltr"}var u1="rovingFocusGroup.onEntryFocus",rfe={bubbles:!1,cancelable:!0},xf="RovingFocusGroup",[oS,z4,afe]=Jd(xf),[sfe,Bv]=or(xf,[afe]),[ife,ofe]=sfe(xf),U4=v.forwardRef((e,t)=>s.jsx(oS.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(oS.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(lfe,{...e,ref:t})})}));U4.displayName=xf;var lfe=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=mt(t,y),j=Wc(i),[b,x]=sa({prop:o,defaultProp:c??null,onChange:d,caller:xf}),[S,N]=v.useState(!1),_=Tn(f),P=z4(n),A=v.useRef(!1),[O,k]=v.useState(0);return v.useEffect(()=>{const R=y.current;if(R)return R.addEventListener(u1,_),()=>R.removeEventListener(u1,_)},[_]),s.jsx(ife,{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(ze.div,{tabIndex:S||O===0?-1:0,"data-orientation":r,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:Ee(e.onMouseDown,()=>{A.current=!0}),onFocus:Ee(e.onFocus,R=>{const M=!A.current;if(R.target===R.currentTarget&&M&&!S){const z=new CustomEvent(u1,rfe);if(R.currentTarget.dispatchEvent(z),!z.defaultPrevented){const B=P().filter(Q=>Q.focusable),L=B.find(Q=>Q.active),G=B.find(Q=>Q.id===b),H=[L,G,...B].filter(Boolean).map(Q=>Q.ref.current);V4(H,h)}}A.current=!1}),onBlur:Ee(e.onBlur,()=>N(!1))})})}),q4="RovingFocusGroupItem",W4=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:i,children:o,...c}=e,d=Vn(),f=i||d,h=ofe(q4,n),p=h.currentTabStopId===f,y=z4(n),{onFocusableItemAdd:g,onFocusableItemRemove:j,currentTabStopId:b}=h;return v.useEffect(()=>{if(r)return g(),()=>j()},[r,g,j]),s.jsx(oS.ItemSlot,{scope:n,id:f,focusable:r,active:a,children:s.jsx(ze.span,{tabIndex:p?0:-1,"data-orientation":h.orientation,...c,ref:t,onMouseDown:Ee(e.onMouseDown,x=>{r?h.onItemFocus(f):x.preventDefault()}),onFocus:Ee(e.onFocus,()=>h.onItemFocus(f)),onKeyDown:Ee(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){h.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const S=dfe(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?ffe(_,P+1):_.slice(P+1)}setTimeout(()=>V4(_))}}),children:typeof o=="function"?o({isCurrentTabStop:p,hasTabStop:b!=null}):o})})});W4.displayName=q4;var cfe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ufe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function dfe(e,t,n){const r=ufe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return cfe[r]}function V4(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function ffe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var H4=U4,K4=W4;function pfe(e){const t=hfe(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(vfe);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 hfe(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=yfe(a),c=gfe(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Cr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var mfe=Symbol("radix.slottable");function vfe(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===mfe}function gfe(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 yfe(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 lS=["Enter"," "],xfe=["ArrowDown","PageUp","Home"],G4=["ArrowUp","PageDown","End"],bfe=[...xfe,...G4],wfe={ltr:[...lS,"ArrowRight"],rtl:[...lS,"ArrowLeft"]},jfe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},bf="Menu",[Gd,Sfe,Nfe]=Jd(bf),[Vo,Y4]=or(bf,[Nfe,Bi,Bv]),zv=Bi(),X4=Bv(),[Cfe,Ho]=Vo(bf),[_fe,wf]=Vo(bf),Q4=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:i,modal:o=!0}=e,c=zv(t),[d,f]=v.useState(null),h=v.useRef(!1),p=Tn(i),y=Wc(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(Dm,{...c,children:s.jsx(Cfe,{scope:t,open:n,onOpenChange:p,content:d,onContentChange:f,children:s.jsx(_fe,{scope:t,onClose:v.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:h,dir:y,modal:o,children:r})})})};Q4.displayName=bf;var Afe="MenuAnchor",JN=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=zv(n);return s.jsx(nf,{...a,...r,ref:t})});JN.displayName=Afe;var ZN="MenuPortal",[Efe,J4]=Vo(ZN,{forceMount:void 0}),Z4=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,i=Ho(ZN,t);return s.jsx(Efe,{scope:t,forceMount:n,children:s.jsx(Kn,{present:n||i.open,children:s.jsx(Ec,{asChild:!0,container:a,children:r})})})};Z4.displayName=ZN;var ja="MenuContent",[Pfe,eC]=Vo(ja),eF=v.forwardRef((e,t)=>{const n=J4(ja,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=Ho(ja,e.__scopeMenu),o=wf(ja,e.__scopeMenu);return s.jsx(Gd.Provider,{scope:e.__scopeMenu,children:s.jsx(Kn,{present:r||i.open,children:s.jsx(Gd.Slot,{scope:e.__scopeMenu,children:o.modal?s.jsx(Ofe,{...a,ref:t}):s.jsx(kfe,{...a,ref:t})})})})}),Ofe=v.forwardRef((e,t)=>{const n=Ho(ja,e.__scopeMenu),r=v.useRef(null),a=mt(t,r);return v.useEffect(()=>{const i=r.current;if(i)return Qm(i)},[]),s.jsx(tC,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ee(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),kfe=v.forwardRef((e,t)=>{const n=Ho(ja,e.__scopeMenu);return s.jsx(tC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Rfe=pfe("MenuContent.ScrollLock"),tC=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=Ho(ja,n),S=wf(ja,n),N=zv(n),_=X4(n),P=Sfe(n),[A,O]=v.useState(null),k=v.useRef(null),R=mt(t,k,x.onContentChange),M=v.useRef(0),z=v.useRef(""),B=v.useRef(0),L=v.useRef(null),G=v.useRef("right"),U=v.useRef(0),H=j?af:v.Fragment,Q=j?{as:Rfe,allowPinchZoom:!0}:void 0,J=D=>{const X=z.current+D,F=P().filter(ie=>!ie.disabled),$=document.activeElement,ee=F.find(ie=>ie.ref.current===$)?.textValue,ae=F.map(ie=>ie.textValue),K=Wfe(ae,X,ee),le=F.find(ie=>ie.textValue===K)?.ref.current;(function ie(fe){z.current=fe,window.clearTimeout(M.current),fe!==""&&(M.current=window.setTimeout(()=>ie(""),1e3))})(X),le&&setTimeout(()=>le.focus())};v.useEffect(()=>()=>window.clearTimeout(M.current),[]),Ym();const T=v.useCallback(D=>G.current===L.current?.side&&Hfe(D,L.current?.area),[]);return s.jsx(Pfe,{scope:n,searchRef:z,onItemEnter:v.useCallback(D=>{T(D)&&D.preventDefault()},[T]),onItemLeave:v.useCallback(D=>{T(D)||(k.current?.focus(),O(null))},[T]),onTriggerLeave:v.useCallback(D=>{T(D)&&D.preventDefault()},[T]),pointerGraceTimerRef:B,onPointerGraceIntentChange:v.useCallback(D=>{L.current=D},[]),children:s.jsx(H,{...Q,children:s.jsx(rf,{asChild:!0,trapped:a,onMountAutoFocus:Ee(i,D=>{D.preventDefault(),k.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:s.jsx($o,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:y,onDismiss:g,children:s.jsx(H4,{asChild:!0,..._,dir:S.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:O,onEntryFocus:Ee(d,D=>{S.isUsingKeyboardRef.current||D.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(Lm,{role:"menu","aria-orientation":"vertical","data-state":vF(x.open),"data-radix-menu-content":"",dir:S.dir,...N,...b,ref:R,style:{outline:"none",...b.style},onKeyDown:Ee(b.onKeyDown,D=>{const F=D.target.closest("[data-radix-menu-content]")===D.currentTarget,$=D.ctrlKey||D.altKey||D.metaKey,ee=D.key.length===1;F&&(D.key==="Tab"&&D.preventDefault(),!$&&ee&&J(D.key));const ae=k.current;if(D.target!==ae||!bfe.includes(D.key))return;D.preventDefault();const le=P().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);G4.includes(D.key)&&le.reverse(),Ufe(le)}),onBlur:Ee(e.onBlur,D=>{D.currentTarget.contains(D.target)||(window.clearTimeout(M.current),z.current="")}),onPointerMove:Ee(e.onPointerMove,Yd(D=>{const X=D.target,F=U.current!==D.clientX;if(D.currentTarget.contains(X)&&F){const $=D.clientX>U.current?"right":"left";G.current=$,U.current=D.clientX}}))})})})})})})});eF.displayName=ja;var Tfe="MenuGroup",nC=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(ze.div,{role:"group",...r,ref:t})});nC.displayName=Tfe;var Ife="MenuLabel",tF=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(ze.div,{...r,ref:t})});tF.displayName=Ife;var xm="MenuItem",ZI="menu.itemSelect",Uv=v.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...a}=e,i=v.useRef(null),o=wf(xm,e.__scopeMenu),c=eC(xm,e.__scopeMenu),d=mt(t,i),f=v.useRef(!1),h=()=>{const p=i.current;if(!n&&p){const y=new CustomEvent(ZI,{bubbles:!0,cancelable:!0});p.addEventListener(ZI,g=>r?.(g),{once:!0}),NS(p,y),y.defaultPrevented?f.current=!1:o.onClose()}};return s.jsx(nF,{...a,ref:d,disabled:n,onClick:Ee(e.onClick,h),onPointerDown:p=>{e.onPointerDown?.(p),f.current=!0},onPointerUp:Ee(e.onPointerUp,p=>{f.current||p.currentTarget?.click()}),onKeyDown:Ee(e.onKeyDown,p=>{const y=c.searchRef.current!=="";n||y&&p.key===" "||lS.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Uv.displayName=xm;var nF=v.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:a,...i}=e,o=eC(xm,n),c=X4(n),d=v.useRef(null),f=mt(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(Gd.ItemSlot,{scope:n,disabled:r,textValue:a??y,children:s.jsx(K4,{asChild:!0,...c,focusable:!r,children:s.jsx(ze.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:f,onPointerMove:Ee(e.onPointerMove,Yd(j=>{r?o.onItemLeave(j):(o.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ee(e.onPointerLeave,Yd(j=>o.onItemLeave(j))),onFocus:Ee(e.onFocus,()=>p(!0)),onBlur:Ee(e.onBlur,()=>p(!1))})})})}),Mfe="MenuCheckboxItem",rF=v.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...a}=e;return s.jsx(lF,{scope:e.__scopeMenu,checked:n,children:s.jsx(Uv,{role:"menuitemcheckbox","aria-checked":bm(n)?"mixed":n,...a,ref:t,"data-state":aC(n),onSelect:Ee(a.onSelect,()=>r?.(bm(n)?!0:!n),{checkForDefaultPrevented:!1})})})});rF.displayName=Mfe;var aF="MenuRadioGroup",[$fe,Dfe]=Vo(aF,{value:void 0,onValueChange:()=>{}}),sF=v.forwardRef((e,t)=>{const{value:n,onValueChange:r,...a}=e,i=Tn(r);return s.jsx($fe,{scope:e.__scopeMenu,value:n,onValueChange:i,children:s.jsx(nC,{...a,ref:t})})});sF.displayName=aF;var iF="MenuRadioItem",oF=v.forwardRef((e,t)=>{const{value:n,...r}=e,a=Dfe(iF,e.__scopeMenu),i=n===a.value;return s.jsx(lF,{scope:e.__scopeMenu,checked:i,children:s.jsx(Uv,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":aC(i),onSelect:Ee(r.onSelect,()=>a.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});oF.displayName=iF;var rC="MenuItemIndicator",[lF,Lfe]=Vo(rC,{checked:!1}),cF=v.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...a}=e,i=Lfe(rC,n);return s.jsx(Kn,{present:r||bm(i.checked)||i.checked===!0,children:s.jsx(ze.span,{...a,ref:t,"data-state":aC(i.checked)})})});cF.displayName=rC;var Ffe="MenuSeparator",uF=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(ze.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});uF.displayName=Ffe;var Bfe="MenuArrow",dF=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=zv(n);return s.jsx(Fm,{...a,...r,ref:t})});dF.displayName=Bfe;var zfe="MenuSub",[Pge,fF]=Vo(zfe),Gu="MenuSubTrigger",pF=v.forwardRef((e,t)=>{const n=Ho(Gu,e.__scopeMenu),r=wf(Gu,e.__scopeMenu),a=fF(Gu,e.__scopeMenu),i=eC(Gu,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(JN,{asChild:!0,...f,children:s.jsx(nF,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":vF(n.open),...e,ref:Cr(t,a.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ee(e.onPointerMove,Yd(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:Ee(e.onPointerLeave,Yd(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:Ee(e.onKeyDown,p=>{const y=i.searchRef.current!=="";e.disabled||y&&p.key===" "||wfe[r.dir].includes(p.key)&&(n.onOpenChange(!0),n.content?.focus(),p.preventDefault())})})})});pF.displayName=Gu;var hF="MenuSubContent",mF=v.forwardRef((e,t)=>{const n=J4(ja,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=Ho(ja,e.__scopeMenu),o=wf(ja,e.__scopeMenu),c=fF(hF,e.__scopeMenu),d=v.useRef(null),f=mt(t,d);return s.jsx(Gd.Provider,{scope:e.__scopeMenu,children:s.jsx(Kn,{present:r||i.open,children:s.jsx(Gd.Slot,{scope:e.__scopeMenu,children:s.jsx(tC,{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:Ee(e.onFocusOutside,h=>{h.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Ee(e.onEscapeKeyDown,h=>{o.onClose(),h.preventDefault()}),onKeyDown:Ee(e.onKeyDown,h=>{const p=h.currentTarget.contains(h.target),y=jfe[o.dir].includes(h.key);p&&y&&(i.onOpenChange(!1),c.trigger?.focus(),h.preventDefault())})})})})})});mF.displayName=hF;function vF(e){return e?"open":"closed"}function bm(e){return e==="indeterminate"}function aC(e){return bm(e)?"indeterminate":e?"checked":"unchecked"}function Ufe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function qfe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Wfe(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=qfe(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 Vfe(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 Hfe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Vfe(n,t)}function Yd(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Kfe=Q4,Gfe=JN,Yfe=Z4,Xfe=eF,Qfe=nC,Jfe=tF,Zfe=Uv,epe=rF,tpe=sF,npe=oF,rpe=cF,ape=uF,spe=dF,ipe=pF,ope=mF,qv="DropdownMenu",[lpe]=or(qv,[Y4]),_r=Y4(),[cpe,gF]=lpe(qv),yF=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:i,onOpenChange:o,modal:c=!0}=e,d=_r(t),f=v.useRef(null),[h,p]=sa({prop:a,defaultProp:i??!1,onChange:o,caller:qv});return s.jsx(cpe,{scope:t,triggerId:Vn(),triggerRef:f,contentId:Vn(),open:h,onOpenChange:p,onOpenToggle:v.useCallback(()=>p(y=>!y),[p]),modal:c,children:s.jsx(Kfe,{...d,open:h,onOpenChange:p,dir:r,modal:c,children:n})})};yF.displayName=qv;var xF="DropdownMenuTrigger",bF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...a}=e,i=gF(xF,n),o=_r(n);return s.jsx(Gfe,{asChild:!0,...o,children:s.jsx(ze.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...a,ref:Cr(t,i.triggerRef),onPointerDown:Ee(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(i.onOpenToggle(),i.open||c.preventDefault())}),onKeyDown:Ee(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&i.onOpenToggle(),c.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});bF.displayName=xF;var upe="DropdownMenuPortal",wF=e=>{const{__scopeDropdownMenu:t,...n}=e,r=_r(t);return s.jsx(Yfe,{...r,...n})};wF.displayName=upe;var jF="DropdownMenuContent",SF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=gF(jF,n),i=_r(n),o=v.useRef(!1);return s.jsx(Xfe,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...r,ref:t,onCloseAutoFocus:Ee(e.onCloseAutoFocus,c=>{o.current||a.triggerRef.current?.focus(),o.current=!1,c.preventDefault()}),onInteractOutside:Ee(e.onInteractOutside,c=>{const d=c.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0,h=d.button===2||f;(!a.modal||h)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});SF.displayName=jF;var dpe="DropdownMenuGroup",fpe=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=_r(n);return s.jsx(Qfe,{...a,...r,ref:t})});fpe.displayName=dpe;var ppe="DropdownMenuLabel",NF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=_r(n);return s.jsx(Jfe,{...a,...r,ref:t})});NF.displayName=ppe;var hpe="DropdownMenuItem",CF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=_r(n);return s.jsx(Zfe,{...a,...r,ref:t})});CF.displayName=hpe;var mpe="DropdownMenuCheckboxItem",_F=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=_r(n);return s.jsx(epe,{...a,...r,ref:t})});_F.displayName=mpe;var vpe="DropdownMenuRadioGroup",gpe=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=_r(n);return s.jsx(tpe,{...a,...r,ref:t})});gpe.displayName=vpe;var ype="DropdownMenuRadioItem",AF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=_r(n);return s.jsx(npe,{...a,...r,ref:t})});AF.displayName=ype;var xpe="DropdownMenuItemIndicator",EF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=_r(n);return s.jsx(rpe,{...a,...r,ref:t})});EF.displayName=xpe;var bpe="DropdownMenuSeparator",PF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=_r(n);return s.jsx(ape,{...a,...r,ref:t})});PF.displayName=bpe;var wpe="DropdownMenuArrow",jpe=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=_r(n);return s.jsx(spe,{...a,...r,ref:t})});jpe.displayName=wpe;var Spe="DropdownMenuSubTrigger",OF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=_r(n);return s.jsx(ipe,{...a,...r,ref:t})});OF.displayName=Spe;var Npe="DropdownMenuSubContent",kF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=_r(n);return s.jsx(ope,{...a,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});kF.displayName=Npe;var Cpe=yF,_pe=bF,Ape=wF,RF=SF,TF=NF,IF=CF,MF=_F,$F=AF,DF=EF,LF=PF,FF=OF,BF=kF;const Vc=Cpe,Hc=_pe,Epe=v.forwardRef(({className:e,inset:t,children:n,...r},a)=>s.jsxs(FF,{ref:a,className:xe("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(r$,{className:"ml-auto h-4 w-4"})]}));Epe.displayName=FF.displayName;const Ppe=v.forwardRef(({className:e,...t},n)=>s.jsx(BF,{ref:n,className:xe("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}));Ppe.displayName=BF.displayName;const Ko=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(Ape,{children:s.jsx(RF,{ref:r,sideOffset:t,className:xe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Ko.displayName=RF.displayName;const gr=v.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(IF,{ref:r,className:xe("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}));gr.displayName=IF.displayName;const Ope=v.forwardRef(({className:e,children:t,checked:n,...r},a)=>s.jsxs(MF,{ref:a,className:xe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),checked:n,...r,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(DF,{children:s.jsx(Yl,{className:"h-4 w-4"})})}),t]}));Ope.displayName=MF.displayName;const kpe=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs($F,{ref:r,className:xe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(DF,{children:s.jsx(O7,{className:"h-2 w-2 fill-current"})})}),t]}));kpe.displayName=$F.displayName;const sC=v.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(TF,{ref:r,className:xe("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));sC.displayName=TF.displayName;const iC=v.forwardRef(({className:e,...t},n)=>s.jsx(LF,{ref:n,className:xe("-mx-1 my-1 h-px bg-muted",e),...t}));iC.displayName=LF.displayName;const zu=e=>e.configName?.trim()||e.name,Rpe=()=>{const{configs:e,deleteConfig:t,cloneConfig:n,loading:r,reload:a}=cf(),i=_a(),[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),_e({title:"Deleted",description:`"${N}" has been removed.`})},y=async S=>{const N=await n(S);_e({title:"Cloned",description:`Created "${zu(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=zu(N).localeCompare(zu(_))),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(Ml,{className:"h-3.5 w-3.5 text-muted-foreground"}):d==="asc"?s.jsx(cs,{className:"h-3.5 w-3.5"}):s.jsx(Vt,{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(i$,{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(Sa,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(se,{variant:"outline",size:"sm",children:[s.jsx(D7,{className:"mr-2 h-4 w-4"}),"Import YAML"]}),s.jsx(se,{size:"sm",asChild:!0,children:s.jsxs(bt,{to:"/mcp-evaluations/new",children:[s.jsx(ps,{className:"mr-2 h-4 w-4"}),"Create New"]})})]})]}),s.jsx(Ue,{children:s.jsx(qe,{className:"p-0",children:s.jsxs(Zr,{children:[s.jsx(ea,{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(ta,{children:[b.map(S=>s.jsxs(Ut,{children:[s.jsx(He,{children:s.jsxs("div",{children:[s.jsx(bt,{to:`/mcp-evaluations/${S.id}`,className:"font-medium text-sm hover:text-primary",children:zu(S)}),S.loadError&&s.jsxs(Qe,{variant:"destructive",className:"ml-2 align-middle text-[10px]",children:[s.jsx(ah,{className:"mr-1 h-3 w-3"}),"Broken"]}),S.description&&s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:S.description}),S.loadError&&s.jsx("p",{className:"text-xs text-destructive mt-0.5 break-all",children:S.loadError})]})}),s.jsx(He,{className:"text-right font-mono text-sm",children:j(S)}),s.jsx(He,{className:"text-right font-mono text-sm",children:g(S)}),s.jsx(He,{className:"text-right text-xs text-muted-foreground",children:new Date(S.updatedAt).toLocaleDateString()}),s.jsx(He,{children:s.jsxs(Vc,{children:[s.jsx(Hc,{asChild:!0,children:s.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Om,{className:"h-4 w-4"})})}),s.jsxs(Ko,{align:"end",children:[s.jsxs(gr,{onClick:()=>i(`/mcp-evaluations/${S.id}`),children:[s.jsx(km,{className:"mr-2 h-3.5 w-3.5"}),"Edit"]}),s.jsxs(gr,{onClick:()=>{y(S.id)},children:[s.jsx($i,{className:"mr-2 h-3.5 w-3.5"}),"Clone"]}),s.jsxs(gr,{children:[s.jsx(wa,{className:"mr-2 h-3.5 w-3.5"}),"Download YAML"]}),s.jsxs(gr,{className:"text-destructive",onClick:()=>{p(S.id,zu(S))},children:[s.jsx(Na,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]})})]},S.id)),!r&&e.length===0&&s.jsx(Ut,{children:s.jsx(He,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"No MCP evaluations yet. Create your first one to get started."})}),r&&s.jsx(Ut,{children:s.jsx(He,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"Loading MCP evaluations..."})})]})]})})})]})};var Tpe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ipe=Tpe.reduce((e,t)=>{const n=Gm(`Primitive.${t}`),r=v.forwardRef((a,i)=>{const{asChild:o,...c}=a,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Mpe="Label",zF=v.forwardRef((e,t)=>s.jsx(Ipe.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));zF.displayName=Mpe;var UF=zF;const $pe=Do("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),$e=v.forwardRef(({className:e,...t},n)=>s.jsx(UF,{ref:n,className:xe($pe(),e),...t}));$e.displayName=UF.displayName;const Ua=v.forwardRef(({className:e,...t},n)=>s.jsx("textarea",{className:xe("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}));Ua.displayName="Textarea";function Wv(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Vv="Switch",[Dpe]=or(Vv),[Lpe,Fpe]=Dpe(Vv),qF=v.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:a,defaultChecked:i,required:o,disabled:c,value:d="on",onCheckedChange:f,form:h,...p}=e,[y,g]=v.useState(null),j=mt(t,_=>g(_)),b=v.useRef(!1),x=y?h||!!y.closest("form"):!0,[S,N]=sa({prop:a,defaultProp:i??!1,onChange:f,caller:Vv});return s.jsxs(Lpe,{scope:n,checked:S,disabled:c,children:[s.jsx(ze.button,{type:"button",role:"switch","aria-checked":S,"aria-required":o,"data-state":KF(S),"data-disabled":c?"":void 0,disabled:c,value:d,...p,ref:j,onClick:Ee(e.onClick,_=>{N(P=>!P),x&&(b.current=_.isPropagationStopped(),b.current||_.stopPropagation())})}),x&&s.jsx(HF,{control:y,bubbles:!b.current,name:r,value:d,checked:S,required:o,disabled:c,form:h,style:{transform:"translateX(-100%)"}})]})});qF.displayName=Vv;var WF="SwitchThumb",VF=v.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,a=Fpe(WF,n);return s.jsx(ze.span,{"data-state":KF(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});VF.displayName=WF;var Bpe="SwitchBubbleInput",HF=v.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...a},i)=>{const o=v.useRef(null),c=mt(o,i),d=Wv(n),f=$m(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}})});HF.displayName=Bpe;function KF(e){return e?"checked":"unchecked"}var GF=qF,zpe=VF;const wm=v.forwardRef(({className:e,...t},n)=>s.jsx(GF,{className:xe("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(zpe,{className:xe("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")})}));wm.displayName=GF.displayName;var Hv="Tabs",[Upe]=or(Hv,[Bv]),YF=Bv(),[qpe,oC]=Upe(Hv),XF=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:o="horizontal",dir:c,activationMode:d="automatic",...f}=e,h=Wc(c),[p,y]=sa({prop:r,onChange:a,defaultProp:i??"",caller:Hv});return s.jsx(qpe,{scope:n,baseId:Vn(),value:p,onValueChange:y,orientation:o,dir:h,activationMode:d,children:s.jsx(ze.div,{dir:h,"data-orientation":o,...f,ref:t})})});XF.displayName=Hv;var QF="TabsList",JF=v.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,i=oC(QF,n),o=YF(n);return s.jsx(H4,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:r,children:s.jsx(ze.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});JF.displayName=QF;var ZF="TabsTrigger",eB=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,o=oC(ZF,n),c=YF(n),d=rB(o.baseId,r),f=aB(o.baseId,r),h=r===o.value;return s.jsx(K4,{asChild:!0,...c,focusable:!a,active:h,children:s.jsx(ze.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:Ee(e.onMouseDown,p=>{!a&&p.button===0&&p.ctrlKey===!1?o.onValueChange(r):p.preventDefault()}),onKeyDown:Ee(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&o.onValueChange(r)}),onFocus:Ee(e.onFocus,()=>{const p=o.activationMode!=="manual";!h&&!a&&p&&o.onValueChange(r)})})})});eB.displayName=ZF;var tB="TabsContent",nB=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:i,...o}=e,c=oC(tB,n),d=rB(c.baseId,r),f=aB(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(ze.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})})});nB.displayName=tB;function rB(e,t){return`${e}-trigger-${t}`}function aB(e,t){return`${e}-content-${t}`}var Wpe=XF,sB=JF,iB=eB,oB=nB;const lC=Wpe,Kv=v.forwardRef(({className:e,...t},n)=>s.jsx(sB,{ref:n,className:xe("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Kv.displayName=sB.displayName;const Ii=v.forwardRef(({className:e,...t},n)=>s.jsx(iB,{ref:n,className:xe("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}));Ii.displayName=iB.displayName;const Xd=v.forwardRef(({className:e,...t},n)=>s.jsx(oB,{ref:n,className:xe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Xd.displayName=oB.displayName;const eM={openai:"bg-emerald-100 text-emerald-800",anthropic:"bg-orange-100 text-orange-800",azure:"bg-blue-100 text-blue-800",google:"bg-yellow-100 text-yellow-800",custom:"bg-gray-100 text-gray-800"};function lB({provider:e}){return s.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${eM[e]??eM.custom}`,children:e})}function Qd(e,[t,n]){return Math.min(n,Math.max(t,e))}function Vpe(e){const t=Hpe(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(Gpe);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 Hpe(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=Xpe(a),c=Ype(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Cr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Kpe=Symbol("radix.slottable");function Gpe(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Kpe}function Ype(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 Xpe(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 Qpe=[" ","Enter","ArrowUp","ArrowDown"],Jpe=[" ","Enter"],To="Select",[Gv,Yv,Zpe]=Jd(To),[Kc]=or(To,[Zpe,Bi]),Xv=Bi(),[ehe,Hi]=Kc(To),[the,nhe]=Kc(To),cB=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:i,value:o,defaultValue:c,onValueChange:d,dir:f,name:h,autoComplete:p,disabled:y,required:g,form:j}=e,b=Xv(t),[x,S]=v.useState(null),[N,_]=v.useState(null),[P,A]=v.useState(!1),O=Wc(f),[k,R]=sa({prop:r,defaultProp:a??!1,onChange:i,caller:To}),[M,z]=sa({prop:o,defaultProp:c,onChange:d,caller:To}),B=v.useRef(null),L=x?j||!!x.closest("form"):!0,[G,U]=v.useState(new Set),H=Array.from(G).map(Q=>Q.props.value).join(";");return s.jsx(Dm,{...b,children:s.jsxs(ehe,{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(Gv.Provider,{scope:t,children:s.jsx(the,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(Q=>{U(J=>new Set(J).add(Q))},[]),onNativeOptionRemove:v.useCallback(Q=>{U(J=>{const T=new Set(J);return T.delete(Q),T})},[]),children:n})}),L?s.jsxs(TB,{"aria-hidden":!0,required:g,tabIndex:-1,name:h,autoComplete:p,value:M,onChange:Q=>z(Q.target.value),disabled:y,form:j,children:[M===void 0?s.jsx("option",{value:""}):null,Array.from(G)]},H):null]})})};cB.displayName=To;var uB="SelectTrigger",dB=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,i=Xv(n),o=Hi(uB,n),c=o.disabled||r,d=mt(t,o.onTriggerChange),f=Yv(n),h=v.useRef("touch"),[p,y,g]=MB(b=>{const x=f().filter(_=>!_.disabled),S=x.find(_=>_.value===o.value),N=$B(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(nf,{asChild:!0,...i,children:s.jsx(ze.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":IB(o.value)?"":void 0,...a,ref:d,onClick:Ee(a.onClick,b=>{b.currentTarget.focus(),h.current!=="mouse"&&j(b)}),onPointerDown:Ee(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:Ee(a.onKeyDown,b=>{const x=p.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&y(b.key),!(x&&b.key===" ")&&Qpe.includes(b.key)&&(j(),b.preventDefault())})})})});dB.displayName=uB;var fB="SelectValue",pB=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:i,placeholder:o="",...c}=e,d=Hi(fB,n),{onValueNodeHasChildrenChange:f}=d,h=i!==void 0,p=mt(t,d.onValueNodeChange);return Hn(()=>{f(h)},[f,h]),s.jsx(ze.span,{...c,ref:p,style:{pointerEvents:"none"},children:IB(d.value)?s.jsx(s.Fragment,{children:o}):i})});pB.displayName=fB;var rhe="SelectIcon",hB=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return s.jsx(ze.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});hB.displayName=rhe;var ahe="SelectPortal",mB=e=>s.jsx(Ec,{asChild:!0,...e});mB.displayName=ahe;var Io="SelectContent",vB=v.forwardRef((e,t)=>{const n=Hi(Io,e.__scopeSelect),[r,a]=v.useState();if(Hn(()=>{a(new DocumentFragment)},[]),!n.open){const i=r;return i?Ac.createPortal(s.jsx(gB,{scope:e.__scopeSelect,children:s.jsx(Gv.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),i):null}return s.jsx(yB,{...e,ref:t})});vB.displayName=Io;var Da=10,[gB,Ki]=Kc(Io),she="SelectContentImpl",ihe=Vpe("SelectContent.RemoveScroll"),yB=v.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:o,side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:y,collisionPadding:g,sticky:j,hideWhenDetached:b,avoidCollisions:x,...S}=e,N=Hi(Io,n),[_,P]=v.useState(null),[A,O]=v.useState(null),k=mt(t,ie=>P(ie)),[R,M]=v.useState(null),[z,B]=v.useState(null),L=Yv(n),[G,U]=v.useState(!1),H=v.useRef(!1);v.useEffect(()=>{if(_)return Qm(_)},[_]),Ym();const Q=v.useCallback(ie=>{const[fe,...oe]=L().map(ne=>ne.ref.current),[ce]=oe.slice(-1),Se=document.activeElement;for(const ne of ie)if(ne===Se||(ne?.scrollIntoView({block:"nearest"}),ne===fe&&A&&(A.scrollTop=0),ne===ce&&A&&(A.scrollTop=A.scrollHeight),ne?.focus(),document.activeElement!==Se))return},[L,A]),J=v.useCallback(()=>Q([R,_]),[Q,R,_]);v.useEffect(()=>{G&&J()},[G,J]);const{onOpenChange:T,triggerPointerDownPosRef:D}=N;v.useEffect(()=>{if(_){let ie={x:0,y:0};const fe=ce=>{ie={x:Math.abs(Math.round(ce.pageX)-(D.current?.x??0)),y:Math.abs(Math.round(ce.pageY)-(D.current?.y??0))}},oe=ce=>{ie.x<=10&&ie.y<=10?ce.preventDefault():_.contains(ce.target)||T(!1),document.removeEventListener("pointermove",fe),D.current=null};return D.current!==null&&(document.addEventListener("pointermove",fe),document.addEventListener("pointerup",oe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",fe),document.removeEventListener("pointerup",oe,{capture:!0})}}},[_,T,D]),v.useEffect(()=>{const ie=()=>T(!1);return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[T]);const[X,F]=MB(ie=>{const fe=L().filter(Se=>!Se.disabled),oe=fe.find(Se=>Se.ref.current===document.activeElement),ce=$B(fe,ie,oe);ce&&setTimeout(()=>ce.ref.current.focus())}),$=v.useCallback((ie,fe,oe)=>{const ce=!H.current&&!oe;(N.value!==void 0&&N.value===fe||ce)&&(M(ie),ce&&(H.current=!0))},[N.value]),ee=v.useCallback(()=>_?.focus(),[_]),ae=v.useCallback((ie,fe,oe)=>{const ce=!H.current&&!oe;(N.value!==void 0&&N.value===fe||ce)&&B(ie)},[N.value]),K=r==="popper"?cS:xB,le=K===cS?{side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:y,collisionPadding:g,sticky:j,hideWhenDetached:b,avoidCollisions:x}:{};return s.jsx(gB,{scope:n,content:_,viewport:A,onViewportChange:O,itemRefCallback:$,selectedItem:R,onItemLeave:ee,itemTextRefCallback:ae,focusSelectedItem:J,selectedItemText:z,position:r,isPositioned:G,searchRef:X,children:s.jsx(af,{as:ihe,allowPinchZoom:!0,children:s.jsx(rf,{asChild:!0,trapped:N.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:Ee(a,ie=>{N.trigger?.focus({preventScroll:!0}),ie.preventDefault()}),children:s.jsx($o,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:s.jsx(K,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:ie=>ie.preventDefault(),...S,...le,onPlaced:()=>U(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:Ee(S.onKeyDown,ie=>{const fe=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!fe&&ie.key.length===1&&F(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let ce=L().filter(Se=>!Se.disabled).map(Se=>Se.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(ce=ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const Se=ie.target,ne=ce.indexOf(Se);ce=ce.slice(ne+1)}setTimeout(()=>Q(ce)),ie.preventDefault()}})})})})})})});yB.displayName=she;var ohe="SelectItemAlignedPosition",xB=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,i=Hi(Io,n),o=Ki(Io,n),[c,d]=v.useState(null),[f,h]=v.useState(null),p=mt(t,k=>h(k)),y=Yv(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 Se=z.left-R.left,ne=M.left-Se,Te=k.left-ne,Ae=k.width+Te,Ye=Math.max(Ae,R.width),ge=window.innerWidth-Da,Oe=Qd(ne,[Da,Math.max(Da,ge-Ye)]);c.style.minWidth=Ae+"px",c.style.left=Oe+"px"}else{const Se=R.right-z.right,ne=window.innerWidth-M.right-Se,Te=window.innerWidth-k.right-ne,Ae=k.width+Te,Ye=Math.max(Ae,R.width),ge=window.innerWidth-Da,Oe=Qd(ne,[Da,Math.max(Da,ge-Ye)]);c.style.minWidth=Ae+"px",c.style.right=Oe+"px"}const B=y(),L=window.innerHeight-Da*2,G=b.scrollHeight,U=window.getComputedStyle(f),H=parseInt(U.borderTopWidth,10),Q=parseInt(U.paddingTop,10),J=parseInt(U.borderBottomWidth,10),T=parseInt(U.paddingBottom,10),D=H+Q+G+T+J,X=Math.min(x.offsetHeight*5,D),F=window.getComputedStyle(b),$=parseInt(F.paddingTop,10),ee=parseInt(F.paddingBottom,10),ae=k.top+k.height/2-Da,K=L-ae,le=x.offsetHeight/2,ie=x.offsetTop+le,fe=H+Q+ie,oe=D-fe;if(fe<=ae){const Se=B.length>0&&x===B[B.length-1].ref.current;c.style.bottom="0px";const ne=f.clientHeight-b.offsetTop-b.offsetHeight,Te=Math.max(K,le+(Se?ee:0)+ne+J),Ae=fe+Te;c.style.height=Ae+"px"}else{const Se=B.length>0&&x===B[0].ref.current;c.style.top="0px";const Te=Math.max(ae,H+b.offsetTop+(Se?$:0)+le)+oe;c.style.height=Te+"px",b.scrollTop=fe-ae+b.offsetTop}c.style.margin=`${Da}px 0`,c.style.minHeight=X+"px",c.style.maxHeight=L+"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(che,{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(ze.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});xB.displayName=ohe;var lhe="SelectPopperPosition",cS=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=Da,...i}=e,o=Xv(n);return s.jsx(Lm,{...o,...i,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});cS.displayName=lhe;var[che,cC]=Kc(Io,{}),uS="SelectViewport",bB=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,i=Ki(uS,n),o=cC(uS,n),c=mt(t,i.onViewportChange),d=v.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),s.jsx(Gv.Slot,{scope:n,children:s.jsx(ze.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Ee(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-Da*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})})})]})});bB.displayName=uS;var wB="SelectGroup",[uhe,dhe]=Kc(wB),fhe=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Vn();return s.jsx(uhe,{scope:n,id:a,children:s.jsx(ze.div,{role:"group","aria-labelledby":a,...r,ref:t})})});fhe.displayName=wB;var jB="SelectLabel",SB=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=dhe(jB,n);return s.jsx(ze.div,{id:a.id,...r,ref:t})});SB.displayName=jB;var jm="SelectItem",[phe,NB]=Kc(jm),CB=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:i,...o}=e,c=Hi(jm,n),d=Ki(jm,n),f=c.value===r,[h,p]=v.useState(i??""),[y,g]=v.useState(!1),j=mt(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(phe,{scope:n,value:r,disabled:a,textId:b,isSelected:f,onItemTextChange:v.useCallback(N=>{p(_=>_||(N?.textContent??"").trim())},[]),children:s.jsx(Gv.ItemSlot,{scope:n,value:r,disabled:a,textValue:h,children:s.jsx(ze.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:Ee(o.onFocus,()=>g(!0)),onBlur:Ee(o.onBlur,()=>g(!1)),onClick:Ee(o.onClick,()=>{x.current!=="mouse"&&S()}),onPointerUp:Ee(o.onPointerUp,()=>{x.current==="mouse"&&S()}),onPointerDown:Ee(o.onPointerDown,N=>{x.current=N.pointerType}),onPointerMove:Ee(o.onPointerMove,N=>{x.current=N.pointerType,a?d.onItemLeave?.():x.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ee(o.onPointerLeave,N=>{N.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Ee(o.onKeyDown,N=>{d.searchRef?.current!==""&&N.key===" "||(Jpe.includes(N.key)&&S(),N.key===" "&&N.preventDefault())})})})})});CB.displayName=jm;var Yu="SelectItemText",_B=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...i}=e,o=Hi(Yu,n),c=Ki(Yu,n),d=NB(Yu,n),f=nhe(Yu,n),[h,p]=v.useState(null),y=mt(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(ze.span,{id:d.textId,...i,ref:y}),d.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Ac.createPortal(i.children,o.valueNode):null]})});_B.displayName=Yu;var AB="SelectItemIndicator",EB=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return NB(AB,n).isSelected?s.jsx(ze.span,{"aria-hidden":!0,...r,ref:t}):null});EB.displayName=AB;var dS="SelectScrollUpButton",PB=v.forwardRef((e,t)=>{const n=Ki(dS,e.__scopeSelect),r=cC(dS,e.__scopeSelect),[a,i]=v.useState(!1),o=mt(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(kB,{...e,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});PB.displayName=dS;var fS="SelectScrollDownButton",OB=v.forwardRef((e,t)=>{const n=Ki(fS,e.__scopeSelect),r=cC(fS,e.__scopeSelect),[a,i]=v.useState(!1),o=mt(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(kB,{...e,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});OB.displayName=fS;var kB=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,i=Ki("SelectScrollButton",n),o=v.useRef(null),c=Yv(n),d=v.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return v.useEffect(()=>()=>d(),[d]),Hn(()=>{c().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),s.jsx(ze.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:Ee(a.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Ee(a.onPointerMove,()=>{i.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Ee(a.onPointerLeave,()=>{d()})})}),hhe="SelectSeparator",RB=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(ze.div,{"aria-hidden":!0,...r,ref:t})});RB.displayName=hhe;var pS="SelectArrow",mhe=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Xv(n),i=Hi(pS,n),o=Ki(pS,n);return i.open&&o.position==="popper"?s.jsx(Fm,{...a,...r,ref:t}):null});mhe.displayName=pS;var vhe="SelectBubbleInput",TB=v.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=v.useRef(null),i=mt(r,a),o=Wv(t);return v.useEffect(()=>{const c=a.current;if(!c)return;const d=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(d,"value").set;if(o!==t&&h){const p=new Event("change",{bubbles:!0});h.call(c,t),c.dispatchEvent(p)}},[o,t]),s.jsx(ze.select,{...n,style:{...IM,...n.style},ref:i,defaultValue:t})});TB.displayName=vhe;function IB(e){return e===""||e===void 0}function MB(e){const t=Tn(e),n=v.useRef(""),r=v.useRef(0),a=v.useCallback(o=>{const c=n.current+o;t(c),(function d(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(c)},[t]),i=v.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}function $B(e,t,n){const a=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=ghe(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 ghe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var yhe=cB,DB=dB,xhe=pB,bhe=hB,whe=mB,LB=vB,jhe=bB,FB=SB,BB=CB,She=_B,Nhe=EB,zB=PB,UB=OB,qB=RB;const on=yhe,ln=xhe,Zt=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(DB,{ref:r,className:xe("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(bhe,{asChild:!0,children:s.jsx(Vt,{className:"h-4 w-4 opacity-50"})})]}));Zt.displayName=DB.displayName;const WB=v.forwardRef(({className:e,...t},n)=>s.jsx(zB,{ref:n,className:xe("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(cs,{className:"h-4 w-4"})}));WB.displayName=zB.displayName;const VB=v.forwardRef(({className:e,...t},n)=>s.jsx(UB,{ref:n,className:xe("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Vt,{className:"h-4 w-4"})}));VB.displayName=UB.displayName;const en=v.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>s.jsx(whe,{children:s.jsxs(LB,{ref:a,className:xe("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[s.jsx(WB,{}),s.jsx(jhe,{className:xe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(VB,{})]})}));en.displayName=LB.displayName;const Che=v.forwardRef(({className:e,...t},n)=>s.jsx(FB,{ref:n,className:xe("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Che.displayName=FB.displayName;const it=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(BB,{ref:r,className:xe("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(Nhe,{children:s.jsx(Yl,{className:"h-4 w-4"})})}),s.jsx(She,{children:t})]}));it.displayName=BB.displayName;const _he=v.forwardRef(({className:e,...t},n)=>s.jsx(qB,{ref:n,className:xe("-mx-1 my-1 h-px bg-muted",e),...t}));_he.displayName=qB.displayName;var Qv="Collapsible",[Ahe]=or(Qv),[Ehe,uC]=Ahe(Qv),HB=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:i,onOpenChange:o,...c}=e,[d,f]=sa({prop:r,defaultProp:a??!1,onChange:o,caller:Qv});return s.jsx(Ehe,{scope:n,disabled:i,contentId:Vn(),open:d,onOpenToggle:v.useCallback(()=>f(h=>!h),[f]),children:s.jsx(ze.div,{"data-state":fC(d),"data-disabled":i?"":void 0,...c,ref:t})})});HB.displayName=Qv;var KB="CollapsibleTrigger",GB=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,a=uC(KB,n);return s.jsx(ze.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":fC(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:t,onClick:Ee(e.onClick,a.onOpenToggle)})});GB.displayName=KB;var dC="CollapsibleContent",YB=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=uC(dC,e.__scopeCollapsible);return s.jsx(Kn,{present:n||a.open,children:({present:i})=>s.jsx(Phe,{...r,ref:t,present:i})})});YB.displayName=dC;var Phe=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:a,...i}=e,o=uC(dC,n),[c,d]=v.useState(r),f=v.useRef(null),h=mt(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(ze.div,{"data-state":fC(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 fC(e){return e?"open":"closed"}var Ohe=HB;const Ei=Ohe,Ms=GB,Pi=YB,khe=Zm,Rhe=ev,XB=v.forwardRef(({className:e,...t},n)=>s.jsx(Mc,{ref:n,className:xe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));XB.displayName=Mc.displayName;const QB=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(Rhe,{children:[s.jsx(XB,{}),s.jsxs($c,{ref:r,className:xe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,s.jsxs(tv,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[s.jsx(Vs,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));QB.displayName=$c.displayName;const JB=({className:e,...t})=>s.jsx("div",{className:xe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});JB.displayName="DialogHeader";const ZB=v.forwardRef(({className:e,...t},n)=>s.jsx(sf,{ref:n,className:xe("text-lg font-semibold leading-none tracking-tight",e),...t}));ZB.displayName=sf.displayName;const e8=v.forwardRef(({className:e,...t},n)=>s.jsx(of,{ref:n,className:xe("text-sm text-muted-foreground",e),...t}));e8.displayName=of.displayName;function The(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var pC="ScrollArea",[t8]=or(pC),[Ihe,Ea]=t8(pC),n8=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:a,scrollHideDelay:i=600,...o}=e,[c,d]=v.useState(null),[f,h]=v.useState(null),[p,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=mt(t,B=>d(B)),z=Wc(a);return s.jsx(Ihe,{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(ze.div,{dir:z,...o,ref:M,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});n8.displayName=pC;var r8="ScrollAreaViewport",a8=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...i}=e,o=Ea(r8,n),c=v.useRef(null),d=mt(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(ze.div,{"data-radix-scroll-area-viewport":"",...i,ref:d,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:s.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});a8.displayName=r8;var js="ScrollAreaScrollbar",hC=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Ea(js,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(Mhe,{...r,ref:t,forceMount:n}):a.type==="scroll"?s.jsx($he,{...r,ref:t,forceMount:n}):a.type==="auto"?s.jsx(s8,{...r,ref:t,forceMount:n}):a.type==="always"?s.jsx(mC,{...r,ref:t}):null});hC.displayName=js;var Mhe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Ea(js,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(s8,{"data-state":i?"visible":"hidden",...r,ref:t})})}),$he=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Ea(js,e.__scopeScrollArea),i=e.orientation==="horizontal",o=Zv(()=>d("SCROLL_END"),100),[c,d]=The("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(mC,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ee(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Ee(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),s8=v.forwardRef((e,t)=>{const n=Ea(js,e.__scopeScrollArea),{forceMount:r,...a}=e,[i,o]=v.useState(!1),c=e.orientation==="horizontal",d=Zv(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;o(c?f:h)}},10);return Cc(n.viewport,d),Cc(n.content,d),s.jsx(Kn,{present:r||i,children:s.jsx(mC,{"data-state":i?"visible":"hidden",...a,ref:t})})}),mC=v.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,a=Ea(js,e.__scopeScrollArea),i=v.useRef(null),o=v.useRef(0),[c,d]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=u8(c.viewport,c.content),h={...r,sizes:c,onSizesChange:d,hasThumb:f>0&&f<1,onThumbChange:y=>i.current=y,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:y=>o.current=y};function p(y,g){return Uhe(y,o.current,c,g)}return n==="horizontal"?s.jsx(Dhe,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const y=a.viewport.scrollLeft,g=tM(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(Lhe,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const y=a.viewport.scrollTop,g=tM(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}),Dhe=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=Ea(js,e.__scopeScrollArea),[o,c]=v.useState(),d=v.useRef(null),f=mt(t,d,i.onScrollbarXChange);return v.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),s.jsx(o8,{"data-orientation":"horizontal",...a,ref:f,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Jv(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,p)=>{if(i.viewport){const y=i.viewport.scrollLeft+h.deltaX;e.onWheelScroll(y),f8(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:Nm(o.paddingLeft),paddingEnd:Nm(o.paddingRight)}})}})}),Lhe=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=Ea(js,e.__scopeScrollArea),[o,c]=v.useState(),d=v.useRef(null),f=mt(t,d,i.onScrollbarYChange);return v.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),s.jsx(o8,{"data-orientation":"vertical",...a,ref:f,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Jv(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,p)=>{if(i.viewport){const y=i.viewport.scrollTop+h.deltaY;e.onWheelScroll(y),f8(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:Nm(o.paddingTop),paddingEnd:Nm(o.paddingBottom)}})}})}),[Fhe,i8]=t8(js),o8=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:a,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:h,onResize:p,...y}=e,g=Ea(js,n),[j,b]=v.useState(null),x=mt(t,M=>b(M)),S=v.useRef(null),N=v.useRef(""),_=g.viewport,P=r.content-r.viewport,A=Tn(h),O=Tn(d),k=Zv(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]),Cc(j,k),Cc(g.content,k),s.jsx(Fhe,{scope:n,scrollbar:j,hasThumb:a,onThumbChange:Tn(i),onThumbPointerUp:Tn(o),onThumbPositionChange:O,onThumbPointerDown:Tn(c),children:s.jsx(ze.div,{...y,ref:x,style:{position:"absolute",...y.style},onPointerDown:Ee(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:Ee(e.onPointerMove,R),onPointerUp:Ee(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})})})}),Sm="ScrollAreaThumb",l8=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=i8(Sm,e.__scopeScrollArea);return s.jsx(Kn,{present:n||a.hasThumb,children:s.jsx(Bhe,{ref:t,...r})})}),Bhe=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,i=Ea(Sm,n),o=i8(Sm,n),{onThumbPositionChange:c}=o,d=mt(t,p=>o.onThumbChange(p)),f=v.useRef(void 0),h=Zv(()=>{f.current&&(f.current(),f.current=void 0)},100);return v.useEffect(()=>{const p=i.viewport;if(p){const y=()=>{if(h(),!f.current){const g=qhe(p,c);f.current=g,c()}};return c(),p.addEventListener("scroll",y),()=>p.removeEventListener("scroll",y)}},[i.viewport,h,c]),s.jsx(ze.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:Ee(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:Ee(e.onPointerUp,o.onThumbPointerUp)})});l8.displayName=Sm;var vC="ScrollAreaCorner",c8=v.forwardRef((e,t)=>{const n=Ea(vC,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx(zhe,{...e,ref:t}):null});c8.displayName=vC;var zhe=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=Ea(vC,n),[i,o]=v.useState(0),[c,d]=v.useState(0),f=!!(i&&c);return Cc(a.scrollbarX,()=>{const h=a.scrollbarX?.offsetHeight||0;a.onCornerHeightChange(h),d(h)}),Cc(a.scrollbarY,()=>{const h=a.scrollbarY?.offsetWidth||0;a.onCornerWidthChange(h),o(h)}),f?s.jsx(ze.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 Nm(e){return e?parseInt(e,10):0}function u8(e,t){const n=e/t;return isNaN(n)?0:n}function Jv(e){const t=u8(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Uhe(e,t,n,r="ltr"){const a=Jv(n),i=a/2,o=t||i,c=a-o,d=n.scrollbar.paddingStart+o,f=n.scrollbar.size-n.scrollbar.paddingEnd-c,h=n.content-n.viewport,p=r==="ltr"?[0,h]:[h*-1,0];return d8([d,f],p)(e)}function tM(e,t,n="ltr"){const r=Jv(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-a,o=t.content-t.viewport,c=i-r,d=n==="ltr"?[0,o]:[o*-1,0],f=Qd(e,d);return d8([0,o],[0,c])(f)}function d8(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function f8(e,t){return e>0&&e<t}var qhe=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function a(){const i={left:e.scrollLeft,top:e.scrollTop},o=n.left!==i.left,c=n.top!==i.top;(o||c)&&t(),n=i,r=window.requestAnimationFrame(a)})(),()=>window.cancelAnimationFrame(r)};function Zv(e,t){const n=Tn(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 Cc(e,t){const n=Tn(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 p8=n8,Whe=a8,Vhe=c8;const Cm=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(p8,{ref:r,className:xe("relative overflow-hidden",e),...n,children:[s.jsx(Whe,{className:"h-full w-full rounded-[inherit]",children:t}),s.jsx(h8,{}),s.jsx(Vhe,{})]}));Cm.displayName=p8.displayName;const h8=v.forwardRef(({className:e,orientation:t="vertical",...n},r)=>s.jsx(hC,{ref:r,orientation:t,className:xe("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:s.jsx(l8,{className:"relative flex-1 rounded-full bg-border"})}));h8.displayName=hC.displayName;const Hhe=[{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 Khe({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}=In(),[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),L=d||i[0]?.id||"";v.useEffect(()=>{if(!e||!L||y)return;let K=!1;return _(!0),p.createScenarioAssistantSession({configId:n,configPath:r,scenarioId:a.id,selectedAssistantAgentName:L,context:{configSnapshotPolicy:c?{enabled:c.enabled,mode:c.mode,baselineSnapshotId:c.baselineSnapshotId}:void 0,scenario:{id:a.id,name:a.name,prompt:a.prompt,serverNames:a.serverIds,evalRules:a.evalRules,extractRules:a.extractRules,snapshotEval:a.snapshotEval?{enabled:a.snapshotEval.enabled,baselineSnapshotId:a.snapshotEval.baselineSnapshotId}:void 0},availableServers:o.map(le=>({name:le.name||le.id,url:le.url})),availableAgents:i.map(le=>({name:le.name||le.id,provider:le.provider,model:le.model}))}}).then(le=>{K||(g(le.sessionId),b(le.session))}).catch(le=>{K||_e({title:"Could not start Scenario Assistant",description:le instanceof Error?le.message:String(le),variant:"destructive"})}).finally(()=>{K||_(!1)}),()=>{K=!0}},[e,p,y,n,r,a,c,i,o,L]);const G=()=>{g(null),b(null),S(""),A(new Set),R.current=null},U=K=>{G(),p.closeScenarioAssistantSession(K).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 K=window.setTimeout(()=>{O.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(K)},[e,N,j?.messages.length,j?.pendingToolCalls.length,j?.warnings.length]),v.useEffect(()=>{const K=k.current;if(!K)return;K.style.height="0px";const le=Math.min(K.scrollHeight,160);K.style.height=`${Math.max(40,le)}px`},[x,e]);const H=i.length>0&&a.serverIds.length>0&&!!L,Q=async K=>{if(!y)return;const le=K.trim();if(!le)return;const ie=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,fe={id:ie,role:"user",text:le,createdAt:new Date().toISOString()};b(oe=>oe&&{...oe,messages:[...oe.messages,fe]}),S(""),_(!0);try{const oe=await p.sendScenarioAssistantMessage(y,le);b(oe.session)}catch(oe){b(ce=>ce&&{...ce,messages:ce.messages.filter(Se=>Se.id!==ie)}),S(ce=>ce.trim()?ce:le),_e({title:"Scenario Assistant error",description:oe instanceof Error?oe.message:String(oe),variant:"destructive"})}finally{_(!1)}},J=K=>{S(K),requestAnimationFrame(()=>k.current?.focus())};v.useEffect(()=>{if(!e||!y||!j||!H||N)return;const K=String(f??"").trim();K&&R.current!==K&&(R.current=K,Q(K))},[e,y,j,H,N,f]);const T=async K=>{if(y){_(!0);try{const le=await p.approveScenarioAssistantToolCall(y,K);b(le.session)}catch(le){_e({title:"Tool call failed",description:le instanceof Error?le.message:String(le),variant:"destructive"})}finally{_(!1)}}},D=async K=>{if(y){_(!0);try{const le=await p.denyScenarioAssistantToolCall(y,K);b(le.session)}catch(le){_e({title:"Could not deny tool call",description:le instanceof Error?le.message:String(le),variant:"destructive"})}finally{_(!1)}}},X=async()=>{if(y){_(!0);try{const K=await p.approveAllScenarioAssistantToolCalls(y);b(K.session)}catch(K){_e({title:"Could not approve all tool calls",description:K instanceof Error?K.message:String(K),variant:"destructive"})}finally{_(!1)}}},F=(K,le,ie)=>{if(!le)return;if(ie==="prompt"&&le.prompt&&h({prompt:le.prompt.replacement}),ie==="evalRules"&&le.evalRules&&h({evalRules:le.evalRules.replacement}),ie==="extractRules"&&le.extractRules&&h({extractRules:le.extractRules.replacement}),ie==="snapshotEval"&&le.snapshotEval&&h({snapshotEval:{enabled:le.snapshotEval.patch.enabled,baselineSnapshotId:le.snapshotEval.patch.baselineSnapshotId}}),K){const oe=`${K}:${ie}`;A(ce=>new Set([...ce,oe]))}_e({title:"Applied suggestion",description:`Updated ${{prompt:"Prompt",evalRules:"Checks",extractRules:"Value Capture Rules",snapshotEval:"Snapshot Settings"}[ie]}`})},$=K=>{K||(z(!1),B.current=!1),t(K)},ee=()=>{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(va,{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(Vs,{className:"h-4 w-4"})})]})]}),s.jsx(khe,{open:e,onOpenChange:$,children:s.jsxs(QB,{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:ee,"aria-label":"Minimize assistant",title:"Minimize assistant",children:[s.jsx(I7,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Minimize"})]}),s.jsx(JB,{className:"pr-20",children:s.jsx("div",{className:"flex items-start justify-between gap-3",children:s.jsxs("div",{className:"min-w-0",children:[s.jsxs(ZB,{className:"flex items-center gap-2",children:[s.jsx(va,{className:"h-4 w-4"}),"Scenario Assistant"]}),s.jsx(e8,{children:"LLM-guided scenario authoring with MCP tool introspection and per-tool-call approval."})]})})}),H?s.jsxs("div",{className:"min-h-0 flex flex-1 flex-col gap-3",children:[s.jsx("div",{className:"grid gap-3 sm:grid-cols-1",children:s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($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(Ds,{className:"h-3.5 w-3.5"}),j?`Loaded ${j.toolsLoaded} tools`:"Preparing..."]})]})}),s.jsx(Cm,{className:"min-h-0 flex-1 rounded-md border p-3",children:s.jsxs("div",{className:"space-y-3",children:[j?.warnings?.map((K,le)=>s.jsx("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900",children:K},`${K}-${le}`)),j?.messages.map(K=>s.jsxs(v.Fragment,{children:[(()=>{const le=K.pendingToolCallIds??(K.pendingToolCallId?[K.pendingToolCallId]:[]),ie=le.map(ne=>(j?.pendingToolCalls??[]).find(Te=>Te.id===ne)).filter(ne=>!!ne),fe=le.map(ne=>j.pendingToolCalls.find(Te=>Te.id===ne)??j.pendingToolCalls.find(Te=>Te.id===ne)).filter(Boolean);if(!(K.role==="assistant"&&le.length>0))return s.jsx("div",{className:"space-y-2",children:s.jsx(Ghe,{message:K})});const ce=ie.length,Se=fe.length-ce;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(ya,{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(hS,{text:K.text,variant:"assistant"})}),fe.length>1&&ce>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:[Se," of ",fe.length," tool calls resolved"]}),s.jsxs(se,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{X()},children:["Approve All (",ce,")"]})]}),fe.map(ne=>{const Te=ne.status==="pending",Ae=ne.tool??ne.publicToolName??"unknown_tool";return s.jsxs("details",{open:Te,className:"group overflow-hidden rounded-md border border-border/60 bg-background",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2",children:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ds,{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 ${Te?"bg-amber-100 text-amber-900":ne.status==="error"?"bg-red-100 text-red-900":ne.status==="denied"?"bg-gray-100 text-gray-700":"bg-muted text-muted-foreground"}`,children:Te?"Needs approval":ne.status==="error"?"Error":ne.status==="denied"?"Denied":"Approved"})]})}),s.jsx(Vt,{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(ne.arguments??{},null,2)})}),Te&&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:()=>{D(ne.id)},children:"Deny"}),s.jsx(se,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{T(ne.id)},children:"Approve"})]})]})]},ne.id)})]})]})})(),K.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(va,{className:"h-3.5 w-3.5"}),"Structured Suggestions"]}),K.suggestions.prompt&&s.jsx(Zp,{title:"Prompt",rationale:K.suggestions.prompt.rationale,preview:K.suggestions.prompt.replacement,applied:P.has(`${K.id}:prompt`),onApply:()=>F(K.id,K.suggestions,"prompt")}),K.suggestions.evalRules&&s.jsx(Zp,{title:"Checks",rationale:K.suggestions.evalRules.rationale,preview:JSON.stringify(K.suggestions.evalRules.replacement,null,2),applied:P.has(`${K.id}:evalRules`),onApply:()=>F(K.id,K.suggestions,"evalRules")}),K.suggestions.extractRules&&s.jsx(Zp,{title:"Value Capture Rules",rationale:K.suggestions.extractRules.rationale,preview:JSON.stringify(K.suggestions.extractRules.replacement,null,2),applied:P.has(`${K.id}:extractRules`),onApply:()=>F(K.id,K.suggestions,"extractRules")}),K.suggestions.snapshotEval&&s.jsx(Zp,{title:"Snapshot Settings",rationale:K.suggestions.snapshotEval.rationale,preview:JSON.stringify(K.suggestions.snapshotEval.patch,null,2),applied:P.has(`${K.id}:snapshotEval`),onApply:()=>F(K.id,K.suggestions,"snapshotEval")}),(()=>{const le=K.suggestions?.notes,ie=Array.isArray(le)?le:typeof le=="string"?[le]:[];return ie.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:ie.map((fe,oe)=>s.jsx("li",{children:fe},`${K.id}-note-${oe}`))})]})})()]})]},K.id)),(j?.pendingToolCalls??[]).filter(K=>!(j?.messages??[]).some(le=>le.pendingToolCallId===K.id||le.pendingToolCallIds?.includes(K.id))).map(K=>s.jsxs("details",{open:!0,className:"group min-w-0 rounded-md border bg-background",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-2 p-3",children:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ds,{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:K.publicToolName||K.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(Vt,{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(K.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:()=>{D(K.id)},children:"Deny"}),s.jsx(se,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{T(K.id)},children:"Approve"})]})]})]},K.id)),!j&&N&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(ir,{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(ya,{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(ir,{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(Ua,{ref:k,value:x,onChange:K=>S(K.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:K=>{K.key==="Enter"&&!K.shiftKey&&(K.preventDefault(),Q(x))}}),s.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 px-1 pt-1",children:[s.jsxs(Vc,{children:[s.jsx(Hc,{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(ps,{className:"h-3 w-3"}),"Snippets",s.jsx(Vt,{className:"h-3 w-3"})]})}),s.jsxs(Ko,{align:"start",className:"w-[320px]",children:[s.jsx(sC,{children:"Scenario Assistant Snippets"}),s.jsx(iC,{}),Hhe.map(K=>s.jsx(gr,{className:"items-start whitespace-normal px-2 py-2",onSelect:()=>J(K.prompt),children:s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("div",{className:"text-xs font-medium leading-tight",children:K.label}),s.jsx("div",{className:"text-[11px] leading-snug text-muted-foreground",children:K.description})]})},K.label))]})]}),s.jsx(se,{type:"button",size:"icon",className:"h-8 w-8 rounded-full",onClick:()=>{Q(x)},disabled:!y||N||!x.trim(),"aria-label":"Send message",title:"Send message",children:N?s.jsx(ir,{className:"h-4 w-4 animate-spin"}):s.jsxs(s.Fragment,{children:[s.jsx(d$,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Send"})]})})]})]})]}):s.jsx("div",{className:"rounded-md border p-3 text-sm text-muted-foreground",children:"Scenario Assistant requires a configured assistant agent and at least one selected server on the scenario."})]})})]})}function Zp({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($l,{className:"mr-1.5 h-3.5 w-3.5"}),"Applied"]}):"Apply"})]}),t&&s.jsx("p",{className:"text-xs text-muted-foreground",children:t}),s.jsx("pre",{className:"max-h-56 overflow-auto rounded bg-muted p-2 text-xs whitespace-pre-wrap",children:n})]})}function Ghe({message:e}){const t=async o=>{try{await navigator.clipboard.writeText(o),_e({title:"Copied"})}catch(c){_e({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(Ds,{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(u$,{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(hS,{text:e.text,variant:"assistant"})})]});const r=n==="user",a=r?kS:ya,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(hS,{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($i,{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 hS({text:e,variant:t="assistant"}){const n=Yhe(e);return s.jsx("div",{className:xe("space-y-2",t==="system"&&"text-xs"),children:n.map((r,a)=>s.jsx(v.Fragment,{children:Xhe(r,a,t)},`md-${a}`))})}function Yhe(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(nM(t,r)){const y=rM(t[r]);r+=2;const g=[];for(;r<t.length&&t[r].includes("|")&&!a(t[r]);)g.push(rM(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)||nM(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 nM(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 rM(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>t.trim())}function Xhe(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:Uu(e.text,`${t}-h`)})}if(e.type==="paragraph")return s.jsx("p",{className:xe("whitespace-pre-wrap leading-relaxed",n==="system"&&"leading-normal"),children:Uu(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:xe("space-y-1 pl-5",e.ordered?"list-decimal":"list-disc"),children:e.items.map((a,i)=>s.jsx("li",{className:"leading-relaxed",children:Uu(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:Uu(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:Uu(i,`${t}-tdc-${a}-${o}`)},`${t}-td-${a}-${o}`))},`${t}-row-${a}`))})]})}):null}function Uu(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 Qhe="mcplab.feature.";function jf(e,t=!1){if(typeof window>"u")return t;try{const n=window.localStorage.getItem(`${Qhe}${e}`);return n==null?t:n==="1"||n==="true"}catch{return t}}const Jhe=()=>({id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]});function mS({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,Jhe()]),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(ps,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Scenario"]})]}),e.map((N,_)=>s.jsx(Zhe,{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 Zhe({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}=In(),_=jf("snapshots",!1),[P,A]=v.useState("required_tool"),[O,k]=v.useState(""),[R,M]=v.useState(""),[z,B]=v.useState(null),[L,G]=v.useState(!1),[U,H]=v.useState(null),[Q,J]=v.useState(""),[T,D]=v.useState(""),[X,F]=v.useState(!1),[$,ee]=v.useState(!x),ae=()=>{O.trim()&&(y({evalRules:[...e.evalRules,{type:P,value:O.trim()}]}),k(""),M(""))},K=be=>{y({evalRules:e.evalRules.filter((Je,lt)=>lt!==be)})},le=()=>{!Q.trim()||!T.trim()||(y({extractRules:[...e.extractRules,{name:Q.trim(),pattern:T.trim()}]}),J(""),D(""))},ie=be=>{y({extractRules:e.extractRules.filter((Je,lt)=>lt!==be)})},fe=be=>{const Je=e.serverIds.includes(be)?e.serverIds.filter(lt=>lt!==be):[...e.serverIds,be];y({serverIds:Je})},oe={required_tool:"Required",forbidden_tool:"Forbidden",response_contains:"Contains",response_not_contains:"Not Contains"},ce={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"},Se=P==="required_tool"||P==="forbidden_tool",ne=e.serverIds.filter(be=>i.some(Je=>Je.id===be)),Te=ne.length>0,Ae=e.snapshotEval?.baselineSnapshotId!==void 0,[Ye,ge]=v.useState(""),[Oe,Be]=v.useState(0);v.useEffect(()=>{const be=(f??"").trim();be&&Ye!==be&&(F(!0),ge(be))},[f,Ye]),v.useEffect(()=>{h&&h!==Oe&&(F(!0),Be(h))},[h,Oe]),v.useEffect(()=>{B(null),H(null),M("")},[e.serverIds.join("|")]),v.useEffect(()=>{M("")},[P]);const dt=async()=>{if(!(!Te||x)){G(!0),H(null);try{const be=new Set;for(const Je of ne){const lt=await N.discoverToolsForAnalysis({serverNames:[Je]});for(const Rt of lt.servers)for(const qt of Rt.tools)be.add(qt.name)}B(Array.from(be).sort((Je,lt)=>Je.localeCompare(lt)))}catch(be){H(be instanceof Error?be.message:"Failed to load tools")}finally{G(!1)}}};return s.jsx(Ei,{open:$,onOpenChange:ee,children:s.jsxs(Ue,{className:x?"rounded-md border shadow-none":"border-dashed",children:[s.jsxs(Ct,{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(Ms,{asChild:!0,children:s.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",children:s.jsx(Vt,{className:`h-3.5 w-3.5 transition-transform ${$?"rotate-0":"-rotate-90"}`})})}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[n+1,"."]}),s.jsx(_t,{className:"truncate text-sm font-medium",children:e.name||`Scenario ${n+1}`})]}),x?s.jsxs("div",{className:"flex items-center gap-2",children:[t&&s.jsx(Qe,{variant:t==="inline"?"secondary":"outline",children:t==="referenced"?"Referenced":"Inline"}),s.jsx(Ms,{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(Vt,{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(va,{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(cs,{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(Vt,{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(Na,{className:"h-3.5 w-3.5 text-destructive"})})]})]}),s.jsx(Pi,{children:s.jsxs(qe,{className:"space-y-3",children:[s.jsx(Khe,{open:X,onOpenChange:F,configId:o,configPath:c,scenario:e,agents:a,servers:i,snapshotEval:p,defaultAssistantAgentName:d,initialUserMessage:f,onApplyPatch:be=>y({...be.prompt!==void 0?{prompt:be.prompt}:{},...be.evalRules!==void 0?{evalRules:be.evalRules}:{},...be.extractRules!==void 0?{extractRules:be.extractRules}:{},...be.snapshotEval!==void 0?{snapshotEval:{...e.snapshotEval??{},...be.snapshotEval}}:{}})}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Name"}),s.jsx(ht,{value:e.name,onChange:be=>y({name:be.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(be=>s.jsx(Qe,{variant:e.serverIds.includes(be.id)?"default":"outline",className:`cursor-pointer text-xs ${e.serverIds.includes(be.id)?"":"opacity-50"}`,onClick:()=>!x&&fe(be.id),children:be.name||be.id},be.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(Ct,{className:"pb-2",children:[s.jsx(_t,{className:"text-sm",children:"Prompt"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"The instruction sent to the agent for this scenario. Be explicit about the task, expected output, and constraints."})]}),s.jsx(qe,{className:"pt-0",children:s.jsx(Ua,{value:e.prompt,onChange:be=>y({prompt:be.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(Ct,{className:"pb-2",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx(_t,{className:"text-sm",children:"Checks"}),s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Checks determine pass/fail for the scenario. Add tool checks or text pattern checks for the final answer."})]}),!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(va,{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((be,Je)=>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 ${ce[be.type]}`,children:oe[be.type]}),s.jsx("span",{className:"font-mono break-all",children:be.value})]})}),!x&&s.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>K(Je),"aria-label":`Remove check ${Je+1}`,children:s.jsx(Vs,{className:"h-3.5 w-3.5"})})]},Je))}),!x&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex gap-2 items-end",children:[s.jsxs(on,{value:P,onValueChange:be=>A(be),children:[s.jsx(Zt,{className:"h-8 w-[14.5rem] shrink-0 text-xs",children:s.jsx(ln,{})}),s.jsxs(en,{children:[s.jsx(it,{value:"required_tool",children:"Required Tool"}),s.jsx(it,{value:"forbidden_tool",children:"Forbidden Tool"}),s.jsx(it,{value:"response_contains",children:"Text matches pattern"}),s.jsx(it,{value:"response_not_contains",children:"Text must not match"})]})]}),s.jsx(ht,{value:O,onChange:be=>k(be.target.value),placeholder:"Value",className:"h-8 text-xs font-mono",onKeyDown:be=>be.key==="Enter"&&(be.preventDefault(),ae())}),s.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:ae,children:"Add"})]}),Se&&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(on,{value:R,onValueChange:be=>{M(be),k(be)},disabled:L||!z||z.length===0,children:[s.jsx(Zt,{className:"h-8 text-xs",children:s.jsx(ln,{placeholder:L?"Loading tools...":z&&z.length>0?"Select tool to insert in value field":"Load tools first"})}),s.jsx(en,{children:(z??[]).map(be=>s.jsx(it,{value:be,children:be},be))})]})]}),s.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:dt,disabled:!Te||L,children:L?"Loading...":z?"Refresh tools":"Load tools"})]}),!Te&&s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Select at least one server in this scenario to load tool names."}),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(Ct,{className:"pb-2",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx(_t,{className:"text-sm",children:"Value Capture Rules"}),s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Formerly “Extract Rules”. These do not fail the run. They capture structured values from the final answer for reporting, snapshots, and comparisons."})]}),!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(va,{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((be,Je)=>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:be.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:be.pattern})]})}),!x&&s.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>ie(Je),"aria-label":`Remove value capture rule ${Je+1}`,children:s.jsx(Vs,{className:"h-3.5 w-3.5"})})]},Je))}),!x&&s.jsxs("div",{className:"flex gap-2 items-end",children:[s.jsx(ht,{value:Q,onChange:be=>J(be.target.value),placeholder:"Field name",className:"h-8 text-xs w-36"}),s.jsx(ht,{value:T,onChange:be=>D(be.target.value),placeholder:"Regex pattern",className:"h-8 text-xs font-mono",onKeyDown:be=>be.key==="Enter"&&(be.preventDefault(),le())}),s.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:le,children:"Add"})]})]})})]})]}),_&&s.jsxs(Ue,{className:"border bg-amber-50/40",children:[s.jsxs(Ct,{className:"pb-2",children:[s.jsx(_t,{className:"text-sm",children:"Snapshot Evaluation"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Per-scenario toggle for config baseline drift checks."})]}),s.jsxs(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(wm,{checked:e.snapshotEval?.enabled!==!1,disabled:x,onCheckedChange:be=>y({snapshotEval:{...e.snapshotEval??{},enabled:be}})})]}),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(wm,{checked:!Ae,disabled:x,onCheckedChange:be=>{if(be){y({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:void 0}});return}y({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:e.snapshotEval?.baselineSnapshotId??""}})}})]}),Ae&&s.jsx(ht,{value:e.snapshotEval?.baselineSnapshotId??"",onChange:be=>y({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:be.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"})]})]})]})]})})]})})}function m8(e){const t=e.name?.trim()||e.id||"Server",n=e.authValue?.trim()||"",r=e.oauthTokenUrl?.trim()||"";return e.authType==="bearer"&&n.length===0?`${t}: bearer token is required.`:e.authType==="api-key"&&r.length===0&&n.length===0?`${t}: API key value is required.`:null}const eme=()=>({id:`cfg-${Date.now()}`,name:"",configName:"",description:"",servers:[],serverEntries:[],agents:[],agentEntries:[],scenarios:[],scenarioEntries:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),aM=()=>{const{id:e,tab:t}=Lo(),n=_a(),[r,a]=Ic(),{getConfig:i,addConfig:o,updateConfig:c,loading:d}=cf(),{source:f}=In(),h=jf("snapshots",!1),{servers:p,agents:y,scenarios:g}=Ha(),j=e==="new",b=!j&&!!e,x=b?i(e):void 0,[S,N]=v.useState(j),[_,P]=v.useState(()=>x?structuredClone(x):eme()),[A,O]=v.useState([]),[k,R]=v.useState(""),[M,z]=v.useState(""),[B,L]=v.useState(""),[G,U]=v.useState(null),[H,Q]=v.useState(!1),[J,T]=v.useState(!1),[D,X]=v.useState(""),[F,$]=v.useState(""),[ee,ae]=v.useState({}),[K,le]=v.useState({}),[ie,fe]=v.useState({}),oe=v.useMemo(()=>{const W=t||r.get("tab");return W==="agents"||W==="scenarios"?W:"scenarios"},[t,r]);v.useEffect(()=>{x&&!S&&P(structuredClone(x))},[x,S]),v.useEffect(()=>{let W=!0;return f.listSnapshots().then(he=>{W&&O(he)}).catch(()=>{W&&O([])}),()=>{W=!1}},[f]),v.useEffect(()=>{if(!k.trim()){U(null);return}let W=!0;return f.getResult(k.trim()).then(he=>{if(!W)return;if(!he){U(!1);return}const De=he.overallPassRate===1&&he.scenarios.every(ct=>ct.runs.every(kt=>kt.passed));U(De)}).catch(()=>{W&&U(!1)}),()=>{W=!1}},[k,f]);const ce=W=>P(he=>({...he,...W})),Se=v.useMemo(()=>_.serverEntries&&_.serverEntries.length>0?_.serverEntries:(_.servers??[]).map(W=>({kind:"inline",server:W})),[_.serverEntries,_.servers]),ne=v.useMemo(()=>_.scenarioEntries&&_.scenarioEntries.length>0?_.scenarioEntries:_.scenarios.map(W=>({kind:"inline",scenario:W})),[_.scenarioEntries,_.scenarios]),Te=W=>{ce({scenarioEntries:W,scenarios:W.filter(he=>he.kind==="inline").map(he=>he.scenario)})},Ae=v.useMemo(()=>_.agentEntries&&_.agentEntries.length>0?_.agentEntries:_.agents.map(W=>({kind:"inline",agent:W})),[_.agentEntries,_.agents]),Ye=W=>{ce({agentEntries:W,agents:W.filter(he=>he.kind==="inline").map(he=>he.agent)})},ge=!S,Oe=_.runDefaults?.selectedAgentNames??[],Be=async W=>{if(!_.id||ge===!1){ce({snapshotEval:{enabled:W.enabled,mode:W.mode,baselineSnapshotId:W.baselineSnapshotId,baselineSourceRunId:W.baselineSourceRunId,lastUpdatedAt:new Date().toISOString()}});return}Q(!0);try{const he=await f.updateSnapshotPolicy(_.id,W);P(he),_e({title:"Snapshot policy updated"})}catch(he){_e({title:"Could not update snapshot policy",description:he instanceof Error?he.message:String(he),variant:"destructive"})}finally{Q(!1)}},dt=async()=>{if(!(!_.id||!k.trim())){T(!0);try{const W=await f.generateSnapshotEvalBaseline(k.trim(),_.id,M.trim()||void 0);P(W.config),L(W.snapshot.id),O(he=>[W.snapshot,...he.filter(De=>De.id!==W.snapshot.id)]),_e({title:"Snapshot baseline generated",description:`${W.snapshot.name} (${W.snapshot.id})`})}catch(W){_e({title:"Could not generate baseline",description:W instanceof Error?W.message:String(W),variant:"destructive"})}finally{T(!1)}}},be=async()=>{if(!_.name.trim()){_e({title:"Validation Error",description:"Config ID is required.",variant:"destructive"});return}const W=Se.map(We=>We.kind==="referenced"?{kind:"referenced",ref:p.find(Tt=>Tt.id===We.ref)?.id||We.ref}:We),he=Ae.map(We=>We.kind==="referenced"?{kind:"referenced",ref:y.find(Tt=>Tt.id===We.ref)?.id||We.ref}:We),De=ne.map(We=>We.kind==="referenced"?{kind:"referenced",ref:g.find(Tt=>Tt.id===We.ref)?.id||We.ref}:We),ct=W.filter(We=>We.kind==="inline").map(We=>({server:We.server,error:m8(We.server)})).find(We=>!!We.error);if(ct?.error){_e({title:"Validation Error",description:ct.error,variant:"destructive"});return}if(De.filter(We=>We.kind==="inline").some(We=>!We.scenario.name?.trim())){_e({title:"Validation Error",description:"Inline scenarios must have a name before saving.",variant:"destructive"});return}const Pt=new Set(he.map(We=>We.kind==="inline"?We.agent.id:We.ref)),gn=(_.runDefaults?.selectedAgentNames??[]).filter(We=>Pt.has(We)),Cn={..._,serverEntries:W,servers:W.filter(We=>We.kind==="inline").map(We=>We.server),agentEntries:he,agents:he.filter(We=>We.kind==="inline").map(We=>We.agent),scenarioEntries:De,scenarios:De.filter(We=>We.kind==="inline").map(We=>We.scenario),runDefaults:gn.length>0?{..._.runDefaults??{},selectedAgentNames:gn}:void 0,updatedAt:new Date().toISOString()};if(j){const We=await o(Cn);P(We);const _n=We.configName?.trim()||We.name;_e({title:"MCP Evaluation Created",description:`"${_n}" has been saved.`}),n(`/mcp-evaluations/${We.id}`)}else{const We=await c(_.id,Cn);P(We);const _n=We.configName?.trim()||We.name;_e({title:"MCP Evaluation Updated",description:`"${_n}" has been updated.`}),N(!1),We.id!==e&&n(`/mcp-evaluations/${We.id}`,{replace:!0})}},Je=_.configName?.trim()||_.name,lt=j?"New MCP Evaluation":S?`Editing: ${Je}`:Je,Rt=j?"/mcp-evaluations/new":`/mcp-evaluations/${encodeURIComponent(_.id||e||"")}`,qt=!!x?.loadError,Z=v.useMemo(()=>y.map(W=>({id:W.id,ref:W.id,label:W.name||W.id,model:W.model})).sort((W,he)=>W.label.localeCompare(he.label)),[y]),je=(W,he)=>{const De=he?Array.from(new Set([...Oe,W])):Oe.filter(ct=>ct!==W);ce({runDefaults:{..._.runDefaults??{},selectedAgentNames:De}})},we=W=>{const he=new Set([...Ae.filter(Pt=>Pt.kind==="inline").map(Pt=>Pt.agent.name||Pt.agent.id),...y.map(Pt=>Pt.name||Pt.id)]),De=`${W}-custom`;let ct=De,kt=2;for(;he.has(ct);)ct=`${De}-${kt}`,kt+=1;return ct},ke=()=>{const he={id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096};Ye([{kind:"inline",agent:he},...Ae]),ae(De=>({...De,[he.id]:!0}))},Le=()=>{const W=y.find(ct=>ct.id===F);if(!W)return;const he=W.id;new Set(Ae.filter(ct=>ct.kind==="referenced").map(ct=>ct.ref)).has(he)||Ye([...Ae,{kind:"referenced",ref:he}]),$("")},Xe=()=>{const W=new Set(Ae.filter(De=>De.kind==="referenced").map(De=>De.ref)),he=y.filter(De=>!W.has(De.id)).map(De=>({kind:"referenced",ref:De.id}));he.length>0&&Ye([...Ae,...he])},At=()=>{const W=y.find(kt=>kt.id===F);if(!W)return;const he=W.name||W.id,De=we(he),ct={...structuredClone(W),id:`agt-${Date.now()}`,name:De};Ye([...Ae,{kind:"inline",agent:ct}]),ae(kt=>({...kt,[ct.id]:!0})),$(""),_e({title:"Imported agent as inline",description:De})},jn=W=>{const he=Ae[W];if(!he)return;const De=he.kind==="inline"?he.agent.id:he.ref,ct=Oe.filter(kt=>kt!==De);ce({runDefaults:{..._.runDefaults??{},selectedAgentNames:ct}}),he.kind==="inline"&&ae(kt=>{const Pt={...kt};return delete Pt[he.agent.id],Pt}),Ye(Ae.filter((kt,Pt)=>Pt!==W))},Sn=(W,he)=>{const De=W+he;if(De<0||De>=Ae.length)return;const ct=[...Ae],[kt]=ct.splice(W,1);ct.splice(De,0,kt),Ye(ct)},lr=W=>{const he=Ae[W];if(!he||he.kind!=="referenced")return;const De=Kt(he.ref);if(!De){_e({title:"Referenced agent not found",variant:"destructive"});return}const ct=De.name||De.id,kt=we(ct),Pt={...structuredClone(De),id:`agt-${Date.now()}`,name:kt},gn=[...Ae];if(gn[W]={kind:"inline",agent:Pt},Ye(gn),Oe.includes(he.ref)){const Cn=Oe.map(We=>We===he.ref?Pt.id:We);ce({runDefaults:{..._.runDefaults??{},selectedAgentNames:Array.from(new Set(Cn))}})}ae(Cn=>({...Cn,[Pt.id]:!0})),_e({title:"Referenced agent converted to inline",description:kt})},cr=()=>{const W=g.find(De=>De.id===D);if(!W)return;const he={...structuredClone(W),id:`scn-${Date.now()}`,serverIds:[...W.serverIds]};Te([...ne,{kind:"inline",scenario:he}]),fe(De=>({...De,[he.id]:!0})),X("")},Ln=()=>{const he={id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};Te([{kind:"inline",scenario:he},...ne]),fe(De=>({...De,[he.id]:!0}))},ur=()=>{const W=g.find(ct=>ct.id===D);if(!W)return;const he=W.id;new Set(ne.filter(ct=>ct.kind==="referenced").map(ct=>ct.ref)).has(he)||Te([...ne,{kind:"referenced",ref:he}]),X("")},Ar=W=>{const he=ne[W];he?.kind==="inline"&&fe(De=>{const ct={...De};return delete ct[he.scenario.id],ct}),Te(ne.filter((De,ct)=>ct!==W))},Fr=(W,he)=>{const De=W+he;if(De<0||De>=ne.length)return;const ct=[...ne],[kt]=ct.splice(W,1);ct.splice(De,0,kt),Te(ct)},Br=W=>{const he=ne[W];if(!he||he.kind!=="referenced")return;const De=On(he.ref);if(!De){_e({title:"Referenced scenario not found",variant:"destructive"});return}const ct=new Set(ne.filter(Tt=>Tt.kind==="inline").map(Tt=>Tt.scenario.name?.trim().toLowerCase()).filter(Boolean)),kt=`${(De.name||De.id).trim()}-custom`;let Pt=kt,gn=2;for(;ct.has(Pt.toLowerCase());)Pt=`${kt}-${gn}`,gn+=1;const Cn=Date.now(),We={...structuredClone(De),id:`scn-${Cn}`,name:Pt,serverIds:[...De.serverIds]},_n=[...ne];_n[W]={kind:"inline",scenario:We},Te(_n),fe(Tt=>({...Tt,[We.id]:!0})),_e({title:"Referenced scenario converted to inline",description:Pt})},Yn=W=>p.find(he=>he.id===W),Kt=W=>y.find(he=>he.id===W),On=W=>g.find(he=>he.id===W),ue=Se.filter(W=>W.kind==="referenced").map(W=>W.ref),Re=ue.map(Yn).filter(W=>!!W),nt=Ae.filter(W=>W.kind==="referenced").map(W=>W.ref),xt=nt.map(Kt).filter(W=>!!W);Ae.filter(W=>W.kind==="inline");const Ft=Ae.flatMap(W=>{if(W.kind==="referenced"){const he=Kt(W.ref);return he?[{agent:he,origin:"referenced",ref:W.ref}]:[]}return[{agent:W.agent,origin:"inline",ref:void 0}]}),Yt=ne.filter(W=>W.kind==="referenced").map(W=>W.ref),Nn=ne.flatMap(W=>{if(W.kind==="referenced"){const he=On(W.ref);return he?[{scenario:he,origin:"referenced"}]:[]}return[{scenario:W.scenario,origin:"inline"}]}),dr=Array.from(new Map([...y,..._.agents,...xt].map(W=>[W.id,W])).values()),vn=Array.from(new Map([...p,..._.servers??[],...Re].map(W=>[W.id,W])).values()),Xn=ue.filter(W=>!Yn(W)),Er=nt.filter(W=>!Kt(W)),yr=Yt.filter(W=>!On(W));new Set(Xn);const ri=new Set(yr),ai=Ae.length,kn=ne.length;return v.useEffect(()=>{if(!F)return;y.some(he=>he.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(bt,{to:"/mcp-evaluations",children:s.jsx(So,{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:lt}),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&&!qt&&s.jsx(se,{size:"sm",variant:"outline",asChild:!0,children:s.jsxs(bt,{to:`/run?configId=${encodeURIComponent(x.id)}`,children:[s.jsx(Dl,{className:"mr-1.5 h-3.5 w-3.5"}),"Run MCP Evaluation"]})}),b&&!S&&qt&&s.jsxs(Qe,{variant:"destructive",className:"py-1 px-3 text-xs",children:[s.jsx(ah,{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:()=>{be()},children:[s.jsx($7,{className:"mr-1.5 h-3.5 w-3.5"}),"Save"]})]})]})]}),qt&&!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(ah,{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})]}),(Xn.length>0||Er.length>0||yr.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"}),Xn.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Servers: ",s.jsx("span",{className:"text-destructive",children:Xn.join(", ")})]}),Er.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Agents: ",s.jsx("span",{className:"text-destructive",children:Er.join(", ")})]}),yr.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Scenarios: ",s.jsx("span",{className:"text-destructive",children:yr.join(", ")})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Valid items still render below. Only the missing references are marked as broken."})]})}),!qt&&(_.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(ah,{className:"h-4 w-4"}),"Migration warnings"]}),_.loadWarnings?.map((W,he)=>s.jsx("p",{className:"text-xs text-muted-foreground",children:W},`${W}-${he}`))]})}),s.jsxs("div",{className:"flex gap-4",children:[s.jsx(Qe,{variant:oe==="scenarios"?"default":"outline",className:"py-1 px-3 text-xs",children:s.jsxs(bt,{to:`${Rt}/scenarios`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[s.jsx(uE,{className:"h-3 w-3"}),kn," scenario",kn!==1?"s":""]})}),s.jsx(Qe,{variant:oe==="agents"?"default":"outline",className:"py-1 px-3 text-xs",children:s.jsxs(bt,{to:`${Rt}/agents`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[s.jsx(ya,{className:"h-3 w-3"}),ai," agent",ai!==1?"s":""]})})]}),s.jsx(Ue,{children:s.jsx(qe,{className:"pt-6 space-y-3",children:s.jsxs("div",{className:`grid gap-4 ${ge||!j?"sm:grid-cols-2":"sm:grid-cols-3"}`,children:[!ge&&j&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Config ID"}),s.jsx(ht,{value:_.name,onChange:W=>ce({name:W.target.value}),disabled:ge,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(ht,{value:_.configName||"",onChange:W=>ce({configName:W.target.value}),disabled:ge,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(ht,{value:_.description||"",onChange:W=>ce({description:W.target.value}),disabled:ge,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(wm,{checked:_.snapshotEval?.enabled??!1,disabled:H,onCheckedChange:W=>{const he=_.snapshotEval;Be({enabled:W,mode:he?.mode??"warn",baselineSnapshotId:he?.baselineSnapshotId,baselineSourceRunId:he?.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(on,{value:_.snapshotEval?.mode??"warn",onValueChange:W=>{const he=_.snapshotEval;Be({enabled:he?.enabled??!1,mode:W,baselineSnapshotId:he?.baselineSnapshotId,baselineSourceRunId:he?.baselineSourceRunId})},children:[s.jsx(Zt,{className:"h-8",children:s.jsx(ln,{})}),s.jsxs(en,{children:[s.jsx(it,{value:"warn",children:"Warn"}),s.jsx(it,{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(ht,{value:k,onChange:W=>R(W.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(ht,{value:M,onChange:W=>z(W.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(on,{value:B||_.snapshotEval?.baselineSnapshotId||"",onValueChange:W=>{L(W),Be({enabled:_.snapshotEval?.enabled??!0,mode:_.snapshotEval?.mode??"warn",baselineSnapshotId:W||void 0,baselineSourceRunId:_.snapshotEval?.baselineSourceRunId})},children:[s.jsx(Zt,{className:"h-8",children:s.jsx(ln,{placeholder:"Select snapshot"})}),s.jsx(en,{children:A.map(W=>s.jsx(it,{value:W.id,children:W.name},W.id))})]})]}),s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:()=>{dt()},disabled:J||!k.trim()||G!==!0,children:J?"Generating...":"Generate Baseline"}),s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:()=>{Be({enabled:_.snapshotEval?.enabled??!1,mode:_.snapshotEval?.mode??"warn",baselineSnapshotId:void 0,baselineSourceRunId:void 0})},disabled:H,children:"Clear Baseline"})]})]})]})}),s.jsxs(lC,{value:oe,onValueChange:W=>{if(W!=="servers"&&W!=="agents"&&W!=="scenarios")return;const he=new URLSearchParams(r);if(he.delete("tab"),a(he,{replace:!0}),e&&e!=="new"){n(`/mcp-evaluations/${encodeURIComponent(e)}/${W}`,{replace:!0});return}n(`/mcp-evaluations/${e??"new"}/${W}`,{replace:!0})},className:"space-y-4",children:[s.jsxs(Kv,{children:[s.jsxs(Ii,{value:"scenarios",className:"gap-1.5",children:[s.jsx(uE,{className:"h-3.5 w-3.5"}),"Scenarios"]}),s.jsxs(Ii,{value:"agents",className:"gap-1.5",children:[s.jsx(ya,{className:"h-3.5 w-3.5"}),"Agents"]})]}),s.jsxs(Xd,{value:"agents",children:[!ge&&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(on,{value:F,onValueChange:$,children:[s.jsx(Zt,{className:"h-8",children:s.jsx(ln,{placeholder:"Select agent from library"})}),s.jsx(en,{children:Z.map(W=>s.jsx(it,{value:W.id,children:W.label},W.id))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!F,onClick:Le,children:"Add Ref"}),s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!F,onClick:At,children:"Import Inline"}),s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:y.length===0||y.every(W=>Ae.some(he=>he.kind==="referenced"&&he.ref===W.id)),onClick:Xe,children:"Add All Refs"}),s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:ke,children:"Add agent"})]})]}),s.jsxs("div",{className:"space-y-2",children:[Ae.map((W,he)=>{const De=W.kind==="referenced"?Kt(W.ref):null,ct=W.kind==="inline"?W.agent.name?.trim()||W.agent.id:De?.name||W.ref,kt=W.kind==="inline"?W.agent.model:De?.model||"unknown",Pt=W.kind==="inline"?W.agent.id:W.ref,gn=W.kind==="referenced"&&!De,Cn=W.kind==="inline"?W.agent.id:W.ref,We=Oe.includes(Cn),_n=W.kind==="inline"&&!!ee[W.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:()=>Sn(he,-1),disabled:he===0,"aria-label":"Move agent up",children:s.jsx(cs,{className:"h-3 w-3"})}),s.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Sn(he,1),disabled:he===Ae.length-1,"aria-label":"Move agent down",children:s.jsx(Vt,{className:"h-3 w-3"})})]}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[he+1,"."]}),s.jsx("span",{className:"truncate font-medium",children:ct}),s.jsx(Qe,{variant:W.kind==="inline"?"secondary":"outline",children:W.kind==="inline"?"Inline":"Referenced"}),s.jsx(Qe,{variant:"outline",className:"font-mono text-[10px]",children:kt}),We&&s.jsx(Qe,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),gn&&s.jsx(Qe,{variant:"destructive",children:"Missing"})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsxs("label",{className:"mx-2 flex items-center gap-1.5 text-xs text-muted-foreground",children:[s.jsx("input",{type:"checkbox",checked:We,onChange:Tt=>je(Cn,Tt.target.checked)}),s.jsx("span",{children:"Default"})]}),W.kind==="inline"&&s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>ae(Tt=>({...Tt,[W.agent.id]:!Tt[W.agent.id]})),children:_n?"Collapse":"Expand"}),W.kind==="referenced"&&s.jsx(s.Fragment,{children:s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>lr(he),disabled:gn,children:"Convert to inline"})}),s.jsx(se,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>jn(he),"aria-label":"Remove agent entry",children:s.jsx(Na,{className:"h-3.5 w-3.5"})})]})]}),W.kind==="inline"&&_n&&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(ht,{value:W.agent.name,onChange:Tt=>{const An=[...Ae];An[he]={kind:"inline",agent:{...W.agent,name:Tt.target.value}},Ye(An)},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(on,{value:W.agent.provider,onValueChange:Tt=>{const An=[...Ae];An[he]={kind:"inline",agent:{...W.agent,provider:Tt}},Ye(An)},children:[s.jsx(Zt,{children:s.jsx(ln,{})}),s.jsxs(en,{children:[s.jsx(it,{value:"openai",children:"OpenAI"}),s.jsx(it,{value:"anthropic",children:"Anthropic"}),s.jsx(it,{value:"azure",children:"Azure OpenAI"}),s.jsx(it,{value:"google",children:"Google"}),s.jsx(it,{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(ht,{value:W.agent.model,onChange:Tt=>{const An=[...Ae];An[he]={kind:"inline",agent:{...W.agent,model:Tt.target.value}},Ye(An)},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(ht,{type:"number",min:1,max:128e3,value:W.agent.maxTokens,onChange:Tt=>{const An=[...Ae];An[he]={kind:"inline",agent:{...W.agent,maxTokens:parseInt(Tt.target.value)||0}},Ye(An)},className:"font-mono text-xs"})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Temperature"}),s.jsx(ht,{type:"number",min:0,max:2,step:.01,value:W.agent.temperature,onChange:Tt=>{const An=[...Ae];An[he]={kind:"inline",agent:{...W.agent,temperature:Number(Tt.target.value)||0}},Ye(An)},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(Ua,{value:W.agent.systemPrompt||"",onChange:Tt=>{const An=[...Ae];An[he]={kind:"inline",agent:{...W.agent,systemPrompt:Tt.target.value}},Ye(An)},rows:3,className:"text-xs"})]})]})]},`agent-entry-${he}-${Pt}`)}),Ae.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents configured yet. Add inline agents or references."})]}),Er.length>0&&s.jsxs("p",{className:"text-xs text-destructive",children:["Missing agent refs: ",Er.join(", ")]})]})}),ge?s.jsx(Ue,{children:s.jsx(qe,{className:"pt-4",children:s.jsxs("div",{className:"space-y-2",children:[Ft.map((W,he)=>{const De=W.agent.name||W.agent.id,ct=Oe.includes(W.origin==="inline"?W.agent.id:W.ref||W.agent.id),kt=W.ref??W.agent.id,Pt=!!K[kt];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:[he+1,"."]}),s.jsx("div",{className:"truncate font-medium text-sm",children:De})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[ct&&s.jsx(Qe,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),s.jsx(Qe,{variant:W.origin==="inline"?"secondary":"outline",children:W.origin==="inline"?"Inline":"Referenced"}),s.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8",onClick:()=>le(gn=>({...gn,[kt]:!gn[kt]})),"aria-label":Pt?"Collapse agent details":"Expand agent details",children:s.jsx(Vt,{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(lB,{provider:W.agent.provider}),s.jsx(Qe,{variant:"outline",className:"text-xs font-mono",children:W.agent.model}),s.jsxs(Qe,{variant:"outline",className:"text-xs font-mono",children:["max_tokens: ",W.agent.maxTokens]}),s.jsxs(Qe,{variant:"outline",className:"text-xs font-mono",children:["temperature: ",W.agent.temperature]})]})]},`agent-view-${he}-${W.ref??W.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(Xd,{value:"scenarios",children:[!ge&&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(on,{value:D,onValueChange:X,children:[s.jsx(Zt,{className:"h-8",children:s.jsx(ln,{placeholder:"Select scenario from library"})}),s.jsx(en,{children:[...g].sort((W,he)=>(W.name||W.id).localeCompare(he.name||he.id)).map(W=>s.jsx(it,{value:W.id,children:W.name||W.id},W.id))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!D,onClick:ur,children:"Add Ref"}),s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!D,onClick:cr,children:"Import Inline"}),s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:Ln,children:"Add scenario"})]})]}),s.jsxs("div",{className:"space-y-2",children:[ne.map((W,he)=>{const De=W.kind==="referenced"?On(W.ref):null,ct=W.kind==="inline"?W.scenario.name?.trim()||W.scenario.id:De?.name||W.ref,kt=W.kind==="inline"&&!W.scenario.name?.trim(),Pt=W.kind==="referenced"&&ri.has(W.ref),gn=W.kind==="inline"&&!!ie[W.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:()=>Fr(he,-1),disabled:he===0,"aria-label":"Move scenario up",children:s.jsx(cs,{className:"h-3 w-3"})}),s.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Fr(he,1),disabled:he===ne.length-1,"aria-label":"Move scenario down",children:s.jsx(Vt,{className:"h-3 w-3"})})]}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[he+1,"."]}),s.jsx("span",{className:"truncate font-medium",children:ct}),s.jsx(Qe,{variant:W.kind==="inline"?"secondary":"outline",children:W.kind==="inline"?"Inline":"Referenced"}),kt&&s.jsx(Qe,{variant:"destructive",children:"Name required"}),Pt&&s.jsx(Qe,{variant:"destructive",children:"Missing"})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[W.kind==="inline"&&s.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-7 w-7",onClick:()=>fe(Cn=>({...Cn,[W.scenario.id]:!Cn[W.scenario.id]})),"aria-label":gn?"Collapse scenario details":"Expand scenario details",children:s.jsx(Vt,{className:`h-3.5 w-3.5 transition-transform ${gn?"rotate-180":""}`})}),W.kind==="referenced"&&s.jsx(s.Fragment,{children:s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>Br(he),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:()=>Ar(he),"aria-label":"Remove scenario entry",children:s.jsx(Na,{className:"h-3.5 w-3.5"})})]})]}),W.kind==="inline"&&gn&&s.jsx("div",{className:"border-t px-3 py-3",children:s.jsx(mS,{scenarios:[W.scenario],scenarioOrigins:["inline"],agents:[..._.agents,...xt],servers:[..._.servers??[],...Re],configId:_.id,configPath:_.sourcePath,defaultAssistantAgentName:_.runDefaults?.selectedAgentNames?.[0],snapshotEval:_.snapshotEval,onChange:Cn=>{const We=Cn[0];if(!We)return;const _n=[...ne];_n[he]={kind:"inline",scenario:We},Te(_n)},readOnly:!1,allowAdd:!1,allowStructureEdits:!1})})]},`scenario-entry-${he}-${W.kind==="inline"?W.scenario.id:W.ref}`)}),ne.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No scenarios configured yet. Add inline scenarios or references."})]}),yr.length>0&&s.jsxs("p",{className:"text-xs text-destructive",children:["Missing scenario refs: ",yr.join(", ")]})]})}),ge?s.jsx(Ue,{children:s.jsx(qe,{className:"pt-4",children:s.jsx(mS,{scenarios:Nn.map(W=>W.scenario),scenarioOrigins:Nn.map(W=>W.origin),agents:dr,servers:vn,configId:_.id,configPath:_.sourcePath,defaultAssistantAgentName:_.runDefaults?.selectedAgentNames?.[0],snapshotEval:_.snapshotEval,onChange:()=>{},readOnly:!0})})}):null]})]})]})};var tme=Symbol("radix.slottable");function nme(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=tme,t}var v8="AlertDialog",[rme]=or(v8,[TD]),ni=TD(),g8=e=>{const{__scopeAlertDialog:t,...n}=e,r=ni(t);return s.jsx(Zm,{...r,...n,modal:!0})};g8.displayName=v8;var ame="AlertDialogTrigger",sme=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ni(n);return s.jsx(qK,{...a,...r,ref:t})});sme.displayName=ame;var ime="AlertDialogPortal",y8=e=>{const{__scopeAlertDialog:t,...n}=e,r=ni(t);return s.jsx(ev,{...r,...n})};y8.displayName=ime;var ome="AlertDialogOverlay",x8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ni(n);return s.jsx(Mc,{...a,...r,ref:t})});x8.displayName=ome;var Vl="AlertDialogContent",[lme,cme]=rme(Vl),ume=nme("AlertDialogContent"),b8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,i=ni(n),o=v.useRef(null),c=mt(t,o),d=v.useRef(null);return s.jsx(FK,{contentName:Vl,titleName:w8,docsSlug:"alert-dialog",children:s.jsx(lme,{scope:n,cancelRef:d,children:s.jsxs($c,{role:"alertdialog",...i,...a,ref:c,onOpenAutoFocus:Ee(a.onOpenAutoFocus,f=>{f.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[s.jsx(ume,{children:r}),s.jsx(fme,{contentRef:o})]})})})});b8.displayName=Vl;var w8="AlertDialogTitle",j8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ni(n);return s.jsx(sf,{...a,...r,ref:t})});j8.displayName=w8;var S8="AlertDialogDescription",N8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ni(n);return s.jsx(of,{...a,...r,ref:t})});N8.displayName=S8;var dme="AlertDialogAction",C8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ni(n);return s.jsx(tv,{...a,...r,ref:t})});C8.displayName=dme;var _8="AlertDialogCancel",A8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=cme(_8,n),i=ni(n),o=mt(t,a);return s.jsx(tv,{...i,...r,ref:o})});A8.displayName=_8;var fme=({contentRef:e})=>{const t=`\`${Vl}\` requires a description for the component to be accessible for screen reader users.
|
|
125
|
-
|
|
126
|
-
You can add a description to the \`${Vl}\` by passing a \`${S8}\` 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 \`${Vl}\`. 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},pme=g8,hme=y8,E8=x8,P8=b8,O8=C8,k8=A8,R8=j8,T8=N8;const Ss=pme,mme=hme,I8=v.forwardRef(({className:e,...t},n)=>s.jsx(E8,{className:xe("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}));I8.displayName=E8.displayName;const Ga=v.forwardRef(({className:e,...t},n)=>s.jsxs(mme,{children:[s.jsx(I8,{}),s.jsx(P8,{ref:n,className:xe("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})]}));Ga.displayName=P8.displayName;const Ya=({className:e,...t})=>s.jsx("div",{className:xe("flex flex-col space-y-2 text-center sm:text-left",e),...t});Ya.displayName="AlertDialogHeader";const Xa=({className:e,...t})=>s.jsx("div",{className:xe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Xa.displayName="AlertDialogFooter";const Qa=v.forwardRef(({className:e,...t},n)=>s.jsx(R8,{ref:n,className:xe("text-lg font-semibold",e),...t}));Qa.displayName=R8.displayName;const Ja=v.forwardRef(({className:e,...t},n)=>s.jsx(T8,{ref:n,className:xe("text-sm text-muted-foreground",e),...t}));Ja.displayName=T8.displayName;const Za=v.forwardRef(({className:e,...t},n)=>s.jsx(O8,{ref:n,className:xe(GS(),e),...t}));Za.displayName=O8.displayName;const es=v.forwardRef(({className:e,...t},n)=>s.jsx(k8,{ref:n,className:xe(GS({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));es.displayName=k8.displayName;const vme=()=>{const{servers:e,setServers:t,reload:n,loading:r}=Ha(),a=_a(),[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]),_e({title:"Server duplicated",description:`Created ${g}.`})},f=async p=>{await t(e.filter(y=>y.id!==p.id)),_e({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(a$,{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(Sa,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(se,{type:"button",size:"sm",onClick:()=>a("/libraries/servers/new"),children:[s.jsx(ps,{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(ps,{className:"mr-2 h-4 w-4"}),"Add Server"]})]}):s.jsx(Ue,{children:s.jsx(qe,{className:"p-0",children:s.jsxs(Zr,{children:[s.jsx(ea,{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(ta,{children:e.map(p=>s.jsxs(Ut,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>a(`/libraries/servers/${encodeURIComponent(p.id)}`),children:[s.jsx(He,{className:"font-medium",children:c(p)}),s.jsx(He,{children:s.jsx(Qe,{variant:"secondary",className:"font-mono text-xs",children:p.transport})}),s.jsx(He,{children:s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:h(p)})}),s.jsx(He,{children:!p.authType||p.authType==="none"?s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"}):s.jsx(Qe,{variant:"outline",className:"text-xs",children:p.authType})}),s.jsx(He,{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(Na,{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($i,{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(km,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},p.id))})]})})}),s.jsx(Ss,{open:!!i,onOpenChange:p=>!p&&o(null),children:s.jsxs(Ga,{children:[s.jsxs(Ya,{children:[s.jsx(Qa,{children:"Delete server?"}),s.jsxs(Ja,{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(Xa,{children:[s.jsx(es,{children:"Cancel"}),s.jsx(Za,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{i&&f(i)},children:"Delete Server"})]})]})})]})},sM={stdio:"Check that the command is installed and the args are correct",sse:"Check that the server is running and the URL is reachable","streamable-http":"Check that the server is running and the URL is reachable"},gme=()=>({id:`srv-${Date.now()}`,name:"",transport:"stdio",authType:"none",oauthRedirectUrl:"http://localhost:6274/oauth/"}),yme=()=>{const{serverId:e}=Lo(),t=_a(),{servers:n,setServers:r}=Ha(),{source:a}=In(),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??gme()),[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!=="bearer"&&R!=="api-key"?{authValue:void 0}:{},...R!=="api-key"?{apiKeyHeaderName:void 0}:{apiKeyHeaderName:M.apiKeyHeaderName||"X-API-Key"},...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()){_e({title:"Name is required",variant:"destructive"});return}const R=m8(f);if(R){_e({title:"Validation Error",description:R,variant:"destructive"});return}const M={...f,authValue:f.authValue?.trim(),apiKeyHeaderName:f.apiKeyHeaderName?.trim()||void 0};j(!0);try{if(i)await r([...n,M]),_e({title:"Server created"}),t(`/libraries/servers/${encodeURIComponent(M.id)}`);else{const z=n.map(B=>B.id===c?.id?M:B);await r(z),_e({title:"Server saved"}),M.id!==o&&t(`/libraries/servers/${encodeURIComponent(M.id)}`,{replace:!0})}}finally{j(!1)}},O=async()=>{const R=n.filter(M=>M.id!==c?.id);await r(R),_e({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(bt,{to:"/libraries/servers",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(So,{className:"h-4 w-4"})," Servers"]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:['Server "',o,'" not found.']})]}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsxs(bt,{to:"/libraries/servers",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(So,{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(p$,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),S&&s.jsxs(Ue,{children:[s.jsxs(Ct,{className:"flex-row items-center justify-between space-y-0",children:[s.jsx(_t,{className:"text-base",children:"Connection Test"}),s.jsx("button",{type:"button",onClick:()=>N(!1),className:"rounded-sm opacity-70 hover:opacity-100",children:s.jsx(Vs,{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(ir,{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(Yl,{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]}),sM[f.transport]&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",sM[f.transport]]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(b.testedAt).toLocaleString()]})]})]})]}),s.jsxs(Ue,{children:[s.jsx(Ct,{children:s.jsx(_t,{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(ht,{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(on,{value:f.transport,onValueChange:R=>h(M=>({...M,transport:R})),children:[s.jsx(Zt,{children:s.jsx(ln,{})}),s.jsxs(en,{children:[s.jsx(it,{value:"stdio",children:"stdio"}),s.jsx(it,{value:"sse",children:"SSE"}),s.jsx(it,{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(ht,{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(ht,{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(ht,{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(on,{value:f.authType||"none",onValueChange:R=>_(R),children:[s.jsx(Zt,{children:s.jsx(ln,{})}),s.jsxs(en,{children:[s.jsx(it,{value:"none",children:"None"}),s.jsx(it,{value:"bearer",children:"Bearer Token"}),s.jsx(it,{value:"api-key",children:"API Key"}),s.jsx(it,{value:"oauth2",children:"OAuth 2.0"})]})]})]}),f.authType==="bearer"&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{children:"Token"}),s.jsx(ht,{value:f.authValue||"",onChange:R=>h(M=>({...M,authValue:R.target.value})),placeholder:"${DATABRICKS_TOKEN}",className:"font-mono text-xs"})]})]}),f.authType==="bearer"&&s.jsxs("p",{className:"text-xs text-muted-foreground -mt-1",children:["Use ",s.jsx("code",{className:"rounded bg-muted px-1",children:"${VAR_NAME}"})," to reference an environment variable, or enter a token directly."]}),f.authType==="api-key"&&s.jsxs("div",{className:"space-y-3 rounded-md border p-3",children:[s.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"API Key"}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Header Name"}),s.jsx(ht,{value:f.apiKeyHeaderName||"X-API-Key",onChange:R=>h(M=>({...M,apiKeyHeaderName:R.target.value})),placeholder:"X-API-Key",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Value"}),s.jsx(ht,{value:f.authValue||"",onChange:R=>h(M=>({...M,authValue:R.target.value})),placeholder:"${MY_API_KEY}",className:"font-mono text-xs"})]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Use ",s.jsx("code",{className:"rounded bg-muted px-1",children:"${VAR_NAME}"})," to reference an environment variable, or enter a value directly."]})]}),f.authType==="oauth2"&&s.jsxs("div",{className:"space-y-3 rounded-md border p-3",children:[s.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"OAuth 2.0 Flow"}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Client ID"}),s.jsx(ht,{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(ht,{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(ht,{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(ht,{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(ir,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Create Server":"Save"]})]})]})]})]}),s.jsx(Ss,{open:p,onOpenChange:y,children:s.jsxs(Ga,{children:[s.jsxs(Ya,{children:[s.jsx(Qa,{children:"Delete server?"}),s.jsxs(Ja,{children:["This will permanently remove the server"," ",s.jsx("span",{className:"font-mono",children:f.name}),". This action cannot be undone."]})]}),s.jsxs(Xa,{children:[s.jsx(es,{children:"Cancel"}),s.jsx(Za,{onClick:()=>{O()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},xme=()=>{const{agents:e,setAgents:t,reload:n,loading:r}=Ha(),a=_a(),[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]),_e({title:"Agent duplicated",description:`Created ${p}.`})},d=async f=>{await t(e.filter(h=>h.id!==f.id)),_e({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(ya,{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(Sa,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(se,{type:"button",size:"sm",onClick:()=>a("/libraries/agents/new"),children:[s.jsx(ps,{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(ps,{className:"mr-2 h-4 w-4"}),"Add Agent"]})]}):s.jsx(Ue,{children:s.jsx(qe,{className:"p-0",children:s.jsxs(Zr,{children:[s.jsx(ea,{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(ta,{children:e.map(f=>s.jsxs(Ut,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>a(`/libraries/agents/${encodeURIComponent(f.id)}`),children:[s.jsx(He,{className:"font-medium",children:f.name}),s.jsx(He,{children:s.jsx(lB,{provider:f.provider})}),s.jsx(He,{children:s.jsx("span",{className:"font-mono text-xs",children:f.model})}),s.jsx(He,{className:"font-mono text-xs",children:f.maxTokens}),s.jsx(He,{className:"font-mono text-xs",children:f.temperature.toFixed(2)}),s.jsx(He,{className:"text-right",onClick:h=>h.stopPropagation(),children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsxs(se,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>o(f),children:[s.jsx(Na,{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($i,{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(km,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},f.id))})]})})}),s.jsx(Ss,{open:!!i,onOpenChange:f=>!f&&o(null),children:s.jsxs(Ga,{children:[s.jsxs(Ya,{children:[s.jsx(Qa,{children:"Delete agent?"}),s.jsxs(Ja,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-mono",children:i?.name})," from the library. This action cannot be undone."]})]}),s.jsxs(Xa,{children:[s.jsx(es,{children:"Cancel"}),s.jsx(Za,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{i&&d(i)},children:"Delete Agent"})]})]})})]})};var M8=["PageUp","PageDown"],$8=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],D8={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Gc="Slider",[vS,bme,wme]=Jd(Gc),[L8]=or(Gc,[wme]),[jme,eg]=L8(Gc),F8=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"?Sme:Nme,[P=[],A]=sa({prop:h,defaultProp:f,onChange:B=>{[...x.current][S.current]?.focus(),p(B)}}),O=v.useRef(P);function k(B){const L=Pme(P,B);z(B,L)}function R(B){z(B,S.current)}function M(){const B=O.current[S.current];P[S.current]!==B&&y(P)}function z(B,L,{commit:G}={commit:!1}){const U=Tme(i),H=Ime(Math.round((B-r)/i)*i+r,U),Q=Qd(H,[r,a]);A((J=[])=>{const T=Ame(J,Q,L);if(Rme(T,d*i)){S.current=T.indexOf(Q);const D=String(T)!==String(J);return D&&G&&y(T),D?T:J}else return J})}return s.jsx(jme,{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(vS.Provider,{scope:e.__scopeSlider,children:s.jsx(vS.Slot,{scope:e.__scopeSlider,children:s.jsx(_,{"aria-disabled":c,"data-disabled":c?"":void 0,...b,ref:t,onPointerDown:Ee(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:L})=>{if(!c){const H=M8.includes(B.key)||B.shiftKey&&$8.includes(B.key)?10:1,Q=S.current,J=P[Q],T=i*H*L;z(J+T,Q,{commit:!0})}}})})})})});F8.displayName=Gc;var[B8,z8]=L8(Gc,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Sme=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=mt(t,_=>y(_)),j=v.useRef(void 0),b=Wc(a),x=b==="ltr",S=x&&!i||!x&&i;function N(_){const P=j.current||p.getBoundingClientRect(),A=[0,P.width],k=gC(A,S?[n,r]:[r,n]);return j.current=P,k(_-P.left)}return s.jsx(B8,{scope:e.__scopeSlider,startEdge:S?"left":"right",endEdge:S?"right":"left",direction:S?1:-1,size:"width",children:s.jsx(U8,{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=D8[S?"from-left":"from-right"].includes(_.key);f?.({event:_,direction:A?-1:1})}})})}),Nme=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=mt(t,h),y=v.useRef(void 0),g=!a;function j(b){const x=y.current||h.current.getBoundingClientRect(),S=[0,x.height],_=gC(S,g?[r,n]:[n,r]);return y.current=x,_(b-x.top)}return s.jsx(B8,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:s.jsx(U8,{"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=D8[g?"from-bottom":"from-top"].includes(b.key);d?.({event:b,direction:S?-1:1})}})})}),U8=v.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:a,onSlideEnd:i,onHomeKeyDown:o,onEndKeyDown:c,onStepKeyDown:d,...f}=e,h=eg(Gc,n);return s.jsx(ze.span,{...f,ref:t,onKeyDown:Ee(e.onKeyDown,p=>{p.key==="Home"?(o(p),p.preventDefault()):p.key==="End"?(c(p),p.preventDefault()):M8.concat($8).includes(p.key)&&(d(p),p.preventDefault())}),onPointerDown:Ee(e.onPointerDown,p=>{const y=p.target;y.setPointerCapture(p.pointerId),p.preventDefault(),h.thumbs.has(y)?y.focus():r(p)}),onPointerMove:Ee(e.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&a(p)}),onPointerUp:Ee(e.onPointerUp,p=>{const y=p.target;y.hasPointerCapture(p.pointerId)&&(y.releasePointerCapture(p.pointerId),i(p))})})}),q8="SliderTrack",W8=v.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=eg(q8,n);return s.jsx(ze.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...r,ref:t})});W8.displayName=q8;var gS="SliderRange",V8=v.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=eg(gS,n),i=z8(gS,n),o=v.useRef(null),c=mt(t,o),d=a.values.length,f=a.values.map(y=>G8(y,a.min,a.max)),h=d>1?Math.min(...f):0,p=100-Math.max(...f);return s.jsx(ze.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...r,ref:c,style:{...e.style,[i.startEdge]:h+"%",[i.endEdge]:p+"%"}})});V8.displayName=gS;var yS="SliderThumb",H8=v.forwardRef((e,t)=>{const n=bme(e.__scopeSlider),[r,a]=v.useState(null),i=mt(t,c=>a(c)),o=v.useMemo(()=>r?n().findIndex(c=>c.ref.current===r):-1,[n,r]);return s.jsx(Cme,{...e,ref:i,index:o})}),Cme=v.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:a,...i}=e,o=eg(yS,n),c=z8(yS,n),[d,f]=v.useState(null),h=mt(t,N=>f(N)),p=d?o.form||!!d.closest("form"):!0,y=$m(d),g=o.values[r],j=g===void 0?0:G8(g,o.min,o.max),b=Eme(r,o.values.length),x=y?.[c.size],S=x?Ome(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(vS.ItemSlot,{scope:e.__scopeSlider,children:s.jsx(ze.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:Ee(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),p&&s.jsx(K8,{name:a??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:g},r)]})});H8.displayName=yS;var _me="RadioBubbleInput",K8=v.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const a=v.useRef(null),i=mt(a,r),o=Wv(t);return v.useEffect(()=>{const c=a.current;if(!c)return;const d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"value").set;if(o!==t&&h){const p=new Event("input",{bubbles:!0});h.call(c,t),c.dispatchEvent(p)}},[o,t]),s.jsx(ze.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});K8.displayName=_me;function Ame(e=[],t,n){const r=[...e];return r[n]=t,r.sort((a,i)=>a-i)}function G8(e,t,n){const i=100/(n-t)*(e-t);return Qd(i,[0,100])}function Eme(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Pme(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 Ome(e,t,n){const r=e/2,i=gC([0,50],[0,r]);return(r-i(t)*n)*n}function kme(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Rme(e,t){if(t>0){const n=kme(e);return Math.min(...n)>=t}return!0}function gC(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 Tme(e){return(String(e).split(".")[1]||"").length}function Ime(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var Y8=F8,Mme=W8,$me=V8,Dme=H8;const X8=v.forwardRef(({className:e,...t},n)=>s.jsxs(Y8,{ref:n,className:xe("relative flex w-full touch-none select-none items-center",e),...t,children:[s.jsx(Mme,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:s.jsx($me,{className:"absolute h-full bg-primary"})}),s.jsx(Dme,{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"})]}));X8.displayName=Y8.displayName;function Lme(e){const t=Fme(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(zme);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 Fme(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=qme(a),c=Ume(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Cr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Bme=Symbol("radix.slottable");function zme(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Bme}function Ume(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 qme(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var tg="Popover",[Q8]=or(tg,[Bi]),Sf=Bi(),[Wme,Gi]=Q8(tg),J8=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!1}=e,c=Sf(t),d=v.useRef(null),[f,h]=v.useState(!1),[p,y]=sa({prop:r,defaultProp:a??!1,onChange:i,caller:tg});return s.jsx(Dm,{...c,children:s.jsx(Wme,{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})})};J8.displayName=tg;var Z8="PopoverAnchor",Vme=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Gi(Z8,n),i=Sf(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:c}=a;return v.useEffect(()=>(o(),()=>c()),[o,c]),s.jsx(nf,{...i,...r,ref:t})});Vme.displayName=Z8;var ez="PopoverTrigger",tz=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Gi(ez,n),i=Sf(n),o=mt(t,a.triggerRef),c=s.jsx(ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":iz(a.open),...r,ref:o,onClick:Ee(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:s.jsx(nf,{asChild:!0,...i,children:c})});tz.displayName=ez;var yC="PopoverPortal",[Hme,Kme]=Q8(yC,{forceMount:void 0}),nz=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=Gi(yC,t);return s.jsx(Hme,{scope:t,forceMount:n,children:s.jsx(Kn,{present:n||i.open,children:s.jsx(Ec,{asChild:!0,container:a,children:r})})})};nz.displayName=yC;var _c="PopoverContent",rz=v.forwardRef((e,t)=>{const n=Kme(_c,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=Gi(_c,e.__scopePopover);return s.jsx(Kn,{present:r||i.open,children:i.modal?s.jsx(Yme,{...a,ref:t}):s.jsx(Xme,{...a,ref:t})})});rz.displayName=_c;var Gme=Lme("PopoverContent.RemoveScroll"),Yme=v.forwardRef((e,t)=>{const n=Gi(_c,e.__scopePopover),r=v.useRef(null),a=mt(t,r),i=v.useRef(!1);return v.useEffect(()=>{const o=r.current;if(o)return Qm(o)},[]),s.jsx(af,{as:Gme,allowPinchZoom:!0,children:s.jsx(az,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ee(e.onCloseAutoFocus,o=>{o.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Ee(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:Ee(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),Xme=v.forwardRef((e,t)=>{const n=Gi(_c,e.__scopePopover),r=v.useRef(!1),a=v.useRef(!1);return s.jsx(az,{...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()}})}),az=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=Gi(_c,n),g=Sf(n);return Ym(),s.jsx(rf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx($o,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>y.onOpenChange(!1),children:s.jsx(Lm,{"data-state":iz(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)"}})})})}),sz="PopoverClose",Qme=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Gi(sz,n);return s.jsx(ze.button,{type:"button",...r,ref:t,onClick:Ee(e.onClick,()=>a.onOpenChange(!1))})});Qme.displayName=sz;var Jme="PopoverArrow",Zme=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Sf(n);return s.jsx(Fm,{...a,...r,ref:t})});Zme.displayName=Jme;function iz(e){return e?"open":"closed"}var eve=J8,tve=tz,nve=nz,oz=rz;const rve=eve,ave=tve,lz=v.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>s.jsx(nve,{children:s.jsx(oz,{ref:a,align:t,sideOffset:n,className:xe("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})}));lz.displayName=oz.displayName;var iM=1,sve=.9,ive=.8,ove=.17,d1=.1,f1=.999,lve=.9999,cve=.99,uve=/[\\\/_+.#"@\[\(\{&]/,dve=/[\\\/_+.#"@\[\(\{&]/g,fve=/[\s-]/,cz=/[\s-]/g;function xS(e,t,n,r,a,i,o){if(i===t.length)return a===e.length?iM:cve;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=xS(e,t,n,r,f+1,i+1,o),p>h&&(f===a?p*=iM:uve.test(e.charAt(f-1))?(p*=ive,g=e.slice(a,f-1).match(dve),g&&a>0&&(p*=Math.pow(f1,g.length))):fve.test(e.charAt(f-1))?(p*=sve,j=e.slice(a,f-1).match(cz),j&&a>0&&(p*=Math.pow(f1,j.length))):(p*=ove,a>0&&(p*=Math.pow(f1,f-a))),e.charAt(f)!==t.charAt(i)&&(p*=lve)),(p<d1&&n.charAt(f-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(f-1)!==r.charAt(i))&&(y=xS(e,t,n,r,f+1,i+2,o),y*d1>p&&(p=y*d1)),p>h&&(h=p),f=n.indexOf(d,f+1);return o[c]=h,h}function oM(e){return e.toLowerCase().replace(cz," ")}function pve(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,xS(e,t,oM(e),oM(t),0,0,{})}var qu='[cmdk-group=""]',p1='[cmdk-group-items=""]',hve='[cmdk-group-heading=""]',uz='[cmdk-item=""]',lM=`${uz}:not([aria-disabled="true"])`,bS="cmdk-item-select",Al="data-value",mve=(e,t,n)=>pve(e,t,n),dz=v.createContext(void 0),Nf=()=>v.useContext(dz),fz=v.createContext(void 0),xC=()=>v.useContext(fz),pz=v.createContext(void 0),hz=v.forwardRef((e,t)=>{let n=El(()=>{var $,ee;return{search:"",value:(ee=($=e.value)!=null?$:e.defaultValue)!=null?ee:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=El(()=>new Set),a=El(()=>new Map),i=El(()=>new Map),o=El(()=>new Set),c=mz(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=_ve();Mo(()=>{if(h!==void 0){let $=h.trim();n.current.value=$,k.emit()}},[h]),Mo(()=>{O(6,G)},[]);let k=v.useMemo(()=>({subscribe:$=>(o.current.add($),()=>o.current.delete($)),snapshot:()=>n.current,setState:($,ee,ae)=>{var K,le,ie,fe;if(!Object.is(n.current[$],ee)){if(n.current[$]=ee,$==="search")L(),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():(K=document.getElementById(N))==null||K.focus()}if(O(7,()=>{var oe;n.current.selectedItemId=(oe=U())==null?void 0:oe.id,k.emit()}),ae||O(5,G),((le=c.current)==null?void 0:le.value)!==void 0){let oe=ee??"";(fe=(ie=c.current).onValueChange)==null||fe.call(ie,oe);return}}k.emit()}},emit:()=>{o.current.forEach($=>$())}}),[]),R=v.useMemo(()=>({value:($,ee,ae)=>{var K;ee!==((K=i.current.get($))==null?void 0:K.value)&&(i.current.set($,{value:ee,keywords:ae}),n.current.filtered.items.set($,M(ee,ae)),O(2,()=>{z(),k.emit()}))},item:($,ee)=>(r.current.add($),ee&&(a.current.has(ee)?a.current.get(ee).add($):a.current.set(ee,new Set([$]))),O(3,()=>{L(),z(),n.current.value||B(),k.emit()}),()=>{i.current.delete($),r.current.delete($),n.current.filtered.items.delete($);let ae=U();O(4,()=>{L(),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($,ee){var ae,K;let le=(K=(ae=c.current)==null?void 0:ae.filter)!=null?K:mve;return $?le($,n.current.search,ee):0}function z(){if(!n.current.search||c.current.shouldFilter===!1)return;let $=n.current.filtered.items,ee=[];n.current.filtered.groups.forEach(K=>{let le=a.current.get(K),ie=0;le.forEach(fe=>{let oe=$.get(fe);ie=Math.max(oe,ie)}),ee.push([K,ie])});let ae=A.current;H().sort((K,le)=>{var ie,fe;let oe=K.getAttribute("id"),ce=le.getAttribute("id");return((ie=$.get(ce))!=null?ie:0)-((fe=$.get(oe))!=null?fe:0)}).forEach(K=>{let le=K.closest(p1);le?le.appendChild(K.parentElement===le?K:K.closest(`${p1} > *`)):ae.appendChild(K.parentElement===ae?K:K.closest(`${p1} > *`))}),ee.sort((K,le)=>le[1]-K[1]).forEach(K=>{var le;let ie=(le=A.current)==null?void 0:le.querySelector(`${qu}[${Al}="${encodeURIComponent(K[0])}"]`);ie?.parentElement.appendChild(ie)})}function B(){let $=H().find(ae=>ae.getAttribute("aria-disabled")!=="true"),ee=$?.getAttribute(Al);k.setState("value",ee||void 0)}function L(){var $,ee,ae,K;if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let le=0;for(let ie of r.current){let fe=(ee=($=i.current.get(ie))==null?void 0:$.value)!=null?ee:"",oe=(K=(ae=i.current.get(ie))==null?void 0:ae.keywords)!=null?K:[],ce=M(fe,oe);n.current.filtered.items.set(ie,ce),ce>0&&le++}for(let[ie,fe]of a.current)for(let oe of fe)if(n.current.filtered.items.get(oe)>0){n.current.filtered.groups.add(ie);break}n.current.filtered.count=le}function G(){var $,ee,ae;let K=U();K&&((($=K.parentElement)==null?void 0:$.firstChild)===K&&((ae=(ee=K.closest(qu))==null?void 0:ee.querySelector(hve))==null||ae.scrollIntoView({block:"nearest"})),K.scrollIntoView({block:"nearest"}))}function U(){var $;return($=A.current)==null?void 0:$.querySelector(`${uz}[aria-selected="true"]`)}function H(){var $;return Array.from((($=A.current)==null?void 0:$.querySelectorAll(lM))||[])}function Q($){let ee=H()[$];ee&&k.setState("value",ee.getAttribute(Al))}function J($){var ee;let ae=U(),K=H(),le=K.findIndex(fe=>fe===ae),ie=K[le+$];(ee=c.current)!=null&&ee.loop&&(ie=le+$<0?K[K.length-1]:le+$===K.length?K[0]:K[le+$]),ie&&k.setState("value",ie.getAttribute(Al))}function T($){let ee=U(),ae=ee?.closest(qu),K;for(;ae&&!K;)ae=$>0?Nve(ae,qu):Cve(ae,qu),K=ae?.querySelector(lM);K?k.setState("value",K.getAttribute(Al)):J($)}let D=()=>Q(H().length-1),X=$=>{$.preventDefault(),$.metaKey?D():$.altKey?T(1):J(1)},F=$=>{$.preventDefault(),$.metaKey?Q(0):$.altKey?T(-1):J(-1)};return v.createElement(ze.div,{ref:t,tabIndex:-1,...S,"cmdk-root":"",onKeyDown:$=>{var ee;(ee=S.onKeyDown)==null||ee.call(S,$);let ae=$.nativeEvent.isComposing||$.keyCode===229;if(!($.defaultPrevented||ae))switch($.key){case"n":case"j":{x&&$.ctrlKey&&X($);break}case"ArrowDown":{X($);break}case"p":case"k":{x&&$.ctrlKey&&F($);break}case"ArrowUp":{F($);break}case"Home":{$.preventDefault(),Q(0);break}case"End":{$.preventDefault(),D();break}case"Enter":{$.preventDefault();let K=U();if(K){let le=new Event(bS);K.dispatchEvent(le)}}}}},v.createElement("label",{"cmdk-label":"",htmlFor:R.inputId,id:R.labelId,style:Eve},d),ng(e,$=>v.createElement(fz.Provider,{value:k},v.createElement(dz.Provider,{value:R},$))))}),vve=v.forwardRef((e,t)=>{var n,r;let a=Vn(),i=v.useRef(null),o=v.useContext(pz),c=Nf(),d=mz(e),f=(r=(n=d.current)==null?void 0:n.forceMount)!=null?r:o?.forceMount;Mo(()=>{if(!f)return c.item(a,o?.id)},[f]);let h=vz(a,i,[e.value,e.children,i],e.keywords),p=xC(),y=Fi(O=>O.value&&O.value===h.current),g=Fi(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(bS,j),()=>O.removeEventListener(bS,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(ze.div,{ref:Cr(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)}),gve=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=Nf(),p=Fi(g=>a||h.filter()===!1?!0:g.search?g.filtered.groups.has(o):!0);Mo(()=>h.group(o),[]),vz(o,c,[e.value,e.heading,d]);let y=v.useMemo(()=>({id:o,forceMount:a}),[a]);return v.createElement(ze.div,{ref:Cr(c,t),...i,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},n&&v.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),ng(e,g=>v.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},v.createElement(pz.Provider,{value:y},g))))}),yve=v.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=v.useRef(null),i=Fi(o=>!o.search);return!n&&!i?null:v.createElement(ze.div,{ref:Cr(a,t),...r,"cmdk-separator":"",role:"separator"})}),xve=v.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,i=xC(),o=Fi(f=>f.search),c=Fi(f=>f.selectedItemId),d=Nf();return v.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),v.createElement(ze.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)}})}),bve=v.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,i=v.useRef(null),o=v.useRef(null),c=Fi(f=>f.selectedItemId),d=Nf();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(ze.div,{ref:Cr(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:d.listId},ng(e,f=>v.createElement("div",{ref:Cr(o,d.listInnerRef),"cmdk-list-sizer":""},f)))}),wve=v.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:i,container:o,...c}=e;return v.createElement(Zm,{open:n,onOpenChange:r},v.createElement(ev,{container:o},v.createElement(Mc,{"cmdk-overlay":"",className:a}),v.createElement($c,{"aria-label":e.label,"cmdk-dialog":"",className:i},v.createElement(hz,{ref:t,...c}))))}),jve=v.forwardRef((e,t)=>Fi(n=>n.filtered.count===0)?v.createElement(ze.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Sve=v.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...i}=e;return v.createElement(ze.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},ng(e,o=>v.createElement("div",{"aria-hidden":!0},o)))}),Lr=Object.assign(hz,{List:bve,Item:vve,Input:xve,Group:gve,Separator:yve,Dialog:wve,Empty:jve,Loading:Sve});function Nve(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Cve(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function mz(e){let t=v.useRef(e);return Mo(()=>{t.current=e}),t}var Mo=typeof window>"u"?v.useEffect:v.useLayoutEffect;function El(e){let t=v.useRef();return t.current===void 0&&(t.current=e()),t}function Fi(e){let t=xC(),n=()=>e(t.snapshot());return v.useSyncExternalStore(t.subscribe,n,n)}function vz(e,t,n,r=[]){let a=v.useRef(),i=Nf();return Mo(()=>{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(Al,c),a.current=c}),a}var _ve=()=>{let[e,t]=v.useState(),n=El(()=>new Map);return Mo(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function Ave(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function ng({asChild:e,children:t},n){return e&&v.isValidElement(t)?v.cloneElement(Ave(t),{ref:t.ref},n(t.props.children)):n(t)}var Eve={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const gz=v.forwardRef(({className:e,...t},n)=>s.jsx(Lr,{ref:n,className:xe("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));gz.displayName=Lr.displayName;const yz=v.forwardRef(({className:e,...t},n)=>s.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[s.jsx(PS,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),s.jsx(Lr.Input,{ref:n,className:xe("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})]}));yz.displayName=Lr.Input.displayName;const xz=v.forwardRef(({className:e,...t},n)=>s.jsx(Lr.List,{ref:n,className:xe("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));xz.displayName=Lr.List.displayName;const bz=v.forwardRef((e,t)=>s.jsx(Lr.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));bz.displayName=Lr.Empty.displayName;const wz=v.forwardRef(({className:e,...t},n)=>s.jsx(Lr.Group,{ref:n,className:xe("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}));wz.displayName=Lr.Group.displayName;const Pve=v.forwardRef(({className:e,...t},n)=>s.jsx(Lr.Separator,{ref:n,className:xe("-mx-1 h-px bg-border",e),...t}));Pve.displayName=Lr.Separator.displayName;const wS=v.forwardRef(({className:e,...t},n)=>s.jsx(Lr.Item,{ref:n,className:xe("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}));wS.displayName=Lr.Item.displayName;const cM={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:[]},uM={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"},Ove=()=>({id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096}),kve=()=>{const{agentName:e}=Lo(),t=_a(),{agents:n,setAgents:r}=Ha(),{source:a}=In(),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??Ove()),[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([...cM[d.provider]||[],...N])),L=B.includes(d.model),G=R||!!d.model&&!L,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()})}},H=async()=>{if(!z){_e({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),_e({title:T.kind==="deployments"?"Deployments loaded":"Models loaded",description:`${T.items.length} ${T.kind} from ${T.source}`})}catch(T){_e({title:"Could not load provider models",description:String(T instanceof Error?T.message:T),variant:"destructive"})}finally{A(!1)}},Q=async()=>{if(!d.name.trim()){_e({title:"Name is required",variant:"destructive"});return}g(!0);try{if(i)await r([...n,d]),_e({title:"Agent created"}),t(`/libraries/agents/${encodeURIComponent(d.id)}`);else{const T=n.map(D=>D.id===c?.id?d:D);await r(T),_e({title:"Agent saved"}),d.id!==o&&t(`/libraries/agents/${encodeURIComponent(d.id)}`,{replace:!0})}}finally{g(!1)}},J=async()=>{const T=n.filter(D=>D.id!==c?.id);await r(T),_e({title:"Agent deleted"}),t("/libraries/agents")};return!i&&!c?s.jsxs("div",{className:"space-y-4",children:[s.jsxs(bt,{to:"/libraries/agents",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(So,{className:"h-4 w-4"})," Agents"]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:['Agent "',o,'" not found.']})]}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsxs(bt,{to:"/libraries/agents",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(So,{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(p$,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),x&&s.jsxs(Ue,{children:[s.jsxs(Ct,{className:"flex-row items-center justify-between space-y-0",children:[s.jsx(_t,{className:"text-base",children:"Connection Test"}),s.jsx("button",{type:"button",onClick:()=>S(!1),className:"rounded-sm opacity-70 hover:opacity-100",children:s.jsx(Vs,{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(ir,{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(Yl,{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]}),uM[d.provider]&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",uM[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(Ct,{children:s.jsx(_t,{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(ht,{value:d.name,onChange:T=>f(D=>({...D,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(on,{value:d.provider,onValueChange:T=>f(D=>({...D,provider:T,model:cM[T]?.[0]||""})),children:[s.jsx(Zt,{children:s.jsx(ln,{})}),s.jsxs(en,{children:[s.jsx(it,{value:"openai",children:"OpenAI"}),s.jsx(it,{value:"anthropic",children:"Anthropic"}),s.jsx(it,{value:"azure",children:"Azure OpenAI"}),s.jsx(it,{value:"google",children:"Google"}),s.jsx(it,{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(rve,{open:O,onOpenChange:k,children:[s.jsx(ave,{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(Vt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(lz,{className:"w-[420px] p-0",align:"start",children:s.jsxs(gz,{children:[s.jsx(yz,{placeholder:`Search ${d.provider==="azure"?"deployments":"models"}...`}),s.jsxs(xz,{children:[s.jsxs(bz,{children:["No ",d.provider==="azure"?"deployments":"models"," found."]}),s.jsxs(wz,{heading:d.provider==="azure"?"Deployments":"Models",children:[B.map(T=>s.jsxs(wS,{value:T,onSelect:D=>{f(X=>({...X,model:D})),M(!1),k(!1)},children:[s.jsx(Yl,{className:xe("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(wS,{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:()=>{H()},disabled:P,title:d.provider==="azure"?"Fetch Azure OpenAI deployments":`Fetch ${d.provider} models`,children:[P?s.jsx(ir,{className:"mr-1 h-3 w-3 animate-spin"}):s.jsx(Sa,{className:"mr-1 h-3 w-3"}),d.provider==="azure"?"Fetch Deployments":"Fetch Models"]})]}),G&&s.jsx(ht,{value:d.model,onChange:T=>f(D=>({...D,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(ht,{type:"number",min:1,max:128e3,value:d.maxTokens,onChange:T=>f(D=>({...D,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(ht,{type:"number",min:1,max:50,value:d.maxTurns??"",onChange:T=>{const D=T.target.value.trim();f(X=>({...X,maxTurns:D&&parseInt(D)||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(X8,{value:[d.temperature],onValueChange:([T])=>f(D=>({...D,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(Ua,{value:d.systemPrompt||"",onChange:T=>f(D=>({...D,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:()=>{Q()},disabled:y,children:[y&&s.jsx(ir,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Create Agent":"Save"]})]})]})]})]}),s.jsx(Ss,{open:h,onOpenChange:p,children:s.jsxs(Ga,{children:[s.jsxs(Ya,{children:[s.jsx(Qa,{children:"Delete agent?"}),s.jsxs(Ja,{children:["This will permanently remove the agent"," ",s.jsx("span",{className:"font-mono",children:d.name}),". This action cannot be undone."]})]}),s.jsxs(Xa,{children:[s.jsx(es,{children:"Cancel"}),s.jsx(Za,{onClick:()=>{J()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},dM="mcplab.resultAssistantScenarioHandoff",fM=()=>{const{testCaseId:e}=Lo(),[t,n]=Ic(),r=_a(),{source:a}=In(),{scenarios:i,setScenarios:o,agents:c,servers:d,reload:f,loading:h}=Ha(),[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,L]=v.useState(""),[G,U]=v.useState(0),[H,Q]=v.useState(null),J=v.useRef(null),T=v.useRef(!1),D=v.useRef(!1),X=v.useRef(null),F=v.useRef(0),$=e?decodeURIComponent(e):void 0,ee=$?i.findIndex(ge=>ge.id===$):-1,ae=ee>=0?i[ee]:void 0,K=async ge=>{if(!ae||ee<0||!ge)return;const Oe=[...i];Oe[ee]=ge,await o(Oe)},le=async()=>{const ge=X.current;if(!ge||!ae)return;if(T.current){D.current=!0;return}T.current=!0,D.current=!1;const Oe=++F.current;R("saving"),z("");try{await K(ge),Oe===F.current&&R("saved")}catch(Be){const dt=Be instanceof Error?Be.message:String(Be);Oe===F.current&&(R("error"),z(dt)),_e({title:"Could not save scenario",description:dt,variant:"destructive"})}finally{T.current=!1,D.current&&(D.current=!1,le())}},ie=ge=>{X.current=ge,R("dirty"),z(""),J.current&&window.clearTimeout(J.current),J.current=window.setTimeout(()=>{J.current=null,le()},700)},fe=async()=>{const ge=`scn-${Date.now()}`;let Oe=ge,Be=1;for(;i.some(be=>be.id===Oe);)Oe=`${ge}-${Be}`,Be+=1;const dt={id:Oe,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};await o([...i,dt]),r(`/libraries/test-cases/${encodeURIComponent(Oe)}`),_e({title:"Test case created",description:`Opened ${Oe} for editing.`})},oe=ge=>{const Oe=(ge||`scn-${Date.now()}`).trim().replace(/\s+/g,"-").replace(/[^a-zA-Z0-9_-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")||`scn-${Date.now()}`;let Be=Oe,dt=1;for(;i.some(be=>be.id===Be);)Be=`${Oe}-${dt}`,dt+=1;return Be},ce=async(ge,Oe=!1)=>{const Be=oe(`${ge.id}-copy`),dt={...structuredClone(ge),id:Be,name:ge.name?`${ge.name} (Copy)`:""};await o([...i,dt]),_e({title:"Test case duplicated",description:`Created ${dt.id}.`}),Oe&&r(`/libraries/test-cases/${encodeURIComponent(dt.id)}`)},Se=async ge=>{J.current&&(window.clearTimeout(J.current),J.current=null);const Oe=i.filter(Be=>Be.id!==ge.id);await o(Oe),_e({title:"Test case deleted",description:`${ge.id} was removed.`}),ae?.id===ge.id&&(O(null),X.current=null,R("idle"),z(""),r("/libraries/test-cases"))},ne=ge=>ge.map(Oe=>d.find(Be=>Be.id===Oe)).filter(Boolean).map(Oe=>Oe?.name||Oe?.id).filter(Boolean),Te=v.useMemo(()=>{const ge=new Set;for(const Oe of i)for(const Be of ne(Oe.serverIds))ge.add(Be);return Array.from(ge).sort((Oe,Be)=>Oe.localeCompare(Be))},[i,d]),Ae=v.useMemo(()=>{const ge=p.trim().toLowerCase(),Oe=i.filter(Be=>{const dt=(Be.name||"").toLowerCase(),be=Be.id.toLowerCase(),Je=(Be.prompt||"").toLowerCase(),lt=ne(Be.serverIds);return g!=="all"&&!lt.includes(g)?!1:ge?dt.includes(ge)||be.includes(ge)||Je.includes(ge)||lt.some(Rt=>Rt.toLowerCase().includes(ge)):!0});return Oe.sort((Be,dt)=>{const be=ne(Be.serverIds),Je=ne(dt.serverIds);let lt=0;switch(b){case"id":lt=Be.id.localeCompare(dt.id);break;case"servers":lt=be.length-Je.length;break;case"evalRules":lt=Be.evalRules.length-dt.evalRules.length;break;case"extractRules":lt=Be.extractRules.length-dt.extractRules.length;break;default:lt=(Be.name||Be.id).localeCompare(dt.name||dt.id);break}return lt===0&&(lt=Be.id.localeCompare(dt.id)),S==="asc"?lt:-lt}),Oe},[i,p,g,b,S,d]);v.useEffect(()=>{let ge=!0;return a.getWorkspaceSettings().then(Oe=>{!ge||!Oe||P(Oe.scenarioAssistantAgentName??"")}).catch(()=>{ge&&P("")}),()=>{ge=!1}},[a]),v.useEffect(()=>{if($&&t.get("assistantHandoff")==="1")try{const ge=window.sessionStorage.getItem(dM);if(!ge)return;const Oe=JSON.parse(ge);if(!Oe||Oe.scenarioId!==$||!Oe.prompt)return;L(String(Oe.prompt)),U(Date.now()),window.sessionStorage.removeItem(dM);const Be=new URLSearchParams(t);Be.delete("assistantHandoff"),n(Be,{replace:!0}),_e({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)),X.current=structuredClone(ae),R("idle"),z("")):(O(null),X.current=null,R("idle"),z("")),J.current&&(window.clearTimeout(J.current),J.current=null),T.current=!1,D.current=!1},[ae]),v.useEffect(()=>()=>{J.current&&window.clearTimeout(J.current)},[]);const Ye=_||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(s$,{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(So,{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(Sa,{className:"mr-2 h-4 w-4"}),"Refresh"]}),!ae&&s.jsxs(se,{type:"button",size:"sm",onClick:()=>{fe()},children:[s.jsx(ps,{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(PS,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),s.jsx(ht,{value:p,onChange:ge=>y(ge.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(on,{value:g,onValueChange:j,children:[s.jsx(Zt,{className:"h-8 text-xs",children:s.jsx(ln,{})}),s.jsxs(en,{children:[s.jsx(it,{value:"all",children:"All servers"}),Te.map(ge=>s.jsx(it,{value:ge,children:ge},ge))]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Sort By"}),s.jsxs(on,{value:b,onValueChange:ge=>x(ge),children:[s.jsx(Zt,{className:"h-8 text-xs",children:s.jsx(ln,{})}),s.jsxs(en,{children:[s.jsx(it,{value:"name",children:"Name"}),s.jsx(it,{value:"id",children:"ID"}),s.jsx(it,{value:"servers",children:"# Servers"}),s.jsx(it,{value:"evalRules",children:"# Eval Rules"}),s.jsx(it,{value:"extractRules",children:"# Extract Rules"})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Direction"}),s.jsxs(on,{value:S,onValueChange:ge=>N(ge),children:[s.jsx(Zt,{className:"h-8 w-28 text-xs",children:s.jsx(ln,{})}),s.jsxs(en,{children:[s.jsx(it,{value:"asc",children:"Ascending"}),s.jsx(it,{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(ge=>{const Oe=$===ge.id,Be=`/libraries/test-cases/${encodeURIComponent(ge.id)}`,dt=ne(ge.serverIds);return s.jsx("div",{className:`rounded-lg border p-3 ${Oe?"border-primary bg-primary/5":""}`,children:s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"space-y-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx(bt,{to:Be,className:"font-medium truncate hover:underline",children:ge.name||ge.id}),s.jsx(Qe,{variant:"outline",className:"font-mono text-[10px]",children:ge.id}),Oe&&s.jsx(Qe,{children:"Selected"})]}),s.jsxs("div",{className:"text-xs text-muted-foreground flex flex-wrap gap-x-3 gap-y-1",children:[s.jsxs("span",{children:[dt.length," server",dt.length!==1?"s":""]}),s.jsxs("span",{children:[ge.evalRules.length," eval rule",ge.evalRules.length!==1?"s":""]}),s.jsxs("span",{children:[ge.extractRules.length," extract rule",ge.extractRules.length!==1?"s":""]})]}),dt.length>0&&s.jsx("div",{className:"flex flex-wrap gap-1",children:dt.map(be=>s.jsx(Qe,{variant:"secondary",className:"text-[10px]",children:be},`${ge.id}-${be}`))})]}),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:()=>Q(ge),children:[s.jsx(Na,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{ce(ge)},children:[s.jsx($i,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsx(se,{type:"button",size:"sm",variant:Oe?"default":"outline",asChild:!0,children:s.jsxs(bt,{to:Be,children:[s.jsx(km,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})})]})]})},ge.id)})})]})})]}),ae&&A?s.jsxs(Ue,{children:[s.jsxs(Ct,{className:"pb-3",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsx("div",{children:s.jsx(_t,{className:"text-base",children:"Edit Test Case"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{ce(A,!0)},children:[s.jsx($i,{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:()=>Q(A),children:[s.jsx(Na,{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(Qe,{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(mS,{scenarios:[A],agents:c,servers:d,defaultAssistantAgentName:Ye,assistantInitialPromptByScenarioId:B&&A?.id?{[A.id]:B}:void 0,assistantAutoOpenNonceByScenarioId:A?.id&&G?{[A.id]:G}:void 0,onChange:ge=>{const Oe=ge[0];Oe&&(O(Oe),ie(Oe))},allowAdd:!1})})]}):null,s.jsx(Ss,{open:!!H,onOpenChange:ge=>!ge&&Q(null),children:s.jsxs(Ga,{children:[s.jsxs(Ya,{children:[s.jsx(Qa,{children:"Delete test case?"}),s.jsxs(Ja,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-medium",children:H?.name||H?.id})," ","from the library. This action cannot be undone."]})]}),s.jsxs(Xa,{children:[s.jsx(es,{children:"Cancel"}),s.jsx(Za,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{H&&(Se(H),Q(null))},children:"Delete Test Case"})]})]})})]})},Rve=()=>{const{source:e}=In(),{agents:t,reload:n,loading:r}=Ha(),[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(""),_e({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}),_e({title:"Settings updated",description:j?`Scenario Assistant Agent set to ${j}.`:"Scenario Assistant Agent cleared (will use first available agent by default)."})}catch(b){_e({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(OS,{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(Sa,{className:"mr-2 h-4 w-4"}),"Refresh"]})]}),s.jsxs(Ue,{children:[s.jsxs(Ct,{className:"pb-3",children:[s.jsx(_t,{className:"text-base",children:"Scenario Assistant"}),s.jsx(Bs,{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(on,{value:h||"__none__",onValueChange:j=>{y(j==="__none__"?"":j)},disabled:o,children:[s.jsx(Zt,{className:"h-9 text-sm",children:s.jsx(ln,{placeholder:"Select assistant agent"})}),s.jsxs(en,{children:[s.jsx(it,{value:"__none__",children:"None (use first agent)"}),t.map(j=>s.jsxs(it,{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 rg="Checkbox",[Tve]=or(rg),[Ive,bC]=Tve(rg);function Mve(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]=sa({prop:n,defaultProp:a??!1,onChange:d,caller:rg}),[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:Mi(a)?!1:a,isFormControl:_,bubbleInput:x,setBubbleInput:S};return s.jsx(Ive,{scope:t,...P,children:$ve(p)?p(P):r})}var jz="CheckboxTrigger",Sz=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}=bC(jz,e),b=mt(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(ze.button,{type:"button",role:"checkbox","aria-checked":Mi(d)?"mixed":d,"aria-required":f,"data-state":Ez(d),"data-disabled":c?"":void 0,disabled:c,value:o,...r,ref:b,onKeyDown:Ee(t,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:Ee(n,S=>{p(N=>Mi(N)?!0:!N),j&&g&&(y.current=S.isPropagationStopped(),y.current||S.stopPropagation())})})});Sz.displayName=jz;var wC=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(Mve,{__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(Sz,{...p,ref:t,__scopeCheckbox:n}),y&&s.jsx(Az,{__scopeCheckbox:n})]})})});wC.displayName=rg;var Nz="CheckboxIndicator",Cz=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,i=bC(Nz,n);return s.jsx(Kn,{present:r||Mi(i.checked)||i.checked===!0,children:s.jsx(ze.span,{"data-state":Ez(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});Cz.displayName=Nz;var _z="CheckboxBubbleInput",Az=v.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:a,checked:i,defaultChecked:o,required:c,disabled:d,name:f,value:h,form:p,bubbleInput:y,setBubbleInput:g}=bC(_z,e),j=mt(n,g),b=Wv(i),x=$m(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=Mi(i),A.call(N,Mi(i)?!1:i),N.dispatchEvent(k)}},[y,b,i,a]);const S=v.useRef(Mi(i)?!1:i);return s.jsx(ze.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??S.current,required:c,disabled:d,name:f,value:h,form:p,...t,tabIndex:-1,ref:j,style:{...t.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Az.displayName=_z;function $ve(e){return typeof e=="function"}function Mi(e){return e==="indeterminate"}function Ez(e){return Mi(e)?"indeterminate":e?"checked":"unchecked"}const ba=v.forwardRef(({className:e,...t},n)=>s.jsx(wC,{ref:n,className:xe("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(Cz,{className:xe("flex items-center justify-center text-current"),children:s.jsx(Yl,{className:"h-4 w-4"})})}));ba.displayName=wC.displayName;const Dve=Do("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"}}),Hl=v.forwardRef(({className:e,variant:t,...n},r)=>s.jsx("div",{ref:r,role:"alert",className:xe(Dve({variant:t}),e),...n}));Hl.displayName="Alert";const Kl=v.forwardRef(({className:e,...t},n)=>s.jsx("h5",{ref:n,className:xe("mb-1 font-medium leading-none tracking-tight",e),...t}));Kl.displayName="AlertTitle";const Gl=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:xe("text-sm [&_p]:leading-relaxed",e),...t}));Gl.displayName="AlertDescription";function Lve(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,Fve(a,...t)]}function Fve(...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 Bve=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pz=Bve.reduce((e,t)=>{const n=Gm(`Primitive.${t}`),r=v.forwardRef((a,i)=>{const{asChild:o,...c}=a,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),jC="Progress",SC=100,[zve]=Lve(jC),[Uve,qve]=zve(jC),Oz=v.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:a,getValueLabel:i=Wve,...o}=e;(a||a===0)&&!pM(a)&&console.error(Vve(`${a}`,"Progress"));const c=pM(a)?a:SC;r!==null&&!hM(r,c)&&console.error(Hve(`${r}`,"Progress"));const d=hM(r,c)?r:null,f=_m(d)?i(d,c):void 0;return s.jsx(Uve,{scope:n,value:d,max:c,children:s.jsx(Pz.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":_m(d)?d:void 0,"aria-valuetext":f,role:"progressbar","data-state":Tz(d,c),"data-value":d??void 0,"data-max":c,...o,ref:t})})});Oz.displayName=jC;var kz="ProgressIndicator",Rz=v.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,a=qve(kz,n);return s.jsx(Pz.div,{"data-state":Tz(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...r,ref:t})});Rz.displayName=kz;function Wve(e,t){return`${Math.round(e/t*100)}%`}function Tz(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function _m(e){return typeof e=="number"}function pM(e){return _m(e)&&!isNaN(e)&&e>0}function hM(e,t){return _m(e)&&!isNaN(e)&&e<=t&&e>=0}function Vve(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${SC}\`.`}function Hve(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 ${SC} if no \`max\` prop is set)
|
|
133
|
-
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
134
|
-
|
|
135
|
-
Defaulting to \`null\`.`}var Iz=Oz,Kve=Rz;const ag=v.forwardRef(({className:e,value:t,...n},r)=>s.jsx(Iz,{ref:r,className:xe("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:s.jsx(Kve,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));ag.displayName=Iz.displayName;const Wu=["critical","high","medium","low","info"];function h1(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 Gve(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 mM({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(T7,{className:"h-3.5 w-3.5"}),"Suggested improvement"]}),s.jsx("p",{children:e})]})}function NC(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 Mz({report:e}){const[t,n]=v.useState([...Wu]),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?[...Wu]: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(Ct,{className:"pb-3",children:[s.jsx(_t,{className:"text-base",children:"Analysis Overview"}),s.jsx(Bs,{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:[Wu.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(Qe,{variant:"outline",className:`capitalize font-normal ${o?h1(i):Gve(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([...Wu]),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===Wu.length:d.some(f=>r.has(f.severity))});return o.length===0?null:s.jsxs(Ue,{children:[s.jsxs(Ct,{className:"pb-3",children:[s.jsx(_t,{className:"text-base",children:i.serverName}),s.jsxs(Bs,{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(Hl,{children:[s.jsx(Kl,{children:"Warnings"}),s.jsx(Gl,{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(Qe,{variant:c.safetyClassification==="read_like"?"secondary":"outline",children:c.safetyClassification}),s.jsx(Vt,{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(Qe,{variant:"outline",className:`shrink-0 text-[10px] ${h1(d.severity)}`,children:d.severity})]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",d.detail]}),d.suggestion&&s.jsx(mM,{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(Qe,{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(Qe,{variant:"outline",className:`shrink-0 text-[10px] ${h1(f.severity)}`,children:f.severity})]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",f.detail]}),f.suggestion&&s.jsx(mM,{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 m1="mcplab.toolAnalysis.activeJobId";function vM(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 gM({text:e}){return s.jsxs(eD,{children:[s.jsx(tD,{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(P7,{className:"h-3.5 w-3.5"})})}),s.jsx(US,{className:"max-w-xs text-xs",children:s.jsx("p",{children:e})})]})}function Yve(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 Xve=()=>{const{source:e}=In(),{servers:t,agents:n,loading:r,reload:a}=Ha(),[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,L]=v.useState(null),[G,U]=v.useState([]),[H,Q]=v.useState(null),[J,T]=v.useState(null),[D,X]=v.useState(!1),[F,$]=v.useState("configure"),[ee,ae]=v.useState("idle"),K=v.useRef(null),le=i||n[0]?.name||"",ie=v.useMemo(()=>{let Z=0;const je=new Set,we=new Set;for(const Le of G){const Xe=typeof Le.payload?.message=="string"?Le.payload.message:"";if(!Xe)continue;const At=Xe.match(/\((\d+)\s+tools?\)/i);At&&(Z=Math.max(Z,Number(At[1])||0));const jn=Xe.match(/^Started\s+(.+)$/);jn&&je.add(jn[1]);const Sn=Xe.match(/^Finished\s+(.+)$/);Sn&&we.add(Sn[1])}const ke=Z>0?Math.max(0,Math.min(100,Math.round(we.size/Z*100))):0;return{totalTools:Z,startedTools:je.size,finishedTools:we.size,percent:ke}},[G]);v.useEffect(()=>{let Z=!0;return e.getWorkspaceSettings().then(je=>{!Z||!je||o(je.scenarioAssistantAgentName??"")}).catch(()=>{Z&&o("")}),()=>{Z=!1}},[e]),v.useEffect(()=>()=>{K.current?.()},[]);const fe=()=>{try{sessionStorage.removeItem(m1)}catch{}},oe=Z=>{try{sessionStorage.setItem(m1,Z)}catch{}},ce=Z=>{K.current?.(),K.current=e.subscribeToolAnalysisJob(Z,je=>{if(U(we=>[...we,je]),je.type==="completed")e.getToolAnalysisResult(Z).then(we=>{Q(we.report),T(we.savedReportId??null)}).catch(we=>_e({title:"Could not load analysis report",description:we instanceof Error?we.message:String(we),variant:"destructive"})).finally(()=>{fe(),L(null),X(!1),ae("idle"),$("run")});else if(je.type==="error"){const we=String(je.payload?.message??"");fe(),ae(we.toLowerCase().includes("abort")?"stopped":"error"),L(null),X(!1)}})};v.useEffect(()=>{if(B||H)return;let Z="";try{Z=sessionStorage.getItem(m1)??""}catch{Z=""}if(Z)return $("run"),ae("running"),X(!0),L(Z),U([]),ce(Z),()=>{}},[e,B,H]);const Se=async()=>{if(c.length===0){y([]),j({});return}h(!0);try{const Z=await e.discoverToolsForAnalysis({serverNames:c});y(Z.servers),j(je=>{const we={};for(const ke of Z.servers){const Le=je[ke.serverName]??[],Xe=ke.tools.map(jn=>jn.name),At=Le.filter(jn=>Xe.includes(jn));we[ke.serverName]=At.length>0?At:Xe}return we})}catch(Z){_e({title:"Could not discover MCP tools",description:Z instanceof Error?Z.message:String(Z),variant:"destructive"})}finally{h(!1)}};v.useEffect(()=>{Se()},[c.join("|")]);const ne=v.useMemo(()=>{const Z=b.trim().toLowerCase();return Z?p.map(je=>({...je,tools:je.tools.filter(we=>we.name.toLowerCase().includes(Z)||(we.description||"").toLowerCase().includes(Z))})).filter(je=>je.tools.length>0):p},[p,b]),Te=v.useMemo(()=>Object.values(g).reduce((Z,je)=>Z+je.length,0),[g]),Ae=c[0]??"",Ye=async()=>{if(!S&&!_){_e({title:"Select at least one mode",variant:"destructive"});return}if(c.length!==1){_e({title:"Select exactly one server",variant:"destructive"});return}if(Te===0){_e({title:"Select at least one tool",variant:"destructive"});return}X(!0),U([]),Q(null),T(null),$("run"),ae("running");try{const{jobId:Z}=await e.startToolAnalysis({serverNames:c,selectedToolsByServer:g,maxParallelTools:A,modes:{metadataReview:S,deeperAnalysis:_},deeperAnalysisOptions:{autoRunPolicy:"read_only_allowlist",sampleCallsPerTool:k,toolCallTimeoutMs:M}});L(Z),oe(Z),ce(Z)}catch(Z){X(!1),ae("error"),$("run"),_e({title:"Could not start tool analysis",description:Z instanceof Error?Z.message:String(Z),variant:"destructive"})}},ge=async()=>{if(!B)return;const Z=B;try{const je=await e.stopToolAnalysis(Z);if(je.status==="completed"){K.current?.(),K.current=null;const we=await e.getToolAnalysisResult(Z);Q(we.report),T(we.savedReportId??null),fe(),L(null),X(!1),ae("idle"),$("run"),_e({title:"Analysis already finished",description:"Showing the result overview."});return}if(je.status==="stopped"){K.current?.(),K.current=null,fe(),L(null),X(!1),ae("stopped"),_e({title:"Analysis stopped"});return}if(je.status==="error"){K.current?.(),K.current=null,fe(),L(null),X(!1),ae("error"),_e({title:"Analysis already ended with an error",description:"Review the progress log and return to Configure Analysis."});return}_e({title:"Stopping analysis..."})}catch(je){_e({title:"Could not stop analysis",description:je instanceof Error?je.message:String(je),variant:"destructive"})}},Oe=()=>{$("configure"),ae("idle"),L(null)},Be=(Z,je)=>{d(we=>je?[Z]:we.filter(ke=>ke!==Z))},dt=(Z,je,we)=>{j(ke=>{const Le=new Set(ke[Z]??[]);return we?Le.add(je):Le.delete(je),{...ke,[Z]:Array.from(Le)}})},be=(Z,je)=>{j(we=>({...we,[Z]:je}))},Je=!0,lt=B!==null||G.length>0||ee==="stopped"||ee==="error",Rt=!!H,qt=Z=>{if(Z==="configure"&&Je){$("configure");return}if(Z==="run"&<){$("run");return}Z==="report"&&Rt&&$("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(l$,{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:()=>qt("configure"),className:"rounded-full","aria-label":"Open Configure Analysis",children:s.jsx(Qe,{variant:F==="configure"?"default":"outline",className:"cursor-pointer",children:"Configure Analysis"})}),s.jsx("button",{type:"button",onClick:()=>qt("run"),disabled:!lt,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Run Analysis",children:s.jsx(Qe,{variant:F==="run"?"default":"outline",className:lt?"cursor-pointer":"cursor-not-allowed",children:"Run Analysis"})}),s.jsx("button",{type:"button",onClick:()=>qt("report"),disabled:!Rt,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Report",children:s.jsx(Qe,{variant:F==="report"?"default":"outline",className:Rt?"cursor-pointer":"cursor-not-allowed",children:"Report"})})]})]}),F==="configure"&&s.jsxs(Ue,{children:[s.jsxs(Ct,{children:[s.jsx(_t,{className:"text-base",children:"Run MCP analysis"}),s.jsx(Bs,{children:"Select servers and tools, choose metadata review and/or deeper sample-call analysis, then run the report."})]}),s.jsxs(qe,{className:"space-y-5",children:[!le&&s.jsxs(Hl,{children:[s.jsx(Kl,{children:"No assistant agent available"}),s.jsxs(Gl,{children:["Add a library agent in"," ",s.jsx(bt,{to:"/libraries/agents",className:"underline",children:"Agents"})," ","and optionally set the default Scenario Assistant Agent in"," ",s.jsx(bt,{to:"/settings",className:"underline",children:"Settings"}),"."]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx($e,{className:"text-xs",children:"Servers"}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{a()},disabled:r,children:[s.jsx(Sa,{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(Z=>{const je=c.includes(Z.id);return s.jsxs("label",{className:"flex items-start gap-2 rounded-md border p-2 text-sm",children:[s.jsx(ba,{checked:je,onCheckedChange:we=>Be(Z.id,!!we)}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"font-medium",children:Z.name||Z.id}),Z.url&&s.jsx("div",{className:"truncate text-xs text-muted-foreground",children:Z.url})]})]},Z.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(PS,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),s.jsx(ht,{className:"h-9 pl-8",placeholder:"Filter tools by name or description...",value:b,onChange:Z=>x(Z.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:()=>{Se()},disabled:f||c.length===0,children:[f&&s.jsx(ir,{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..."}):ne.length===0&&!f?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No discovered tools match the current filters."}):ne.map(Z=>{const je=new Set(g[Z.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:Z.serverName}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(se,{type:"button",size:"sm",variant:"ghost",onClick:()=>be(Z.serverName,Z.tools.map(we=>we.name)),children:"Select all"}),s.jsx(se,{type:"button",size:"sm",variant:"ghost",onClick:()=>be(Z.serverName,[]),children:"Clear"})]})]}),Z.warnings.length>0&&s.jsx("div",{className:"mb-2 space-y-1",children:Z.warnings.map(we=>s.jsx("div",{className:"text-xs text-amber-700",children:Yve(Z.serverName,we)},`${Z.serverName}-${we}`))}),s.jsx("div",{className:"grid gap-2",children:Z.tools.map(we=>s.jsxs("label",{className:"flex items-start gap-2 rounded border p-2",children:[s.jsx(ba,{checked:je.has(we.name),onCheckedChange:ke=>dt(Z.serverName,we.name,!!ke)}),s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("span",{className:"font-mono text-xs",children:we.name}),s.jsx(Qe,{variant:we.safetyClassification==="read_like"?"secondary":"outline",className:"text-[10px]",children:we.safetyClassification==="read_like"?"read-like":"unsafe/unknown"})]}),we.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:we.description}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:we.classificationReason})]})]},`${Z.serverName}-${we.name}`))})]},Z.serverName)})}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Selected tools: ",Te]})]}),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(ba,{checked:S,onCheckedChange:Z=>N(!!Z)}),s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Metadata / schema review",s.jsx(gM,{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(ba,{checked:_,onCheckedChange:Z=>P(!!Z)}),s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Deeper analysis",s.jsx(gM,{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(ht,{type:"number",min:1,max:8,value:A,onChange:Z=>O(Math.max(1,Math.min(8,Number(Z.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(ht,{type:"number",min:1,max:5,value:k,onChange:Z=>R(Math.max(1,Math.min(5,Number(Z.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(ht,{type:"number",min:1e3,max:6e4,step:500,value:M,onChange:Z=>z(Math.max(1e3,Math.min(6e4,Number(Z.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:()=>{Ye()},disabled:D||!!B,children:[(D||!!B)&&s.jsx(ir,{className:"mr-2 h-4 w-4 animate-spin"}),"Analyze Tools"]})})]})]}),F==="run"&&s.jsxs(Ue,{children:[s.jsx(Ct,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(_t,{className:"flex items-center gap-2 text-base",children:s.jsx("span",{children:"Progress"})}),s.jsx(Bs,{children:B?"Live tool-analysis job events:":H?"Analysis finished. Review the summary below or open the saved report details.":ee==="stopped"?"Analysis was stopped. You can return to Configure Analysis.":ee==="error"?"Analysis ended with an error. Review the log and go back to Configure Analysis.":"Analysis finished."})]}),B?s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{ge()},children:"Stop Analysis"}):s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:Oe,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(ir,{className:"h-3.5 w-3.5 animate-spin"}),"Analysis is still running..."]}),(ie.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:ie.totalTools>0?`${ie.finishedTools}/${ie.totalTools} tools finished`:"Preparing analysis..."}),s.jsx("span",{children:ie.totalTools>0?`${ie.percent}%`:"0%"})]}),s.jsx(ag,{value:ie.totalTools>0?ie.percent:0,className:"h-2"})]}),G.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children: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((Z,je)=>s.jsxs("div",{className:"text-xs",children:[s.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(Z.ts).toLocaleTimeString()}),s.jsx(Qe,{variant:"outline",className:"mr-2 text-[10px]",children:Z.type}),s.jsx("span",{className:"break-all",children:typeof Z.payload.message=="string"?Z.payload.message:JSON.stringify(Z.payload)})]},`${Z.ts}-${je}`))}),!B&&H&&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:[H.summary.toolsAnalyzed," tools analyzed, ",H.summary.toolsSkipped," skipped, across"," ",H.summary.serversAnalyzed," server",H.summary.serversAnalyzed!==1?"s":"","."]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[J&&s.jsx(se,{asChild:!0,size:"sm",children:s.jsx(bt,{to:`/tool-analysis-results/${J}`,children:"Open result details"})}),s.jsx(se,{asChild:!0,size:"sm",variant:"outline",children:s.jsx(bt,{to:"/tool-analysis-results",children:"View all results"})}),s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>qt("report"),children:"View inline report"})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[H.summary.issueCounts.critical>0&&s.jsxs(Qe,{className:"bg-red-600 text-white hover:bg-red-600",children:["Critical: ",H.summary.issueCounts.critical]}),H.summary.issueCounts.high>0&&s.jsxs(Qe,{className:"bg-orange-500 text-white hover:bg-orange-500",children:["High: ",H.summary.issueCounts.high]}),H.summary.issueCounts.medium>0&&s.jsxs(Qe,{className:"bg-amber-500 text-white hover:bg-amber-500",children:["Medium: ",H.summary.issueCounts.medium]}),H.summary.issueCounts.low>0&&s.jsxs(Qe,{className:"bg-blue-500 text-white hover:bg-blue-500",children:["Low: ",H.summary.issueCounts.low]}),H.summary.issueCounts.info>0&&s.jsxs(Qe,{variant:"outline",children:["Info: ",H.summary.issueCounts.info]}),Object.values(H.summary.issueCounts).every(Z=>Z===0)&&s.jsx(Qe,{className:"bg-green-600 text-white hover:bg-green-600",children:"No findings"})]})]})})]})]}),F==="report"&&H&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-semibold",children:"Report"}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:[H.summary.toolsAnalyzed," tools analyzed across ",H.summary.serversAnalyzed," server",H.summary.serversAnalyzed!==1?"s":"","."]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:Oe,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(bt,{to:`/tool-analysis-results/${J}`,children:"Open saved report"})}),s.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx(bt,{to:"/tool-analysis-results",children:"View all reports"})})]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>vM(`tool-analysis-${Date.now()}.json`,`${JSON.stringify(H,null,2)}
|
|
138
|
-
`,"application/json"),children:[s.jsx(wa,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>vM(`tool-analysis-${Date.now()}.md`,NC(H),"text/markdown"),children:[s.jsx(wa,{className:"mr-2 h-4 w-4"}),"Export Markdown"]})]})]}),s.jsx(Mz,{report:H})]})]})};function yM(e,t,n){const r=new Blob([t],{type:n}),a=URL.createObjectURL(r),i=document.createElement("a");i.href=a,i.download=e,i.click(),URL.revokeObjectURL(a)}function Qve(){const{source:e}=In(),[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){_e({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)),_e({title:"Tool analysis report deleted"}),o(null)}catch(g){_e({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"?yM(`${g}.json`,`${JSON.stringify(b,null,2)}
|
|
139
|
-
`,"application/json"):yM(`${g}.md`,NC(b.report),"text/markdown")}catch(b){_e({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(c$,{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(bt,{to:"/tool-analysis",children:"Analyze MCP Tools"})})]})]}),s.jsx(Ue,{children:s.jsx(qe,{className:"p-0",children:r?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Loading tool analysis results..."}):t.length===0?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"No saved tool analysis reports yet."}):s.jsxs(Zr,{children:[s.jsx(ea,{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(ta,{children:t.map(g=>s.jsxs(Ut,{children:[s.jsx(He,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(bt,{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(He,{className:"text-[11px] text-muted-foreground",children:s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Servers: ",s.jsx("span",{className:"font-medium text-foreground",children: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(He,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(ef,{className:"h-3 w-3"}),new Date(g.createdAt).toLocaleString()]})}),s.jsx(He,{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(Qe,{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(Qe,{variant:"outline",children:"No issues"})]})}),s.jsx(He,{children:s.jsxs("div",{className:"flex flex-wrap gap-1",children:[g.modes.metadataReview&&s.jsx(Qe,{variant:"outline",children:"metadata"}),g.modes.deeperAnalysis&&s.jsx(Qe,{variant:"outline",children:"deeper"})]})}),s.jsx(He,{children:s.jsxs(Vc,{children:[s.jsx(Hc,{asChild:!0,children:s.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Om,{className:"h-4 w-4"})})}),s.jsxs(Ko,{align:"end",children:[s.jsx(gr,{asChild:!0,children:s.jsx(bt,{to:`/tool-analysis-results/${g.reportId}`,children:"View"})}),s.jsxs(gr,{onSelect:()=>{y(g.reportId,"json")},children:[s.jsx(wa,{className:"mr-2 h-3.5 w-3.5"})," Export JSON"]}),s.jsxs(gr,{onSelect:()=>{y(g.reportId,"markdown")},children:[s.jsx(wa,{className:"mr-2 h-3.5 w-3.5"})," Export Markdown"]}),s.jsxs(gr,{className:"text-destructive",onSelect:j=>{j.preventDefault(),o(g.reportId)},children:[s.jsx(Na,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},g.reportId))})]})})}),s.jsx(Ss,{open:!!i,onOpenChange:g=>!g&&o(null),children:s.jsxs(Ga,{children:[s.jsxs(Ya,{children:[s.jsx(Qa,{children:"Delete tool analysis report?"}),s.jsx(Ja,{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(Xa,{children:[s.jsx(es,{disabled:c,children:"Cancel"}),s.jsx(Za,{onClick:g=>{g.preventDefault(),p()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}function xM(e,t,n){const r=new Blob([t],{type:n}),a=URL.createObjectURL(r),i=document.createElement("a");i.href=a,i.download=e,i.click(),URL.revokeObjectURL(a)}function Jve(){const{id:e=""}=Lo(),t=_a(),{source:n}=In(),[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}_e({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),_e({title:"Tool analysis report deleted"}),t("/tool-analysis-results")}catch(j){_e({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(bt,{to:"/tool-analysis-results",children:"Back to Tool Analysis Results"})})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"font-mono text-xl font-semibold",children:r.reportId}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:[new Date(r.createdAt).toLocaleString()," · ",r.serverNames.join(", ")||"—"]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(se,{asChild:!0,size:"sm",variant:"outline",children:s.jsx(bt,{to:"/tool-analysis-results",children:"Back to results"})}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>xM(`${r.reportId}.json`,`${JSON.stringify(r,null,2)}
|
|
140
|
-
`,"application/json"),children:[s.jsx(wa,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>xM(`${r.reportId}.md`,NC(r.report),"text/markdown"),children:[s.jsx(wa,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>h(!0),children:[s.jsx(Na,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]}),s.jsx(Mz,{report:r.report}),s.jsx(Ss,{open:f,onOpenChange:h,children:s.jsxs(Ga,{children:[s.jsxs(Ya,{children:[s.jsx(Qa,{children:"Delete tool analysis report?"}),s.jsxs(Ja,{children:["Delete saved report '",r.reportId,"' from disk? This cannot be undone."]})]}),s.jsxs(Xa,{children:[s.jsx(es,{disabled:p,children:"Cancel"}),s.jsx(Za,{onClick:j=>{j.preventDefault(),g()},disabled:p,children:p?"Deleting...":"Delete"})]})]})})]})}const Zve=[{id:"configure",label:"Configure Debug Session"},{id:"run",label:"Run / Inspect Flow"},{id:"report",label:"Report / Export"}];function ege(e){return navigator.clipboard.writeText(e)}function tge(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}function nge(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 rge(){const{source:e}=In(),{servers:t,reload:n,loading:r}=Ha(),[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("{}"),[L,G]=v.useState(""),[U,H]=v.useState(""),[Q,J]=v.useState(""),[T,D]=v.useState(""),[X,F]=v.useState(""),[$,ee]=v.useState(""),[ae,K]=v.useState(""),[le,ie]=v.useState(""),[fe,oe]=v.useState(null),[ce,Se]=v.useState(null),[ne,Te]=v.useState([]),[Ae,Ye]=v.useState(!1),[ge,Oe]=v.useState(!1),[Be,dt]=v.useState(!1),[be,Je]=v.useState("all"),[lt,Rt]=v.useState("all"),[qt,Z]=v.useState("inspector"),je=v.useRef(null),we=v.useRef(null);v.useEffect(()=>()=>{je.current?.(),je.current=null},[]),v.useEffect(()=>{we.current?.scrollIntoView({behavior:"smooth",block:"end"})},[ne.length]);const ke=v.useMemo(()=>t.filter(ue=>ue.authType==="oauth2"),[t]),Le=ke.find(ue=>ue.id===o);v.useEffect(()=>{o&&(ke.some(ue=>ue.id===o)||c(""))},[ke,o]);const Xe=v.useMemo(()=>{const ue=fe?.stepStates.length??0,Re=fe?.stepStates.filter(Ft=>Ft.status==="completed"||Ft.status==="skipped").length??0,nt=fe?.stepStates.filter(Ft=>Ft.status==="failed").length??0,xt=ue>0?Math.round((Re+nt)/ue*100):0;return{total:ue,completed:Re,failed:nt,percent:xt}},[fe]),At=v.useMemo(()=>(fe?.network??[]).filter(Re=>!(be!=="all"&&Re.stepId!==be||lt==="error"&&!(Re.phase==="response"&&(Re.status??0)>=400)||lt==="ok"&&!(Re.phase==="response"&&(Re.status??0)<400))),[fe?.network,be,lt]),jn=!!ce,Sn=!!(fe&&(fe.status==="completed"||fe.status==="error"||fe.status==="stopped")),lr=ue=>{if(ue==="configure"||ue==="run"&&jn||ue==="report"&&Sn)return i(ue)},cr=()=>{let ue;if(d==="dcr"&&z.trim())try{ue=JSON.parse(z)}catch{throw new Error("DCR metadata JSON is invalid")}if(!Le)throw new Error("Select an MCP server");return{profile:"latest",target:{serverName:Le.id,overrides:{authorizationServerMetadataUrl:Q||void 0,authorizationEndpoint:T||void 0,tokenEndpoint:X||void 0,registrationEndpoint:$||void 0,cimdUrl:L||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:ue,tokenEndpointAuthMethod:R||void 0}:void 0,cimd:d==="cimd"?{cimdUrl:L||void 0,expectedClientId:U||void 0}:void 0},runtime:{redirectMode:h,scopes:x.split(/[,\s]+/).map(Re=>Re.trim()).filter(Boolean),resource:N.trim()||void 0,usePkce:j,codeChallengeMethod:"S256"},display:{showSensitiveValues:y}}},Ln=ue=>{je.current?.(),je.current=e.subscribeOAuthDebuggerSession(ue,Re=>{Te(xt=>[...xt,Re]),(Re.type==="completed"||Re.type==="error"||Re.type==="stopped")&&Ye(!1),e.getOAuthDebuggerSession(ue).then(xt=>{oe(xt.session),xt.session.status==="completed"&&i("report")}).catch(()=>{})})},ur=async()=>{Oe(!0);try{const ue=cr(),Re=await e.createOAuthDebuggerSession(ue);Se(Re.sessionId),oe(Re.session),Te([]),i("run"),Ln(Re.sessionId);const nt=await e.startOAuthDebuggerSession(Re.sessionId);oe(nt.session),Ye(!0),(nt.session.status==="waiting_for_user"||nt.session.status==="waiting_for_browser_callback")&&Ye(!1)}catch(ue){_e({title:"Could not start OAuth Debugger session",description:ue instanceof Error?ue.message:String(ue),variant:"destructive"})}finally{Oe(!1)}},Ar=async()=>{if(ce)try{Oe(!0);const ue=await e.submitOAuthDebuggerManualCallback(ce,{redirectUrl:le.trim()||void 0});oe(ue.session),ie(""),Ye(!0)}catch(ue){_e({title:"Could not submit callback",description:ue instanceof Error?ue.message:String(ue),variant:"destructive"})}finally{Oe(!1)}},Fr=async()=>{if(ce){dt(!0);try{const ue=await e.stopOAuthDebuggerSession(ce);if(Ye(!1),ue.status!=="running"){const Re=await e.getOAuthDebuggerSession(ce);oe(Re.session),Re.session.status==="completed"?i("report"):i("run")}}catch(ue){_e({title:"Could not stop session",description:ue instanceof Error?ue.message:String(ue),variant:"destructive"})}finally{dt(!1)}}},Br=async()=>{je.current?.(),je.current=null,oe(null),Se(null),Te([]),Ye(!1),dt(!1),Oe(!1),ie(""),Je("all"),Rt("all"),Z("inspector"),i("run"),await ur()},Yn=async ue=>{if(!(!ce||!fe))try{const Re=await e.exportOAuthDebuggerSession(ce,ue);let nt="";const xt=ue==="json"?"json":ue==="raw"?"txt":"md";typeof Re=="string"?nt=Re:nt=`${JSON.stringify(Re,null,2)}
|
|
143
|
-
`;const Ft=new Blob([nt],{type:"text/plain;charset=utf-8"}),Yt=URL.createObjectURL(Ft),Nn=document.createElement("a");Nn.href=Yt,Nn.download=`oauth-debugger-${ce}.${xt}`,Nn.click(),URL.revokeObjectURL(Yt)}catch(Re){if(ue==="markdown"){const nt=nge(fe,ne),xt=new Blob([nt],{type:"text/markdown;charset=utf-8"}),Ft=URL.createObjectURL(xt),Yt=document.createElement("a");Yt.href=Ft,Yt.download=`oauth-debugger-${fe.id}.md`,Yt.click(),URL.revokeObjectURL(Ft);return}_e({title:"Export failed",description:Re instanceof Error?Re.message:String(Re),variant:"destructive"})}},Kt=ce?`${tge()}/api/oauth-debugger/sessions/${ce}/authorize`:void 0,On=ue=>ue==="error"?"destructive":ue==="warning"?"outline":"secondary";return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"OAuth Debugger"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Step-by-step OAuth flow debugging for MCP servers (latest MCP authorization draft profile)."})]}),s.jsx("div",{className:"flex flex-wrap items-center gap-2",children:Zve.map(ue=>{const Re=a===ue.id,nt=ue.id==="configure"||ue.id==="run"&&jn||ue.id==="report"&&Sn;return s.jsx("button",{type:"button",onClick:()=>nt&&lr(ue.id),disabled:!nt,className:"rounded-full",children:s.jsx(Qe,{variant:Re?"default":"outline",className:nt?"":"opacity-50",children:ue.label})},ue.id)})})]}),a==="configure"&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs(Ue,{children:[s.jsx(Ct,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(_t,{className:"text-base",children:"Target MCP Server"}),s.jsx(Bs,{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(Sa,{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(on,{value:o,onValueChange:c,children:[s.jsx(Zt,{children:s.jsx(ln,{placeholder:"Select an MCP server"})}),s.jsx(en,{children:ke.map(ue=>s.jsx(it,{value:ue.id,children:ue.name||ue.id},ue.id))})]}),ke.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"}),"."]}),Le&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:[Le.transport," · ",Le.url||Le.command||"No URL/command"]})]})})]}),s.jsxs(Ue,{children:[s.jsx(Ct,{className:"pb-3",children:s.jsx(_t,{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(ue=>s.jsx("button",{type:"button",onClick:()=>f(ue.id),className:"rounded-md border p-3 text-left",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:`h-2.5 w-2.5 rounded-full ${d===ue.id?"bg-primary":"bg-muted-foreground/30"}`}),s.jsx("span",{className:"text-sm font-medium",children:ue.label})]})},ue.id))}),s.jsx("div",{className:"grid gap-3 md:grid-cols-1",children:s.jsxs("div",{className:"max-w-md space-y-1",children:[s.jsx($e,{className:"text-xs",children:"Redirect mode"}),s.jsxs(on,{value:h,onValueChange:ue=>p(ue),children:[s.jsx(Zt,{children:s.jsx(ln,{})}),s.jsxs(en,{children:[s.jsx(it,{value:"local_callback",children:"Local callback (recommended)"}),s.jsx(it,{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(ht,{value:P,onChange:ue=>A(ue.target.value)})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx($e,{className:"text-xs",children:"client_secret (optional)"}),s.jsx(ht,{value:O,onChange:ue=>k(ue.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(ht,{value:L,onChange:ue=>G(ue.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),s.jsxs(Ue,{children:[s.jsx(Ct,{className:"pb-3",children:s.jsx(_t,{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(ht,{value:x,onChange:ue=>S(ue.target.value),placeholder:"openid profile mcp"})]}),s.jsxs("div",{className:"flex items-center gap-2 md:col-span-2",children:[s.jsx(ba,{checked:j,onCheckedChange:ue=>b(!!ue)}),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(ht,{value:R,onChange:ue=>M(ue.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(ht,{value:N,onChange:ue=>_(ue.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(Ua,{value:z,onChange:ue=>B(ue.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(ht,{value:U,onChange:ue=>H(ue.target.value)})]}),s.jsxs("div",{className:"rounded-md border bg-background p-3",children:[s.jsx("div",{className:"mb-3 text-sm font-medium",children:"Endpoint overrides"}),s.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx($e,{className:"text-xs",children:"Authorization server metadata URL"}),s.jsx(ht,{value:Q,onChange:ue=>J(ue.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(ht,{value:ae,onChange:ue=>K(ue.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(ht,{value:T,onChange:ue=>D(ue.target.value),placeholder:"https://.../authorize"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx($e,{className:"text-xs",children:"Token endpoint"}),s.jsx(ht,{value:X,onChange:ue=>F(ue.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(ht,{value:$,onChange:ue=>ee(ue.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(ht,{value:L,onChange:ue=>G(ue.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),s.jsxs(Hl,{children:[s.jsx(Ky,{className:"h-4 w-4"}),s.jsx(Kl,{children:"Secrets display"}),s.jsxs(Gl,{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(ba,{checked:!y,onCheckedChange:ue=>g(ue===!1)}),s.jsx($e,{children:"Hide sensitive values in inspector"})]})]})]})]})]}),s.jsx("div",{className:"flex justify-end",children:s.jsxs(se,{type:"button",onClick:()=>{ur()},disabled:ge,children:[ge&&s.jsx(ir,{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(Ct,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(_t,{className:"text-base",children:"Progress"}),s.jsx(Bs,{children:"Visual OAuth flow guide with live session events and next-step actions."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[fe?.uiHints.authorizationUrl&&Kt&&s.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsxs("a",{href:Kt,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(ch,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Br()},disabled:ge,children:[s.jsx(Sa,{className:"mr-2 h-4 w-4"}),"Restart"]}),ce&&s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Fr()},disabled:Be||!ce,children:[(Be||Ae)&&Be&&s.jsx(ir,{className:"mr-2 h-4 w-4 animate-spin"}),s.jsx(rh,{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:[Xe.completed+Xe.failed,"/",Xe.total," steps"]}),s.jsxs("span",{children:[Xe.percent,"%"]})]}),s.jsx(ag,{value:Xe.percent,className:"h-2"})]}),fe?.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(Ua,{value:le,onChange:ue=>ie(ue.target.value),placeholder:"Paste the final redirect URL (with code and state)",className:"min-h-24 text-xs font-mono"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(se,{type:"button",size:"sm",onClick:()=>{Ar()},disabled:ge||!le.trim(),children:[ge&&s.jsx(ir,{className:"mr-2 h-4 w-4 animate-spin"}),"Continue"]}),fe.uiHints.authorizationUrl&&Kt&&s.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx("a",{href:Kt,target:"_blank",rel:"noopener noreferrer",children:"Open Authorization URL"})})]})]})}),fe?.status==="waiting_for_browser_callback"&&s.jsxs(Hl,{children:[s.jsx(Ky,{className:"h-4 w-4"}),s.jsx(Kl,{children:"Waiting for browser callback"}),s.jsxs(Gl,{className:"space-y-1",children:[s.jsx("p",{className:"text-xs",children:"Complete the authorization flow in your browser. MCP Lab is listening for the callback at:"}),s.jsx("p",{className:"text-xs font-mono break-all",children:fe.uiHints.callbackUrl}),fe.uiHints.authorizationUrl&&Kt&&s.jsx("div",{className:"pt-2",children:s.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsxs("a",{href:Kt,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(ch,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})})})]})]}),s.jsx("div",{className:"space-y-2",children:fe?.stepStates.map(ue=>s.jsxs("div",{className:"rounded-md border p-3",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium",children:ue.title}),s.jsx("div",{className:"text-xs text-muted-foreground",children:ue.description})]}),s.jsx(Qe,{variant:ue.status==="failed"?"destructive":ue.status==="completed"?"outline":ue.status==="active"?"secondary":"outline",className:ue.status==="completed"?"border-emerald-300 bg-emerald-50 text-emerald-700":void 0,children:ue.status})]}),ue.outcomeSummary&&s.jsx("p",{className:"mt-2 text-xs text-muted-foreground break-all",children:ue.outcomeSummary})]},ue.id))||s.jsx("p",{className:"text-sm text-muted-foreground",children:"No steps yet."})})]})]}),s.jsx("div",{className:"space-y-4 xl:col-span-1",children:s.jsxs(Ue,{children:[s.jsxs(Ct,{className:"pb-3",children:[s.jsx(_t,{className:"text-base",children:"Inspect"}),s.jsx(Bs,{children:"Live events and network requests/responses for the OAuth flow."})]}),s.jsx(qe,{className:"space-y-3",children:s.jsxs(lC,{value:qt,onValueChange:ue=>Z(ue),children:[s.jsxs(Kv,{className:"grid grid-cols-2",children:[s.jsx(Ii,{value:"inspector",children:"Network Inspector"}),s.jsx(Ii,{value:"events",children:"Live Debug"})]}),s.jsx(Xd,{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:[ne.length===0?s.jsx("p",{className:"text-muted-foreground",children:"No events yet."}):ne.map((ue,Re)=>s.jsxs("div",{className:"break-all",children:[s.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(ue.ts).toLocaleTimeString()}),s.jsx(Qe,{variant:"outline",className:"mr-2 text-[10px]",children:ue.type}),typeof ue.payload.message=="string"?ue.payload.message:JSON.stringify(ue.payload)]},`${ue.ts}-${Re}`)),s.jsx("div",{ref:we})]})}),s.jsxs(Xd,{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(on,{value:be,onValueChange:Je,children:[s.jsx(Zt,{className:"h-8",children:s.jsx(ln,{})}),s.jsxs(en,{children:[s.jsx(it,{value:"all",children:"All steps"}),(fe?.stepStates??[]).map(ue=>s.jsx(it,{value:ue.id,children:ue.title},ue.id))]})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx($e,{className:"text-xs",children:"Filter by status"}),s.jsxs(on,{value:lt,onValueChange:Rt,children:[s.jsx(Zt,{className:"h-8",children:s.jsx(ln,{})}),s.jsxs(en,{children:[s.jsx(it,{value:"all",children:"All"}),s.jsx(it,{value:"ok",children:"Successful responses"}),s.jsx(it,{value:"error",children:"Error responses"})]})]})]})]}),s.jsx("div",{className:"max-h-[34rem] space-y-2 overflow-auto",children:At.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No network exchanges captured yet."}):At.map(ue=>s.jsxs("details",{className:"rounded-md border p-3",children:[s.jsx("summary",{className:"cursor-pointer list-none",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium",children:ue.label}),s.jsxs("div",{className:"text-xs text-muted-foreground break-all",children:[ue.method?`${ue.method} `:"",ue.url]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Qe,{variant:"outline",children:ue.phase}),typeof ue.status=="number"&&s.jsx(Qe,{variant:ue.status>=400?"destructive":"secondary",children:ue.status})]})]})}),s.jsxs("div",{className:"mt-3 space-y-3",children:[s.jsxs("div",{children:[s.jsx("div",{className:"mb-1 text-xs font-medium",children:"Headers"}),s.jsx("pre",{className:"max-h-40 overflow-auto whitespace-pre rounded bg-muted p-2 text-xs",children:JSON.stringify(ue.headers,null,2)})]}),ue.bodyText&&s.jsxs("div",{children:[s.jsx("div",{className:"mb-1 text-xs font-medium",children:"Body"}),s.jsx("pre",{className:"max-h-64 overflow-auto whitespace-pre rounded bg-muted p-2 text-xs",children:ue.bodyText})]}),s.jsx("div",{className:"flex gap-2",children:s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{ege(JSON.stringify(ue,null,2))},children:[s.jsx($i,{className:"mr-2 h-4 w-4"}),"Copy JSON"]})})]})]},ue.id))})]})]})})]})})]})}),a==="report"&&fe&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-semibold",children:"Report / Export"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"OAuth debug session summary, validations, and trace exports."})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>i("configure"),children:"Back to Configure"}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Yn("json")},children:[s.jsx(wa,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Yn("markdown")},children:[s.jsx(wa,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Yn("raw")},children:[s.jsx(wa,{className:"mr-2 h-4 w-4"}),"Copy/Export Raw Trace"]})]})]}),s.jsxs(Hl,{children:[s.jsx(Ky,{className:"h-4 w-4"}),s.jsx(Kl,{children:"Secrets display mode"}),s.jsx(Gl,{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:fe.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:fe.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:fe.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:fe.validations.length})]})})]}),s.jsxs(Ue,{children:[s.jsx(Ct,{className:"pb-3",children:s.jsx(_t,{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:fe.summary?.issuer||"-"})]}),s.jsxs("div",{children:[s.jsx($e,{className:"text-xs",children:"Client ID"}),s.jsx("p",{className:"text-sm break-all",children:fe.summary?.clientId||"-"})]}),s.jsxs("div",{children:[s.jsx($e,{className:"text-xs",children:"Redirect URI"}),s.jsx("p",{className:"text-sm break-all",children:fe.summary?.redirectUri||"-"})]}),s.jsxs("div",{children:[s.jsx($e,{className:"text-xs",children:"Token endpoint status"}),s.jsx("p",{className:"text-sm",children:fe.summary?.tokenEndpointStatus??"-"})]}),s.jsxs("div",{children:[s.jsx($e,{className:"text-xs",children:"Token type"}),s.jsx("p",{className:"text-sm",children:fe.summary?.tokenType||"-"})]}),s.jsxs("div",{children:[s.jsx($e,{className:"text-xs",children:"Scopes granted"}),s.jsx("p",{className:"text-sm break-all",children:(fe.summary?.grantedScopes??[]).join(", ")||"-"})]})]})]}),s.jsxs(Ue,{children:[s.jsx(Ct,{className:"pb-3",children:s.jsx(_t,{className:"text-base",children:"Validation findings"})}),s.jsx(qe,{className:"space-y-2",children:fe.validations.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No validation findings recorded."}):fe.validations.map((ue,Re)=>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:Re+1}),s.jsx("span",{className:"font-bold",children:ue.title})]}),s.jsx(Qe,{variant:On(ue.severity),children:ue.severity})]}),s.jsxs("p",{className:"text-sm",children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",ue.detail]}),ue.recommendation&&s.jsxs("div",{className:"mt-2 rounded-md border px-2.5 py-2 text-xs",children:[s.jsx("div",{className:"mb-1 font-medium text-muted-foreground",children:"Suggested improvement"}),s.jsx("p",{children:ue.recommendation})]}),s.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Step: ",ue.stepId,ue.specReference&&s.jsxs(s.Fragment,{children:[" · ",s.jsx("a",{href:ue.specReference,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"Spec reference"})]})]})]},ue.id))})]})]})]})}const v1="mcplab.runEvaluation.activeJobId",age=()=>{const[e]=Ic(),[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,L]=v.useState(""),[G,U]=v.useState(!1),[H,Q]=v.useState([]),[J,T]=v.useState(null),D=v.useRef(null),X=v.useRef(null),{configs:F,reload:$}=cf(),{source:ee}=In(),ae=jf("snapshots",!1),{agents:K,scenarios:le,reload:ie}=Ha(),fe=b.trim(),oe=fe?`/results/${encodeURIComponent(fe)}${t?`?configId=${encodeURIComponent(t)}`:""}`:"/results",ce=F.find(Z=>Z.id===t),Se=e.get("configId"),ne=v.useMemo(()=>{if(!ce)return[];const Z=new Map,je=ce.agentEntries&&ce.agentEntries.length>0?ce.agentEntries:ce.agents.map(we=>({kind:"inline",agent:we}));for(const we of je){if(we.kind==="inline"){const Le=we.agent.id;Z.has(Le)||Z.set(Le,we.agent);continue}const ke=K.find(Le=>Le.id===we.ref);ke&&!Z.has(ke.id)&&Z.set(ke.id,ke)}return Array.from(Z.values())},[ce,K]),Te=v.useMemo(()=>{if(!ce)return[];const Z=new Map,je=ce.scenarioEntries&&ce.scenarioEntries.length>0?ce.scenarioEntries:ce.scenarios.map(we=>({kind:"inline",scenario:we}));for(const we of je){if(we.kind==="inline"){Z.has(we.scenario.id)||Z.set(we.scenario.id,we.scenario);continue}const ke=le.find(Le=>Le.id===we.ref);ke&&!Z.has(ke.id)&&Z.set(ke.id,ke)}return Array.from(Z.values())},[ce,le]);v.useEffect(()=>{Se&&F.some(Z=>Z.id===Se)&&n(Se)},[Se,F]);const Ae=v.useRef("");v.useEffect(()=>{const Z=ce?`${ce.id}::${ce.sourcePath??""}`:"";if(Z===Ae.current)return;if(Ae.current=Z,!ce){P([]),O([]);return}const je=ne.filter(we=>(ce.runDefaults?.selectedAgentNames??[]).includes(we.id)).map(we=>we.id);P(je.length>0?je:ne.map(we=>we.id)),O(Te.map(we=>we.id)),R(!0)},[ce?.id,ce?.sourcePath,ne,Te]);const Ye=async()=>{if(!ce?.sourcePath){h(ke=>[...ke,`[${new Date().toLocaleTimeString()}] Missing source path for selected config.`]);return}const Z=ne.filter(ke=>_.includes(ke.id));if(Z.length===0){h(ke=>[...ke,`[${new Date().toLocaleTimeString()}] Select at least one agent.`]);return}const je=Te.filter(ke=>A.includes(ke.id));if(je.length===0){h(ke=>[...ke,`[${new Date().toLocaleTimeString()}] Select at least one test.`]);return}o(!0),y(!1),j(!1),x("");const we=(ce.serverEntries??[]).some(ke=>ke.kind==="referenced")||(ce.agentEntries??[]).some(ke=>ke.kind==="referenced")||(ce.scenarioEntries??[]).some(ke=>ke.kind==="referenced")?"refs-composed":"single-file/inline";h([`[${new Date().toLocaleTimeString()}] Starting evaluation run...`,`[${new Date().toLocaleTimeString()}] Config=${ce.name} mode=${we} agents=${Z.map(ke=>ke.name||ke.id).join(", ")} tests=${je.map(ke=>ke.id).join(", ")} runs=${Number(r)} snapshotEval=${ae&&k?"on":"off"}${M.trim()?` note=${M.trim()}`:""}`]),d(10);try{const{jobId:ke}=await ee.startRun({configPath:ce.sourcePath,runsPerScenario:Number(r),agents:Z.map(Le=>Le.id),scenarioIds:je.map(Le=>Le.id),applySnapshotEval:ae?k:!1,runNote:M.trim()?M.trim():void 0});N(ke),be(ke),qt(ke),Je()}catch(ke){const Le=ke instanceof Error?ke.message:String(ke),Xe=Le.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(At=>[...At,`[${new Date().toLocaleTimeString()}] Error: ${Le}${Xe}`]),o(!1),d(0),N(null)}},ge=()=>{Ye()},Oe=()=>{S&&ee.stopRun(S),X.current?.(),X.current=null,dt(),N(null),o(!1),y(!1),j(!0),h(Z=>[...Z,`[${new Date().toLocaleTimeString()}] Run aborted by user.`]),Je()},Be=async()=>{if(b){U(!0);try{const Z=await ee.createSnapshotFromRun(b,B.trim()||void 0);_e({title:"Snapshot saved",description:`Created ${Z.name} (${Z.id})`}),B.trim()||L(Z.name)}catch(Z){_e({title:"Could not save snapshot",description:Z instanceof Error?Z.message:String(Z),variant:"destructive"})}finally{U(!1)}}};v.useEffect(()=>{D.current&&(D.current.scrollTop=D.current.scrollHeight)},[f]),v.useEffect(()=>()=>{X.current?.()},[]),v.useEffect(()=>{if(S||p)return;let Z="";try{Z=sessionStorage.getItem(v1)??""}catch{Z=""}if(Z)return N(Z),o(!0),y(!1),j(!1),h(je=>je.length>0?je:[`[${new Date().toLocaleTimeString()}] Reattached to in-progress evaluation run...`]),qt(Z),()=>{}},[S,p]);const dt=()=>{try{sessionStorage.removeItem(v1)}catch{}},be=Z=>{try{sessionStorage.setItem(v1,Z)}catch{}},Je=async()=>{try{const Z=await ee.getRunQueue();Q(Z.queued),T(Z.active)}catch{}},lt=()=>{$(),ie()};v.useEffect(()=>{lt(),Je();const Z=()=>{lt(),Je()};return window.addEventListener("focus",Z),()=>{window.removeEventListener("focus",Z)}},[$,ie]);const Rt=async Z=>{try{await ee.removeQueuedRun(Z),Q(je=>je.filter(we=>we.jobId!==Z))}catch(je){const we=je instanceof Error?je.message:String(je);if(we.includes("Use the /stop endpoint"))try{await ee.stopRun(Z)}catch{}else _e({title:"Could not remove queued run",description:we,variant:"destructive"})}Je()},qt=Z=>{X.current?.(),X.current=ee.subscribeRunJob(Z,je=>{const we=new Date(je.ts).toLocaleTimeString();if(je.type==="queued"){h(ke=>{const Le=je.payload.position?` (position ${je.payload.position})`:"",Xe=`[${we}] Run queued${Le}. Waiting for active run to finish...`;return ke.includes(Xe)?ke:[...ke,Xe]}),d(5);return}if(je.type==="started"&&(h(ke=>{const Le=`[${we}] Run started.`;return ke.includes(Le)?ke:[...ke,Le]}),d(ke=>Math.max(ke,30)),j(!1)),je.type==="log"){const ke=String(je.payload.message??"").trim();ke&&(h(Le=>{const Xe=`[${we}] ${ke}`;return Le.includes(Xe)?Le:[...Le,Xe]}),d(Le=>{const Xe=ke.toLowerCase();if(Xe.startsWith("loading mcp evaluation config"))return Math.max(Le,15);if(Xe.startsWith("loaded config"))return Math.max(Le,20);if(Xe.startsWith("selected "))return Math.max(Le,30);if(Xe.startsWith("using requested agents")||Xe.startsWith("using resolved default agents"))return Math.max(Le,35);if(Xe.startsWith("expanded to "))return Math.max(Le,45);if(Xe.startsWith("running evaluation"))return Math.max(Le,50);const At=Xe.match(/^scenario (\d+)\/(\d+) finished:/);if(At){const jn=Number(At[1]),Sn=Number(At[2]);return Math.max(Le,50+Math.round(jn/Sn*25))}return Xe.startsWith("evaluation execution finished")?Math.max(Le,78):Xe.startsWith("applying snapshot evaluation policy")?Math.max(Le,82):Xe.includes("snapshot evaluation applied")||Xe.includes("snapshot evaluation enabled")?Math.max(Le,88):Xe.startsWith("writing results to ")?Math.max(Le,94):Xe.startsWith("run finished:")?Math.max(Le,98):Le}))}if(je.type==="completed"){const ke=String(je.payload.runId??"").trim();if(h(Le=>{const Xe=`[${we}] Run completed.`;return Le.includes(Xe)?Le:[...Le,Xe]}),je.payload.snapshotEval&&typeof je.payload.snapshotEval=="object"){const Le=je.payload.snapshotEval;h(Xe=>{const At=`[${we}] Snapshot eval (${Le.mode??"warn"}) baseline=${Le.baseline_snapshot_id??"-"} score=${Le.overall_score??"-"} status=${Le.status??"-"}`;return Xe.includes(At)?Xe:[...Xe,At]})}d(100),o(!1),y(!0),j(!1),x(ke),dt(),N(null),X.current?.(),X.current=null,Je()}if(je.type==="error"){const ke=String(je.payload.message??"Unknown error"),Le=ke.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(Xe=>[...Xe,`[${we}] Error: ${ke}${Le}`]),o(!1),y(!1),j(!1),d(0),dt(),N(null),X.current?.(),X.current=null,Je()}})};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(Dl,{className:"h-6 w-6"}),"Run Evaluation"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Execute evaluation scenarios against MCP servers"})]}),s.jsx(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(on,{value:t,onValueChange:n,children:[s.jsx(Zt,{children:s.jsx(ln,{placeholder:"Select a config"})}),s.jsx(en,{children:F.map(Z=>s.jsx(it,{value:Z.id,children:Z.name},Z.id))})]}),s.jsx(se,{type:"button",variant:"outline",size:"icon",className:"h-10 w-10 shrink-0",onClick:lt,"aria-label":"Refresh configs",title:"Refresh configs",children:s.jsx(Sa,{className:"h-4 w-4"})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{children:"Variance Runs"}),s.jsx(ht,{type:"number",min:"1",max:"10",value:r,onChange:Z=>a(Z.target.value)})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx($e,{htmlFor:"run-note",children:"Run Note"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[M.length,"/500"]})]}),s.jsx(Ua,{id:"run-note",value:M,onChange:Z=>z(Z.target.value.slice(0,500)),placeholder:"Optional context for this run (for example: mcp-server v1.8.2 #staging)",rows:2})]}),ce&&s.jsxs("div",{className:"space-y-2",children:[ae&&ce.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 (",ce.snapshotEval.mode,") · baseline:"," ",s.jsx("span",{className:"font-mono",children:ce.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(Z=>Z.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(Z=>{const je=_.includes(Z.id);return s.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[s.jsx(ba,{checked:je,onCheckedChange:we=>{const ke=we===!0;P(Le=>ke?[...Le,Z.id]:Le.filter(Xe=>Xe!==Z.id))}}),s.jsx("span",{children:Z.name||Z.id})]},Z.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."})]}),ce&&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(Te.map(Z=>Z.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 ",Te.length," selected"]}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:Te.map(Z=>{const je=A.includes(Z.id);return s.jsxs("label",{className:"flex items-start gap-2 text-sm rounded-md border p-2",children:[s.jsx(ba,{checked:je,onCheckedChange:we=>{const ke=we===!0;O(Le=>ke?[...Le,Z.id]:Le.filter(Xe=>Xe!==Z.id))}}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:"block font-medium",children:Z.name||Z.id}),s.jsx("span",{className:"block font-mono text-xs text-muted-foreground truncate",children:Z.id})]})]},Z.id)})})]}),ae&&s.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[s.jsx(ba,{checked:k,onCheckedChange:Z=>R(Z===!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||Te.length>0&&A.length===0,children:[s.jsx(Dl,{className:"mr-2 h-4 w-4"}),J?"Queue Run":"Run"]}),i&&s.jsxs(se,{variant:"destructive",onClick:Oe,children:[s.jsx(rh,{className:"mr-2 h-4 w-4"}),"Stop"]})]})]})}),(i||f.length>0)&&s.jsxs(Ue,{children:[s.jsx(Ct,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(_t,{className:"text-base",children:"Progress"}),s.jsxs("span",{className:"text-xs text-muted-foreground font-mono",children:[Math.round(c),"%"]})]})}),s.jsxs(qe,{className:"space-y-4",children:[s.jsx(ag,{value:c,className:"h-2"}),s.jsx("div",{ref:D,className:"h-64 overflow-auto rounded-md border bg-muted/30 p-3 font-mono text-xs space-y-0.5",children:f.map((Z,je)=>s.jsx("div",{className:Z.includes("✓")?"text-success":Z.includes("aborted")?"text-destructive":"text-foreground",children:Z},je))})]})]}),s.jsxs(Ue,{children:[s.jsx(Ct,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(_t,{className:"inline-flex items-center gap-2 text-base",children:[s.jsx(ef,{className:"h-4 w-4"}),"Run Queue"]}),s.jsx(se,{variant:"ghost",size:"sm",onClick:()=>{Je()},children:s.jsx(Sa,{className:"h-3 w-3"})})]})}),s.jsx(qe,{children:!J&&H.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No active or queued runs. Start a run above."}):s.jsxs("div",{className:"space-y-2",children:[J&&s.jsxs("div",{className:`flex items-center justify-between rounded-md border border-primary/30 bg-primary/5 p-2 text-sm cursor-pointer hover:bg-primary/10 transition-colors ${S===J.jobId?"ring-2 ring-primary/40":""}`,onClick:()=>{S!==J.jobId&&(N(J.jobId),be(J.jobId),o(!0),y(!1),j(!1),h([`[${new Date().toLocaleTimeString()}] Attached to running job ${J.jobId}...`]),d(10),qt(J.jobId))},title:"Click to view progress",children:[s.jsxs("div",{className:"min-w-0 flex items-center gap-2",children:[s.jsx("span",{className:"inline-flex items-center rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:"Running"}),s.jsx("span",{className:"font-mono text-xs",children:J.runParams.configPath.split("/").pop()??J.runParams.configPath}),J.runParams.agents&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:["agents: ",J.runParams.agents.join(", ")]}),J.runParams.runNote&&s.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["note: ",J.runParams.runNote]})]}),s.jsxs(se,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-destructive hover:text-destructive hover:bg-destructive/10",onClick:Z=>{Z.stopPropagation(),J&&(ee.stopRun(J.jobId),Je())},title:"Stop running job",children:[s.jsx(rh,{className:"mr-1 h-3 w-3"}),"Stop"]})]}),H.map((Z,je)=>{const we=Z.runParams.configPath.split("/").pop()??Z.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:["#",je+1," Queued"]}),s.jsx("span",{className:"font-mono text-xs",children:we}),Z.runParams.agents&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:["agents: ",Z.runParams.agents.join(", ")]}),Z.runParams.runNote&&s.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["note: ",Z.runParams.runNote]})]}),s.jsx(se,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:()=>{Rt(Z.jobId)},title:"Remove from queue",children:s.jsx(Vs,{className:"h-4 w-4"})})]},Z.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(rh,{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(Dl,{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($l,{className:"h-6 w-6 text-success"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Evaluation Complete"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"All scenarios have been evaluated successfully."})]}),s.jsx(se,{asChild:!0,className:"ml-auto",children:s.jsx(bt,{to:oe,children:fe?"View Results":"View Runs"})})]}),ae&&fe&&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(ht,{value:B,onChange:Z=>L(Z.target.value),placeholder:"e.g. baseline-v1",className:"h-8 w-64"})]}),s.jsx(se,{type:"button",variant:"outline",size:"sm",onClick:()=>{Be()},disabled:G,children:G?"Saving...":"Save Snapshot"})]})]})})]})},sge=()=>{const{source:e}=In(),[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){_e({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&&_e({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(),L=z||B;L&&k.add(L)})}),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(Ml,{className:"h-3.5 w-3.5 text-muted-foreground"}):p==="asc"?s.jsx(cs,{className:"h-3.5 w-3.5"}):s.jsx(Vt,{className:"h-3.5 w-3.5"}),A=k=>{const R=Array.from(new Map(k.scenarios.map(L=>{const G=String(L.scenarioId??"").trim(),U=String(L.scenarioName??"").trim();return!G&&!U?null:[G||U,U||G]}).filter(L=>!!L)).values()),M=Array.from(new Set(k.scenarios.map(L=>L.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)),_e({title:"Run deleted",description:k}),o(null)}catch(R){_e({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(Ss,{open:i!==null,onOpenChange:k=>{!k&&!c&&o(null)},children:s.jsxs(Ga,{children:[s.jsxs(Ya,{children:[s.jsx(Qa,{children:"Delete run?"}),s.jsxs(Ja,{children:["This will permanently remove the run artifacts from disk for"," ",s.jsx("span",{className:"font-mono",children:i??""}),"."]})]}),s.jsxs(Xa,{children:[s.jsx(es,{disabled:c,children:"Cancel"}),s.jsx(Za,{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(id,{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(on,{value:g,onValueChange:j,children:[s.jsx(Zt,{className:"w-[260px]",children:s.jsx(ln,{placeholder:"Filter by scenario"})}),s.jsxs(en,{children:[s.jsx(it,{value:"all",children:"All scenarios"}),S.map(k=>s.jsx(it,{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(Zr,{children:[s.jsx(ea,{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(ta,{children:_.map(k=>s.jsxs(Ut,{children:[s.jsx(He,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(bt,{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,k.runNote?s.jsxs("div",{className:"text-[11px] text-muted-foreground break-words",children:["Note: ",k.runNote]}):null]})}),s.jsx(He,{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(He,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(ef,{className:"h-3 w-3"}),new Date(k.timestamp).toLocaleString()]})}),s.jsx(He,{children:s.jsx(bo,{rate:k.overallPassRate})}),s.jsx(He,{className:"font-mono text-sm",children:k.totalScenarios}),s.jsx(He,{className:"font-mono text-sm",children:k.avgToolCalls.toFixed(0)}),s.jsx(He,{children:s.jsxs(Vc,{children:[s.jsx(Hc,{asChild:!0,children:s.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Om,{className:"h-4 w-4"})})}),s.jsxs(Ko,{align:"end",children:[s.jsx(gr,{asChild:!0,children:s.jsxs(bt,{to:`/results/${k.id}`,children:[s.jsx(k7,{className:"mr-2 h-3.5 w-3.5"}),"View"]})}),s.jsxs(gr,{children:[s.jsx(wa,{className:"mr-2 h-3.5 w-3.5"}),"Export JSON"]}),s.jsxs(gr,{className:"text-destructive",onSelect:R=>{R.preventDefault(),o(k.id)},children:[s.jsx(Na,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]})})]},k.id))})]})})})]})};function sd({text:e,variant:t="assistant",className:n}){const r=ige(e);return s.jsx("div",{className:xe("space-y-2",t==="system"&&"text-xs",n),children:r.map((a,i)=>s.jsx(v.Fragment,{children:oge(a,i,t)},`md-${i}`))})}function ige(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(bM(t,r)){const y=wM(t[r]);r+=2;const g=[];for(;r<t.length&&t[r].includes("|")&&!a(t[r]);)g.push(wM(t[r])),r+=1;n.push({type:"table",headers: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(">")||bM(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 bM(e,t){if(t+1>=e.length)return!1;const n=e[t].trim(),r=e[t+1].trim();return n.includes("|")?/^\|?(\s*:?-{3,}:?\s*\|)+\s*:?-{3,}:?\s*\|?$/.test(r):!1}function wM(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>t.trim())}function oge(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:Nl(e.text,`${t}-h`)})}if(e.type==="paragraph")return s.jsx("p",{className:xe("whitespace-pre-wrap leading-relaxed",n==="system"&&"leading-normal"),children:Nl(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:Nl(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:xe("space-y-1 pl-5",e.ordered?"list-decimal":"list-disc"),children:e.items.map((a,i)=>s.jsx("li",{className:"leading-relaxed",children:Nl(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:Nl(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:Nl(i,`${t}-tdc-${a}-${o}`)},`${t}-td-${a}-${o}`))},`${t}-row-${a}`))})]})}):null}function Nl(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 lge(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">${fo(c.scenarioName)}</span>
|
|
153
|
-
<span class="scenario-agent">${fo(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">${fo(f.name)} <small>${f.duration}ms</small></span>`).join("")}
|
|
166
|
-
</div>
|
|
167
|
-
${d.failureReasons.length?`<div class="failure-reasons">${d.failureReasons.map(f=>fo(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 — ${fo(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">${fo(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">${fo(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 fo(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}const cge="mcplab.resultAssistantScenarioHandoff",uge=[{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 jM(e){const t=new Date().toISOString().replace(/[:]/g,"-").replace(/\..+/,"");return`mcplab/reports/result-assistant/${e}-${t}.md`}function SM(e){const t=e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}const dge=()=>{const{id:e}=Lo(),t=_a(),[n]=Ic(),{source:r}=In(),a=jf("snapshots",!1),{configs:i}=cf(),{scenarios:o}=Ha(),[c,d]=v.useState(void 0),[f,h]=v.useState(!0),[p,y]=v.useState(!1),[g,j]=v.useState(""),[b,x]=v.useState(!1),[S,N]=v.useState(new Set),[_,P]=v.useState(new Set),[A,O]=v.useState([]),[k,R]=v.useState(""),[M,z]=v.useState(null),[B,L]=v.useState(!1),[G,U]=v.useState(""),[H,Q]=v.useState(""),[J,T]=v.useState(!1),[D,X]=v.useState(!1),[F,$]=v.useState(null),[ee,ae]=v.useState([]),[K,le]=v.useState([]),[ie,fe]=v.useState(""),[oe,ce]=v.useState(!1),[Se,ne]=v.useState(!1),[Te,Ae]=v.useState("assistant"),[Ye,ge]=v.useState(null),[Oe,Be]=v.useState(null),[dt,be]=v.useState(!1),[Je,lt]=v.useState(""),[Rt,qt]=v.useState(""),[Z,je]=v.useState(!1),[we,ke]=v.useState(!1),[Le,Xe]=v.useState(!1),[At,jn]=v.useState([]),[Sn,lr]=v.useState(!1),[cr,Ln]=v.useState(""),[ur,Ar]=v.useState(null),[Fr,Br]=v.useState(!1),[Yn,Kt]=v.useState(null),On=v.useRef(null),ue=v.useRef(null),Re=v.useCallback(async(V,ve)=>{lr(!0);try{const Me=(await r.listMarkdownReports()).filter(Mt=>{const Et=String(Mt.relativePath??""),yn=String(Mt.name??"");return Et.includes(V)||yn.includes(V)});if(jn(Me),ve&&Me.length>0){const Mt=Me.find(Et=>Et.relativePath===ve||Et.path===ve||Et.relativePath.endsWith(ve)||Et.path.endsWith(ve));Mt&&Ln(Mt.relativePath)}return Me}catch{return jn([]),[]}finally{lr(!1)}},[r]);v.useEffect(()=>{if(!e)return;let V=!0;const ve=F;return ve&&(r.closeResultAssistantSession(ve).catch(()=>{}),$(null),ae([]),le([]),Be(null)),h(!0),r.getResult(e).then(st=>{V&&(d(st),j(st?.runNote??""),y(!1),h(!1))}),()=>{V=!1}},[e,r]),v.useEffect(()=>{let V=!0;return r.listSnapshots().then(ve=>{V&&O(ve)}).catch(()=>{V&&O([])}),()=>{V=!1}},[r]),v.useEffect(()=>{if(!c?.id){jn([]);return}let V=!0;return(async()=>{const ve=await Re(c.id)})(),()=>{V=!1}},[c?.id,Re]),v.useEffect(()=>{if(At.length===0){Ln(""),Ar(null),Kt(null);return}(!cr||!At.some(V=>V.relativePath===cr))&&Ln(At[0].relativePath)},[At,cr]),v.useEffect(()=>{if(!D||Te!=="reports")return;if(!cr){Ar(null),Kt(null);return}let V=!0;return Br(!0),Kt(null),r.getMarkdownReport(cr).then(ve=>{V&&Ar(ve)}).catch(ve=>{V&&(Ar(null),Kt(ve instanceof Error?ve.message:String(ve)))}).finally(()=>{V&&Br(!1)}),()=>{V=!1}},[D,Te,cr,r]);const nt=n.get("configId")??"",xt=v.useMemo(()=>{const V=nt?i.find(ve=>ve.id===nt):void 0;return V||(c?i.find(ve=>ve.id===c.configId):void 0)},[i,nt,c]),Ft=v.useMemo(()=>{const V=new Map;if(xt){for(const ve of xt.scenarios)V.set(ve.id,ve),ve.name&&!V.has(ve.name)&&V.set(ve.name,ve);for(const ve of xt.scenarioEntries??[]){if(ve.kind!=="referenced")continue;const st=o.find(Me=>Me.id===ve.ref);st&&(V.set(st.id,st),st.name&&V.set(st.name,st),V.has(ve.ref)||V.set(ve.ref,st))}}for(const ve of o)V.has(ve.id)||V.set(ve.id,ve),ve.name&&!V.has(ve.name)&&V.set(ve.name,ve);return V},[xt,o]),Yt=v.useMemo(()=>{if(!c?.snapshotEval?.baselineSnapshotId)return"";const V=i.filter(ve=>ve.snapshotEval?.baselineSnapshotId===c.snapshotEval?.baselineSnapshotId);return V.length===1?V[0].id:""},[i,c?.snapshotEval?.baselineSnapshotId]);if(v.useEffect(()=>{c?.snapshotEval?.baselineSnapshotId&&R(V=>V||c.snapshotEval.baselineSnapshotId)},[c?.snapshotEval?.baselineSnapshotId]),v.useEffect(()=>{if(nt&&i.some(V=>V.id===nt)){U(nt);return}Yt&&U(V=>V||Yt)},[nt,i,Yt]),v.useEffect(()=>{if(!D)return;const V=window.setTimeout(()=>{On.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(V)},[D,ee.length,oe]),v.useEffect(()=>()=>{F&&r.closeResultAssistantSession(F).catch(()=>{})},[F,r]),v.useEffect(()=>{const V=ue.current;if(!V)return;V.style.height="0px";const ve=Math.min(V.scrollHeight,160);V.style.height=`${Math.max(40,ve)}px`},[ie,D]),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 dr=Object.entries(c.mcpServerVersions??{}).map(([V,ve])=>`${V}: ${ve??"unknown"}`).join(", "),vn=c.scenarios.reduce((V,ve)=>V+ve.runs.filter(st=>st.passed).length,0),Xn=c.totalRuns-vn,Er=[{name:"Pass",value:vn,color:"hsl(152, 69%, 40%)"},{name:"Fail",value:Xn,color:"hsl(0, 72%, 51%)"}],yr={};c.scenarios.forEach(V=>V.runs.forEach(ve=>ve.toolCalls.forEach(st=>{yr[st.name]=(yr[st.name]||0)+1})));const ri=Object.entries(yr).map(([V,ve])=>({name:V,count:ve})).sort((V,ve)=>ve.count-V.count),ai=V=>{N(ve=>{const st=new Set(ve);return st.has(V)?st.delete(V):st.add(V),st})},kn=(V,ve,st,Me)=>`${V}:${ve}:${st}:${Me}`,W=(V,ve)=>`${V}::${ve}`,he=V=>{P(ve=>{const st=new Set(ve);return st.has(V)?st.delete(V):st.add(V),st})},De=V=>{const ve=!V.endsWith(":conversation");return _.has(V)?!ve:ve},ct=new Map((M?.scenario_results??[]).map(V=>[V.scenario_id,V])),kt=async()=>{if(!(!c||!k)){L(!0);try{const V=await r.compareSnapshot(k,c.id);z(V)}finally{L(!1)}}},Pt=async V=>{const ve=V||c.snapshotEval?.baselineSnapshotId;if(ve){R(ve),L(!0);try{const st=await r.compareSnapshot(ve,c.id);z(st)}catch(st){_e({title:"Could not review drift",description:st instanceof Error?st.message:String(st),variant:"destructive"})}finally{L(!1)}}},gn=async()=>{if(!G){_e({title:"Select a configuration",description:"Choose which config should receive the new baseline.",variant:"destructive"});return}T(!0);try{const V=await r.generateSnapshotEvalBaseline(c.id,G,H.trim()||void 0);O(ve=>[V.snapshot,...ve.filter(st=>st.id!==V.snapshot.id)]),R(V.snapshot.id),_e({title:"Baseline updated",description:`${V.snapshot.name} is now linked to the selected config.`}),H.trim()||Q(V.snapshot.name),c.snapshotEval?.applied&&Pt(V.snapshot.id)}catch(V){_e({title:"Could not accept new baseline",description:V instanceof Error?V.message:String(V),variant:"destructive"})}finally{T(!1)}},Cn=async()=>{const V=ie.trim();if(!V||!c)return;const ve=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,st={id:ve,role:"user",text:V,createdAt:new Date().toISOString()};fe(""),ae(Me=>[...Me,st]),ce(!0);try{let Me=F;if(!Me){const Et=await r.createResultAssistantSession(c.id);Me=Et.sessionId,$(Et.session.id),le(Et.session.pendingToolCalls),Be({assistantAgentName:Et.session.selectedAssistantAgentName,provider:Et.session.provider,model:Et.session.model}),ae(yn=>{const zr=yn.some(ts=>ts.id===ve),Xt=Et.session.messages;return zr?[...Xt,st]:Xt})}const Mt=await r.sendResultAssistantMessage(Me,V);_n(Mt.session)}catch(Me){ae(Mt=>Mt.filter(Et=>Et.id!==ve)),_e({title:"MCP Labs Assistant error",description:Me instanceof Error?Me.message:String(Me),variant:"destructive"})}finally{ce(!1)}},We=V=>{fe(V),requestAnimationFrame(()=>ue.current?.focus())},_n=V=>{$(V.id),ae(V.messages),le(V.pendingToolCalls),Be({assistantAgentName:V.selectedAssistantAgentName,provider:V.provider,model:V.model})},Tt=async V=>{if(F){ce(!0);try{const ve=await r.approveResultAssistantToolCall(F,V);_n(ve.session)}catch(ve){_e({title:"Could not approve assistant action",description:ve instanceof Error?ve.message:String(ve),variant:"destructive"})}finally{ce(!1)}}},An=async V=>{if(F){ce(!0);try{const ve=await r.denyResultAssistantToolCall(F,V);_n(ve.session)}catch(ve){_e({title:"Could not deny assistant action",description:ve instanceof Error?ve.message:String(ve),variant:"destructive"})}finally{ce(!1)}}},nn=(V,ve)=>{Ae("assistant"),X(!0),ge(ve?.scenarioId??null),ee.length===0&&ae([{id:`msg-${Date.now()}`,role:"assistant",text:"Ask me to explain failures, tool usage, snapshot drift, or suggest what to inspect next in this result.",createdAt:new Date().toISOString()}]),V&&fe(V)},sg=V=>{Ae("reports"),X(!0)},Yc=()=>{Ae("note"),X(!0)},Cf=V=>{if(!c)return;if(!Ye){_e({title:"No scenario context",description:"Ask about a specific scenario or run first, then send the suggestion.",variant:"destructive"});return}const ve=o.find(Me=>Me.id===Ye)??o.find(Me=>Me.name===Ye);if(!ve){_e({title:"Scenario not found in library",description:`Could not find library scenario '${Ye}' to open in Scenario Assistant.`,variant:"destructive"});return}const st=[`I am sending a suggestion from the Result Assistant for scenario '${Ye}' based on run '${c.id}'.`,"Please review the suggestion, check it against the current scenario configuration, and propose concrete updates to the Checks and/or Value Capture Rules if appropriate.","","Result Assistant suggestion:",V].join(`
|
|
249
|
-
`);try{window.sessionStorage.setItem(cge,JSON.stringify({type:"result-assistant-handoff-v1",runId:c.id,configId:nt||c.configId||"",scenarioId:ve.id,prompt:st,sourceReply:V})),t(`/libraries/test-cases/${encodeURIComponent(ve.id)}?assistantHandoff=1`)}catch(Me){_e({title:"Could not create handoff",description:Me instanceof Error?Me.message:String(Me),variant:"destructive"})}},Yi=V=>{c&&(Xe(!1),lt(V),qt(jM(c.id)),je(!1),be(!0))},ig=()=>{c&&(Xe(!0),lt(""),qt(jM(c.id)),je(!1),be(!0))},_f=async()=>{if(!c)return;if(!Je.trim()){_e({title:"No markdown to write",description:"The selected assistant response is empty.",variant:"destructive"});return}ke(!0);try{const ve=await r.applyResultAssistantReport({runId:c.id,markdown:Je,outputPath:Rt.trim()||void 0,overwrite:Z});_e({title:"Markdown report written",description:typeof ve.path=="string"&&ve.path?ve.path:ve.outputPath}),await Re(c.id,typeof ve.path=="string"&&ve.path||ve.outputPath||void 0),D&&Ae("reports"),be(!1)}catch(ve){_e({title:"Could not write markdown report",description:ve instanceof Error?ve.message:String(ve),variant:"destructive"})}finally{ke(!1)}},Go=async V=>{try{await navigator.clipboard.writeText(V),_e({title:"Copied"})}catch(ve){_e({title:"Could not copy",description:ve instanceof Error?ve.message:String(ve),variant:"destructive"})}},ia=async()=>{if(c){x(!0);try{const V=g.trim();await r.updateRunNote(c.id,V||void 0),d(ve=>ve&&{...ve,runNote:V||void 0}),j(V),y(!1),_e({title:"Run note saved"})}catch(V){_e({title:"Could not save run note",description:V instanceof Error?V.message:String(V),variant:"destructive"})}finally{x(!1)}}};return s.jsxs("div",{className:`${D?"xl:flex xl:h-[calc(100vh-2rem-48px)] xl:min-h-0 xl:flex-col xl:overflow-hidden":""}`,children:[s.jsx("div",{className:`${D?"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(bt,{to:"/results",children:s.jsx(So,{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(bo,{rate:c.overallPassRate}),a&&c.snapshotEval?.applied&&s.jsxs(Qe,{variant:"outline",className:"text-xs",children:["Snapshot policy · ",c.snapshotEval.mode," · ",c.snapshotEval.status]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[new Date(c.timestamp).toLocaleString()," ","· 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:[dr?s.jsxs("span",{className:"inline-flex items-center rounded-sm border border-border/60 bg-muted/30 px-1.5 py-1 text-[11px] text-muted-foreground",children:[s.jsx("span",{className:"font-medium",children:"MCP:"}),s.jsx("span",{className:"ml-1 font-mono",children:dr})]}):null,a&&c.snapshotEval?.applied&&s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>{Pt()},disabled:B,children:[s.jsx(ES,{className:"h-3.5 w-3.5"}),B?"Reviewing drift...":"Review Drift"]}),s.jsxs(se,{variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>{const V=lge(c),ve=new Blob([V],{type:"text/html"}),st=URL.createObjectURL(ve),Me=document.createElement("a");Me.href=st,Me.download=`mcplab-report-${c.id}.html`,Me.click(),URL.revokeObjectURL(st)},children:[s.jsx(wa,{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:()=>sg(),disabled:Sn,children:[s.jsx(Pl,{className:"h-3.5 w-3.5"}),Sn?"Reference Reports...":`Reference Reports${At.length?` (${At.length})`:""}`]}),s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>Yc(),children:[s.jsx(Pl,{className:"h-3.5 w-3.5"}),"Run Note"]}),s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>nn(),children:[s.jsx(va,{className:"h-3.5 w-3.5"}),"MCP Labs Assistant"]})]})]})}),s.jsxs("div",{className:`grid gap-6 items-start ${D?Se?"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 ${D?"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(Ct,{className:"pb-3",children:s.jsx(_t,{className:"text-base",children:"Snapshot Drift Review"})}),s.jsxs(qe,{className:"space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[s.jsxs(Qe,{variant:"outline",children:["Mode: ",c.snapshotEval.mode]}),s.jsxs(Qe,{variant:"outline",children:["Status: ",c.snapshotEval.status]}),s.jsxs(Qe,{variant:"outline",children:["Overall score: ",c.snapshotEval.overallScore]}),s.jsxs(Qe,{variant:"outline",className:"font-mono",children:["Baseline: ",c.snapshotEval.baselineSnapshotId]})]}),c.snapshotEval.impactedScenarios.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Impacted scenarios: ",c.snapshotEval.impactedScenarios.join(", ")]}),s.jsxs("div",{className:"grid gap-3 lg:grid-cols-[1.2fr_1fr_auto] items-end",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Target config for baseline update"}),s.jsxs(on,{value:G,onValueChange:U,children:[s.jsx(Zt,{className:"h-8",children:s.jsx(ln,{placeholder:"Select config to update"})}),s.jsx(en,{children:i.map(V=>s.jsx(it,{value:V.id,children:V.name},V.id))})]}),!G&&s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Tip: open results from the Run page to prefill the config automatically."})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"New snapshot name (optional)"}),s.jsx("div",{className:"relative",children:s.jsx("input",{value:H,onChange:V=>Q(V.target.value),placeholder:`Snapshot ${c.id}`,className:"h-8 w-full rounded-md border bg-background px-2 text-xs"})})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5",onClick:()=>{Pt()},disabled:B,children:[s.jsx(Sa,{className:`h-3.5 w-3.5 ${B?"animate-spin":""}`}),"Review Drift"]}),s.jsx(se,{type:"button",size:"sm",className:"h-8",onClick:()=>{gn()},disabled:J||c.overallPassRate!==1,children:J?"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($s,{title:"Scenarios",value:c.totalScenarios,icon:w1}),s.jsx($s,{title:"Total Runs",value:c.totalRuns,icon:n$}),s.jsx($s,{title:"Pass Rate",value:`${Math.round(c.overallPassRate*100)}%`,icon:id}),s.jsx($s,{title:"Avg Tool Calls",value:SM(c.avgToolCalls),icon:$l}),s.jsx($s,{title:"Avg Latency",value:`${c.avgLatency}ms`,icon:f$})]}),s.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[s.jsxs(Ue,{children:[s.jsx(Ct,{className:"pb-2",children:s.jsx(_t,{className:"text-base",children:"Pass / Fail"})}),s.jsxs(qe,{className:"flex items-center justify-center",children:[s.jsxs(efe,{width:180,height:180,children:[s.jsx(ti,{data:Er,dataKey:"value",innerRadius:50,outerRadius:75,paddingAngle:3,children:Er.map((V,ve)=>s.jsx(hv,{fill:V.color},ve))}),s.jsx(Yr,{})]}),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"}),vn," 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"}),Xn," failed"]})]})]})]}),s.jsxs(Ue,{children:[s.jsx(Ct,{className:"pb-2",children:s.jsx(_t,{className:"text-base",children:"Tool Usage"})}),s.jsx(qe,{children:s.jsx(rj,{width:"100%",height:180,children:s.jsxs(Zde,{data:ri,layout:"vertical",children:[s.jsx(ko,{type:"number",tick:{fontSize:11}}),s.jsx(Ro,{type:"category",dataKey:"name",tick:{fontSize:11},width:120}),s.jsx(Yr,{}),s.jsx(Wo,{dataKey:"count",fill:"hsl(38, 92%, 50%)",radius:[0,4,4,0]})]})})})]})]}),s.jsxs(Ue,{children:[s.jsx(Ct,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx(_t,{className:"text-base",children:"Scenarios"}),s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5 px-2 text-xs",onClick:()=>nn("Summarize the scenario results in this run. Highlight failed scenarios/checks first, then mention notable tool usage and extracted values."),children:[s.jsx(va,{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(on,{value:k,onValueChange:R,children:[s.jsx(Zt,{className:"h-8",children:s.jsx(ln,{placeholder:"Select snapshot"})}),s.jsx(en,{children:A.map(V=>s.jsx(it,{value:V.id,children:V.name},V.id))})]})]}),s.jsx(se,{type:"button",variant:"outline",size:"sm",disabled:!k||B,onClick:()=>{kt()},children:B?"Comparing...":"Compare Snapshot"}),M&&s.jsxs(Qe,{variant:"outline",className:"h-8 px-2 py-0 text-xs",children:["Overall snapshot score: ",M.overall_score]})]}),s.jsxs(Zr,{children:[s.jsx(ea,{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(ta,{children:c.scenarios.map(V=>{const ve=W(V.scenarioId,V.agentName),st=V.scenarioName||V.scenarioId;return s.jsx(Ei,{open:S.has(ve),onOpenChange:()=>ai(ve),asChild:!0,children:s.jsxs(s.Fragment,{children:[s.jsx(Ms,{asChild:!0,children:s.jsxs(Ut,{className:"cursor-pointer hover:bg-muted/50",children:[s.jsx(He,{children:s.jsx(Vt,{className:`h-4 w-4 transition-transform ${S.has(ve)?"rotate-180":""}`})}),s.jsx(He,{className:"font-medium text-sm",children:V.scenarioName}),s.jsx(He,{className:"text-sm",children:V.agentName}),s.jsx(He,{className:"font-mono text-sm",children:V.runs.length}),s.jsx(He,{children:s.jsx(bo,{rate:V.passRate})}),s.jsx(He,{className:"font-mono text-sm",children:SM(V.avgToolCalls)}),s.jsx(He,{children:(()=>{const Me=ct.get(V.scenarioId);if(!Me)return s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"});const Mt=Me.status==="Match"?"bg-success/15 text-success":Me.status==="Warn"?"bg-amber-500/15 text-amber-600":"bg-destructive/15 text-destructive";return s.jsxs(Qe,{variant:"outline",className:`text-xs ${Mt}`,children:[Me.status," · ",Me.score]})})()})]})}),s.jsx(Pi,{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:[st," · ",V.agentName," · ",Math.round(V.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:()=>nn(`Explain why scenario '${st}' failed (agent: ${V.agentName}). Summarize the likely cause from the result details and suggest what to inspect next.`,{scenarioId:V.scenarioId}),children:[s.jsx(va,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]}),(()=>{const Me=ct.get(V.scenarioId);return!Me||Me.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: ",Me.baseline_agents.join(", ")||"—"," · observed agents: ",Me.observed_agents.join(", ")||"—"]}),s.jsx("ul",{className:"space-y-1 text-xs text-muted-foreground",children:Me.reasons.map((Mt,Et)=>s.jsxs("li",{children:["• ",Mt]},Et))})]})})(),V.runs.map(Me=>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:Me.passed?s.jsx($l,{className:"h-4 w-4 text-success"}):s.jsx(nh,{className:"h-4 w-4 text-destructive"})}),s.jsxs("div",{className:"flex-1 space-y-1",children:[(()=>{const Mt=Ft.get(V.scenarioId),Et=Mt?hge(Mt.evalRules,Me.failureReasons):[],yn=Et.filter(Xt=>Xt.status==="failed"),zr=Et.filter(Xt=>Xt.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 #",Me.runIndex+1]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[Me.duration,"ms"]}),!Me.passed&&s.jsx(Qe,{variant:"outline",className:"h-5 border-destructive/30 bg-destructive/10 text-destructive text-[10px]",children:"Failed"})]}),Me.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(nh,{className:"h-3.5 w-3.5"}),"Failure reasons"]}),s.jsx("ul",{className:"space-y-1 text-xs text-destructive",children:Me.failureReasons.map((Xt,ts)=>s.jsxs("li",{children:["• ",_M(Xt)]},ts))})]}),Et.length>0&&s.jsx(Ei,{open:De(kn(V.scenarioId,V.agentName,Me.runIndex,"checks")),onOpenChange:()=>he(kn(V.scenarioId,V.agentName,Me.runIndex,"checks")),children:s.jsxs("div",{className:"rounded-md border bg-muted/20 p-2",children:[s.jsx(Ms,{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(Vt,{className:`h-3.5 w-3.5 transition-transform ${De(kn(V.scenarioId,V.agentName,Me.runIndex,"checks"))?"rotate-180":""}`}),s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Checks"}),s.jsxs(Qe,{variant:"outline",className:"h-5 border-success/30 bg-success/10 text-success text-[10px]",children:[zr.length," passed"]}),s.jsxs(Qe,{variant:"outline",className:`h-5 text-[10px] ${yn.length>0?"border-destructive/30 bg-destructive/10 text-destructive":""}`,children:[yn.length," failed"]})]})}),s.jsx(Pi,{children:s.jsx("div",{className:"space-y-1",children:Et.map((Xt,ts)=>s.jsxs("div",{className:`flex items-start justify-between gap-2 rounded-md border px-2 py-1.5 text-xs ${Xt.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:[Xt.status==="failed"?s.jsx(nh,{className:"h-3.5 w-3.5 shrink-0 text-destructive"}):s.jsx($l,{className:"h-3.5 w-3.5 shrink-0 text-success"}),s.jsx("span",{className:"font-medium",children:vge(Xt.rule)})]}),Xt.failureReason&&s.jsx("p",{className:"mt-1 pl-5 text-[11px] text-destructive",children:_M(Xt.failureReason)})]}),s.jsx(Qe,{variant:"outline",className:`shrink-0 text-[10px] ${Xt.status==="failed"?"border-destructive/30 text-destructive":"border-success/30 text-success"}`,children:Xt.status})]},`${Xt.rule.type}-${Xt.rule.value}-${ts}`))})})]})})]})})(),s.jsx(Ei,{open:De(kn(V.scenarioId,V.agentName,Me.runIndex,"extracts")),onOpenChange:()=>he(kn(V.scenarioId,V.agentName,Me.runIndex,"extracts")),children:s.jsxs("div",{className:"rounded-md border border-violet-500/20 bg-violet-500/5 p-2",children:[s.jsx(Ms,{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(Vt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${De(kn(V.scenarioId,V.agentName,Me.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(w1,{className:"h-3.5 w-3.5 text-violet-600"}),"Extracted values"]})]}),s.jsxs(Qe,{variant:"outline",className:"h-5 text-[10px]",children:[Object.keys(Me.extractedValues??{}).length," total"]})]})}),s.jsx(Pi,{children:Object.keys(Me.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(Me.extractedValues??{}).map(([Mt,Et])=>s.jsxs("div",{className:"rounded-md border bg-background px-2 py-1.5 text-xs",children:[s.jsx("div",{className:"mb-0.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:Mt}),s.jsx("div",{className:"font-mono break-all text-foreground",children:Et===null?"null":String(Et)})]},Mt))})})]})}),s.jsx(Ei,{open:De(kn(V.scenarioId,V.agentName,Me.runIndex,"tools")),onOpenChange:()=>he(kn(V.scenarioId,V.agentName,Me.runIndex,"tools")),children:s.jsxs("div",{className:"rounded-md border border-sky-500/20 bg-sky-500/5 p-2",children:[s.jsx(Ms,{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(Vt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${De(kn(V.scenarioId,V.agentName,Me.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(Ds,{className:"h-3.5 w-3.5 text-sky-600"}),"Tool call sequence"]})]}),s.jsxs(Qe,{variant:"outline",className:"h-5 text-[10px]",children:[Me.toolCalls.length," total"]})]})}),s.jsx(Pi,{children:Me.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:Me.toolCalls.map((Mt,Et)=>s.jsxs(Qe,{variant:"outline",className:"font-mono text-xs bg-background",children:[s.jsxs("span",{className:"mr-1 text-muted-foreground",children:["#",Et+1]}),Mt.name,s.jsxs("span",{className:"ml-1 text-muted-foreground",children:[Mt.duration,"ms"]})]},Et))})})]})}),s.jsx(Ei,{open:De(kn(V.scenarioId,V.agentName,Me.runIndex,"final")),onOpenChange:()=>he(kn(V.scenarioId,V.agentName,Me.runIndex,"final")),children:s.jsxs("div",{className:"rounded-md border border-muted-foreground/20 bg-card p-2",children:[s.jsx(Ms,{asChild:!0,children:s.jsxs("button",{type:"button",className:"mb-2 flex w-full items-center gap-2 text-left",children:[s.jsx(Vt,{className:`h-3.5 w-3.5 transition-transform ${De(kn(V.scenarioId,V.agentName,Me.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(ya,{className:"h-3.5 w-3.5"}),"Final answer"]})]})}),s.jsx(Pi,{children:s.jsx(jS,{text:Me.finalAnswer||"No final answer captured.",maxLength:1200,className:"text-xs text-foreground"})})]})}),s.jsx(Ei,{open:De(kn(V.scenarioId,V.agentName,Me.runIndex,"conversation")),onOpenChange:()=>he(kn(V.scenarioId,V.agentName,Me.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(Ms,{asChild:!0,children:s.jsxs("button",{type:"button",className:"flex min-w-0 items-center gap-2 text-left",children:[s.jsx(Vt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${De(kn(V.scenarioId,V.agentName,Me.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:()=>nn(`Explain Run #${Me.runIndex+1} for scenario '${st}'. It ${Me.passed?"passed":"failed"} in ${Me.duration}ms. Focus on the tool sequence and ${Me.passed?"why it passed":"what caused the failure"}.`,{scenarioId:V.scenarioId}),children:[s.jsx(va,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})})]}),s.jsx(Pi,{children:s.jsx("div",{className:"space-y-2 rounded-md border bg-muted/20 p-2",children:Me.conversation.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No conversation trace captured."}):Me.conversation.map(Mt=>s.jsx(fge,{item:Mt,fallbackUserPrompt:Ft.get(V.scenarioId)?.prompt},Mt.id))})}),!De(kn(V.scenarioId,V.agentName,Me.runIndex,"conversation"))&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"Expand to inspect user/assistant/tool messages for this run."})]})})]})]},Me.runIndex))]})})})})]})},ve)})})]})]})]})]}),D&&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(lC,{value:Te,onValueChange:V=>Ae(V),className:"min-w-0 -mb-px px-3 pt-1",children:s.jsxs(Kv,{className:"h-auto w-full justify-start rounded-none border-b bg-transparent p-0",children:[s.jsx(Ii,{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(Ii,{value:"reports",className:"-mb-px h-9 rounded-none rounded-t border border-border border-b-border bg-muted/20 px-3 text-xs text-muted-foreground data-[state=active]:z-10 data-[state=active]:bg-card data-[state=active]:text-foreground data-[state=active]:border-border data-[state=active]:border-b-card data-[state=active]:shadow-none",children:"Reports"}),s.jsx(Ii,{value:"note",className:"-mb-px h-9 rounded-none rounded-t border border-border border-b-border bg-muted/20 px-3 text-xs text-muted-foreground data-[state=active]:z-10 data-[state=active]:bg-card data-[state=active]:text-foreground data-[state=active]:border-border data-[state=active]:border-b-card data-[state=active]:shadow-none",children:"Note"})]})}),Te==="assistant"?s.jsxs(Ue,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[s.jsx(Ct,{className:"border-b px-4 py-3",children:s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(_t,{className:"flex items-center gap-2 text-base",children:[s.jsx(va,{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:()=>ne(V=>!V),children:[Se?s.jsx(Gy,{className:"h-3.5 w-3.5"}):s.jsx(Yy,{className:"h-3.5 w-3.5"}),Se?"Compact":"Expand"]}),s.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>X(!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(Cm,{className:"min-h-0 flex-1 bg-muted/15 px-4 py-4",children:s.jsxs("div",{className:"space-y-3 pr-2",children:[ee.map((V,ve)=>{const st=V.role==="user",Me=V.role==="assistant",Mt=V.role==="system",Et=V.role==="tool",yn=V.pendingToolCallId?K.find(Yo=>Yo.id===V.pendingToolCallId):void 0,zr=Me&&!!V.pendingToolCallId;if(Et&&/^(Approved|Denied) tool call\b/i.test(String(V.text??"").trim()))return null;yn?.server??V.toolRequestServer;const Xt=yn?.tool??V.toolRequestName,ts=yn?.publicToolName??V.toolRequestPublicName,Af=Me&&!zr&&pge(V.text,!!Ye);if(zr){const Yo=Xt??ts??"unknown_tool";return Xt&&Xt.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(ya,{className:"h-3 w-3"})}),s.jsxs("details",{open:!!yn,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(Ds,{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 ${Yo}`}),s.jsx("span",{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${yn?"bg-amber-100 text-amber-900":"bg-muted text-muted-foreground"}`,children:yn?"Needs approval":"Completed"})]})}),s.jsx(Vt,{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(sd,{text:V.text,className:"text-sm"}),yn&&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(yn.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:oe,onClick:()=>{An(yn.id)},children:"Deny"}),s.jsx(se,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:oe,onClick:()=>{Tt(yn.id)},children:"Approve"})]})]})]})]})]},`${V.id??`${V.role}-${ve}`}:${yn?"pending":"completed"}`)}const Xc=st||Me&&!Et&&!Mt;return s.jsxs("div",{className:`flex items-start gap-2 ${st?"justify-end":"justify-start"}`,children:[!st&&s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700",children:Mt?s.jsx(u$,{className:"h-3 w-3"}):s.jsx(ya,{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 ${st?"border-primary/20 bg-primary/10":Mt?"border-amber-400/30 bg-amber-50/70":Et?"border-blue-300/30 bg-blue-50/50":"border-border/80 bg-background shadow-sm"}`,children:[!(st||Mt)&&s.jsx("p",{className:`mb-2 text-[11px] font-semibold text-muted-foreground ${st?"text-right":""}`,children:Et?"Tool":"Assistant"}),s.jsx(sd,{text:V.text,className:"text-sm"}),Af&&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:()=>Cf(V.text),children:[s.jsx(va,{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:()=>Yi(V.text),children:[s.jsx(Ds,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})]}),!Af&&Me&&!zr&&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:()=>Yi(V.text),children:[s.jsx(Ds,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})})]}),Xc&&s.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"absolute -right-8 bottom-1 h-6 w-6 text-muted-foreground",onClick:()=>{Go(V.text)},"aria-label":"Copy message",title:"Copy message",children:s.jsx($i,{className:"h-3.5 w-3.5"})})]}),st&&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(kS,{className:"h-3 w-3"})})]},V.id??`${V.role}-${ve}`)}),K.filter(V=>!ee.some(ve=>ve.pendingToolCallId===V.id)).length>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Pending actions (approve/deny)"}),K.filter(V=>!ee.some(ve=>ve.pendingToolCallId===V.id)).map(V=>s.jsxs("details",{open:!0,className:"group min-w-0 rounded-md border bg-background",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-2 p-3",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"break-all font-mono text-xs font-semibold",children:V.publicToolName}),s.jsxs("p",{className:"break-all text-xs text-muted-foreground",children:[V.server,"::",V.tool]})]}),s.jsx(Vt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),s.jsxs("div",{className:"border-t px-3 pb-3 pt-2",children:[s.jsx("pre",{className:"max-h-48 min-w-0 w-full max-w-full overflow-x-auto overflow-y-auto whitespace-pre-wrap break-words rounded border bg-muted/50 p-2 text-xs",children:s.jsx("code",{className:"break-words",children:JSON.stringify(V.arguments??{},null,2)})}),s.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:oe,onClick:()=>{An(V.id)},children:"Deny"}),s.jsx(se,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:oe,onClick:()=>{Tt(V.id)},children:"Approve"})]})]})]},V.id))]}),oe&&s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700",children:s.jsx(ya,{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(ir,{className:"h-4 w-4 animate-spin"}),"Thinking..."]})]}),s.jsx("div",{ref:On})]})}),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(Ua,{ref:ue,value:ie,onChange:V=>fe(V.target.value),placeholder:"Ask about this result...",rows:1,className:"min-h-10 max-h-40 resize-none border-0 bg-transparent px-2 py-1 text-sm shadow-none focus-visible:ring-0 focus-visible:ring-offset-0",onKeyDown:V=>{V.key==="Enter"&&!V.shiftKey&&(V.preventDefault(),oe||Cn())}}),s.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 px-1 pt-1",children:[s.jsxs(Vc,{children:[s.jsx(Hc,{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:oe,children:[s.jsx(ps,{className:"h-3 w-3"}),"Snippets",s.jsx(Vt,{className:"h-3 w-3"})]})}),s.jsxs(Ko,{align:"start",className:"w-[360px]",children:[s.jsx(sC,{children:"Result Assistant Snippets"}),s.jsx(iC,{}),uge.map(V=>s.jsx(gr,{className:"items-start whitespace-normal px-2 py-2",onSelect:()=>We(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 shrink-0 rounded-full",onClick:()=>{Cn()},disabled:oe||!ie.trim(),"aria-label":"Send assistant message",title:"Send assistant message",children:oe?s.jsx(ir,{className:"h-4 w-4 animate-spin"}):s.jsxs(s.Fragment,{children:[s.jsx(d$,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Ask"})]})})]})]})})]})]}):Te==="reports"?s.jsxs(Ue,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[s.jsx(Ct,{className:"border-b px-4 py-3",children:s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(_t,{className:"flex items-center gap-2 text-base",children:[s.jsx(Pl,{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:()=>ne(V=>!V),children:[Se?s.jsx(Gy,{className:"h-3.5 w-3.5"}):s.jsx(Yy,{className:"h-3.5 w-3.5"}),Se?"Compact":"Expand"]}),s.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>X(!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:[(Sn||At.length===0||At.length>1)&&s.jsx("div",{className:"border-b px-4 py-3",children:Sn?s.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading reference reports..."}):At.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:()=>ig(),children:[s.jsx(ps,{className:"h-3.5 w-3.5"}),"New Report"]})]}):s.jsx("div",{className:"space-y-2",children:At.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(on,{value:cr,onValueChange:Ln,children:[s.jsx(Zt,{className:"h-8",children:s.jsx(ln,{placeholder:"Select a report"})}),s.jsx(en,{children:At.map(V=>s.jsx(it,{value:V.relativePath,children:V.name},V.path))})]})]}):null})}),s.jsx(Cm,{className:"min-h-0 flex-1 bg-muted/15 px-4 py-4",children:At.length===0?s.jsx("div",{className:"text-sm text-muted-foreground",children:"No report selected."}):Fr?s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(ir,{className:"h-4 w-4 animate-spin"}),"Loading report..."]}):Yn?s.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive",children:["Could not load report: ",Yn]}):ur?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:ur.name}),s.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:ur.relativePath}),s.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:new Date(ur.mtime).toLocaleString()})]}),s.jsx("div",{className:"rounded-md border bg-background p-3",children:s.jsx(sd,{text:ur.content,className:"text-sm"})})]}):s.jsx("div",{className:"text-sm text-muted-foreground",children:"Select a report to preview."})})]})]}):s.jsxs(Ue,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[s.jsx(Ct,{className:"border-b px-4 py-3",children:s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(_t,{className:"flex items-center gap-2 text-base",children:[s.jsx(Pl,{className:"h-4 w-4 text-muted-foreground"}),"Run Note"]}),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:()=>ne(V=>!V),children:[Se?s.jsx(Gy,{className:"h-3.5 w-3.5"}):s.jsx(Yy,{className:"h-3.5 w-3.5"}),Se?"Compact":"Expand"]}),s.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>X(!1),children:"Hide"})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Add context for this run, such as server version or environment details."})]})}),s.jsx(qe,{className:"flex h-[70vh] min-h-[520px] flex-col p-4 xl:h-auto xl:min-h-0 xl:flex-1",children:p?s.jsxs("div",{className:"w-full max-w-xl space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("p",{className:"text-xs font-medium",children:"Run note"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[g.length,"/500"]})]}),s.jsx(Ua,{value:g,onChange:V=>j(V.target.value.slice(0,500)),placeholder:"Optional context for this run",rows:3,className:"min-h-20 resize"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(se,{size:"sm",onClick:()=>{ia()},disabled:b,children:b?"Saving...":"Save note"}),s.jsx(se,{size:"sm",variant:"outline",onClick:()=>{j(c.runNote??""),y(!1)},disabled:b,children:"Cancel"})]})]}):s.jsxs("div",{className:"flex w-full max-w-3xl items-center gap-2 rounded-md border bg-muted/20 px-2 py-1 text-xs",children:[s.jsxs("div",{className:"min-w-0 flex items-center gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"Run note:"}),s.jsx("span",{className:`break-words ${c.runNote?"text-foreground":"text-muted-foreground"}`,children:c.runNote||"none"})]}),s.jsx(se,{size:"sm",variant:"ghost",className:"ml-auto h-6 px-2 text-xs",onClick:()=>y(!0),children:c.runNote?"Edit":"Add note"})]})})]})]}),s.jsx(Ss,{open:dt,onOpenChange:V=>!we&&be(V),children:s.jsxs(Ga,{className:"max-w-2xl",children:[s.jsxs(Ya,{children:[s.jsx(Qa,{children:Le?"Create markdown report":"Approve MCP action: write markdown report"}),s.jsx(Ja,{children:Le?"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:[!Le&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Output path"}),s.jsx(ht,{value:Rt,onChange:V=>qt(V.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(ba,{checked:Z,onCheckedChange:V=>je(V===!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:Le?"Markdown content":"Markdown preview (to be written)"}),s.jsx(Ua,{value:Je,onChange:V=>lt(V.target.value),rows:10,className:"font-mono text-xs",disabled:we})]})]}),s.jsxs(Xa,{children:[s.jsx(es,{disabled:we,children:"Cancel"}),s.jsx(Za,{onClick:V=>{V.preventDefault(),_f()},disabled:we,children:we?"Writing...":Le?"Save Report":"Approve & Write"})]})]})})]})]})};function fge({item:e,fallbackUserPrompt:t}){if(e.kind==="tool_call")return s.jsx(CM,{variant:"call",title:`Tool call · ${e.toolName||"unknown"}`,text:e.text});if(e.kind==="tool_result"){const d=e.ok?s.jsx($l,{className:"h-3.5 w-3.5 text-emerald-700 dark:text-emerald-300"}):s.jsx(nh,{className:"h-3.5 w-3.5 text-rose-700 dark:text-rose-300"});return s.jsx(CM,{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=NM(e.text,e.kind),a=t?NM(t,"user_prompt"):"",i=n&&!r&&a?a:r,o=n?"User prompt":e.kind==="assistant_final"?"Agent final":"Agent",c=n?kS:ya;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(jS,{text:i,maxLength:280,className:"text-xs"}):s.jsx(jS,{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 NM(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 pge(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 CM({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(Ei,{open:a,onOpenChange:i,children:s.jsxs("div",{className:`rounded-md border p-2 text-xs ${o[e]}`,children:[s.jsx(Ms,{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(Ds,{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(Pi,{children:s.jsx("p",{className:"mt-2 font-mono whitespace-pre-wrap text-foreground",children:n})})]})})}function jS({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(sd,{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 hge(e,t){return e.map(n=>{const r=mge(n,t);return{rule:n,status:r?"failed":"passed",failureReason:r}})}function mge(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 vge(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 _M(e){const t=String(e??"").trim(),n=t.match(/^Regex assertion failed:\s*(.+)$/i);return n?`Text match failed: ${n[1]}`:t}const AM=["hsl(38, 92%, 50%)","hsl(200, 80%, 50%)","hsl(152, 69%, 40%)","hsl(280, 60%, 50%)","hsl(0, 72%, 51%)"],gge=()=>{const{source:e}=In(),t=jf("snapshots",!1),[n,r]=v.useState([]),[a,i]=v.useState(!1),[o,c]=v.useState(new Set),[d,f]=v.useState("timestamp"),[h,p]=v.useState("desc"),[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){_e({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(D=>{T&&r(D)}).catch(D=>{T&&_e({title:"Could not load results",description:D instanceof Error?D.message:String(D),variant:"destructive"})}).finally(()=>{T&&i(!1)}),()=>{T=!1}},[e]),v.useEffect(()=>{let T=!0;return e.listSnapshots().then(D=>{T&&S(D)}).catch(()=>{T&&S([])}),()=>{T=!1}},[e]);const M=T=>{if(d===T){p(D=>D==="asc"?"desc":"asc");return}f(T),p(T==="timestamp"?"desc":"asc")},z=T=>{c(D=>{const X=new Set(D);return X.has(T)?X.delete(T):X.add(T),X})},B=v.useMemo(()=>{const T=new Set;return n.forEach(D=>{D.scenarios.forEach(X=>{const F=String(X.scenarioName??"").trim(),$=String(X.scenarioId??"").trim(),ee=F||$;ee&&T.add(ee)})}),Array.from(T).sort((D,X)=>D.localeCompare(X))},[n]),L=v.useMemo(()=>y==="all"?n:n.filter(T=>T.scenarios.some(D=>{const X=String(D.scenarioName??"").trim(),F=String(D.scenarioId??"").trim();return(X||F)===y})),[n,y]),G=v.useMemo(()=>[...L].sort((D,X)=>{let F=0;return d==="id"&&(F=D.id.localeCompare(X.id)),d==="timestamp"&&(F=new Date(D.timestamp).getTime()-new Date(X.timestamp).getTime()),d==="passRate"&&(F=D.overallPassRate-X.overallPassRate),d==="scenarios"&&(F=D.totalScenarios-X.totalScenarios),h==="asc"?F:-F}),[L,d,h]),U=G.filter(T=>o.has(T.id)),H=T=>d!==T?s.jsx(Ml,{className:"h-3.5 w-3.5 text-muted-foreground"}):h==="asc"?s.jsx(cs,{className:"h-3.5 w-3.5"}):s.jsx(Vt,{className:"h-3.5 w-3.5"}),Q=T=>{const D=Array.from(new Set(T.scenarios.map(ee=>ee.scenarioId).filter(Boolean))),X=Array.from(new Set(T.scenarios.map(ee=>ee.agentName).filter(Boolean))),F=D.slice(0,2).join(", "),$=D.length>2?` +${D.length-2}`:"";return{scenarioCount:D.length,agentCount:X.length,scenarioPreview:F?`${F}${$}`:"n/a"}},J=[...new Set(U.flatMap(T=>T.scenarios.map(D=>D.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(ES,{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(on,{value:y,onValueChange:g,children:[s.jsx(Zt,{className:"w-[260px]",children:s.jsx(ln,{placeholder:"Filter by scenario"})}),s.jsxs(en,{children:[s.jsx(it,{value:"all",children:"All scenarios"}),B.map(T=>s.jsx(it,{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(Zr,{children:[s.jsx(ea,{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",H("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",H("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",H("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",H("scenarios")]})})]})}),s.jsx(ta,{children:G.map(T=>s.jsxs(Ut,{children:[s.jsx(He,{children:s.jsx(ba,{checked:o.has(T.id),onCheckedChange:()=>z(T.id),disabled:!o.has(T.id)&&o.size>=5})}),s.jsx(He,{className:"font-mono text-xs",children:T.id}),s.jsx(He,{className:"text-[11px] text-muted-foreground",children:(()=>{const D=Q(T);return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Evaluated: ",D.scenarioCount," scenario",D.scenarioCount===1?"":"s"," · ",D.agentCount," agent",D.agentCount===1?"":"s"]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:D.scenarioPreview})]})})()}),s.jsx(He,{className:"text-xs text-muted-foreground",children:new Date(T.timestamp).toLocaleString()}),s.jsx(He,{children:s.jsx(bo,{rate:T.overallPassRate})}),s.jsx(He,{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(bt,{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(Ct,{className:"pb-3",children:s.jsx(_t,{className:"text-base",children:"Summary Comparison"})}),s.jsx(qe,{className:"p-0",children:s.jsxs(Zr,{children:[s.jsx(ea,{children:s.jsxs(Ut,{children:[s.jsx(tt,{children:"Metric"}),U.map((T,D)=>s.jsx(tt,{style:{color:AM[D]},className:"font-mono text-xs",children:T.id},T.id))]})}),s.jsxs(ta,{children:[s.jsxs(Ut,{children:[s.jsx(He,{className:"font-medium",children:"Pass Rate"}),U.map(T=>s.jsx(He,{children:s.jsx(bo,{rate:T.overallPassRate})},T.id))]}),s.jsxs(Ut,{children:[s.jsx(He,{className:"font-medium",children:"Total Runs"}),U.map(T=>s.jsx(He,{className:"font-mono",children:T.totalRuns},T.id))]}),s.jsxs(Ut,{children:[s.jsx(He,{className:"font-medium",children:"Tool Calls"}),U.map(T=>s.jsx(He,{className:"font-mono",children:T.avgToolCalls.toFixed(1)},T.id))]}),s.jsxs(Ut,{children:[s.jsx(He,{className:"font-medium",children:"Avg Latency"}),U.map(T=>s.jsxs(He,{className:"font-mono",children:[T.avgLatency,"ms"]},T.id))]})]})]})})]}),s.jsxs(Ue,{children:[s.jsx(Ct,{className:"pb-3",children:s.jsx(_t,{className:"text-base",children:"Scenario Breakdown"})}),s.jsx(qe,{className:"p-0",children:s.jsxs(Zr,{children:[s.jsx(ea,{children:s.jsxs(Ut,{children:[s.jsx(tt,{children:"Scenario"}),U.map((T,D)=>s.jsx(tt,{style:{color:AM[D]},className:"font-mono text-xs",children:T.id},T.id))]})}),s.jsx(ta,{children:J.map(T=>s.jsxs(Ut,{children:[s.jsx(He,{className:"font-medium text-sm",children:T}),U.map(D=>{const X=D.scenarios.find(F=>F.scenarioId===T);return s.jsx(He,{children:X?s.jsx(bo,{rate:X.passRate}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},D.id)})]},T))})]})})]})]}),t&&j==="snapshot"&&s.jsxs(Ue,{children:[s.jsx(Ct,{className:"pb-3",children:s.jsx(_t,{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(on,{value:P,onValueChange:A,children:[s.jsx(Zt,{children:s.jsx(ln,{placeholder:"Select run"})}),s.jsx(en,{children:n.map(T=>s.jsx(it,{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(on,{value:N,onValueChange:_,children:[s.jsx(Zt,{children:s.jsx(ln,{placeholder:"Select snapshot"})}),s.jsx(en,{children:x.map(T=>s.jsx(it,{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(Zr,{children:[s.jsx(ea,{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(ta,{children:O.scenario_results.map(T=>s.jsxs(Ut,{children:[s.jsx(He,{children:T.scenario_id}),s.jsxs(He,{className:"text-xs text-muted-foreground",children:["baseline: ",T.baseline_agents.join(", ")||"—"," · observed: ",T.observed_agents.join(", ")||"—"]}),s.jsx(He,{className:"font-mono text-xs",children:T.score}),s.jsx(He,{children:T.status}),s.jsx(He,{className:"text-xs text-muted-foreground",children:T.reasons.slice(0,2).join("; ")||"—"})]},T.scenario_id))})]})]})]})]})]})},EM=(e,t)=>{const n=new URLSearchParams;return t&&n.set("configId",t),n.set("embed","1"),`/results/${encodeURIComponent(e)}?${n.toString()}`},yge=()=>{const[e]=Ic(),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(Ct,{children:s.jsx(_t,{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(bt,{to:"/compare",children:"Back to Compare"})})]})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Full Result Compare"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"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(bt,{to:"/compare",children:[s.jsx(E7,{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(ch,{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(ch,{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(Ct,{className:"py-3",children:s.jsx(_t,{className:"text-sm font-mono",children:t})}),s.jsx(qe,{className:"p-0",children:s.jsx("iframe",{title:`Result ${t}`,src:EM(t,r),className:"h-[calc(100vh-15rem)] w-full border-0"})})]}),s.jsxs(Ue,{className:"overflow-hidden",children:[s.jsx(Ct,{className:"py-3",children:s.jsx(_t,{className:"text-sm font-mono",children:n})}),s.jsx(qe,{className:"p-0",children:s.jsx("iframe",{title:`Result ${n}`,src:EM(n,a),className:"h-[calc(100vh-15rem)] w-full border-0"})})]})]})]})};function xge(e){return e.match(/(?:^|\/)(?:result-assistant|results?)\/([0-9]{8}-[0-9]{6})(?:-|\/)/i)?.[1]??null}function bge(){const{source:e}=In(),[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){_e({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)),_e({title:"Markdown report deleted"}),o(null)}catch(g){_e({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(Pl,{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(bt,{to:`/markdown-reports/view?path=${encodeURIComponent(h.relativePath)}`,children:"Open latest"})}):null]})]}),s.jsx(Ue,{children:s.jsx(qe,{className:"p-0",children:r?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Loading markdown reports..."}):t.length===0?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"No markdown reports found yet."}):s.jsxs(Zr,{children:[s.jsx(ea,{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(ta,{children:t.map(g=>s.jsxs(Ut,{children:[s.jsx(He,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(bt,{to:`/markdown-reports/view?path=${encodeURIComponent(g.relativePath)}`,className:"font-mono text-xs text-primary hover:underline",children:g.name}),s.jsx("div",{className:"font-mono text-[11px] text-muted-foreground",children:g.relativePath})]})}),s.jsx(He,{className:"text-xs text-muted-foreground font-mono",children:(()=>{const j=xge(g.relativePath);return j?s.jsx(bt,{to:`/results/${encodeURIComponent(j)}`,className:"text-primary hover:underline",children:j}):s.jsx("span",{className:"text-muted-foreground",children:"—"})})()}),s.jsx(He,{className:"text-xs text-muted-foreground font-mono",children:g.relativePath.includes("/")?g.relativePath.slice(0,g.relativePath.lastIndexOf("/")):"."}),s.jsx(He,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(ef,{className:"h-3 w-3"}),new Date(g.mtime).toLocaleString()]})}),s.jsx(He,{children:s.jsxs(Vc,{children:[s.jsx(Hc,{asChild:!0,children:s.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Om,{className:"h-4 w-4"})})}),s.jsxs(Ko,{align:"end",children:[s.jsx(gr,{asChild:!0,children:s.jsx(bt,{to:`/markdown-reports/view?path=${encodeURIComponent(g.relativePath)}`,children:"View"})}),s.jsxs(gr,{className:"text-destructive",onSelect:j=>{j.preventDefault(),o(g.relativePath)},children:[s.jsx(Na,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},g.path))})]})})}),s.jsx(Ss,{open:!!i,onOpenChange:g=>!g&&o(null),children:s.jsxs(Ga,{children:[s.jsxs(Ya,{children:[s.jsx(Qa,{children:"Delete markdown report?"}),s.jsx(Ja,{children:p?`Delete '${p.name}' from disk? This cannot be undone.`:"Delete this report from disk? This cannot be undone."})]}),s.jsxs(Xa,{children:[s.jsx(es,{disabled:c,children:"Cancel"}),s.jsx(Za,{onClick:g=>{g.preventDefault(),y()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}function wge(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function jge(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 Sge(){const{source:e}=In(),[t]=Ic(),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}_e({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(bt,{to:"/markdown-reports",children:"Back to Markdown Reports"})})]});if(i)return s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading markdown report..."});if(c||!r)return s.jsxs("div",{className:"space-y-4",children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Markdown Report"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Report not found."}),s.jsx(se,{asChild:!0,variant:"outline",children:s.jsx(bt,{to:"/markdown-reports",children:"Back to Markdown Reports"})})]});const p=jge(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()," "," · "," ",wge(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(bt,{to:`/results/${encodeURIComponent(p)}`,children:"Open Result"})})]}):null,s.jsx(se,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(bt,{to:"/markdown-reports",children:"Back to reports"})})]})]}),s.jsx(Ue,{children:s.jsx(qe,{className:"pt-6",children:s.jsx(sd,{text:r.content,variant:"assistant"})})}),p?s.jsx(YD,{open:f,onOpenChange:h,children:s.jsxs(JS,{side:"right",className:"w-[96vw] max-w-none p-0 sm:max-w-5xl",children:[s.jsx(QD,{className:"border-b px-4 py-3 pr-12",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(JD,{className:"text-base",children:["Result ",p]}),s.jsx(se,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(bt,{to:`/results/${encodeURIComponent(p)}`,target:"_blank",rel:"noreferrer",children:"Open full page"})})]})}),s.jsx("div",{className:"h-[calc(100vh-64px)]",children:s.jsx("iframe",{title:`Result ${p}`,src:`/results/${encodeURIComponent(p)}?embed=1`,className:"h-full w-full border-0"})})]})}):null]})}const Nge=()=>{const e=xs();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"})]})})},Cge=new fV;function _ge(){const{scenarioId:e}=Lo();return s.jsx(gD,{to:e?`/libraries/test-cases/${encodeURIComponent(e)}`:"/libraries/test-cases",replace:!0})}const Age=()=>s.jsx(hV,{client:Cge,children:s.jsx(Z$,{children:s.jsx(NG,{children:s.jsx(EG,{children:s.jsxs(AG,{children:[s.jsx(xq,{}),s.jsx(Qq,{}),s.jsx(mH,{children:s.jsxs(iH,{children:[s.jsxs(Qt,{element:s.jsx(_G,{}),children:[s.jsx(Qt,{path:"/",element:s.jsx(tfe,{})}),s.jsx(Qt,{path:"/mcp-evaluations",element:s.jsx(Rpe,{})}),s.jsx(Qt,{path:"/mcp-evaluations/:id",element:s.jsx(aM,{})}),s.jsx(Qt,{path:"/mcp-evaluations/:id/:tab",element:s.jsx(aM,{})}),s.jsx(Qt,{path:"/tool-analysis",element:s.jsx(Xve,{})}),s.jsx(Qt,{path:"/tool-analysis-results",element:s.jsx(Qve,{})}),s.jsx(Qt,{path:"/tool-analysis-results/:id",element:s.jsx(Jve,{})}),s.jsx(Qt,{path:"/oauth-debugger",element:s.jsx(rge,{})}),s.jsx(Qt,{path:"/libraries/servers",element:s.jsx(vme,{})}),s.jsx(Qt,{path:"/libraries/servers/:serverId",element:s.jsx(yme,{})}),s.jsx(Qt,{path:"/libraries/agents",element:s.jsx(xme,{})}),s.jsx(Qt,{path:"/libraries/agents/:agentName",element:s.jsx(kve,{})}),s.jsx(Qt,{path:"/libraries/test-cases",element:s.jsx(fM,{})}),s.jsx(Qt,{path:"/libraries/test-cases/:testCaseId",element:s.jsx(fM,{})}),s.jsx(Qt,{path:"/libraries/scenarios",element:s.jsx(gD,{to:"/libraries/test-cases",replace:!0})}),s.jsx(Qt,{path:"/libraries/scenarios/:scenarioId",element:s.jsx(_ge,{})}),s.jsx(Qt,{path:"/settings",element:s.jsx(Rve,{})}),s.jsx(Qt,{path:"/run",element:s.jsx(age,{})}),s.jsx(Qt,{path:"/results",element:s.jsx(sge,{})}),s.jsx(Qt,{path:"/results/:id",element:s.jsx(dge,{})}),s.jsx(Qt,{path:"/markdown-reports",element:s.jsx(bge,{})}),s.jsx(Qt,{path:"/markdown-reports/view",element:s.jsx(Sge,{})}),s.jsx(Qt,{path:"/compare",element:s.jsx(gge,{})}),s.jsx(Qt,{path:"/compare/results",element:s.jsx(yge,{})})]}),s.jsx(Qt,{path:"*",element:s.jsx(Nge,{})})]})})]})})})})});SU.createRoot(document.getElementById("root")).render(s.jsx(Age,{}));
|