@inspectr/mcplab 1.12.0 → 1.12.1
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.
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
function hU(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}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 s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)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(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var eh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var py={exports:{}},id={},hy={exports:{}},Ht={};var EE;function mU(){if(EE)return Ht;EE=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function x(D){return D===null||typeof D!="object"?null:(D=p&&D[p]||D["@@iterator"],typeof D=="function"?D:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,b={};function y(D,I,re){this.props=D,this.context=I,this.refs=b,this.updater=re||g}y.prototype.isReactComponent={},y.prototype.setState=function(D,I){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,I,"setState")},y.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function S(){}S.prototype=y.prototype;function C(D,I,re){this.props=D,this.context=I,this.refs=b,this.updater=re||g}var N=C.prototype=new S;N.constructor=C,j(N,y.prototype),N.isPureReactComponent=!0;var E=Array.isArray,A=Object.prototype.hasOwnProperty,P={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function T(D,I,re){var ne,fe={},he=null,V=null;if(I!=null)for(ne in I.ref!==void 0&&(V=I.ref),I.key!==void 0&&(he=""+I.key),I)A.call(I,ne)&&!O.hasOwnProperty(ne)&&(fe[ne]=I[ne]);var de=arguments.length-2;if(de===1)fe.children=re;else if(1<de){for(var Q=Array(de),ee=0;ee<de;ee++)Q[ee]=arguments[ee+2];fe.children=Q}if(D&&D.defaultProps)for(ne in de=D.defaultProps,de)fe[ne]===void 0&&(fe[ne]=de[ne]);return{$$typeof:e,type:D,key:he,ref:V,props:fe,_owner:P.current}}function $(D,I){return{$$typeof:e,type:D.type,key:I,ref:D.ref,props:D.props,_owner:D._owner}}function z(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function q(D){var I={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(re){return I[re]})}var F=/\/+/g;function H(D,I){return typeof D=="object"&&D!==null&&D.key!=null?q(""+D.key):I.toString(36)}function U(D,I,re,ne,fe){var he=typeof D;(he==="undefined"||he==="boolean")&&(D=null);var V=!1;if(D===null)V=!0;else switch(he){case"string":case"number":V=!0;break;case"object":switch(D.$$typeof){case e:case t:V=!0}}if(V)return V=D,fe=fe(V),D=ne===""?"."+H(V,0):ne,E(fe)?(re="",D!=null&&(re=D.replace(F,"$&/")+"/"),U(fe,I,re,"",function(ee){return ee})):fe!=null&&(z(fe)&&(fe=$(fe,re+(!fe.key||V&&V.key===fe.key?"":(""+fe.key).replace(F,"$&/")+"/")+D)),I.push(fe)),1;if(V=0,ne=ne===""?".":ne+":",E(D))for(var de=0;de<D.length;de++){he=D[de];var Q=ne+H(he,de);V+=U(he,I,re,Q,fe)}else if(Q=x(D),typeof Q=="function")for(D=Q.call(D),de=0;!(he=D.next()).done;)he=he.value,Q=ne+H(he,de++),V+=U(he,I,re,Q,fe);else if(he==="object")throw I=String(D),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.");return V}function R(D,I,re){if(D==null)return D;var ne=[],fe=0;return U(D,ne,"","",function(he){return I.call(re,he,fe++)}),ne}function W(D){if(D._status===-1){var I=D._result;I=I(),I.then(function(re){(D._status===0||D._status===-1)&&(D._status=1,D._result=re)},function(re){(D._status===0||D._status===-1)&&(D._status=2,D._result=re)}),D._status===-1&&(D._status=0,D._result=I)}if(D._status===1)return D._result.default;throw D._result}var X={current:null},G={transition:null},B={ReactCurrentDispatcher:X,ReactCurrentBatchConfig:G,ReactCurrentOwner:P};function J(){throw Error("act(...) is not supported in production builds of React.")}return Ht.Children={map:R,forEach:function(D,I,re){R(D,function(){I.apply(this,arguments)},re)},count:function(D){var I=0;return R(D,function(){I++}),I},toArray:function(D){return R(D,function(I){return I})||[]},only:function(D){if(!z(D))throw Error("React.Children.only expected to receive a single React element child.");return D}},Ht.Component=y,Ht.Fragment=n,Ht.Profiler=s,Ht.PureComponent=C,Ht.StrictMode=r,Ht.Suspense=d,Ht.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=B,Ht.act=J,Ht.cloneElement=function(D,I,re){if(D==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+D+".");var ne=j({},D.props),fe=D.key,he=D.ref,V=D._owner;if(I!=null){if(I.ref!==void 0&&(he=I.ref,V=P.current),I.key!==void 0&&(fe=""+I.key),D.type&&D.type.defaultProps)var de=D.type.defaultProps;for(Q in I)A.call(I,Q)&&!O.hasOwnProperty(Q)&&(ne[Q]=I[Q]===void 0&&de!==void 0?de[Q]:I[Q])}var Q=arguments.length-2;if(Q===1)ne.children=re;else if(1<Q){de=Array(Q);for(var ee=0;ee<Q;ee++)de[ee]=arguments[ee+2];ne.children=de}return{$$typeof:e,type:D.type,key:fe,ref:he,props:ne,_owner:V}},Ht.createContext=function(D){return D={$$typeof:o,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},D.Provider={$$typeof:i,_context:D},D.Consumer=D},Ht.createElement=T,Ht.createFactory=function(D){var I=T.bind(null,D);return I.type=D,I},Ht.createRef=function(){return{current:null}},Ht.forwardRef=function(D){return{$$typeof:c,render:D}},Ht.isValidElement=z,Ht.lazy=function(D){return{$$typeof:h,_payload:{_status:-1,_result:D},_init:W}},Ht.memo=function(D,I){return{$$typeof:f,type:D,compare:I===void 0?null:I}},Ht.startTransition=function(D){var I=G.transition;G.transition={};try{D()}finally{G.transition=I}},Ht.unstable_act=J,Ht.useCallback=function(D,I){return X.current.useCallback(D,I)},Ht.useContext=function(D){return X.current.useContext(D)},Ht.useDebugValue=function(){},Ht.useDeferredValue=function(D){return X.current.useDeferredValue(D)},Ht.useEffect=function(D,I){return X.current.useEffect(D,I)},Ht.useId=function(){return X.current.useId()},Ht.useImperativeHandle=function(D,I,re){return X.current.useImperativeHandle(D,I,re)},Ht.useInsertionEffect=function(D,I){return X.current.useInsertionEffect(D,I)},Ht.useLayoutEffect=function(D,I){return X.current.useLayoutEffect(D,I)},Ht.useMemo=function(D,I){return X.current.useMemo(D,I)},Ht.useReducer=function(D,I,re){return X.current.useReducer(D,I,re)},Ht.useRef=function(D){return X.current.useRef(D)},Ht.useState=function(D){return X.current.useState(D)},Ht.useSyncExternalStore=function(D,I,re){return X.current.useSyncExternalStore(D,I,re)},Ht.useTransition=function(){return X.current.useTransition()},Ht.version="18.3.1",Ht}var PE;function sN(){return PE||(PE=1,hy.exports=mU()),hy.exports}var kE;function vU(){if(kE)return id;kE=1;var e=sN(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(c,d,f){var h,p={},x=null,g=null;f!==void 0&&(x=""+f),d.key!==void 0&&(x=""+d.key),d.ref!==void 0&&(g=d.ref);for(h in d)r.call(d,h)&&!i.hasOwnProperty(h)&&(p[h]=d[h]);if(c&&c.defaultProps)for(h in d=c.defaultProps,d)p[h]===void 0&&(p[h]=d[h]);return{$$typeof:t,type:c,key:x,ref:g,props:p,_owner:s.current}}return id.Fragment=n,id.jsx=o,id.jsxs=o,id}var OE;function gU(){return OE||(OE=1,py.exports=vU()),py.exports}var a=gU(),th={},my={exports:{}},Fr={},vy={exports:{}},gy={};var TE;function xU(){return TE||(TE=1,(function(e){function t(G,B){var J=G.length;G.push(B);e:for(;0<J;){var D=J-1>>>1,I=G[D];if(0<s(I,B))G[D]=B,G[J]=I,J=D;else break e}}function n(G){return G.length===0?null:G[0]}function r(G){if(G.length===0)return null;var B=G[0],J=G.pop();if(J!==B){G[0]=J;e:for(var D=0,I=G.length,re=I>>>1;D<re;){var ne=2*(D+1)-1,fe=G[ne],he=ne+1,V=G[he];if(0>s(fe,J))he<I&&0>s(V,fe)?(G[D]=V,G[he]=J,D=he):(G[D]=fe,G[ne]=J,D=ne);else if(he<I&&0>s(V,J))G[D]=V,G[he]=J,D=he;else break e}}return B}function s(G,B){var J=G.sortIndex-B.sortIndex;return J!==0?J:G.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,c=o.now();e.unstable_now=function(){return o.now()-c}}var d=[],f=[],h=1,p=null,x=3,g=!1,j=!1,b=!1,y=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function N(G){for(var B=n(f);B!==null;){if(B.callback===null)r(f);else if(B.startTime<=G)r(f),B.sortIndex=B.expirationTime,t(d,B);else break;B=n(f)}}function E(G){if(b=!1,N(G),!j)if(n(d)!==null)j=!0,W(A);else{var B=n(f);B!==null&&X(E,B.startTime-G)}}function A(G,B){j=!1,b&&(b=!1,S(T),T=-1),g=!0;var J=x;try{for(N(B),p=n(d);p!==null&&(!(p.expirationTime>B)||G&&!q());){var D=p.callback;if(typeof D=="function"){p.callback=null,x=p.priorityLevel;var I=D(p.expirationTime<=B);B=e.unstable_now(),typeof I=="function"?p.callback=I:p===n(d)&&r(d),N(B)}else r(d);p=n(d)}if(p!==null)var re=!0;else{var ne=n(f);ne!==null&&X(E,ne.startTime-B),re=!1}return re}finally{p=null,x=J,g=!1}}var P=!1,O=null,T=-1,$=5,z=-1;function q(){return!(e.unstable_now()-z<$)}function F(){if(O!==null){var G=e.unstable_now();z=G;var B=!0;try{B=O(!0,G)}finally{B?H():(P=!1,O=null)}}else P=!1}var H;if(typeof C=="function")H=function(){C(F)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,R=U.port2;U.port1.onmessage=F,H=function(){R.postMessage(null)}}else H=function(){y(F,0)};function W(G){O=G,P||(P=!0,H())}function X(G,B){T=y(function(){G(e.unstable_now())},B)}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(G){G.callback=null},e.unstable_continueExecution=function(){j||g||(j=!0,W(A))},e.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<G?Math.floor(1e3/G):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(G){switch(x){case 1:case 2:case 3:var B=3;break;default:B=x}var J=x;x=B;try{return G()}finally{x=J}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(G,B){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var J=x;x=G;try{return B()}finally{x=J}},e.unstable_scheduleCallback=function(G,B,J){var D=e.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?D+J:D):J=D,G){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=J+I,G={id:h++,callback:B,priorityLevel:G,startTime:J,expirationTime:I,sortIndex:-1},J>D?(G.sortIndex=J,t(f,G),n(d)===null&&G===n(f)&&(b?(S(T),T=-1):b=!0,X(E,J-D))):(G.sortIndex=I,t(d,G),j||g||(j=!0,W(A))),G},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(G){var B=x;return function(){var J=x;x=B;try{return G.apply(this,arguments)}finally{x=J}}}})(gy)),gy}var RE;function yU(){return RE||(RE=1,vy.exports=xU()),vy.exports}var IE;function bU(){if(IE)return Fr;IE=1;var e=sN(),t=yU();function n(l){for(var u="https://reactjs.org/docs/error-decoder.html?invariant="+l,v=1;v<arguments.length;v++)u+="&args[]="+encodeURIComponent(arguments[v]);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,s={};function i(l,u){o(l,u),o(l+"Capture",u)}function o(l,u){for(s[l]=u,l=0;l<u.length;l++)r.add(u[l])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,h={},p={};function x(l){return d.call(p,l)?!0:d.call(h,l)?!1:f.test(l)?p[l]=!0:(h[l]=!0,!1)}function g(l,u,v,w){if(v!==null&&v.type===0)return!1;switch(typeof u){case"function":case"symbol":return!0;case"boolean":return w?!1:v!==null?!v.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function j(l,u,v,w){if(u===null||typeof u>"u"||g(l,u,v,w))return!0;if(w)return!1;if(v!==null)switch(v.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,v,w,_,k,M){this.acceptsBooleans=u===2||u===3||u===4,this.attributeName=w,this.attributeNamespace=_,this.mustUseProperty=v,this.propertyName=l,this.type=u,this.sanitizeURL=k,this.removeEmptyString=M}var y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){y[l]=new b(l,0,!1,l,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(l){var u=l[0];y[u]=new b(u,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){y[l]=new b(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){y[l]=new b(l,2,!1,l,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(l){y[l]=new b(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){y[l]=new b(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){y[l]=new b(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){y[l]=new b(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){y[l]=new b(l,5,!1,l.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function C(l){return l[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(l){var u=l.replace(S,C);y[u]=new b(u,1,!1,l,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(l){var u=l.replace(S,C);y[u]=new b(u,1,!1,l,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(l){var u=l.replace(S,C);y[u]=new b(u,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){y[l]=new b(l,1,!1,l.toLowerCase(),null,!1,!1)}),y.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){y[l]=new b(l,1,!1,l.toLowerCase(),null,!0,!0)});function N(l,u,v,w){var _=y.hasOwnProperty(u)?y[u]:null;(_!==null?_.type!==0:w||!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(j(u,v,_,w)&&(v=null),w||_===null?x(u)&&(v===null?l.removeAttribute(u):l.setAttribute(u,""+v)):_.mustUseProperty?l[_.propertyName]=v===null?_.type===3?!1:"":v:(u=_.attributeName,w=_.attributeNamespace,v===null?l.removeAttribute(u):(_=_.type,v=_===3||_===4&&v===!0?"":""+v,w?l.setAttributeNS(w,u,v):l.setAttribute(u,v))))}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),P=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),z=Symbol.for("react.provider"),q=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),X=Symbol.for("react.offscreen"),G=Symbol.iterator;function B(l){return l===null||typeof l!="object"?null:(l=G&&l[G]||l["@@iterator"],typeof l=="function"?l:null)}var J=Object.assign,D;function I(l){if(D===void 0)try{throw Error()}catch(v){var u=v.stack.trim().match(/\n( *(at )?)/);D=u&&u[1]||""}return`
|
|
2
|
+
`+D+l}var re=!1;function ne(l,u){if(!l||re)return"";re=!0;var v=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(be){var w=be}Reflect.construct(l,[],u)}else{try{u.call()}catch(be){w=be}l.call(u.prototype)}else{try{throw Error()}catch(be){w=be}l()}}catch(be){if(be&&w&&typeof be.stack=="string"){for(var _=be.stack.split(`
|
|
3
|
+
`),k=w.stack.split(`
|
|
4
|
+
`),M=_.length-1,te=k.length-1;1<=M&&0<=te&&_[M]!==k[te];)te--;for(;1<=M&&0<=te;M--,te--)if(_[M]!==k[te]){if(M!==1||te!==1)do if(M--,te--,0>te||_[M]!==k[te]){var ie=`
|
|
5
|
+
`+_[M].replace(" at new "," at ");return l.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",l.displayName)),ie}while(1<=M&&0<=te);break}}}finally{re=!1,Error.prepareStackTrace=v}return(l=l?l.displayName||l.name:"")?I(l):""}function fe(l){switch(l.tag){case 5:return I(l.type);case 16:return I("Lazy");case 13:return I("Suspense");case 19:return I("SuspenseList");case 0:case 2:case 15:return l=ne(l.type,!1),l;case 11:return l=ne(l.type.render,!1),l;case 1:return l=ne(l.type,!0),l;default:return""}}function he(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case O:return"Fragment";case P:return"Portal";case $:return"Profiler";case T:return"StrictMode";case H:return"Suspense";case U:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case q:return(l.displayName||"Context")+".Consumer";case z:return(l._context.displayName||"Context")+".Provider";case F:var u=l.render;return l=l.displayName,l||(l=u.displayName||u.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case R:return u=l.displayName||null,u!==null?u:he(l.type)||"Memo";case W:u=l._payload,l=l._init;try{return he(l(u))}catch{}}return null}function V(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 he(u);case 8:return u===T?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u}return null}function de(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function Q(l){var u=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function ee(l){var u=Q(l)?"checked":"value",v=Object.getOwnPropertyDescriptor(l.constructor.prototype,u),w=""+l[u];if(!l.hasOwnProperty(u)&&typeof v<"u"&&typeof v.get=="function"&&typeof v.set=="function"){var _=v.get,k=v.set;return Object.defineProperty(l,u,{configurable:!0,get:function(){return _.call(this)},set:function(M){w=""+M,k.call(this,M)}}),Object.defineProperty(l,u,{enumerable:v.enumerable}),{getValue:function(){return w},setValue:function(M){w=""+M},stopTracking:function(){l._valueTracker=null,delete l[u]}}}}function pe(l){l._valueTracker||(l._valueTracker=ee(l))}function ae(l){if(!l)return!1;var u=l._valueTracker;if(!u)return!0;var v=u.getValue(),w="";return l&&(w=Q(l)?l.checked?"true":"false":l.value),l=w,l!==v?(u.setValue(l),!0):!1}function Re(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}function Ce(l,u){var v=u.checked;return J({},u,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:v??l._wrapperState.initialChecked})}function Me(l,u){var v=u.defaultValue==null?"":u.defaultValue,w=u.checked!=null?u.checked:u.defaultChecked;v=de(u.value!=null?u.value:v),l._wrapperState={initialChecked:w,initialValue:v,controlled:u.type==="checkbox"||u.type==="radio"?u.checked!=null:u.value!=null}}function L(l,u){u=u.checked,u!=null&&N(l,"checked",u,!1)}function oe(l,u){L(l,u);var v=de(u.value),w=u.type;if(v!=null)w==="number"?(v===0&&l.value===""||l.value!=v)&&(l.value=""+v):l.value!==""+v&&(l.value=""+v);else if(w==="submit"||w==="reset"){l.removeAttribute("value");return}u.hasOwnProperty("value")?Pe(l,u.type,v):u.hasOwnProperty("defaultValue")&&Pe(l,u.type,de(u.defaultValue)),u.checked==null&&u.defaultChecked!=null&&(l.defaultChecked=!!u.defaultChecked)}function ve(l,u,v){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,v||u===l.value||(l.value=u),l.defaultValue=u}v=l.name,v!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,v!==""&&(l.name=v)}function Pe(l,u,v){(u!=="number"||Re(l.ownerDocument)!==l)&&(v==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+v&&(l.defaultValue=""+v))}var Ge=Array.isArray;function lt(l,u,v,w){if(l=l.options,u){u={};for(var _=0;_<v.length;_++)u["$"+v[_]]=!0;for(v=0;v<l.length;v++)_=u.hasOwnProperty("$"+l[v].value),l[v].selected!==_&&(l[v].selected=_),_&&w&&(l[v].defaultSelected=!0)}else{for(v=""+de(v),u=null,_=0;_<l.length;_++){if(l[_].value===v){l[_].selected=!0,w&&(l[_].defaultSelected=!0);return}u!==null||l[_].disabled||(u=l[_])}u!==null&&(u.selected=!0)}}function pt(l,u){if(u.dangerouslySetInnerHTML!=null)throw Error(n(91));return J({},u,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function vt(l,u){var v=u.value;if(v==null){if(v=u.children,u=u.defaultValue,v!=null){if(u!=null)throw Error(n(92));if(Ge(v)){if(1<v.length)throw Error(n(93));v=v[0]}u=v}u==null&&(u=""),v=u}l._wrapperState={initialValue:de(v)}}function zt(l,u){var v=de(u.value),w=de(u.defaultValue);v!=null&&(v=""+v,v!==l.value&&(l.value=v),u.defaultValue==null&&l.defaultValue!==v&&(l.defaultValue=v)),w!=null&&(l.defaultValue=""+w)}function qt(l){var u=l.textContent;u===l._wrapperState.initialValue&&u!==""&&u!==null&&(l.value=u)}function Wt(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 Qt(l,u){return l==null||l==="http://www.w3.org/1999/xhtml"?Wt(u):l==="http://www.w3.org/2000/svg"&&u==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var Ne,Xe=(function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(u,v,w,_){MSApp.execUnsafeLocalFunction(function(){return l(u,v,w,_)})}:l})(function(l,u){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=u;else{for(Ne=Ne||document.createElement("div"),Ne.innerHTML="<svg>"+u.valueOf().toString()+"</svg>",u=Ne.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;u.firstChild;)l.appendChild(u.firstChild)}});function Fe(l,u){if(u){var v=l.firstChild;if(v&&v===l.lastChild&&v.nodeType===3){v.nodeValue=u;return}}l.textContent=u}var Ft={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},on=["Webkit","ms","Moz","O"];Object.keys(Ft).forEach(function(l){on.forEach(function(u){u=u+l.charAt(0).toUpperCase()+l.substring(1),Ft[u]=Ft[l]})});function Ut(l,u,v){return u==null||typeof u=="boolean"||u===""?"":v||typeof u!="number"||u===0||Ft.hasOwnProperty(l)&&Ft[l]?(""+u).trim():u+"px"}function ye(l,u){l=l.style;for(var v in u)if(u.hasOwnProperty(v)){var w=v.indexOf("--")===0,_=Ut(v,u[v],w);v==="float"&&(v="cssFloat"),w?l.setProperty(v,_):l[v]=_}}var Ve=J({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 Be(l,u){if(u){if(Ve[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 xt(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 Ee=null;function ue(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var Ze=null,ht=null,Ot=null;function Jt(l){if(l=Vu(l)){if(typeof Ze!="function")throw Error(n(280));var u=l.stateNode;u&&(u=mp(u),Ze(l.stateNode,l.type,u))}}function Pn(l){ht?Ot?Ot.push(l):Ot=[l]:ht=l}function mt(){if(ht){var l=ht,u=Ot;if(Ot=ht=null,Jt(l),u)for(l=0;l<u.length;l++)Jt(u[l])}}function It(l,u){return l(u)}function Lt(){}var Kt=!1;function qn(l,u,v){if(Kt)return l(u,v);Kt=!0;try{return It(l,u,v)}finally{Kt=!1,(ht!==null||Ot!==null)&&(Lt(),mt())}}function le(l,u){var v=l.stateNode;if(v===null)return null;var w=mp(v);if(w===null)return null;v=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(v&&typeof v!="function")throw Error(n(231,u,typeof v));return v}var at=!1;if(c)try{var Ct={};Object.defineProperty(Ct,"passive",{get:function(){at=!0}}),window.addEventListener("test",Ct,Ct),window.removeEventListener("test",Ct,Ct)}catch{at=!1}function an(l,u,v,w,_,k,M,te,ie){var be=Array.prototype.slice.call(arguments,3);try{u.apply(v,be)}catch(Oe){this.onError(Oe)}}var bt=!1,kn=null,Fn=!1,Tr=null,ji={onError:function(l){bt=!0,kn=l}};function Fs(l,u,v,w,_,k,M,te,ie){bt=!1,kn=null,an.apply(ji,arguments)}function Si(l,u,v,w,_,k,M,te,ie){if(Fs.apply(this,arguments),bt){if(bt){var be=kn;bt=!1,kn=null}else throw Error(n(198));Fn||(Fn=!0,Tr=be)}}function Da(l){var u=l,v=l;if(l.alternate)for(;u.return;)u=u.return;else{l=u;do u=l,(u.flags&4098)!==0&&(v=u.return),l=u.return;while(l)}return u.tag===3?v:null}function Au(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 K(l){if(Da(l)!==l)throw Error(n(188))}function ge(l){var u=l.alternate;if(!u){if(u=Da(l),u===null)throw Error(n(188));return u!==l?null:l}for(var v=l,w=u;;){var _=v.return;if(_===null)break;var k=_.alternate;if(k===null){if(w=_.return,w!==null){v=w;continue}break}if(_.child===k.child){for(k=_.child;k;){if(k===v)return K(_),l;if(k===w)return K(_),u;k=k.sibling}throw Error(n(188))}if(v.return!==w.return)v=_,w=k;else{for(var M=!1,te=_.child;te;){if(te===v){M=!0,v=_,w=k;break}if(te===w){M=!0,w=_,v=k;break}te=te.sibling}if(!M){for(te=k.child;te;){if(te===v){M=!0,v=k,w=_;break}if(te===w){M=!0,w=k,v=_;break}te=te.sibling}if(!M)throw Error(n(189))}}if(v.alternate!==w)throw Error(n(190))}if(v.tag!==3)throw Error(n(188));return v.stateNode.current===v?l:u}function He(l){return l=ge(l),l!==null?ct(l):null}function ct(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var u=ct(l);if(u!==null)return u;l=l.sibling}return null}var Vt=t.unstable_scheduleCallback,yt=t.unstable_cancelCallback,Un=t.unstable_shouldYield,In=t.unstable_requestPaint,Ae=t.unstable_now,On=t.unstable_getCurrentPriorityLevel,Et=t.unstable_ImmediatePriority,Zt=t.unstable_UserBlockingPriority,Jr=t.unstable_NormalPriority,Ni=t.unstable_LowPriority,Eu=t.unstable_IdlePriority,El=null,va=null;function Rg(l){if(va&&typeof va.onCommitFiberRoot=="function")try{va.onCommitFiberRoot(El,l,void 0,(l.current.flags&128)===128)}catch{}}var Rr=Math.clz32?Math.clz32:$g,Ig=Math.log,Mg=Math.LN2;function $g(l){return l>>>=0,l===0?32:31-(Ig(l)/Mg|0)|0}var Pl=64,Z=4194304;function we(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 st(l,u){var v=l.pendingLanes;if(v===0)return 0;var w=0,_=l.suspendedLanes,k=l.pingedLanes,M=v&268435455;if(M!==0){var te=M&~_;te!==0?w=we(te):(k&=M,k!==0&&(w=we(k)))}else M=v&~_,M!==0?w=we(M):k!==0&&(w=we(k));if(w===0)return 0;if(u!==0&&u!==w&&(u&_)===0&&(_=w&-w,k=u&-u,_>=k||_===16&&(k&4194240)!==0))return u;if((w&4)!==0&&(w|=v&16),u=l.entangledLanes,u!==0)for(l=l.entanglements,u&=w;0<u;)v=31-Rr(u),_=1<<v,w|=l[v],u&=~_;return w}function De(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 Xt(l,u){for(var v=l.suspendedLanes,w=l.pingedLanes,_=l.expirationTimes,k=l.pendingLanes;0<k;){var M=31-Rr(k),te=1<<M,ie=_[M];ie===-1?((te&v)===0||(te&w)!==0)&&(_[M]=De(te,u)):ie<=u&&(l.expiredLanes|=te),k&=~te}}function Rt(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function xn(){var l=Pl;return Pl<<=1,(Pl&4194240)===0&&(Pl=64),l}function sr(l){for(var u=[],v=0;31>v;v++)u.push(l);return u}function ln(l,u,v){l.pendingLanes|=u,u!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,u=31-Rr(u),l[u]=v}function yo(l,u){var v=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<v;){var _=31-Rr(v),k=1<<_;u[_]=0,w[_]=-1,l[_]=-1,v&=~k}}function kl(l,u){var v=l.entangledLanes|=u;for(l=l.entanglements;v;){var w=31-Rr(v),_=1<<w;_&u|l[w]&u&&(l[w]|=u),v&=~_}}var sn=0;function Ol(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var Zf,Dg,l_,c_,u_,Lg=!1,ep=[],Ci=null,_i=null,Ai=null,Pu=new Map,ku=new Map,Ei=[],$6="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 d_(l,u){switch(l){case"focusin":case"focusout":Ci=null;break;case"dragenter":case"dragleave":_i=null;break;case"mouseover":case"mouseout":Ai=null;break;case"pointerover":case"pointerout":Pu.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":ku.delete(u.pointerId)}}function Ou(l,u,v,w,_,k){return l===null||l.nativeEvent!==k?(l={blockedOn:u,domEventName:v,eventSystemFlags:w,nativeEvent:k,targetContainers:[_]},u!==null&&(u=Vu(u),u!==null&&Dg(u)),l):(l.eventSystemFlags|=w,u=l.targetContainers,_!==null&&u.indexOf(_)===-1&&u.push(_),l)}function D6(l,u,v,w,_){switch(u){case"focusin":return Ci=Ou(Ci,l,u,v,w,_),!0;case"dragenter":return _i=Ou(_i,l,u,v,w,_),!0;case"mouseover":return Ai=Ou(Ai,l,u,v,w,_),!0;case"pointerover":var k=_.pointerId;return Pu.set(k,Ou(Pu.get(k)||null,l,u,v,w,_)),!0;case"gotpointercapture":return k=_.pointerId,ku.set(k,Ou(ku.get(k)||null,l,u,v,w,_)),!0}return!1}function f_(l){var u=bo(l.target);if(u!==null){var v=Da(u);if(v!==null){if(u=v.tag,u===13){if(u=Au(v),u!==null){l.blockedOn=u,u_(l.priority,function(){l_(v)});return}}else if(u===3&&v.stateNode.current.memoizedState.isDehydrated){l.blockedOn=v.tag===3?v.stateNode.containerInfo:null;return}}}l.blockedOn=null}function tp(l){if(l.blockedOn!==null)return!1;for(var u=l.targetContainers;0<u.length;){var v=Bg(l.domEventName,l.eventSystemFlags,u[0],l.nativeEvent);if(v===null){v=l.nativeEvent;var w=new v.constructor(v.type,v);Ee=w,v.target.dispatchEvent(w),Ee=null}else return u=Vu(v),u!==null&&Dg(u),l.blockedOn=v,!1;u.shift()}return!0}function p_(l,u,v){tp(l)&&v.delete(u)}function L6(){Lg=!1,Ci!==null&&tp(Ci)&&(Ci=null),_i!==null&&tp(_i)&&(_i=null),Ai!==null&&tp(Ai)&&(Ai=null),Pu.forEach(p_),ku.forEach(p_)}function Tu(l,u){l.blockedOn===u&&(l.blockedOn=null,Lg||(Lg=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,L6)))}function Ru(l){function u(_){return Tu(_,l)}if(0<ep.length){Tu(ep[0],l);for(var v=1;v<ep.length;v++){var w=ep[v];w.blockedOn===l&&(w.blockedOn=null)}}for(Ci!==null&&Tu(Ci,l),_i!==null&&Tu(_i,l),Ai!==null&&Tu(Ai,l),Pu.forEach(u),ku.forEach(u),v=0;v<Ei.length;v++)w=Ei[v],w.blockedOn===l&&(w.blockedOn=null);for(;0<Ei.length&&(v=Ei[0],v.blockedOn===null);)f_(v),v.blockedOn===null&&Ei.shift()}var Tl=E.ReactCurrentBatchConfig,np=!0;function F6(l,u,v,w){var _=sn,k=Tl.transition;Tl.transition=null;try{sn=1,Fg(l,u,v,w)}finally{sn=_,Tl.transition=k}}function B6(l,u,v,w){var _=sn,k=Tl.transition;Tl.transition=null;try{sn=4,Fg(l,u,v,w)}finally{sn=_,Tl.transition=k}}function Fg(l,u,v,w){if(np){var _=Bg(l,u,v,w);if(_===null)rx(l,u,w,rp,v),d_(l,w);else if(D6(_,l,u,v,w))w.stopPropagation();else if(d_(l,w),u&4&&-1<$6.indexOf(l)){for(;_!==null;){var k=Vu(_);if(k!==null&&Zf(k),k=Bg(l,u,v,w),k===null&&rx(l,u,w,rp,v),k===_)break;_=k}_!==null&&w.stopPropagation()}else rx(l,u,w,null,v)}}var rp=null;function Bg(l,u,v,w){if(rp=null,l=ue(w),l=bo(l),l!==null)if(u=Da(l),u===null)l=null;else if(v=u.tag,v===13){if(l=Au(u),l!==null)return l;l=null}else if(v===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;l=null}else u!==l&&(l=null);return rp=l,null}function h_(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(On()){case Et:return 1;case Zt:return 4;case Jr:case Ni:return 16;case Eu:return 536870912;default:return 16}default:return 16}}var Pi=null,zg=null,ap=null;function m_(){if(ap)return ap;var l,u=zg,v=u.length,w,_="value"in Pi?Pi.value:Pi.textContent,k=_.length;for(l=0;l<v&&u[l]===_[l];l++);var M=v-l;for(w=1;w<=M&&u[v-w]===_[k-w];w++);return ap=_.slice(l,1<w?1-w:void 0)}function sp(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 ip(){return!0}function v_(){return!1}function Zr(l){function u(v,w,_,k,M){this._reactName=v,this._targetInst=_,this.type=w,this.nativeEvent=k,this.target=M,this.currentTarget=null;for(var te in l)l.hasOwnProperty(te)&&(v=l[te],this[te]=v?v(k):k[te]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?ip:v_,this.isPropagationStopped=v_,this}return J(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var v=this.nativeEvent;v&&(v.preventDefault?v.preventDefault():typeof v.returnValue!="unknown"&&(v.returnValue=!1),this.isDefaultPrevented=ip)},stopPropagation:function(){var v=this.nativeEvent;v&&(v.stopPropagation?v.stopPropagation():typeof v.cancelBubble!="unknown"&&(v.cancelBubble=!0),this.isPropagationStopped=ip)},persist:function(){},isPersistent:ip}),u}var Rl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},qg=Zr(Rl),Iu=J({},Rl,{view:0,detail:0}),z6=Zr(Iu),Ug,Wg,Mu,op=J({},Iu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hg,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!==Mu&&(Mu&&l.type==="mousemove"?(Ug=l.screenX-Mu.screenX,Wg=l.screenY-Mu.screenY):Wg=Ug=0,Mu=l),Ug)},movementY:function(l){return"movementY"in l?l.movementY:Wg}}),g_=Zr(op),q6=J({},op,{dataTransfer:0}),U6=Zr(q6),W6=J({},Iu,{relatedTarget:0}),Vg=Zr(W6),V6=J({},Rl,{animationName:0,elapsedTime:0,pseudoElement:0}),H6=Zr(V6),K6=J({},Rl,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),G6=Zr(K6),Y6=J({},Rl,{data:0}),x_=Zr(Y6),X6={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Q6={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"},J6={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Z6(l){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(l):(l=J6[l])?!!u[l]:!1}function Hg(){return Z6}var eq=J({},Iu,{key:function(l){if(l.key){var u=X6[l.key]||l.key;if(u!=="Unidentified")return u}return l.type==="keypress"?(l=sp(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?Q6[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hg,charCode:function(l){return l.type==="keypress"?sp(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?sp(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),tq=Zr(eq),nq=J({},op,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),y_=Zr(nq),rq=J({},Iu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hg}),aq=Zr(rq),sq=J({},Rl,{propertyName:0,elapsedTime:0,pseudoElement:0}),iq=Zr(sq),oq=J({},op,{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}),lq=Zr(oq),cq=[9,13,27,32],Kg=c&&"CompositionEvent"in window,$u=null;c&&"documentMode"in document&&($u=document.documentMode);var uq=c&&"TextEvent"in window&&!$u,b_=c&&(!Kg||$u&&8<$u&&11>=$u),w_=" ",j_=!1;function S_(l,u){switch(l){case"keyup":return cq.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function N_(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var Il=!1;function dq(l,u){switch(l){case"compositionend":return N_(u);case"keypress":return u.which!==32?null:(j_=!0,w_);case"textInput":return l=u.data,l===w_&&j_?null:l;default:return null}}function fq(l,u){if(Il)return l==="compositionend"||!Kg&&S_(l,u)?(l=m_(),ap=zg=Pi=null,Il=!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 b_&&u.locale!=="ko"?null:u.data;default:return null}}var pq={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 C_(l){var u=l&&l.nodeName&&l.nodeName.toLowerCase();return u==="input"?!!pq[l.type]:u==="textarea"}function __(l,u,v,w){Pn(w),u=fp(u,"onChange"),0<u.length&&(v=new qg("onChange","change",null,v,w),l.push({event:v,listeners:u}))}var Du=null,Lu=null;function hq(l){W_(l,0)}function lp(l){var u=Fl(l);if(ae(u))return l}function mq(l,u){if(l==="change")return u}var A_=!1;if(c){var Gg;if(c){var Yg="oninput"in document;if(!Yg){var E_=document.createElement("div");E_.setAttribute("oninput","return;"),Yg=typeof E_.oninput=="function"}Gg=Yg}else Gg=!1;A_=Gg&&(!document.documentMode||9<document.documentMode)}function P_(){Du&&(Du.detachEvent("onpropertychange",k_),Lu=Du=null)}function k_(l){if(l.propertyName==="value"&&lp(Lu)){var u=[];__(u,Lu,l,ue(l)),qn(hq,u)}}function vq(l,u,v){l==="focusin"?(P_(),Du=u,Lu=v,Du.attachEvent("onpropertychange",k_)):l==="focusout"&&P_()}function gq(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return lp(Lu)}function xq(l,u){if(l==="click")return lp(u)}function yq(l,u){if(l==="input"||l==="change")return lp(u)}function bq(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var La=typeof Object.is=="function"?Object.is:bq;function Fu(l,u){if(La(l,u))return!0;if(typeof l!="object"||l===null||typeof u!="object"||u===null)return!1;var v=Object.keys(l),w=Object.keys(u);if(v.length!==w.length)return!1;for(w=0;w<v.length;w++){var _=v[w];if(!d.call(u,_)||!La(l[_],u[_]))return!1}return!0}function O_(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function T_(l,u){var v=O_(l);l=0;for(var w;v;){if(v.nodeType===3){if(w=l+v.textContent.length,l<=u&&w>=u)return{node:v,offset:u-l};l=w}e:{for(;v;){if(v.nextSibling){v=v.nextSibling;break e}v=v.parentNode}v=void 0}v=O_(v)}}function R_(l,u){return l&&u?l===u?!0:l&&l.nodeType===3?!1:u&&u.nodeType===3?R_(l,u.parentNode):"contains"in l?l.contains(u):l.compareDocumentPosition?!!(l.compareDocumentPosition(u)&16):!1:!1}function I_(){for(var l=window,u=Re();u instanceof l.HTMLIFrameElement;){try{var v=typeof u.contentWindow.location.href=="string"}catch{v=!1}if(v)l=u.contentWindow;else break;u=Re(l.document)}return u}function Xg(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 wq(l){var u=I_(),v=l.focusedElem,w=l.selectionRange;if(u!==v&&v&&v.ownerDocument&&R_(v.ownerDocument.documentElement,v)){if(w!==null&&Xg(v)){if(u=w.start,l=w.end,l===void 0&&(l=u),"selectionStart"in v)v.selectionStart=u,v.selectionEnd=Math.min(l,v.value.length);else if(l=(u=v.ownerDocument||document)&&u.defaultView||window,l.getSelection){l=l.getSelection();var _=v.textContent.length,k=Math.min(w.start,_);w=w.end===void 0?k:Math.min(w.end,_),!l.extend&&k>w&&(_=w,w=k,k=_),_=T_(v,k);var M=T_(v,w);_&&M&&(l.rangeCount!==1||l.anchorNode!==_.node||l.anchorOffset!==_.offset||l.focusNode!==M.node||l.focusOffset!==M.offset)&&(u=u.createRange(),u.setStart(_.node,_.offset),l.removeAllRanges(),k>w?(l.addRange(u),l.extend(M.node,M.offset)):(u.setEnd(M.node,M.offset),l.addRange(u)))}}for(u=[],l=v;l=l.parentNode;)l.nodeType===1&&u.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v<u.length;v++)l=u[v],l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}var jq=c&&"documentMode"in document&&11>=document.documentMode,Ml=null,Qg=null,Bu=null,Jg=!1;function M_(l,u,v){var w=v.window===v?v.document:v.nodeType===9?v:v.ownerDocument;Jg||Ml==null||Ml!==Re(w)||(w=Ml,"selectionStart"in w&&Xg(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}),Bu&&Fu(Bu,w)||(Bu=w,w=fp(Qg,"onSelect"),0<w.length&&(u=new qg("onSelect","select",null,u,v),l.push({event:u,listeners:w}),u.target=Ml)))}function cp(l,u){var v={};return v[l.toLowerCase()]=u.toLowerCase(),v["Webkit"+l]="webkit"+u,v["Moz"+l]="moz"+u,v}var $l={animationend:cp("Animation","AnimationEnd"),animationiteration:cp("Animation","AnimationIteration"),animationstart:cp("Animation","AnimationStart"),transitionend:cp("Transition","TransitionEnd")},Zg={},$_={};c&&($_=document.createElement("div").style,"AnimationEvent"in window||(delete $l.animationend.animation,delete $l.animationiteration.animation,delete $l.animationstart.animation),"TransitionEvent"in window||delete $l.transitionend.transition);function up(l){if(Zg[l])return Zg[l];if(!$l[l])return l;var u=$l[l],v;for(v in u)if(u.hasOwnProperty(v)&&v in $_)return Zg[l]=u[v];return l}var D_=up("animationend"),L_=up("animationiteration"),F_=up("animationstart"),B_=up("transitionend"),z_=new Map,q_="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 ki(l,u){z_.set(l,u),i(u,[l])}for(var ex=0;ex<q_.length;ex++){var tx=q_[ex],Sq=tx.toLowerCase(),Nq=tx[0].toUpperCase()+tx.slice(1);ki(Sq,"on"+Nq)}ki(D_,"onAnimationEnd"),ki(L_,"onAnimationIteration"),ki(F_,"onAnimationStart"),ki("dblclick","onDoubleClick"),ki("focusin","onFocus"),ki("focusout","onBlur"),ki(B_,"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 zu="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(" "),Cq=new Set("cancel close invalid load scroll toggle".split(" ").concat(zu));function U_(l,u,v){var w=l.type||"unknown-event";l.currentTarget=v,Si(w,u,void 0,l),l.currentTarget=null}function W_(l,u){u=(u&4)!==0;for(var v=0;v<l.length;v++){var w=l[v],_=w.event;w=w.listeners;e:{var k=void 0;if(u)for(var M=w.length-1;0<=M;M--){var te=w[M],ie=te.instance,be=te.currentTarget;if(te=te.listener,ie!==k&&_.isPropagationStopped())break e;U_(_,te,be),k=ie}else for(M=0;M<w.length;M++){if(te=w[M],ie=te.instance,be=te.currentTarget,te=te.listener,ie!==k&&_.isPropagationStopped())break e;U_(_,te,be),k=ie}}}if(Fn)throw l=Tr,Fn=!1,Tr=null,l}function Cn(l,u){var v=u[cx];v===void 0&&(v=u[cx]=new Set);var w=l+"__bubble";v.has(w)||(V_(u,l,2,!1),v.add(w))}function nx(l,u,v){var w=0;u&&(w|=4),V_(v,l,w,u)}var dp="_reactListening"+Math.random().toString(36).slice(2);function qu(l){if(!l[dp]){l[dp]=!0,r.forEach(function(v){v!=="selectionchange"&&(Cq.has(v)||nx(v,!1,l),nx(v,!0,l))});var u=l.nodeType===9?l:l.ownerDocument;u===null||u[dp]||(u[dp]=!0,nx("selectionchange",!1,u))}}function V_(l,u,v,w){switch(h_(u)){case 1:var _=F6;break;case 4:_=B6;break;default:_=Fg}v=_.bind(null,u,v,l),_=void 0,!at||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(_=!0),w?_!==void 0?l.addEventListener(u,v,{capture:!0,passive:_}):l.addEventListener(u,v,!0):_!==void 0?l.addEventListener(u,v,{passive:_}):l.addEventListener(u,v,!1)}function rx(l,u,v,w,_){var k=w;if((u&1)===0&&(u&2)===0&&w!==null)e:for(;;){if(w===null)return;var M=w.tag;if(M===3||M===4){var te=w.stateNode.containerInfo;if(te===_||te.nodeType===8&&te.parentNode===_)break;if(M===4)for(M=w.return;M!==null;){var ie=M.tag;if((ie===3||ie===4)&&(ie=M.stateNode.containerInfo,ie===_||ie.nodeType===8&&ie.parentNode===_))return;M=M.return}for(;te!==null;){if(M=bo(te),M===null)return;if(ie=M.tag,ie===5||ie===6){w=k=M;continue e}te=te.parentNode}}w=w.return}qn(function(){var be=k,Oe=ue(v),Ie=[];e:{var ke=z_.get(l);if(ke!==void 0){var Je=qg,it=l;switch(l){case"keypress":if(sp(v)===0)break e;case"keydown":case"keyup":Je=tq;break;case"focusin":it="focus",Je=Vg;break;case"focusout":it="blur",Je=Vg;break;case"beforeblur":case"afterblur":Je=Vg;break;case"click":if(v.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Je=g_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Je=U6;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Je=aq;break;case D_:case L_:case F_:Je=H6;break;case B_:Je=iq;break;case"scroll":Je=z6;break;case"wheel":Je=lq;break;case"copy":case"cut":case"paste":Je=G6;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Je=y_}var dt=(u&4)!==0,Wn=!dt&&l==="scroll",me=dt?ke!==null?ke+"Capture":null:ke;dt=[];for(var ce=be,xe;ce!==null;){xe=ce;var Le=xe.stateNode;if(xe.tag===5&&Le!==null&&(xe=Le,me!==null&&(Le=le(ce,me),Le!=null&&dt.push(Uu(ce,Le,xe)))),Wn)break;ce=ce.return}0<dt.length&&(ke=new Je(ke,it,null,v,Oe),Ie.push({event:ke,listeners:dt}))}}if((u&7)===0){e:{if(ke=l==="mouseover"||l==="pointerover",Je=l==="mouseout"||l==="pointerout",ke&&v!==Ee&&(it=v.relatedTarget||v.fromElement)&&(bo(it)||it[Bs]))break e;if((Je||ke)&&(ke=Oe.window===Oe?Oe:(ke=Oe.ownerDocument)?ke.defaultView||ke.parentWindow:window,Je?(it=v.relatedTarget||v.toElement,Je=be,it=it?bo(it):null,it!==null&&(Wn=Da(it),it!==Wn||it.tag!==5&&it.tag!==6)&&(it=null)):(Je=null,it=be),Je!==it)){if(dt=g_,Le="onMouseLeave",me="onMouseEnter",ce="mouse",(l==="pointerout"||l==="pointerover")&&(dt=y_,Le="onPointerLeave",me="onPointerEnter",ce="pointer"),Wn=Je==null?ke:Fl(Je),xe=it==null?ke:Fl(it),ke=new dt(Le,ce+"leave",Je,v,Oe),ke.target=Wn,ke.relatedTarget=xe,Le=null,bo(Oe)===be&&(dt=new dt(me,ce+"enter",it,v,Oe),dt.target=xe,dt.relatedTarget=Wn,Le=dt),Wn=Le,Je&&it)t:{for(dt=Je,me=it,ce=0,xe=dt;xe;xe=Dl(xe))ce++;for(xe=0,Le=me;Le;Le=Dl(Le))xe++;for(;0<ce-xe;)dt=Dl(dt),ce--;for(;0<xe-ce;)me=Dl(me),xe--;for(;ce--;){if(dt===me||me!==null&&dt===me.alternate)break t;dt=Dl(dt),me=Dl(me)}dt=null}else dt=null;Je!==null&&H_(Ie,ke,Je,dt,!1),it!==null&&Wn!==null&&H_(Ie,Wn,it,dt,!0)}}e:{if(ke=be?Fl(be):window,Je=ke.nodeName&&ke.nodeName.toLowerCase(),Je==="select"||Je==="input"&&ke.type==="file")var ft=mq;else if(C_(ke))if(A_)ft=yq;else{ft=gq;var wt=vq}else(Je=ke.nodeName)&&Je.toLowerCase()==="input"&&(ke.type==="checkbox"||ke.type==="radio")&&(ft=xq);if(ft&&(ft=ft(l,be))){__(Ie,ft,v,Oe);break e}wt&&wt(l,ke,be),l==="focusout"&&(wt=ke._wrapperState)&&wt.controlled&&ke.type==="number"&&Pe(ke,"number",ke.value)}switch(wt=be?Fl(be):window,l){case"focusin":(C_(wt)||wt.contentEditable==="true")&&(Ml=wt,Qg=be,Bu=null);break;case"focusout":Bu=Qg=Ml=null;break;case"mousedown":Jg=!0;break;case"contextmenu":case"mouseup":case"dragend":Jg=!1,M_(Ie,v,Oe);break;case"selectionchange":if(jq)break;case"keydown":case"keyup":M_(Ie,v,Oe)}var jt;if(Kg)e:{switch(l){case"compositionstart":var Tt="onCompositionStart";break e;case"compositionend":Tt="onCompositionEnd";break e;case"compositionupdate":Tt="onCompositionUpdate";break e}Tt=void 0}else Il?S_(l,v)&&(Tt="onCompositionEnd"):l==="keydown"&&v.keyCode===229&&(Tt="onCompositionStart");Tt&&(b_&&v.locale!=="ko"&&(Il||Tt!=="onCompositionStart"?Tt==="onCompositionEnd"&&Il&&(jt=m_()):(Pi=Oe,zg="value"in Pi?Pi.value:Pi.textContent,Il=!0)),wt=fp(be,Tt),0<wt.length&&(Tt=new x_(Tt,l,null,v,Oe),Ie.push({event:Tt,listeners:wt}),jt?Tt.data=jt:(jt=N_(v),jt!==null&&(Tt.data=jt)))),(jt=uq?dq(l,v):fq(l,v))&&(be=fp(be,"onBeforeInput"),0<be.length&&(Oe=new x_("onBeforeInput","beforeinput",null,v,Oe),Ie.push({event:Oe,listeners:be}),Oe.data=jt))}W_(Ie,u)})}function Uu(l,u,v){return{instance:l,listener:u,currentTarget:v}}function fp(l,u){for(var v=u+"Capture",w=[];l!==null;){var _=l,k=_.stateNode;_.tag===5&&k!==null&&(_=k,k=le(l,v),k!=null&&w.unshift(Uu(l,k,_)),k=le(l,u),k!=null&&w.push(Uu(l,k,_))),l=l.return}return w}function Dl(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function H_(l,u,v,w,_){for(var k=u._reactName,M=[];v!==null&&v!==w;){var te=v,ie=te.alternate,be=te.stateNode;if(ie!==null&&ie===w)break;te.tag===5&&be!==null&&(te=be,_?(ie=le(v,k),ie!=null&&M.unshift(Uu(v,ie,te))):_||(ie=le(v,k),ie!=null&&M.push(Uu(v,ie,te)))),v=v.return}M.length!==0&&l.push({event:u,listeners:M})}var _q=/\r\n?/g,Aq=/\u0000|\uFFFD/g;function K_(l){return(typeof l=="string"?l:""+l).replace(_q,`
|
|
6
|
+
`).replace(Aq,"")}function pp(l,u,v){if(u=K_(u),K_(l)!==u&&v)throw Error(n(425))}function hp(){}var ax=null,sx=null;function ix(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 ox=typeof setTimeout=="function"?setTimeout:void 0,Eq=typeof clearTimeout=="function"?clearTimeout:void 0,G_=typeof Promise=="function"?Promise:void 0,Pq=typeof queueMicrotask=="function"?queueMicrotask:typeof G_<"u"?function(l){return G_.resolve(null).then(l).catch(kq)}:ox;function kq(l){setTimeout(function(){throw l})}function lx(l,u){var v=u,w=0;do{var _=v.nextSibling;if(l.removeChild(v),_&&_.nodeType===8)if(v=_.data,v==="/$"){if(w===0){l.removeChild(_),Ru(u);return}w--}else v!=="$"&&v!=="$?"&&v!=="$!"||w++;v=_}while(v);Ru(u)}function Oi(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 Y_(l){l=l.previousSibling;for(var u=0;l;){if(l.nodeType===8){var v=l.data;if(v==="$"||v==="$!"||v==="$?"){if(u===0)return l;u--}else v==="/$"&&u++}l=l.previousSibling}return null}var Ll=Math.random().toString(36).slice(2),fs="__reactFiber$"+Ll,Wu="__reactProps$"+Ll,Bs="__reactContainer$"+Ll,cx="__reactEvents$"+Ll,Oq="__reactListeners$"+Ll,Tq="__reactHandles$"+Ll;function bo(l){var u=l[fs];if(u)return u;for(var v=l.parentNode;v;){if(u=v[Bs]||v[fs]){if(v=u.alternate,u.child!==null||v!==null&&v.child!==null)for(l=Y_(l);l!==null;){if(v=l[fs])return v;l=Y_(l)}return u}l=v,v=l.parentNode}return null}function Vu(l){return l=l[fs]||l[Bs],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function Fl(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(n(33))}function mp(l){return l[Wu]||null}var ux=[],Bl=-1;function Ti(l){return{current:l}}function _n(l){0>Bl||(l.current=ux[Bl],ux[Bl]=null,Bl--)}function yn(l,u){Bl++,ux[Bl]=l.current,l.current=u}var Ri={},vr=Ti(Ri),Ir=Ti(!1),wo=Ri;function zl(l,u){var v=l.type.contextTypes;if(!v)return Ri;var w=l.stateNode;if(w&&w.__reactInternalMemoizedUnmaskedChildContext===u)return w.__reactInternalMemoizedMaskedChildContext;var _={},k;for(k in v)_[k]=u[k];return w&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=u,l.__reactInternalMemoizedMaskedChildContext=_),_}function Mr(l){return l=l.childContextTypes,l!=null}function vp(){_n(Ir),_n(vr)}function X_(l,u,v){if(vr.current!==Ri)throw Error(n(168));yn(vr,u),yn(Ir,v)}function Q_(l,u,v){var w=l.stateNode;if(u=u.childContextTypes,typeof w.getChildContext!="function")return v;w=w.getChildContext();for(var _ in w)if(!(_ in u))throw Error(n(108,V(l)||"Unknown",_));return J({},v,w)}function gp(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||Ri,wo=vr.current,yn(vr,l),yn(Ir,Ir.current),!0}function J_(l,u,v){var w=l.stateNode;if(!w)throw Error(n(169));v?(l=Q_(l,u,wo),w.__reactInternalMemoizedMergedChildContext=l,_n(Ir),_n(vr),yn(vr,l)):_n(Ir),yn(Ir,v)}var zs=null,xp=!1,dx=!1;function Z_(l){zs===null?zs=[l]:zs.push(l)}function Rq(l){xp=!0,Z_(l)}function Ii(){if(!dx&&zs!==null){dx=!0;var l=0,u=sn;try{var v=zs;for(sn=1;l<v.length;l++){var w=v[l];do w=w(!0);while(w!==null)}zs=null,xp=!1}catch(_){throw zs!==null&&(zs=zs.slice(l+1)),Vt(Et,Ii),_}finally{sn=u,dx=!1}}return null}var ql=[],Ul=0,yp=null,bp=0,ga=[],xa=0,jo=null,qs=1,Us="";function So(l,u){ql[Ul++]=bp,ql[Ul++]=yp,yp=l,bp=u}function eA(l,u,v){ga[xa++]=qs,ga[xa++]=Us,ga[xa++]=jo,jo=l;var w=qs;l=Us;var _=32-Rr(w)-1;w&=~(1<<_),v+=1;var k=32-Rr(u)+_;if(30<k){var M=_-_%5;k=(w&(1<<M)-1).toString(32),w>>=M,_-=M,qs=1<<32-Rr(u)+_|v<<_|w,Us=k+l}else qs=1<<k|v<<_|w,Us=l}function fx(l){l.return!==null&&(So(l,1),eA(l,1,0))}function px(l){for(;l===yp;)yp=ql[--Ul],ql[Ul]=null,bp=ql[--Ul],ql[Ul]=null;for(;l===jo;)jo=ga[--xa],ga[xa]=null,Us=ga[--xa],ga[xa]=null,qs=ga[--xa],ga[xa]=null}var ea=null,ta=null,Tn=!1,Fa=null;function tA(l,u){var v=ja(5,null,null,0);v.elementType="DELETED",v.stateNode=u,v.return=l,u=l.deletions,u===null?(l.deletions=[v],l.flags|=16):u.push(v)}function nA(l,u){switch(l.tag){case 5:var v=l.type;return u=u.nodeType!==1||v.toLowerCase()!==u.nodeName.toLowerCase()?null:u,u!==null?(l.stateNode=u,ea=l,ta=Oi(u.firstChild),!0):!1;case 6:return u=l.pendingProps===""||u.nodeType!==3?null:u,u!==null?(l.stateNode=u,ea=l,ta=null,!0):!1;case 13:return u=u.nodeType!==8?null:u,u!==null?(v=jo!==null?{id:qs,overflow:Us}:null,l.memoizedState={dehydrated:u,treeContext:v,retryLane:1073741824},v=ja(18,null,null,0),v.stateNode=u,v.return=l,l.child=v,ea=l,ta=null,!0):!1;default:return!1}}function hx(l){return(l.mode&1)!==0&&(l.flags&128)===0}function mx(l){if(Tn){var u=ta;if(u){var v=u;if(!nA(l,u)){if(hx(l))throw Error(n(418));u=Oi(v.nextSibling);var w=ea;u&&nA(l,u)?tA(w,v):(l.flags=l.flags&-4097|2,Tn=!1,ea=l)}}else{if(hx(l))throw Error(n(418));l.flags=l.flags&-4097|2,Tn=!1,ea=l}}}function rA(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;ea=l}function wp(l){if(l!==ea)return!1;if(!Tn)return rA(l),Tn=!0,!1;var u;if((u=l.tag!==3)&&!(u=l.tag!==5)&&(u=l.type,u=u!=="head"&&u!=="body"&&!ix(l.type,l.memoizedProps)),u&&(u=ta)){if(hx(l))throw aA(),Error(n(418));for(;u;)tA(l,u),u=Oi(u.nextSibling)}if(rA(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 v=l.data;if(v==="/$"){if(u===0){ta=Oi(l.nextSibling);break e}u--}else v!=="$"&&v!=="$!"&&v!=="$?"||u++}l=l.nextSibling}ta=null}}else ta=ea?Oi(l.stateNode.nextSibling):null;return!0}function aA(){for(var l=ta;l;)l=Oi(l.nextSibling)}function Wl(){ta=ea=null,Tn=!1}function vx(l){Fa===null?Fa=[l]:Fa.push(l)}var Iq=E.ReactCurrentBatchConfig;function Hu(l,u,v){if(l=v.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(v._owner){if(v=v._owner,v){if(v.tag!==1)throw Error(n(309));var w=v.stateNode}if(!w)throw Error(n(147,l));var _=w,k=""+l;return u!==null&&u.ref!==null&&typeof u.ref=="function"&&u.ref._stringRef===k?u.ref:(u=function(M){var te=_.refs;M===null?delete te[k]:te[k]=M},u._stringRef=k,u)}if(typeof l!="string")throw Error(n(284));if(!v._owner)throw Error(n(290,l))}return l}function jp(l,u){throw l=Object.prototype.toString.call(u),Error(n(31,l==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":l))}function sA(l){var u=l._init;return u(l._payload)}function iA(l){function u(me,ce){if(l){var xe=me.deletions;xe===null?(me.deletions=[ce],me.flags|=16):xe.push(ce)}}function v(me,ce){if(!l)return null;for(;ce!==null;)u(me,ce),ce=ce.sibling;return null}function w(me,ce){for(me=new Map;ce!==null;)ce.key!==null?me.set(ce.key,ce):me.set(ce.index,ce),ce=ce.sibling;return me}function _(me,ce){return me=qi(me,ce),me.index=0,me.sibling=null,me}function k(me,ce,xe){return me.index=xe,l?(xe=me.alternate,xe!==null?(xe=xe.index,xe<ce?(me.flags|=2,ce):xe):(me.flags|=2,ce)):(me.flags|=1048576,ce)}function M(me){return l&&me.alternate===null&&(me.flags|=2),me}function te(me,ce,xe,Le){return ce===null||ce.tag!==6?(ce=oy(xe,me.mode,Le),ce.return=me,ce):(ce=_(ce,xe),ce.return=me,ce)}function ie(me,ce,xe,Le){var ft=xe.type;return ft===O?Oe(me,ce,xe.props.children,Le,xe.key):ce!==null&&(ce.elementType===ft||typeof ft=="object"&&ft!==null&&ft.$$typeof===W&&sA(ft)===ce.type)?(Le=_(ce,xe.props),Le.ref=Hu(me,ce,xe),Le.return=me,Le):(Le=Hp(xe.type,xe.key,xe.props,null,me.mode,Le),Le.ref=Hu(me,ce,xe),Le.return=me,Le)}function be(me,ce,xe,Le){return ce===null||ce.tag!==4||ce.stateNode.containerInfo!==xe.containerInfo||ce.stateNode.implementation!==xe.implementation?(ce=ly(xe,me.mode,Le),ce.return=me,ce):(ce=_(ce,xe.children||[]),ce.return=me,ce)}function Oe(me,ce,xe,Le,ft){return ce===null||ce.tag!==7?(ce=Oo(xe,me.mode,Le,ft),ce.return=me,ce):(ce=_(ce,xe),ce.return=me,ce)}function Ie(me,ce,xe){if(typeof ce=="string"&&ce!==""||typeof ce=="number")return ce=oy(""+ce,me.mode,xe),ce.return=me,ce;if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case A:return xe=Hp(ce.type,ce.key,ce.props,null,me.mode,xe),xe.ref=Hu(me,null,ce),xe.return=me,xe;case P:return ce=ly(ce,me.mode,xe),ce.return=me,ce;case W:var Le=ce._init;return Ie(me,Le(ce._payload),xe)}if(Ge(ce)||B(ce))return ce=Oo(ce,me.mode,xe,null),ce.return=me,ce;jp(me,ce)}return null}function ke(me,ce,xe,Le){var ft=ce!==null?ce.key:null;if(typeof xe=="string"&&xe!==""||typeof xe=="number")return ft!==null?null:te(me,ce,""+xe,Le);if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case A:return xe.key===ft?ie(me,ce,xe,Le):null;case P:return xe.key===ft?be(me,ce,xe,Le):null;case W:return ft=xe._init,ke(me,ce,ft(xe._payload),Le)}if(Ge(xe)||B(xe))return ft!==null?null:Oe(me,ce,xe,Le,null);jp(me,xe)}return null}function Je(me,ce,xe,Le,ft){if(typeof Le=="string"&&Le!==""||typeof Le=="number")return me=me.get(xe)||null,te(ce,me,""+Le,ft);if(typeof Le=="object"&&Le!==null){switch(Le.$$typeof){case A:return me=me.get(Le.key===null?xe:Le.key)||null,ie(ce,me,Le,ft);case P:return me=me.get(Le.key===null?xe:Le.key)||null,be(ce,me,Le,ft);case W:var wt=Le._init;return Je(me,ce,xe,wt(Le._payload),ft)}if(Ge(Le)||B(Le))return me=me.get(xe)||null,Oe(ce,me,Le,ft,null);jp(ce,Le)}return null}function it(me,ce,xe,Le){for(var ft=null,wt=null,jt=ce,Tt=ce=0,lr=null;jt!==null&&Tt<xe.length;Tt++){jt.index>Tt?(lr=jt,jt=null):lr=jt.sibling;var tn=ke(me,jt,xe[Tt],Le);if(tn===null){jt===null&&(jt=lr);break}l&&jt&&tn.alternate===null&&u(me,jt),ce=k(tn,ce,Tt),wt===null?ft=tn:wt.sibling=tn,wt=tn,jt=lr}if(Tt===xe.length)return v(me,jt),Tn&&So(me,Tt),ft;if(jt===null){for(;Tt<xe.length;Tt++)jt=Ie(me,xe[Tt],Le),jt!==null&&(ce=k(jt,ce,Tt),wt===null?ft=jt:wt.sibling=jt,wt=jt);return Tn&&So(me,Tt),ft}for(jt=w(me,jt);Tt<xe.length;Tt++)lr=Je(jt,me,Tt,xe[Tt],Le),lr!==null&&(l&&lr.alternate!==null&&jt.delete(lr.key===null?Tt:lr.key),ce=k(lr,ce,Tt),wt===null?ft=lr:wt.sibling=lr,wt=lr);return l&&jt.forEach(function(Ui){return u(me,Ui)}),Tn&&So(me,Tt),ft}function dt(me,ce,xe,Le){var ft=B(xe);if(typeof ft!="function")throw Error(n(150));if(xe=ft.call(xe),xe==null)throw Error(n(151));for(var wt=ft=null,jt=ce,Tt=ce=0,lr=null,tn=xe.next();jt!==null&&!tn.done;Tt++,tn=xe.next()){jt.index>Tt?(lr=jt,jt=null):lr=jt.sibling;var Ui=ke(me,jt,tn.value,Le);if(Ui===null){jt===null&&(jt=lr);break}l&&jt&&Ui.alternate===null&&u(me,jt),ce=k(Ui,ce,Tt),wt===null?ft=Ui:wt.sibling=Ui,wt=Ui,jt=lr}if(tn.done)return v(me,jt),Tn&&So(me,Tt),ft;if(jt===null){for(;!tn.done;Tt++,tn=xe.next())tn=Ie(me,tn.value,Le),tn!==null&&(ce=k(tn,ce,Tt),wt===null?ft=tn:wt.sibling=tn,wt=tn);return Tn&&So(me,Tt),ft}for(jt=w(me,jt);!tn.done;Tt++,tn=xe.next())tn=Je(jt,me,Tt,tn.value,Le),tn!==null&&(l&&tn.alternate!==null&&jt.delete(tn.key===null?Tt:tn.key),ce=k(tn,ce,Tt),wt===null?ft=tn:wt.sibling=tn,wt=tn);return l&&jt.forEach(function(pU){return u(me,pU)}),Tn&&So(me,Tt),ft}function Wn(me,ce,xe,Le){if(typeof xe=="object"&&xe!==null&&xe.type===O&&xe.key===null&&(xe=xe.props.children),typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case A:e:{for(var ft=xe.key,wt=ce;wt!==null;){if(wt.key===ft){if(ft=xe.type,ft===O){if(wt.tag===7){v(me,wt.sibling),ce=_(wt,xe.props.children),ce.return=me,me=ce;break e}}else if(wt.elementType===ft||typeof ft=="object"&&ft!==null&&ft.$$typeof===W&&sA(ft)===wt.type){v(me,wt.sibling),ce=_(wt,xe.props),ce.ref=Hu(me,wt,xe),ce.return=me,me=ce;break e}v(me,wt);break}else u(me,wt);wt=wt.sibling}xe.type===O?(ce=Oo(xe.props.children,me.mode,Le,xe.key),ce.return=me,me=ce):(Le=Hp(xe.type,xe.key,xe.props,null,me.mode,Le),Le.ref=Hu(me,ce,xe),Le.return=me,me=Le)}return M(me);case P:e:{for(wt=xe.key;ce!==null;){if(ce.key===wt)if(ce.tag===4&&ce.stateNode.containerInfo===xe.containerInfo&&ce.stateNode.implementation===xe.implementation){v(me,ce.sibling),ce=_(ce,xe.children||[]),ce.return=me,me=ce;break e}else{v(me,ce);break}else u(me,ce);ce=ce.sibling}ce=ly(xe,me.mode,Le),ce.return=me,me=ce}return M(me);case W:return wt=xe._init,Wn(me,ce,wt(xe._payload),Le)}if(Ge(xe))return it(me,ce,xe,Le);if(B(xe))return dt(me,ce,xe,Le);jp(me,xe)}return typeof xe=="string"&&xe!==""||typeof xe=="number"?(xe=""+xe,ce!==null&&ce.tag===6?(v(me,ce.sibling),ce=_(ce,xe),ce.return=me,me=ce):(v(me,ce),ce=oy(xe,me.mode,Le),ce.return=me,me=ce),M(me)):v(me,ce)}return Wn}var Vl=iA(!0),oA=iA(!1),Sp=Ti(null),Np=null,Hl=null,gx=null;function xx(){gx=Hl=Np=null}function yx(l){var u=Sp.current;_n(Sp),l._currentValue=u}function bx(l,u,v){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===v)break;l=l.return}}function Kl(l,u){Np=l,gx=Hl=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&u)!==0&&($r=!0),l.firstContext=null)}function ya(l){var u=l._currentValue;if(gx!==l)if(l={context:l,memoizedValue:u,next:null},Hl===null){if(Np===null)throw Error(n(308));Hl=l,Np.dependencies={lanes:0,firstContext:l}}else Hl=Hl.next=l;return u}var No=null;function wx(l){No===null?No=[l]:No.push(l)}function lA(l,u,v,w){var _=u.interleaved;return _===null?(v.next=v,wx(u)):(v.next=_.next,_.next=v),u.interleaved=v,Ws(l,w)}function Ws(l,u){l.lanes|=u;var v=l.alternate;for(v!==null&&(v.lanes|=u),v=l,l=l.return;l!==null;)l.childLanes|=u,v=l.alternate,v!==null&&(v.childLanes|=u),v=l,l=l.return;return v.tag===3?v.stateNode:null}var Mi=!1;function jx(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function cA(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 Vs(l,u){return{eventTime:l,lane:u,tag:0,payload:null,callback:null,next:null}}function $i(l,u,v){var w=l.updateQueue;if(w===null)return null;if(w=w.shared,(en&2)!==0){var _=w.pending;return _===null?u.next=u:(u.next=_.next,_.next=u),w.pending=u,Ws(l,v)}return _=w.interleaved,_===null?(u.next=u,wx(w)):(u.next=_.next,_.next=u),w.interleaved=u,Ws(l,v)}function Cp(l,u,v){if(u=u.updateQueue,u!==null&&(u=u.shared,(v&4194240)!==0)){var w=u.lanes;w&=l.pendingLanes,v|=w,u.lanes=v,kl(l,v)}}function uA(l,u){var v=l.updateQueue,w=l.alternate;if(w!==null&&(w=w.updateQueue,v===w)){var _=null,k=null;if(v=v.firstBaseUpdate,v!==null){do{var M={eventTime:v.eventTime,lane:v.lane,tag:v.tag,payload:v.payload,callback:v.callback,next:null};k===null?_=k=M:k=k.next=M,v=v.next}while(v!==null);k===null?_=k=u:k=k.next=u}else _=k=u;v={baseState:w.baseState,firstBaseUpdate:_,lastBaseUpdate:k,shared:w.shared,effects:w.effects},l.updateQueue=v;return}l=v.lastBaseUpdate,l===null?v.firstBaseUpdate=u:l.next=u,v.lastBaseUpdate=u}function _p(l,u,v,w){var _=l.updateQueue;Mi=!1;var k=_.firstBaseUpdate,M=_.lastBaseUpdate,te=_.shared.pending;if(te!==null){_.shared.pending=null;var ie=te,be=ie.next;ie.next=null,M===null?k=be:M.next=be,M=ie;var Oe=l.alternate;Oe!==null&&(Oe=Oe.updateQueue,te=Oe.lastBaseUpdate,te!==M&&(te===null?Oe.firstBaseUpdate=be:te.next=be,Oe.lastBaseUpdate=ie))}if(k!==null){var Ie=_.baseState;M=0,Oe=be=ie=null,te=k;do{var ke=te.lane,Je=te.eventTime;if((w&ke)===ke){Oe!==null&&(Oe=Oe.next={eventTime:Je,lane:0,tag:te.tag,payload:te.payload,callback:te.callback,next:null});e:{var it=l,dt=te;switch(ke=u,Je=v,dt.tag){case 1:if(it=dt.payload,typeof it=="function"){Ie=it.call(Je,Ie,ke);break e}Ie=it;break e;case 3:it.flags=it.flags&-65537|128;case 0:if(it=dt.payload,ke=typeof it=="function"?it.call(Je,Ie,ke):it,ke==null)break e;Ie=J({},Ie,ke);break e;case 2:Mi=!0}}te.callback!==null&&te.lane!==0&&(l.flags|=64,ke=_.effects,ke===null?_.effects=[te]:ke.push(te))}else Je={eventTime:Je,lane:ke,tag:te.tag,payload:te.payload,callback:te.callback,next:null},Oe===null?(be=Oe=Je,ie=Ie):Oe=Oe.next=Je,M|=ke;if(te=te.next,te===null){if(te=_.shared.pending,te===null)break;ke=te,te=ke.next,ke.next=null,_.lastBaseUpdate=ke,_.shared.pending=null}}while(!0);if(Oe===null&&(ie=Ie),_.baseState=ie,_.firstBaseUpdate=be,_.lastBaseUpdate=Oe,u=_.shared.interleaved,u!==null){_=u;do M|=_.lane,_=_.next;while(_!==u)}else k===null&&(_.shared.lanes=0);Ao|=M,l.lanes=M,l.memoizedState=Ie}}function dA(l,u,v){if(l=u.effects,u.effects=null,l!==null)for(u=0;u<l.length;u++){var w=l[u],_=w.callback;if(_!==null){if(w.callback=null,w=v,typeof _!="function")throw Error(n(191,_));_.call(w)}}}var Ku={},ps=Ti(Ku),Gu=Ti(Ku),Yu=Ti(Ku);function Co(l){if(l===Ku)throw Error(n(174));return l}function Sx(l,u){switch(yn(Yu,u),yn(Gu,l),yn(ps,Ku),l=u.nodeType,l){case 9:case 11:u=(u=u.documentElement)?u.namespaceURI:Qt(null,"");break;default:l=l===8?u.parentNode:u,u=l.namespaceURI||null,l=l.tagName,u=Qt(u,l)}_n(ps),yn(ps,u)}function Gl(){_n(ps),_n(Gu),_n(Yu)}function fA(l){Co(Yu.current);var u=Co(ps.current),v=Qt(u,l.type);u!==v&&(yn(Gu,l),yn(ps,v))}function Nx(l){Gu.current===l&&(_n(ps),_n(Gu))}var Mn=Ti(0);function Ap(l){for(var u=l;u!==null;){if(u.tag===13){var v=u.memoizedState;if(v!==null&&(v=v.dehydrated,v===null||v.data==="$?"||v.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 Cx=[];function _x(){for(var l=0;l<Cx.length;l++)Cx[l]._workInProgressVersionPrimary=null;Cx.length=0}var Ep=E.ReactCurrentDispatcher,Ax=E.ReactCurrentBatchConfig,_o=0,$n=null,Xn=null,ir=null,Pp=!1,Xu=!1,Qu=0,Mq=0;function gr(){throw Error(n(321))}function Ex(l,u){if(u===null)return!1;for(var v=0;v<u.length&&v<l.length;v++)if(!La(l[v],u[v]))return!1;return!0}function Px(l,u,v,w,_,k){if(_o=k,$n=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,Ep.current=l===null||l.memoizedState===null?Fq:Bq,l=v(w,_),Xu){k=0;do{if(Xu=!1,Qu=0,25<=k)throw Error(n(301));k+=1,ir=Xn=null,u.updateQueue=null,Ep.current=zq,l=v(w,_)}while(Xu)}if(Ep.current=Tp,u=Xn!==null&&Xn.next!==null,_o=0,ir=Xn=$n=null,Pp=!1,u)throw Error(n(300));return l}function kx(){var l=Qu!==0;return Qu=0,l}function hs(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ir===null?$n.memoizedState=ir=l:ir=ir.next=l,ir}function ba(){if(Xn===null){var l=$n.alternate;l=l!==null?l.memoizedState:null}else l=Xn.next;var u=ir===null?$n.memoizedState:ir.next;if(u!==null)ir=u,Xn=l;else{if(l===null)throw Error(n(310));Xn=l,l={memoizedState:Xn.memoizedState,baseState:Xn.baseState,baseQueue:Xn.baseQueue,queue:Xn.queue,next:null},ir===null?$n.memoizedState=ir=l:ir=ir.next=l}return ir}function Ju(l,u){return typeof u=="function"?u(l):u}function Ox(l){var u=ba(),v=u.queue;if(v===null)throw Error(n(311));v.lastRenderedReducer=l;var w=Xn,_=w.baseQueue,k=v.pending;if(k!==null){if(_!==null){var M=_.next;_.next=k.next,k.next=M}w.baseQueue=_=k,v.pending=null}if(_!==null){k=_.next,w=w.baseState;var te=M=null,ie=null,be=k;do{var Oe=be.lane;if((_o&Oe)===Oe)ie!==null&&(ie=ie.next={lane:0,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null}),w=be.hasEagerState?be.eagerState:l(w,be.action);else{var Ie={lane:Oe,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null};ie===null?(te=ie=Ie,M=w):ie=ie.next=Ie,$n.lanes|=Oe,Ao|=Oe}be=be.next}while(be!==null&&be!==k);ie===null?M=w:ie.next=te,La(w,u.memoizedState)||($r=!0),u.memoizedState=w,u.baseState=M,u.baseQueue=ie,v.lastRenderedState=w}if(l=v.interleaved,l!==null){_=l;do k=_.lane,$n.lanes|=k,Ao|=k,_=_.next;while(_!==l)}else _===null&&(v.lanes=0);return[u.memoizedState,v.dispatch]}function Tx(l){var u=ba(),v=u.queue;if(v===null)throw Error(n(311));v.lastRenderedReducer=l;var w=v.dispatch,_=v.pending,k=u.memoizedState;if(_!==null){v.pending=null;var M=_=_.next;do k=l(k,M.action),M=M.next;while(M!==_);La(k,u.memoizedState)||($r=!0),u.memoizedState=k,u.baseQueue===null&&(u.baseState=k),v.lastRenderedState=k}return[k,w]}function pA(){}function hA(l,u){var v=$n,w=ba(),_=u(),k=!La(w.memoizedState,_);if(k&&(w.memoizedState=_,$r=!0),w=w.queue,Rx(gA.bind(null,v,w,l),[l]),w.getSnapshot!==u||k||ir!==null&&ir.memoizedState.tag&1){if(v.flags|=2048,Zu(9,vA.bind(null,v,w,_,u),void 0,null),or===null)throw Error(n(349));(_o&30)!==0||mA(v,u,_)}return _}function mA(l,u,v){l.flags|=16384,l={getSnapshot:u,value:v},u=$n.updateQueue,u===null?(u={lastEffect:null,stores:null},$n.updateQueue=u,u.stores=[l]):(v=u.stores,v===null?u.stores=[l]:v.push(l))}function vA(l,u,v,w){u.value=v,u.getSnapshot=w,xA(u)&&yA(l)}function gA(l,u,v){return v(function(){xA(u)&&yA(l)})}function xA(l){var u=l.getSnapshot;l=l.value;try{var v=u();return!La(l,v)}catch{return!0}}function yA(l){var u=Ws(l,1);u!==null&&Ua(u,l,1,-1)}function bA(l){var u=hs();return typeof l=="function"&&(l=l()),u.memoizedState=u.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ju,lastRenderedState:l},u.queue=l,l=l.dispatch=Lq.bind(null,$n,l),[u.memoizedState,l]}function Zu(l,u,v,w){return l={tag:l,create:u,destroy:v,deps:w,next:null},u=$n.updateQueue,u===null?(u={lastEffect:null,stores:null},$n.updateQueue=u,u.lastEffect=l.next=l):(v=u.lastEffect,v===null?u.lastEffect=l.next=l:(w=v.next,v.next=l,l.next=w,u.lastEffect=l)),l}function wA(){return ba().memoizedState}function kp(l,u,v,w){var _=hs();$n.flags|=l,_.memoizedState=Zu(1|u,v,void 0,w===void 0?null:w)}function Op(l,u,v,w){var _=ba();w=w===void 0?null:w;var k=void 0;if(Xn!==null){var M=Xn.memoizedState;if(k=M.destroy,w!==null&&Ex(w,M.deps)){_.memoizedState=Zu(u,v,k,w);return}}$n.flags|=l,_.memoizedState=Zu(1|u,v,k,w)}function jA(l,u){return kp(8390656,8,l,u)}function Rx(l,u){return Op(2048,8,l,u)}function SA(l,u){return Op(4,2,l,u)}function NA(l,u){return Op(4,4,l,u)}function CA(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 _A(l,u,v){return v=v!=null?v.concat([l]):null,Op(4,4,CA.bind(null,u,l),v)}function Ix(){}function AA(l,u){var v=ba();u=u===void 0?null:u;var w=v.memoizedState;return w!==null&&u!==null&&Ex(u,w[1])?w[0]:(v.memoizedState=[l,u],l)}function EA(l,u){var v=ba();u=u===void 0?null:u;var w=v.memoizedState;return w!==null&&u!==null&&Ex(u,w[1])?w[0]:(l=l(),v.memoizedState=[l,u],l)}function PA(l,u,v){return(_o&21)===0?(l.baseState&&(l.baseState=!1,$r=!0),l.memoizedState=v):(La(v,u)||(v=xn(),$n.lanes|=v,Ao|=v,l.baseState=!0),u)}function $q(l,u){var v=sn;sn=v!==0&&4>v?v:4,l(!0);var w=Ax.transition;Ax.transition={};try{l(!1),u()}finally{sn=v,Ax.transition=w}}function kA(){return ba().memoizedState}function Dq(l,u,v){var w=Bi(l);if(v={lane:w,action:v,hasEagerState:!1,eagerState:null,next:null},OA(l))TA(u,v);else if(v=lA(l,u,v,w),v!==null){var _=Sr();Ua(v,l,w,_),RA(v,u,w)}}function Lq(l,u,v){var w=Bi(l),_={lane:w,action:v,hasEagerState:!1,eagerState:null,next:null};if(OA(l))TA(u,_);else{var k=l.alternate;if(l.lanes===0&&(k===null||k.lanes===0)&&(k=u.lastRenderedReducer,k!==null))try{var M=u.lastRenderedState,te=k(M,v);if(_.hasEagerState=!0,_.eagerState=te,La(te,M)){var ie=u.interleaved;ie===null?(_.next=_,wx(u)):(_.next=ie.next,ie.next=_),u.interleaved=_;return}}catch{}v=lA(l,u,_,w),v!==null&&(_=Sr(),Ua(v,l,w,_),RA(v,u,w))}}function OA(l){var u=l.alternate;return l===$n||u!==null&&u===$n}function TA(l,u){Xu=Pp=!0;var v=l.pending;v===null?u.next=u:(u.next=v.next,v.next=u),l.pending=u}function RA(l,u,v){if((v&4194240)!==0){var w=u.lanes;w&=l.pendingLanes,v|=w,u.lanes=v,kl(l,v)}}var Tp={readContext:ya,useCallback:gr,useContext:gr,useEffect:gr,useImperativeHandle:gr,useInsertionEffect:gr,useLayoutEffect:gr,useMemo:gr,useReducer:gr,useRef:gr,useState:gr,useDebugValue:gr,useDeferredValue:gr,useTransition:gr,useMutableSource:gr,useSyncExternalStore:gr,useId:gr,unstable_isNewReconciler:!1},Fq={readContext:ya,useCallback:function(l,u){return hs().memoizedState=[l,u===void 0?null:u],l},useContext:ya,useEffect:jA,useImperativeHandle:function(l,u,v){return v=v!=null?v.concat([l]):null,kp(4194308,4,CA.bind(null,u,l),v)},useLayoutEffect:function(l,u){return kp(4194308,4,l,u)},useInsertionEffect:function(l,u){return kp(4,2,l,u)},useMemo:function(l,u){var v=hs();return u=u===void 0?null:u,l=l(),v.memoizedState=[l,u],l},useReducer:function(l,u,v){var w=hs();return u=v!==void 0?v(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=Dq.bind(null,$n,l),[w.memoizedState,l]},useRef:function(l){var u=hs();return l={current:l},u.memoizedState=l},useState:bA,useDebugValue:Ix,useDeferredValue:function(l){return hs().memoizedState=l},useTransition:function(){var l=bA(!1),u=l[0];return l=$q.bind(null,l[1]),hs().memoizedState=l,[u,l]},useMutableSource:function(){},useSyncExternalStore:function(l,u,v){var w=$n,_=hs();if(Tn){if(v===void 0)throw Error(n(407));v=v()}else{if(v=u(),or===null)throw Error(n(349));(_o&30)!==0||mA(w,u,v)}_.memoizedState=v;var k={value:v,getSnapshot:u};return _.queue=k,jA(gA.bind(null,w,k,l),[l]),w.flags|=2048,Zu(9,vA.bind(null,w,k,v,u),void 0,null),v},useId:function(){var l=hs(),u=or.identifierPrefix;if(Tn){var v=Us,w=qs;v=(w&~(1<<32-Rr(w)-1)).toString(32)+v,u=":"+u+"R"+v,v=Qu++,0<v&&(u+="H"+v.toString(32)),u+=":"}else v=Mq++,u=":"+u+"r"+v.toString(32)+":";return l.memoizedState=u},unstable_isNewReconciler:!1},Bq={readContext:ya,useCallback:AA,useContext:ya,useEffect:Rx,useImperativeHandle:_A,useInsertionEffect:SA,useLayoutEffect:NA,useMemo:EA,useReducer:Ox,useRef:wA,useState:function(){return Ox(Ju)},useDebugValue:Ix,useDeferredValue:function(l){var u=ba();return PA(u,Xn.memoizedState,l)},useTransition:function(){var l=Ox(Ju)[0],u=ba().memoizedState;return[l,u]},useMutableSource:pA,useSyncExternalStore:hA,useId:kA,unstable_isNewReconciler:!1},zq={readContext:ya,useCallback:AA,useContext:ya,useEffect:Rx,useImperativeHandle:_A,useInsertionEffect:SA,useLayoutEffect:NA,useMemo:EA,useReducer:Tx,useRef:wA,useState:function(){return Tx(Ju)},useDebugValue:Ix,useDeferredValue:function(l){var u=ba();return Xn===null?u.memoizedState=l:PA(u,Xn.memoizedState,l)},useTransition:function(){var l=Tx(Ju)[0],u=ba().memoizedState;return[l,u]},useMutableSource:pA,useSyncExternalStore:hA,useId:kA,unstable_isNewReconciler:!1};function Ba(l,u){if(l&&l.defaultProps){u=J({},u),l=l.defaultProps;for(var v in l)u[v]===void 0&&(u[v]=l[v]);return u}return u}function Mx(l,u,v,w){u=l.memoizedState,v=v(w,u),v=v==null?u:J({},u,v),l.memoizedState=v,l.lanes===0&&(l.updateQueue.baseState=v)}var Rp={isMounted:function(l){return(l=l._reactInternals)?Da(l)===l:!1},enqueueSetState:function(l,u,v){l=l._reactInternals;var w=Sr(),_=Bi(l),k=Vs(w,_);k.payload=u,v!=null&&(k.callback=v),u=$i(l,k,_),u!==null&&(Ua(u,l,_,w),Cp(u,l,_))},enqueueReplaceState:function(l,u,v){l=l._reactInternals;var w=Sr(),_=Bi(l),k=Vs(w,_);k.tag=1,k.payload=u,v!=null&&(k.callback=v),u=$i(l,k,_),u!==null&&(Ua(u,l,_,w),Cp(u,l,_))},enqueueForceUpdate:function(l,u){l=l._reactInternals;var v=Sr(),w=Bi(l),_=Vs(v,w);_.tag=2,u!=null&&(_.callback=u),u=$i(l,_,w),u!==null&&(Ua(u,l,w,v),Cp(u,l,w))}};function IA(l,u,v,w,_,k,M){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(w,k,M):u.prototype&&u.prototype.isPureReactComponent?!Fu(v,w)||!Fu(_,k):!0}function MA(l,u,v){var w=!1,_=Ri,k=u.contextType;return typeof k=="object"&&k!==null?k=ya(k):(_=Mr(u)?wo:vr.current,w=u.contextTypes,k=(w=w!=null)?zl(l,_):Ri),u=new u(v,k),l.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Rp,l.stateNode=u,u._reactInternals=l,w&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=_,l.__reactInternalMemoizedMaskedChildContext=k),u}function $A(l,u,v,w){l=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(v,w),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(v,w),u.state!==l&&Rp.enqueueReplaceState(u,u.state,null)}function $x(l,u,v,w){var _=l.stateNode;_.props=v,_.state=l.memoizedState,_.refs={},jx(l);var k=u.contextType;typeof k=="object"&&k!==null?_.context=ya(k):(k=Mr(u)?wo:vr.current,_.context=zl(l,k)),_.state=l.memoizedState,k=u.getDerivedStateFromProps,typeof k=="function"&&(Mx(l,u,k,v),_.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(u=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),u!==_.state&&Rp.enqueueReplaceState(_,_.state,null),_p(l,v,_,w),_.state=l.memoizedState),typeof _.componentDidMount=="function"&&(l.flags|=4194308)}function Yl(l,u){try{var v="",w=u;do v+=fe(w),w=w.return;while(w);var _=v}catch(k){_=`
|
|
7
|
+
Error generating stack: `+k.message+`
|
|
8
|
+
`+k.stack}return{value:l,source:u,stack:_,digest:null}}function Dx(l,u,v){return{value:l,source:null,stack:v??null,digest:u??null}}function Lx(l,u){try{console.error(u.value)}catch(v){setTimeout(function(){throw v})}}var qq=typeof WeakMap=="function"?WeakMap:Map;function DA(l,u,v){v=Vs(-1,v),v.tag=3,v.payload={element:null};var w=u.value;return v.callback=function(){Bp||(Bp=!0,Zx=w),Lx(l,u)},v}function LA(l,u,v){v=Vs(-1,v),v.tag=3;var w=l.type.getDerivedStateFromError;if(typeof w=="function"){var _=u.value;v.payload=function(){return w(_)},v.callback=function(){Lx(l,u)}}var k=l.stateNode;return k!==null&&typeof k.componentDidCatch=="function"&&(v.callback=function(){Lx(l,u),typeof w!="function"&&(Li===null?Li=new Set([this]):Li.add(this));var M=u.stack;this.componentDidCatch(u.value,{componentStack:M!==null?M:""})}),v}function FA(l,u,v){var w=l.pingCache;if(w===null){w=l.pingCache=new qq;var _=new Set;w.set(u,_)}else _=w.get(u),_===void 0&&(_=new Set,w.set(u,_));_.has(v)||(_.add(v),l=nU.bind(null,l,u,v),u.then(l,l))}function BA(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 zA(l,u,v,w,_){return(l.mode&1)===0?(l===u?l.flags|=65536:(l.flags|=128,v.flags|=131072,v.flags&=-52805,v.tag===1&&(v.alternate===null?v.tag=17:(u=Vs(-1,1),u.tag=2,$i(v,u,1))),v.lanes|=1),l):(l.flags|=65536,l.lanes=_,l)}var Uq=E.ReactCurrentOwner,$r=!1;function jr(l,u,v,w){u.child=l===null?oA(u,null,v,w):Vl(u,l.child,v,w)}function qA(l,u,v,w,_){v=v.render;var k=u.ref;return Kl(u,_),w=Px(l,u,v,w,k,_),v=kx(),l!==null&&!$r?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~_,Hs(l,u,_)):(Tn&&v&&fx(u),u.flags|=1,jr(l,u,w,_),u.child)}function UA(l,u,v,w,_){if(l===null){var k=v.type;return typeof k=="function"&&!iy(k)&&k.defaultProps===void 0&&v.compare===null&&v.defaultProps===void 0?(u.tag=15,u.type=k,WA(l,u,k,w,_)):(l=Hp(v.type,null,w,u,u.mode,_),l.ref=u.ref,l.return=u,u.child=l)}if(k=l.child,(l.lanes&_)===0){var M=k.memoizedProps;if(v=v.compare,v=v!==null?v:Fu,v(M,w)&&l.ref===u.ref)return Hs(l,u,_)}return u.flags|=1,l=qi(k,w),l.ref=u.ref,l.return=u,u.child=l}function WA(l,u,v,w,_){if(l!==null){var k=l.memoizedProps;if(Fu(k,w)&&l.ref===u.ref)if($r=!1,u.pendingProps=w=k,(l.lanes&_)!==0)(l.flags&131072)!==0&&($r=!0);else return u.lanes=l.lanes,Hs(l,u,_)}return Fx(l,u,v,w,_)}function VA(l,u,v){var w=u.pendingProps,_=w.children,k=l!==null?l.memoizedState:null;if(w.mode==="hidden")if((u.mode&1)===0)u.memoizedState={baseLanes:0,cachePool:null,transitions:null},yn(Ql,na),na|=v;else{if((v&1073741824)===0)return l=k!==null?k.baseLanes|v:v,u.lanes=u.childLanes=1073741824,u.memoizedState={baseLanes:l,cachePool:null,transitions:null},u.updateQueue=null,yn(Ql,na),na|=l,null;u.memoizedState={baseLanes:0,cachePool:null,transitions:null},w=k!==null?k.baseLanes:v,yn(Ql,na),na|=w}else k!==null?(w=k.baseLanes|v,u.memoizedState=null):w=v,yn(Ql,na),na|=w;return jr(l,u,_,v),u.child}function HA(l,u){var v=u.ref;(l===null&&v!==null||l!==null&&l.ref!==v)&&(u.flags|=512,u.flags|=2097152)}function Fx(l,u,v,w,_){var k=Mr(v)?wo:vr.current;return k=zl(u,k),Kl(u,_),v=Px(l,u,v,w,k,_),w=kx(),l!==null&&!$r?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~_,Hs(l,u,_)):(Tn&&w&&fx(u),u.flags|=1,jr(l,u,v,_),u.child)}function KA(l,u,v,w,_){if(Mr(v)){var k=!0;gp(u)}else k=!1;if(Kl(u,_),u.stateNode===null)Mp(l,u),MA(u,v,w),$x(u,v,w,_),w=!0;else if(l===null){var M=u.stateNode,te=u.memoizedProps;M.props=te;var ie=M.context,be=v.contextType;typeof be=="object"&&be!==null?be=ya(be):(be=Mr(v)?wo:vr.current,be=zl(u,be));var Oe=v.getDerivedStateFromProps,Ie=typeof Oe=="function"||typeof M.getSnapshotBeforeUpdate=="function";Ie||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(te!==w||ie!==be)&&$A(u,M,w,be),Mi=!1;var ke=u.memoizedState;M.state=ke,_p(u,w,M,_),ie=u.memoizedState,te!==w||ke!==ie||Ir.current||Mi?(typeof Oe=="function"&&(Mx(u,v,Oe,w),ie=u.memoizedState),(te=Mi||IA(u,v,te,w,ke,ie,be))?(Ie||typeof M.UNSAFE_componentWillMount!="function"&&typeof M.componentWillMount!="function"||(typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount()),typeof M.componentDidMount=="function"&&(u.flags|=4194308)):(typeof M.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=w,u.memoizedState=ie),M.props=w,M.state=ie,M.context=be,w=te):(typeof M.componentDidMount=="function"&&(u.flags|=4194308),w=!1)}else{M=u.stateNode,cA(l,u),te=u.memoizedProps,be=u.type===u.elementType?te:Ba(u.type,te),M.props=be,Ie=u.pendingProps,ke=M.context,ie=v.contextType,typeof ie=="object"&&ie!==null?ie=ya(ie):(ie=Mr(v)?wo:vr.current,ie=zl(u,ie));var Je=v.getDerivedStateFromProps;(Oe=typeof Je=="function"||typeof M.getSnapshotBeforeUpdate=="function")||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(te!==Ie||ke!==ie)&&$A(u,M,w,ie),Mi=!1,ke=u.memoizedState,M.state=ke,_p(u,w,M,_);var it=u.memoizedState;te!==Ie||ke!==it||Ir.current||Mi?(typeof Je=="function"&&(Mx(u,v,Je,w),it=u.memoizedState),(be=Mi||IA(u,v,be,w,ke,it,ie)||!1)?(Oe||typeof M.UNSAFE_componentWillUpdate!="function"&&typeof M.componentWillUpdate!="function"||(typeof M.componentWillUpdate=="function"&&M.componentWillUpdate(w,it,ie),typeof M.UNSAFE_componentWillUpdate=="function"&&M.UNSAFE_componentWillUpdate(w,it,ie)),typeof M.componentDidUpdate=="function"&&(u.flags|=4),typeof M.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof M.componentDidUpdate!="function"||te===l.memoizedProps&&ke===l.memoizedState||(u.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||te===l.memoizedProps&&ke===l.memoizedState||(u.flags|=1024),u.memoizedProps=w,u.memoizedState=it),M.props=w,M.state=it,M.context=ie,w=be):(typeof M.componentDidUpdate!="function"||te===l.memoizedProps&&ke===l.memoizedState||(u.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||te===l.memoizedProps&&ke===l.memoizedState||(u.flags|=1024),w=!1)}return Bx(l,u,v,w,k,_)}function Bx(l,u,v,w,_,k){HA(l,u);var M=(u.flags&128)!==0;if(!w&&!M)return _&&J_(u,v,!1),Hs(l,u,k);w=u.stateNode,Uq.current=u;var te=M&&typeof v.getDerivedStateFromError!="function"?null:w.render();return u.flags|=1,l!==null&&M?(u.child=Vl(u,l.child,null,k),u.child=Vl(u,null,te,k)):jr(l,u,te,k),u.memoizedState=w.state,_&&J_(u,v,!0),u.child}function GA(l){var u=l.stateNode;u.pendingContext?X_(l,u.pendingContext,u.pendingContext!==u.context):u.context&&X_(l,u.context,!1),Sx(l,u.containerInfo)}function YA(l,u,v,w,_){return Wl(),vx(_),u.flags|=256,jr(l,u,v,w),u.child}var zx={dehydrated:null,treeContext:null,retryLane:0};function qx(l){return{baseLanes:l,cachePool:null,transitions:null}}function XA(l,u,v){var w=u.pendingProps,_=Mn.current,k=!1,M=(u.flags&128)!==0,te;if((te=M)||(te=l!==null&&l.memoizedState===null?!1:(_&2)!==0),te?(k=!0,u.flags&=-129):(l===null||l.memoizedState!==null)&&(_|=1),yn(Mn,_&1),l===null)return mx(u),l=u.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?((u.mode&1)===0?u.lanes=1:l.data==="$!"?u.lanes=8:u.lanes=1073741824,null):(M=w.children,l=w.fallback,k?(w=u.mode,k=u.child,M={mode:"hidden",children:M},(w&1)===0&&k!==null?(k.childLanes=0,k.pendingProps=M):k=Kp(M,w,0,null),l=Oo(l,w,v,null),k.return=u,l.return=u,k.sibling=l,u.child=k,u.child.memoizedState=qx(v),u.memoizedState=zx,l):Ux(u,M));if(_=l.memoizedState,_!==null&&(te=_.dehydrated,te!==null))return Wq(l,u,M,w,te,_,v);if(k){k=w.fallback,M=u.mode,_=l.child,te=_.sibling;var ie={mode:"hidden",children:w.children};return(M&1)===0&&u.child!==_?(w=u.child,w.childLanes=0,w.pendingProps=ie,u.deletions=null):(w=qi(_,ie),w.subtreeFlags=_.subtreeFlags&14680064),te!==null?k=qi(te,k):(k=Oo(k,M,v,null),k.flags|=2),k.return=u,w.return=u,w.sibling=k,u.child=w,w=k,k=u.child,M=l.child.memoizedState,M=M===null?qx(v):{baseLanes:M.baseLanes|v,cachePool:null,transitions:M.transitions},k.memoizedState=M,k.childLanes=l.childLanes&~v,u.memoizedState=zx,w}return k=l.child,l=k.sibling,w=qi(k,{mode:"visible",children:w.children}),(u.mode&1)===0&&(w.lanes=v),w.return=u,w.sibling=null,l!==null&&(v=u.deletions,v===null?(u.deletions=[l],u.flags|=16):v.push(l)),u.child=w,u.memoizedState=null,w}function Ux(l,u){return u=Kp({mode:"visible",children:u},l.mode,0,null),u.return=l,l.child=u}function Ip(l,u,v,w){return w!==null&&vx(w),Vl(u,l.child,null,v),l=Ux(u,u.pendingProps.children),l.flags|=2,u.memoizedState=null,l}function Wq(l,u,v,w,_,k,M){if(v)return u.flags&256?(u.flags&=-257,w=Dx(Error(n(422))),Ip(l,u,M,w)):u.memoizedState!==null?(u.child=l.child,u.flags|=128,null):(k=w.fallback,_=u.mode,w=Kp({mode:"visible",children:w.children},_,0,null),k=Oo(k,_,M,null),k.flags|=2,w.return=u,k.return=u,w.sibling=k,u.child=w,(u.mode&1)!==0&&Vl(u,l.child,null,M),u.child.memoizedState=qx(M),u.memoizedState=zx,k);if((u.mode&1)===0)return Ip(l,u,M,null);if(_.data==="$!"){if(w=_.nextSibling&&_.nextSibling.dataset,w)var te=w.dgst;return w=te,k=Error(n(419)),w=Dx(k,w,void 0),Ip(l,u,M,w)}if(te=(M&l.childLanes)!==0,$r||te){if(w=or,w!==null){switch(M&-M){case 4:_=2;break;case 16:_=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:_=32;break;case 536870912:_=268435456;break;default:_=0}_=(_&(w.suspendedLanes|M))!==0?0:_,_!==0&&_!==k.retryLane&&(k.retryLane=_,Ws(l,_),Ua(w,l,_,-1))}return sy(),w=Dx(Error(n(421))),Ip(l,u,M,w)}return _.data==="$?"?(u.flags|=128,u.child=l.child,u=rU.bind(null,l),_._reactRetry=u,null):(l=k.treeContext,ta=Oi(_.nextSibling),ea=u,Tn=!0,Fa=null,l!==null&&(ga[xa++]=qs,ga[xa++]=Us,ga[xa++]=jo,qs=l.id,Us=l.overflow,jo=u),u=Ux(u,w.children),u.flags|=4096,u)}function QA(l,u,v){l.lanes|=u;var w=l.alternate;w!==null&&(w.lanes|=u),bx(l.return,u,v)}function Wx(l,u,v,w,_){var k=l.memoizedState;k===null?l.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:w,tail:v,tailMode:_}:(k.isBackwards=u,k.rendering=null,k.renderingStartTime=0,k.last=w,k.tail=v,k.tailMode=_)}function JA(l,u,v){var w=u.pendingProps,_=w.revealOrder,k=w.tail;if(jr(l,u,w.children,v),w=Mn.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&&QA(l,v,u);else if(l.tag===19)QA(l,v,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(yn(Mn,w),(u.mode&1)===0)u.memoizedState=null;else switch(_){case"forwards":for(v=u.child,_=null;v!==null;)l=v.alternate,l!==null&&Ap(l)===null&&(_=v),v=v.sibling;v=_,v===null?(_=u.child,u.child=null):(_=v.sibling,v.sibling=null),Wx(u,!1,_,v,k);break;case"backwards":for(v=null,_=u.child,u.child=null;_!==null;){if(l=_.alternate,l!==null&&Ap(l)===null){u.child=_;break}l=_.sibling,_.sibling=v,v=_,_=l}Wx(u,!0,v,null,k);break;case"together":Wx(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function Mp(l,u){(u.mode&1)===0&&l!==null&&(l.alternate=null,u.alternate=null,u.flags|=2)}function Hs(l,u,v){if(l!==null&&(u.dependencies=l.dependencies),Ao|=u.lanes,(v&u.childLanes)===0)return null;if(l!==null&&u.child!==l.child)throw Error(n(153));if(u.child!==null){for(l=u.child,v=qi(l,l.pendingProps),u.child=v,v.return=u;l.sibling!==null;)l=l.sibling,v=v.sibling=qi(l,l.pendingProps),v.return=u;v.sibling=null}return u.child}function Vq(l,u,v){switch(u.tag){case 3:GA(u),Wl();break;case 5:fA(u);break;case 1:Mr(u.type)&&gp(u);break;case 4:Sx(u,u.stateNode.containerInfo);break;case 10:var w=u.type._context,_=u.memoizedProps.value;yn(Sp,w._currentValue),w._currentValue=_;break;case 13:if(w=u.memoizedState,w!==null)return w.dehydrated!==null?(yn(Mn,Mn.current&1),u.flags|=128,null):(v&u.child.childLanes)!==0?XA(l,u,v):(yn(Mn,Mn.current&1),l=Hs(l,u,v),l!==null?l.sibling:null);yn(Mn,Mn.current&1);break;case 19:if(w=(v&u.childLanes)!==0,(l.flags&128)!==0){if(w)return JA(l,u,v);u.flags|=128}if(_=u.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),yn(Mn,Mn.current),w)break;return null;case 22:case 23:return u.lanes=0,VA(l,u,v)}return Hs(l,u,v)}var ZA,Vx,eE,tE;ZA=function(l,u){for(var v=u.child;v!==null;){if(v.tag===5||v.tag===6)l.appendChild(v.stateNode);else if(v.tag!==4&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===u)break;for(;v.sibling===null;){if(v.return===null||v.return===u)return;v=v.return}v.sibling.return=v.return,v=v.sibling}},Vx=function(){},eE=function(l,u,v,w){var _=l.memoizedProps;if(_!==w){l=u.stateNode,Co(ps.current);var k=null;switch(v){case"input":_=Ce(l,_),w=Ce(l,w),k=[];break;case"select":_=J({},_,{value:void 0}),w=J({},w,{value:void 0}),k=[];break;case"textarea":_=pt(l,_),w=pt(l,w),k=[];break;default:typeof _.onClick!="function"&&typeof w.onClick=="function"&&(l.onclick=hp)}Be(v,w);var M;v=null;for(be in _)if(!w.hasOwnProperty(be)&&_.hasOwnProperty(be)&&_[be]!=null)if(be==="style"){var te=_[be];for(M in te)te.hasOwnProperty(M)&&(v||(v={}),v[M]="")}else be!=="dangerouslySetInnerHTML"&&be!=="children"&&be!=="suppressContentEditableWarning"&&be!=="suppressHydrationWarning"&&be!=="autoFocus"&&(s.hasOwnProperty(be)?k||(k=[]):(k=k||[]).push(be,null));for(be in w){var ie=w[be];if(te=_?.[be],w.hasOwnProperty(be)&&ie!==te&&(ie!=null||te!=null))if(be==="style")if(te){for(M in te)!te.hasOwnProperty(M)||ie&&ie.hasOwnProperty(M)||(v||(v={}),v[M]="");for(M in ie)ie.hasOwnProperty(M)&&te[M]!==ie[M]&&(v||(v={}),v[M]=ie[M])}else v||(k||(k=[]),k.push(be,v)),v=ie;else be==="dangerouslySetInnerHTML"?(ie=ie?ie.__html:void 0,te=te?te.__html:void 0,ie!=null&&te!==ie&&(k=k||[]).push(be,ie)):be==="children"?typeof ie!="string"&&typeof ie!="number"||(k=k||[]).push(be,""+ie):be!=="suppressContentEditableWarning"&&be!=="suppressHydrationWarning"&&(s.hasOwnProperty(be)?(ie!=null&&be==="onScroll"&&Cn("scroll",l),k||te===ie||(k=[])):(k=k||[]).push(be,ie))}v&&(k=k||[]).push("style",v);var be=k;(u.updateQueue=be)&&(u.flags|=4)}},tE=function(l,u,v,w){v!==w&&(u.flags|=4)};function ed(l,u){if(!Tn)switch(l.tailMode){case"hidden":u=l.tail;for(var v=null;u!==null;)u.alternate!==null&&(v=u),u=u.sibling;v===null?l.tail=null:v.sibling=null;break;case"collapsed":v=l.tail;for(var w=null;v!==null;)v.alternate!==null&&(w=v),v=v.sibling;w===null?u||l.tail===null?l.tail=null:l.tail.sibling=null:w.sibling=null}}function xr(l){var u=l.alternate!==null&&l.alternate.child===l.child,v=0,w=0;if(u)for(var _=l.child;_!==null;)v|=_.lanes|_.childLanes,w|=_.subtreeFlags&14680064,w|=_.flags&14680064,_.return=l,_=_.sibling;else for(_=l.child;_!==null;)v|=_.lanes|_.childLanes,w|=_.subtreeFlags,w|=_.flags,_.return=l,_=_.sibling;return l.subtreeFlags|=w,l.childLanes=v,u}function Hq(l,u,v){var w=u.pendingProps;switch(px(u),u.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xr(u),null;case 1:return Mr(u.type)&&vp(),xr(u),null;case 3:return w=u.stateNode,Gl(),_n(Ir),_n(vr),_x(),w.pendingContext&&(w.context=w.pendingContext,w.pendingContext=null),(l===null||l.child===null)&&(wp(u)?u.flags|=4:l===null||l.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Fa!==null&&(ny(Fa),Fa=null))),Vx(l,u),xr(u),null;case 5:Nx(u);var _=Co(Yu.current);if(v=u.type,l!==null&&u.stateNode!=null)eE(l,u,v,w,_),l.ref!==u.ref&&(u.flags|=512,u.flags|=2097152);else{if(!w){if(u.stateNode===null)throw Error(n(166));return xr(u),null}if(l=Co(ps.current),wp(u)){w=u.stateNode,v=u.type;var k=u.memoizedProps;switch(w[fs]=u,w[Wu]=k,l=(u.mode&1)!==0,v){case"dialog":Cn("cancel",w),Cn("close",w);break;case"iframe":case"object":case"embed":Cn("load",w);break;case"video":case"audio":for(_=0;_<zu.length;_++)Cn(zu[_],w);break;case"source":Cn("error",w);break;case"img":case"image":case"link":Cn("error",w),Cn("load",w);break;case"details":Cn("toggle",w);break;case"input":Me(w,k),Cn("invalid",w);break;case"select":w._wrapperState={wasMultiple:!!k.multiple},Cn("invalid",w);break;case"textarea":vt(w,k),Cn("invalid",w)}Be(v,k),_=null;for(var M in k)if(k.hasOwnProperty(M)){var te=k[M];M==="children"?typeof te=="string"?w.textContent!==te&&(k.suppressHydrationWarning!==!0&&pp(w.textContent,te,l),_=["children",te]):typeof te=="number"&&w.textContent!==""+te&&(k.suppressHydrationWarning!==!0&&pp(w.textContent,te,l),_=["children",""+te]):s.hasOwnProperty(M)&&te!=null&&M==="onScroll"&&Cn("scroll",w)}switch(v){case"input":pe(w),ve(w,k,!0);break;case"textarea":pe(w),qt(w);break;case"select":case"option":break;default:typeof k.onClick=="function"&&(w.onclick=hp)}w=_,u.updateQueue=w,w!==null&&(u.flags|=4)}else{M=_.nodeType===9?_:_.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=Wt(v)),l==="http://www.w3.org/1999/xhtml"?v==="script"?(l=M.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof w.is=="string"?l=M.createElement(v,{is:w.is}):(l=M.createElement(v),v==="select"&&(M=l,w.multiple?M.multiple=!0:w.size&&(M.size=w.size))):l=M.createElementNS(l,v),l[fs]=u,l[Wu]=w,ZA(l,u,!1,!1),u.stateNode=l;e:{switch(M=xt(v,w),v){case"dialog":Cn("cancel",l),Cn("close",l),_=w;break;case"iframe":case"object":case"embed":Cn("load",l),_=w;break;case"video":case"audio":for(_=0;_<zu.length;_++)Cn(zu[_],l);_=w;break;case"source":Cn("error",l),_=w;break;case"img":case"image":case"link":Cn("error",l),Cn("load",l),_=w;break;case"details":Cn("toggle",l),_=w;break;case"input":Me(l,w),_=Ce(l,w),Cn("invalid",l);break;case"option":_=w;break;case"select":l._wrapperState={wasMultiple:!!w.multiple},_=J({},w,{value:void 0}),Cn("invalid",l);break;case"textarea":vt(l,w),_=pt(l,w),Cn("invalid",l);break;default:_=w}Be(v,_),te=_;for(k in te)if(te.hasOwnProperty(k)){var ie=te[k];k==="style"?ye(l,ie):k==="dangerouslySetInnerHTML"?(ie=ie?ie.__html:void 0,ie!=null&&Xe(l,ie)):k==="children"?typeof ie=="string"?(v!=="textarea"||ie!=="")&&Fe(l,ie):typeof ie=="number"&&Fe(l,""+ie):k!=="suppressContentEditableWarning"&&k!=="suppressHydrationWarning"&&k!=="autoFocus"&&(s.hasOwnProperty(k)?ie!=null&&k==="onScroll"&&Cn("scroll",l):ie!=null&&N(l,k,ie,M))}switch(v){case"input":pe(l),ve(l,w,!1);break;case"textarea":pe(l),qt(l);break;case"option":w.value!=null&&l.setAttribute("value",""+de(w.value));break;case"select":l.multiple=!!w.multiple,k=w.value,k!=null?lt(l,!!w.multiple,k,!1):w.defaultValue!=null&<(l,!!w.multiple,w.defaultValue,!0);break;default:typeof _.onClick=="function"&&(l.onclick=hp)}switch(v){case"button":case"input":case"select":case"textarea":w=!!w.autoFocus;break e;case"img":w=!0;break e;default:w=!1}}w&&(u.flags|=4)}u.ref!==null&&(u.flags|=512,u.flags|=2097152)}return xr(u),null;case 6:if(l&&u.stateNode!=null)tE(l,u,l.memoizedProps,w);else{if(typeof w!="string"&&u.stateNode===null)throw Error(n(166));if(v=Co(Yu.current),Co(ps.current),wp(u)){if(w=u.stateNode,v=u.memoizedProps,w[fs]=u,(k=w.nodeValue!==v)&&(l=ea,l!==null))switch(l.tag){case 3:pp(w.nodeValue,v,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&pp(w.nodeValue,v,(l.mode&1)!==0)}k&&(u.flags|=4)}else w=(v.nodeType===9?v:v.ownerDocument).createTextNode(w),w[fs]=u,u.stateNode=w}return xr(u),null;case 13:if(_n(Mn),w=u.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(Tn&&ta!==null&&(u.mode&1)!==0&&(u.flags&128)===0)aA(),Wl(),u.flags|=98560,k=!1;else if(k=wp(u),w!==null&&w.dehydrated!==null){if(l===null){if(!k)throw Error(n(318));if(k=u.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(n(317));k[fs]=u}else Wl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;xr(u),k=!1}else Fa!==null&&(ny(Fa),Fa=null),k=!0;if(!k)return u.flags&65536?u:null}return(u.flags&128)!==0?(u.lanes=v,u):(w=w!==null,w!==(l!==null&&l.memoizedState!==null)&&w&&(u.child.flags|=8192,(u.mode&1)!==0&&(l===null||(Mn.current&1)!==0?Qn===0&&(Qn=3):sy())),u.updateQueue!==null&&(u.flags|=4),xr(u),null);case 4:return Gl(),Vx(l,u),l===null&&qu(u.stateNode.containerInfo),xr(u),null;case 10:return yx(u.type._context),xr(u),null;case 17:return Mr(u.type)&&vp(),xr(u),null;case 19:if(_n(Mn),k=u.memoizedState,k===null)return xr(u),null;if(w=(u.flags&128)!==0,M=k.rendering,M===null)if(w)ed(k,!1);else{if(Qn!==0||l!==null&&(l.flags&128)!==0)for(l=u.child;l!==null;){if(M=Ap(l),M!==null){for(u.flags|=128,ed(k,!1),w=M.updateQueue,w!==null&&(u.updateQueue=w,u.flags|=4),u.subtreeFlags=0,w=v,v=u.child;v!==null;)k=v,l=w,k.flags&=14680066,M=k.alternate,M===null?(k.childLanes=0,k.lanes=l,k.child=null,k.subtreeFlags=0,k.memoizedProps=null,k.memoizedState=null,k.updateQueue=null,k.dependencies=null,k.stateNode=null):(k.childLanes=M.childLanes,k.lanes=M.lanes,k.child=M.child,k.subtreeFlags=0,k.deletions=null,k.memoizedProps=M.memoizedProps,k.memoizedState=M.memoizedState,k.updateQueue=M.updateQueue,k.type=M.type,l=M.dependencies,k.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),v=v.sibling;return yn(Mn,Mn.current&1|2),u.child}l=l.sibling}k.tail!==null&&Ae()>Jl&&(u.flags|=128,w=!0,ed(k,!1),u.lanes=4194304)}else{if(!w)if(l=Ap(M),l!==null){if(u.flags|=128,w=!0,v=l.updateQueue,v!==null&&(u.updateQueue=v,u.flags|=4),ed(k,!0),k.tail===null&&k.tailMode==="hidden"&&!M.alternate&&!Tn)return xr(u),null}else 2*Ae()-k.renderingStartTime>Jl&&v!==1073741824&&(u.flags|=128,w=!0,ed(k,!1),u.lanes=4194304);k.isBackwards?(M.sibling=u.child,u.child=M):(v=k.last,v!==null?v.sibling=M:u.child=M,k.last=M)}return k.tail!==null?(u=k.tail,k.rendering=u,k.tail=u.sibling,k.renderingStartTime=Ae(),u.sibling=null,v=Mn.current,yn(Mn,w?v&1|2:v&1),u):(xr(u),null);case 22:case 23:return ay(),w=u.memoizedState!==null,l!==null&&l.memoizedState!==null!==w&&(u.flags|=8192),w&&(u.mode&1)!==0?(na&1073741824)!==0&&(xr(u),u.subtreeFlags&6&&(u.flags|=8192)):xr(u),null;case 24:return null;case 25:return null}throw Error(n(156,u.tag))}function Kq(l,u){switch(px(u),u.tag){case 1:return Mr(u.type)&&vp(),l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 3:return Gl(),_n(Ir),_n(vr),_x(),l=u.flags,(l&65536)!==0&&(l&128)===0?(u.flags=l&-65537|128,u):null;case 5:return Nx(u),null;case 13:if(_n(Mn),l=u.memoizedState,l!==null&&l.dehydrated!==null){if(u.alternate===null)throw Error(n(340));Wl()}return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 19:return _n(Mn),null;case 4:return Gl(),null;case 10:return yx(u.type._context),null;case 22:case 23:return ay(),null;case 24:return null;default:return null}}var $p=!1,yr=!1,Gq=typeof WeakSet=="function"?WeakSet:Set,tt=null;function Xl(l,u){var v=l.ref;if(v!==null)if(typeof v=="function")try{v(null)}catch(w){Bn(l,u,w)}else v.current=null}function Hx(l,u,v){try{v()}catch(w){Bn(l,u,w)}}var nE=!1;function Yq(l,u){if(ax=np,l=I_(),Xg(l)){if("selectionStart"in l)var v={start:l.selectionStart,end:l.selectionEnd};else e:{v=(v=l.ownerDocument)&&v.defaultView||window;var w=v.getSelection&&v.getSelection();if(w&&w.rangeCount!==0){v=w.anchorNode;var _=w.anchorOffset,k=w.focusNode;w=w.focusOffset;try{v.nodeType,k.nodeType}catch{v=null;break e}var M=0,te=-1,ie=-1,be=0,Oe=0,Ie=l,ke=null;t:for(;;){for(var Je;Ie!==v||_!==0&&Ie.nodeType!==3||(te=M+_),Ie!==k||w!==0&&Ie.nodeType!==3||(ie=M+w),Ie.nodeType===3&&(M+=Ie.nodeValue.length),(Je=Ie.firstChild)!==null;)ke=Ie,Ie=Je;for(;;){if(Ie===l)break t;if(ke===v&&++be===_&&(te=M),ke===k&&++Oe===w&&(ie=M),(Je=Ie.nextSibling)!==null)break;Ie=ke,ke=Ie.parentNode}Ie=Je}v=te===-1||ie===-1?null:{start:te,end:ie}}else v=null}v=v||{start:0,end:0}}else v=null;for(sx={focusedElem:l,selectionRange:v},np=!1,tt=u;tt!==null;)if(u=tt,l=u.child,(u.subtreeFlags&1028)!==0&&l!==null)l.return=u,tt=l;else for(;tt!==null;){u=tt;try{var it=u.alternate;if((u.flags&1024)!==0)switch(u.tag){case 0:case 11:case 15:break;case 1:if(it!==null){var dt=it.memoizedProps,Wn=it.memoizedState,me=u.stateNode,ce=me.getSnapshotBeforeUpdate(u.elementType===u.type?dt:Ba(u.type,dt),Wn);me.__reactInternalSnapshotBeforeUpdate=ce}break;case 3:var xe=u.stateNode.containerInfo;xe.nodeType===1?xe.textContent="":xe.nodeType===9&&xe.documentElement&&xe.removeChild(xe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Le){Bn(u,u.return,Le)}if(l=u.sibling,l!==null){l.return=u.return,tt=l;break}tt=u.return}return it=nE,nE=!1,it}function td(l,u,v){var w=u.updateQueue;if(w=w!==null?w.lastEffect:null,w!==null){var _=w=w.next;do{if((_.tag&l)===l){var k=_.destroy;_.destroy=void 0,k!==void 0&&Hx(u,v,k)}_=_.next}while(_!==w)}}function Dp(l,u){if(u=u.updateQueue,u=u!==null?u.lastEffect:null,u!==null){var v=u=u.next;do{if((v.tag&l)===l){var w=v.create;v.destroy=w()}v=v.next}while(v!==u)}}function Kx(l){var u=l.ref;if(u!==null){var v=l.stateNode;l.tag,l=v,typeof u=="function"?u(l):u.current=l}}function rE(l){var u=l.alternate;u!==null&&(l.alternate=null,rE(u)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(u=l.stateNode,u!==null&&(delete u[fs],delete u[Wu],delete u[cx],delete u[Oq],delete u[Tq])),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 aE(l){return l.tag===5||l.tag===3||l.tag===4}function sE(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||aE(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 Gx(l,u,v){var w=l.tag;if(w===5||w===6)l=l.stateNode,u?v.nodeType===8?v.parentNode.insertBefore(l,u):v.insertBefore(l,u):(v.nodeType===8?(u=v.parentNode,u.insertBefore(l,v)):(u=v,u.appendChild(l)),v=v._reactRootContainer,v!=null||u.onclick!==null||(u.onclick=hp));else if(w!==4&&(l=l.child,l!==null))for(Gx(l,u,v),l=l.sibling;l!==null;)Gx(l,u,v),l=l.sibling}function Yx(l,u,v){var w=l.tag;if(w===5||w===6)l=l.stateNode,u?v.insertBefore(l,u):v.appendChild(l);else if(w!==4&&(l=l.child,l!==null))for(Yx(l,u,v),l=l.sibling;l!==null;)Yx(l,u,v),l=l.sibling}var fr=null,za=!1;function Di(l,u,v){for(v=v.child;v!==null;)iE(l,u,v),v=v.sibling}function iE(l,u,v){if(va&&typeof va.onCommitFiberUnmount=="function")try{va.onCommitFiberUnmount(El,v)}catch{}switch(v.tag){case 5:yr||Xl(v,u);case 6:var w=fr,_=za;fr=null,Di(l,u,v),fr=w,za=_,fr!==null&&(za?(l=fr,v=v.stateNode,l.nodeType===8?l.parentNode.removeChild(v):l.removeChild(v)):fr.removeChild(v.stateNode));break;case 18:fr!==null&&(za?(l=fr,v=v.stateNode,l.nodeType===8?lx(l.parentNode,v):l.nodeType===1&&lx(l,v),Ru(l)):lx(fr,v.stateNode));break;case 4:w=fr,_=za,fr=v.stateNode.containerInfo,za=!0,Di(l,u,v),fr=w,za=_;break;case 0:case 11:case 14:case 15:if(!yr&&(w=v.updateQueue,w!==null&&(w=w.lastEffect,w!==null))){_=w=w.next;do{var k=_,M=k.destroy;k=k.tag,M!==void 0&&((k&2)!==0||(k&4)!==0)&&Hx(v,u,M),_=_.next}while(_!==w)}Di(l,u,v);break;case 1:if(!yr&&(Xl(v,u),w=v.stateNode,typeof w.componentWillUnmount=="function"))try{w.props=v.memoizedProps,w.state=v.memoizedState,w.componentWillUnmount()}catch(te){Bn(v,u,te)}Di(l,u,v);break;case 21:Di(l,u,v);break;case 22:v.mode&1?(yr=(w=yr)||v.memoizedState!==null,Di(l,u,v),yr=w):Di(l,u,v);break;default:Di(l,u,v)}}function oE(l){var u=l.updateQueue;if(u!==null){l.updateQueue=null;var v=l.stateNode;v===null&&(v=l.stateNode=new Gq),u.forEach(function(w){var _=aU.bind(null,l,w);v.has(w)||(v.add(w),w.then(_,_))})}}function qa(l,u){var v=u.deletions;if(v!==null)for(var w=0;w<v.length;w++){var _=v[w];try{var k=l,M=u,te=M;e:for(;te!==null;){switch(te.tag){case 5:fr=te.stateNode,za=!1;break e;case 3:fr=te.stateNode.containerInfo,za=!0;break e;case 4:fr=te.stateNode.containerInfo,za=!0;break e}te=te.return}if(fr===null)throw Error(n(160));iE(k,M,_),fr=null,za=!1;var ie=_.alternate;ie!==null&&(ie.return=null),_.return=null}catch(be){Bn(_,u,be)}}if(u.subtreeFlags&12854)for(u=u.child;u!==null;)lE(u,l),u=u.sibling}function lE(l,u){var v=l.alternate,w=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(qa(u,l),ms(l),w&4){try{td(3,l,l.return),Dp(3,l)}catch(dt){Bn(l,l.return,dt)}try{td(5,l,l.return)}catch(dt){Bn(l,l.return,dt)}}break;case 1:qa(u,l),ms(l),w&512&&v!==null&&Xl(v,v.return);break;case 5:if(qa(u,l),ms(l),w&512&&v!==null&&Xl(v,v.return),l.flags&32){var _=l.stateNode;try{Fe(_,"")}catch(dt){Bn(l,l.return,dt)}}if(w&4&&(_=l.stateNode,_!=null)){var k=l.memoizedProps,M=v!==null?v.memoizedProps:k,te=l.type,ie=l.updateQueue;if(l.updateQueue=null,ie!==null)try{te==="input"&&k.type==="radio"&&k.name!=null&&L(_,k),xt(te,M);var be=xt(te,k);for(M=0;M<ie.length;M+=2){var Oe=ie[M],Ie=ie[M+1];Oe==="style"?ye(_,Ie):Oe==="dangerouslySetInnerHTML"?Xe(_,Ie):Oe==="children"?Fe(_,Ie):N(_,Oe,Ie,be)}switch(te){case"input":oe(_,k);break;case"textarea":zt(_,k);break;case"select":var ke=_._wrapperState.wasMultiple;_._wrapperState.wasMultiple=!!k.multiple;var Je=k.value;Je!=null?lt(_,!!k.multiple,Je,!1):ke!==!!k.multiple&&(k.defaultValue!=null?lt(_,!!k.multiple,k.defaultValue,!0):lt(_,!!k.multiple,k.multiple?[]:"",!1))}_[Wu]=k}catch(dt){Bn(l,l.return,dt)}}break;case 6:if(qa(u,l),ms(l),w&4){if(l.stateNode===null)throw Error(n(162));_=l.stateNode,k=l.memoizedProps;try{_.nodeValue=k}catch(dt){Bn(l,l.return,dt)}}break;case 3:if(qa(u,l),ms(l),w&4&&v!==null&&v.memoizedState.isDehydrated)try{Ru(u.containerInfo)}catch(dt){Bn(l,l.return,dt)}break;case 4:qa(u,l),ms(l);break;case 13:qa(u,l),ms(l),_=l.child,_.flags&8192&&(k=_.memoizedState!==null,_.stateNode.isHidden=k,!k||_.alternate!==null&&_.alternate.memoizedState!==null||(Jx=Ae())),w&4&&oE(l);break;case 22:if(Oe=v!==null&&v.memoizedState!==null,l.mode&1?(yr=(be=yr)||Oe,qa(u,l),yr=be):qa(u,l),ms(l),w&8192){if(be=l.memoizedState!==null,(l.stateNode.isHidden=be)&&!Oe&&(l.mode&1)!==0)for(tt=l,Oe=l.child;Oe!==null;){for(Ie=tt=Oe;tt!==null;){switch(ke=tt,Je=ke.child,ke.tag){case 0:case 11:case 14:case 15:td(4,ke,ke.return);break;case 1:Xl(ke,ke.return);var it=ke.stateNode;if(typeof it.componentWillUnmount=="function"){w=ke,v=ke.return;try{u=w,it.props=u.memoizedProps,it.state=u.memoizedState,it.componentWillUnmount()}catch(dt){Bn(w,v,dt)}}break;case 5:Xl(ke,ke.return);break;case 22:if(ke.memoizedState!==null){dE(Ie);continue}}Je!==null?(Je.return=ke,tt=Je):dE(Ie)}Oe=Oe.sibling}e:for(Oe=null,Ie=l;;){if(Ie.tag===5){if(Oe===null){Oe=Ie;try{_=Ie.stateNode,be?(k=_.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none"):(te=Ie.stateNode,ie=Ie.memoizedProps.style,M=ie!=null&&ie.hasOwnProperty("display")?ie.display:null,te.style.display=Ut("display",M))}catch(dt){Bn(l,l.return,dt)}}}else if(Ie.tag===6){if(Oe===null)try{Ie.stateNode.nodeValue=be?"":Ie.memoizedProps}catch(dt){Bn(l,l.return,dt)}}else if((Ie.tag!==22&&Ie.tag!==23||Ie.memoizedState===null||Ie===l)&&Ie.child!==null){Ie.child.return=Ie,Ie=Ie.child;continue}if(Ie===l)break e;for(;Ie.sibling===null;){if(Ie.return===null||Ie.return===l)break e;Oe===Ie&&(Oe=null),Ie=Ie.return}Oe===Ie&&(Oe=null),Ie.sibling.return=Ie.return,Ie=Ie.sibling}}break;case 19:qa(u,l),ms(l),w&4&&oE(l);break;case 21:break;default:qa(u,l),ms(l)}}function ms(l){var u=l.flags;if(u&2){try{e:{for(var v=l.return;v!==null;){if(aE(v)){var w=v;break e}v=v.return}throw Error(n(160))}switch(w.tag){case 5:var _=w.stateNode;w.flags&32&&(Fe(_,""),w.flags&=-33);var k=sE(l);Yx(l,k,_);break;case 3:case 4:var M=w.stateNode.containerInfo,te=sE(l);Gx(l,te,M);break;default:throw Error(n(161))}}catch(ie){Bn(l,l.return,ie)}l.flags&=-3}u&4096&&(l.flags&=-4097)}function Xq(l,u,v){tt=l,cE(l)}function cE(l,u,v){for(var w=(l.mode&1)!==0;tt!==null;){var _=tt,k=_.child;if(_.tag===22&&w){var M=_.memoizedState!==null||$p;if(!M){var te=_.alternate,ie=te!==null&&te.memoizedState!==null||yr;te=$p;var be=yr;if($p=M,(yr=ie)&&!be)for(tt=_;tt!==null;)M=tt,ie=M.child,M.tag===22&&M.memoizedState!==null?fE(_):ie!==null?(ie.return=M,tt=ie):fE(_);for(;k!==null;)tt=k,cE(k),k=k.sibling;tt=_,$p=te,yr=be}uE(l)}else(_.subtreeFlags&8772)!==0&&k!==null?(k.return=_,tt=k):uE(l)}}function uE(l){for(;tt!==null;){var u=tt;if((u.flags&8772)!==0){var v=u.alternate;try{if((u.flags&8772)!==0)switch(u.tag){case 0:case 11:case 15:yr||Dp(5,u);break;case 1:var w=u.stateNode;if(u.flags&4&&!yr)if(v===null)w.componentDidMount();else{var _=u.elementType===u.type?v.memoizedProps:Ba(u.type,v.memoizedProps);w.componentDidUpdate(_,v.memoizedState,w.__reactInternalSnapshotBeforeUpdate)}var k=u.updateQueue;k!==null&&dA(u,k,w);break;case 3:var M=u.updateQueue;if(M!==null){if(v=null,u.child!==null)switch(u.child.tag){case 5:v=u.child.stateNode;break;case 1:v=u.child.stateNode}dA(u,M,v)}break;case 5:var te=u.stateNode;if(v===null&&u.flags&4){v=te;var ie=u.memoizedProps;switch(u.type){case"button":case"input":case"select":case"textarea":ie.autoFocus&&v.focus();break;case"img":ie.src&&(v.src=ie.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(u.memoizedState===null){var be=u.alternate;if(be!==null){var Oe=be.memoizedState;if(Oe!==null){var Ie=Oe.dehydrated;Ie!==null&&Ru(Ie)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}yr||u.flags&512&&Kx(u)}catch(ke){Bn(u,u.return,ke)}}if(u===l){tt=null;break}if(v=u.sibling,v!==null){v.return=u.return,tt=v;break}tt=u.return}}function dE(l){for(;tt!==null;){var u=tt;if(u===l){tt=null;break}var v=u.sibling;if(v!==null){v.return=u.return,tt=v;break}tt=u.return}}function fE(l){for(;tt!==null;){var u=tt;try{switch(u.tag){case 0:case 11:case 15:var v=u.return;try{Dp(4,u)}catch(ie){Bn(u,v,ie)}break;case 1:var w=u.stateNode;if(typeof w.componentDidMount=="function"){var _=u.return;try{w.componentDidMount()}catch(ie){Bn(u,_,ie)}}var k=u.return;try{Kx(u)}catch(ie){Bn(u,k,ie)}break;case 5:var M=u.return;try{Kx(u)}catch(ie){Bn(u,M,ie)}}}catch(ie){Bn(u,u.return,ie)}if(u===l){tt=null;break}var te=u.sibling;if(te!==null){te.return=u.return,tt=te;break}tt=u.return}}var Qq=Math.ceil,Lp=E.ReactCurrentDispatcher,Xx=E.ReactCurrentOwner,wa=E.ReactCurrentBatchConfig,en=0,or=null,Hn=null,pr=0,na=0,Ql=Ti(0),Qn=0,nd=null,Ao=0,Fp=0,Qx=0,rd=null,Dr=null,Jx=0,Jl=1/0,Ks=null,Bp=!1,Zx=null,Li=null,zp=!1,Fi=null,qp=0,ad=0,ey=null,Up=-1,Wp=0;function Sr(){return(en&6)!==0?Ae():Up!==-1?Up:Up=Ae()}function Bi(l){return(l.mode&1)===0?1:(en&2)!==0&&pr!==0?pr&-pr:Iq.transition!==null?(Wp===0&&(Wp=xn()),Wp):(l=sn,l!==0||(l=window.event,l=l===void 0?16:h_(l.type)),l)}function Ua(l,u,v,w){if(50<ad)throw ad=0,ey=null,Error(n(185));ln(l,v,w),((en&2)===0||l!==or)&&(l===or&&((en&2)===0&&(Fp|=v),Qn===4&&zi(l,pr)),Lr(l,w),v===1&&en===0&&(u.mode&1)===0&&(Jl=Ae()+500,xp&&Ii()))}function Lr(l,u){var v=l.callbackNode;Xt(l,u);var w=st(l,l===or?pr:0);if(w===0)v!==null&&yt(v),l.callbackNode=null,l.callbackPriority=0;else if(u=w&-w,l.callbackPriority!==u){if(v!=null&&yt(v),u===1)l.tag===0?Rq(hE.bind(null,l)):Z_(hE.bind(null,l)),Pq(function(){(en&6)===0&&Ii()}),v=null;else{switch(Ol(w)){case 1:v=Et;break;case 4:v=Zt;break;case 16:v=Jr;break;case 536870912:v=Eu;break;default:v=Jr}v=jE(v,pE.bind(null,l))}l.callbackPriority=u,l.callbackNode=v}}function pE(l,u){if(Up=-1,Wp=0,(en&6)!==0)throw Error(n(327));var v=l.callbackNode;if(Zl()&&l.callbackNode!==v)return null;var w=st(l,l===or?pr:0);if(w===0)return null;if((w&30)!==0||(w&l.expiredLanes)!==0||u)u=Vp(l,w);else{u=w;var _=en;en|=2;var k=vE();(or!==l||pr!==u)&&(Ks=null,Jl=Ae()+500,Po(l,u));do try{eU();break}catch(te){mE(l,te)}while(!0);xx(),Lp.current=k,en=_,Hn!==null?u=0:(or=null,pr=0,u=Qn)}if(u!==0){if(u===2&&(_=Rt(l),_!==0&&(w=_,u=ty(l,_))),u===1)throw v=nd,Po(l,0),zi(l,w),Lr(l,Ae()),v;if(u===6)zi(l,w);else{if(_=l.current.alternate,(w&30)===0&&!Jq(_)&&(u=Vp(l,w),u===2&&(k=Rt(l),k!==0&&(w=k,u=ty(l,k))),u===1))throw v=nd,Po(l,0),zi(l,w),Lr(l,Ae()),v;switch(l.finishedWork=_,l.finishedLanes=w,u){case 0:case 1:throw Error(n(345));case 2:ko(l,Dr,Ks);break;case 3:if(zi(l,w),(w&130023424)===w&&(u=Jx+500-Ae(),10<u)){if(st(l,0)!==0)break;if(_=l.suspendedLanes,(_&w)!==w){Sr(),l.pingedLanes|=l.suspendedLanes&_;break}l.timeoutHandle=ox(ko.bind(null,l,Dr,Ks),u);break}ko(l,Dr,Ks);break;case 4:if(zi(l,w),(w&4194240)===w)break;for(u=l.eventTimes,_=-1;0<w;){var M=31-Rr(w);k=1<<M,M=u[M],M>_&&(_=M),w&=~k}if(w=_,w=Ae()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*Qq(w/1960))-w,10<w){l.timeoutHandle=ox(ko.bind(null,l,Dr,Ks),w);break}ko(l,Dr,Ks);break;case 5:ko(l,Dr,Ks);break;default:throw Error(n(329))}}}return Lr(l,Ae()),l.callbackNode===v?pE.bind(null,l):null}function ty(l,u){var v=rd;return l.current.memoizedState.isDehydrated&&(Po(l,u).flags|=256),l=Vp(l,u),l!==2&&(u=Dr,Dr=v,u!==null&&ny(u)),l}function ny(l){Dr===null?Dr=l:Dr.push.apply(Dr,l)}function Jq(l){for(var u=l;;){if(u.flags&16384){var v=u.updateQueue;if(v!==null&&(v=v.stores,v!==null))for(var w=0;w<v.length;w++){var _=v[w],k=_.getSnapshot;_=_.value;try{if(!La(k(),_))return!1}catch{return!1}}}if(v=u.child,u.subtreeFlags&16384&&v!==null)v.return=u,u=v;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 zi(l,u){for(u&=~Qx,u&=~Fp,l.suspendedLanes|=u,l.pingedLanes&=~u,l=l.expirationTimes;0<u;){var v=31-Rr(u),w=1<<v;l[v]=-1,u&=~w}}function hE(l){if((en&6)!==0)throw Error(n(327));Zl();var u=st(l,0);if((u&1)===0)return Lr(l,Ae()),null;var v=Vp(l,u);if(l.tag!==0&&v===2){var w=Rt(l);w!==0&&(u=w,v=ty(l,w))}if(v===1)throw v=nd,Po(l,0),zi(l,u),Lr(l,Ae()),v;if(v===6)throw Error(n(345));return l.finishedWork=l.current.alternate,l.finishedLanes=u,ko(l,Dr,Ks),Lr(l,Ae()),null}function ry(l,u){var v=en;en|=1;try{return l(u)}finally{en=v,en===0&&(Jl=Ae()+500,xp&&Ii())}}function Eo(l){Fi!==null&&Fi.tag===0&&(en&6)===0&&Zl();var u=en;en|=1;var v=wa.transition,w=sn;try{if(wa.transition=null,sn=1,l)return l()}finally{sn=w,wa.transition=v,en=u,(en&6)===0&&Ii()}}function ay(){na=Ql.current,_n(Ql)}function Po(l,u){l.finishedWork=null,l.finishedLanes=0;var v=l.timeoutHandle;if(v!==-1&&(l.timeoutHandle=-1,Eq(v)),Hn!==null)for(v=Hn.return;v!==null;){var w=v;switch(px(w),w.tag){case 1:w=w.type.childContextTypes,w!=null&&vp();break;case 3:Gl(),_n(Ir),_n(vr),_x();break;case 5:Nx(w);break;case 4:Gl();break;case 13:_n(Mn);break;case 19:_n(Mn);break;case 10:yx(w.type._context);break;case 22:case 23:ay()}v=v.return}if(or=l,Hn=l=qi(l.current,null),pr=na=u,Qn=0,nd=null,Qx=Fp=Ao=0,Dr=rd=null,No!==null){for(u=0;u<No.length;u++)if(v=No[u],w=v.interleaved,w!==null){v.interleaved=null;var _=w.next,k=v.pending;if(k!==null){var M=k.next;k.next=_,w.next=M}v.pending=w}No=null}return l}function mE(l,u){do{var v=Hn;try{if(xx(),Ep.current=Tp,Pp){for(var w=$n.memoizedState;w!==null;){var _=w.queue;_!==null&&(_.pending=null),w=w.next}Pp=!1}if(_o=0,ir=Xn=$n=null,Xu=!1,Qu=0,Xx.current=null,v===null||v.return===null){Qn=1,nd=u,Hn=null;break}e:{var k=l,M=v.return,te=v,ie=u;if(u=pr,te.flags|=32768,ie!==null&&typeof ie=="object"&&typeof ie.then=="function"){var be=ie,Oe=te,Ie=Oe.tag;if((Oe.mode&1)===0&&(Ie===0||Ie===11||Ie===15)){var ke=Oe.alternate;ke?(Oe.updateQueue=ke.updateQueue,Oe.memoizedState=ke.memoizedState,Oe.lanes=ke.lanes):(Oe.updateQueue=null,Oe.memoizedState=null)}var Je=BA(M);if(Je!==null){Je.flags&=-257,zA(Je,M,te,k,u),Je.mode&1&&FA(k,be,u),u=Je,ie=be;var it=u.updateQueue;if(it===null){var dt=new Set;dt.add(ie),u.updateQueue=dt}else it.add(ie);break e}else{if((u&1)===0){FA(k,be,u),sy();break e}ie=Error(n(426))}}else if(Tn&&te.mode&1){var Wn=BA(M);if(Wn!==null){(Wn.flags&65536)===0&&(Wn.flags|=256),zA(Wn,M,te,k,u),vx(Yl(ie,te));break e}}k=ie=Yl(ie,te),Qn!==4&&(Qn=2),rd===null?rd=[k]:rd.push(k),k=M;do{switch(k.tag){case 3:k.flags|=65536,u&=-u,k.lanes|=u;var me=DA(k,ie,u);uA(k,me);break e;case 1:te=ie;var ce=k.type,xe=k.stateNode;if((k.flags&128)===0&&(typeof ce.getDerivedStateFromError=="function"||xe!==null&&typeof xe.componentDidCatch=="function"&&(Li===null||!Li.has(xe)))){k.flags|=65536,u&=-u,k.lanes|=u;var Le=LA(k,te,u);uA(k,Le);break e}}k=k.return}while(k!==null)}xE(v)}catch(ft){u=ft,Hn===v&&v!==null&&(Hn=v=v.return);continue}break}while(!0)}function vE(){var l=Lp.current;return Lp.current=Tp,l===null?Tp:l}function sy(){(Qn===0||Qn===3||Qn===2)&&(Qn=4),or===null||(Ao&268435455)===0&&(Fp&268435455)===0||zi(or,pr)}function Vp(l,u){var v=en;en|=2;var w=vE();(or!==l||pr!==u)&&(Ks=null,Po(l,u));do try{Zq();break}catch(_){mE(l,_)}while(!0);if(xx(),en=v,Lp.current=w,Hn!==null)throw Error(n(261));return or=null,pr=0,Qn}function Zq(){for(;Hn!==null;)gE(Hn)}function eU(){for(;Hn!==null&&!Un();)gE(Hn)}function gE(l){var u=wE(l.alternate,l,na);l.memoizedProps=l.pendingProps,u===null?xE(l):Hn=u,Xx.current=null}function xE(l){var u=l;do{var v=u.alternate;if(l=u.return,(u.flags&32768)===0){if(v=Hq(v,u,na),v!==null){Hn=v;return}}else{if(v=Kq(v,u),v!==null){v.flags&=32767,Hn=v;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{Qn=6,Hn=null;return}}if(u=u.sibling,u!==null){Hn=u;return}Hn=u=l}while(u!==null);Qn===0&&(Qn=5)}function ko(l,u,v){var w=sn,_=wa.transition;try{wa.transition=null,sn=1,tU(l,u,v,w)}finally{wa.transition=_,sn=w}return null}function tU(l,u,v,w){do Zl();while(Fi!==null);if((en&6)!==0)throw Error(n(327));v=l.finishedWork;var _=l.finishedLanes;if(v===null)return null;if(l.finishedWork=null,l.finishedLanes=0,v===l.current)throw Error(n(177));l.callbackNode=null,l.callbackPriority=0;var k=v.lanes|v.childLanes;if(yo(l,k),l===or&&(Hn=or=null,pr=0),(v.subtreeFlags&2064)===0&&(v.flags&2064)===0||zp||(zp=!0,jE(Jr,function(){return Zl(),null})),k=(v.flags&15990)!==0,(v.subtreeFlags&15990)!==0||k){k=wa.transition,wa.transition=null;var M=sn;sn=1;var te=en;en|=4,Xx.current=null,Yq(l,v),lE(v,l),wq(sx),np=!!ax,sx=ax=null,l.current=v,Xq(v),In(),en=te,sn=M,wa.transition=k}else l.current=v;if(zp&&(zp=!1,Fi=l,qp=_),k=l.pendingLanes,k===0&&(Li=null),Rg(v.stateNode),Lr(l,Ae()),u!==null)for(w=l.onRecoverableError,v=0;v<u.length;v++)_=u[v],w(_.value,{componentStack:_.stack,digest:_.digest});if(Bp)throw Bp=!1,l=Zx,Zx=null,l;return(qp&1)!==0&&l.tag!==0&&Zl(),k=l.pendingLanes,(k&1)!==0?l===ey?ad++:(ad=0,ey=l):ad=0,Ii(),null}function Zl(){if(Fi!==null){var l=Ol(qp),u=wa.transition,v=sn;try{if(wa.transition=null,sn=16>l?16:l,Fi===null)var w=!1;else{if(l=Fi,Fi=null,qp=0,(en&6)!==0)throw Error(n(331));var _=en;for(en|=4,tt=l.current;tt!==null;){var k=tt,M=k.child;if((tt.flags&16)!==0){var te=k.deletions;if(te!==null){for(var ie=0;ie<te.length;ie++){var be=te[ie];for(tt=be;tt!==null;){var Oe=tt;switch(Oe.tag){case 0:case 11:case 15:td(8,Oe,k)}var Ie=Oe.child;if(Ie!==null)Ie.return=Oe,tt=Ie;else for(;tt!==null;){Oe=tt;var ke=Oe.sibling,Je=Oe.return;if(rE(Oe),Oe===be){tt=null;break}if(ke!==null){ke.return=Je,tt=ke;break}tt=Je}}}var it=k.alternate;if(it!==null){var dt=it.child;if(dt!==null){it.child=null;do{var Wn=dt.sibling;dt.sibling=null,dt=Wn}while(dt!==null)}}tt=k}}if((k.subtreeFlags&2064)!==0&&M!==null)M.return=k,tt=M;else e:for(;tt!==null;){if(k=tt,(k.flags&2048)!==0)switch(k.tag){case 0:case 11:case 15:td(9,k,k.return)}var me=k.sibling;if(me!==null){me.return=k.return,tt=me;break e}tt=k.return}}var ce=l.current;for(tt=ce;tt!==null;){M=tt;var xe=M.child;if((M.subtreeFlags&2064)!==0&&xe!==null)xe.return=M,tt=xe;else e:for(M=ce;tt!==null;){if(te=tt,(te.flags&2048)!==0)try{switch(te.tag){case 0:case 11:case 15:Dp(9,te)}}catch(ft){Bn(te,te.return,ft)}if(te===M){tt=null;break e}var Le=te.sibling;if(Le!==null){Le.return=te.return,tt=Le;break e}tt=te.return}}if(en=_,Ii(),va&&typeof va.onPostCommitFiberRoot=="function")try{va.onPostCommitFiberRoot(El,l)}catch{}w=!0}return w}finally{sn=v,wa.transition=u}}return!1}function yE(l,u,v){u=Yl(v,u),u=DA(l,u,1),l=$i(l,u,1),u=Sr(),l!==null&&(ln(l,1,u),Lr(l,u))}function Bn(l,u,v){if(l.tag===3)yE(l,l,v);else for(;u!==null;){if(u.tag===3){yE(u,l,v);break}else if(u.tag===1){var w=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(Li===null||!Li.has(w))){l=Yl(v,l),l=LA(u,l,1),u=$i(u,l,1),l=Sr(),u!==null&&(ln(u,1,l),Lr(u,l));break}}u=u.return}}function nU(l,u,v){var w=l.pingCache;w!==null&&w.delete(u),u=Sr(),l.pingedLanes|=l.suspendedLanes&v,or===l&&(pr&v)===v&&(Qn===4||Qn===3&&(pr&130023424)===pr&&500>Ae()-Jx?Po(l,0):Qx|=v),Lr(l,u)}function bE(l,u){u===0&&((l.mode&1)===0?u=1:(u=Z,Z<<=1,(Z&130023424)===0&&(Z=4194304)));var v=Sr();l=Ws(l,u),l!==null&&(ln(l,u,v),Lr(l,v))}function rU(l){var u=l.memoizedState,v=0;u!==null&&(v=u.retryLane),bE(l,v)}function aU(l,u){var v=0;switch(l.tag){case 13:var w=l.stateNode,_=l.memoizedState;_!==null&&(v=_.retryLane);break;case 19:w=l.stateNode;break;default:throw Error(n(314))}w!==null&&w.delete(u),bE(l,v)}var wE;wE=function(l,u,v){if(l!==null)if(l.memoizedProps!==u.pendingProps||Ir.current)$r=!0;else{if((l.lanes&v)===0&&(u.flags&128)===0)return $r=!1,Vq(l,u,v);$r=(l.flags&131072)!==0}else $r=!1,Tn&&(u.flags&1048576)!==0&&eA(u,bp,u.index);switch(u.lanes=0,u.tag){case 2:var w=u.type;Mp(l,u),l=u.pendingProps;var _=zl(u,vr.current);Kl(u,v),_=Px(null,u,w,l,_,v);var k=kx();return u.flags|=1,typeof _=="object"&&_!==null&&typeof _.render=="function"&&_.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,Mr(w)?(k=!0,gp(u)):k=!1,u.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,jx(u),_.updater=Rp,u.stateNode=_,_._reactInternals=u,$x(u,w,l,v),u=Bx(null,u,w,!0,k,v)):(u.tag=0,Tn&&k&&fx(u),jr(null,u,_,v),u=u.child),u;case 16:w=u.elementType;e:{switch(Mp(l,u),l=u.pendingProps,_=w._init,w=_(w._payload),u.type=w,_=u.tag=iU(w),l=Ba(w,l),_){case 0:u=Fx(null,u,w,l,v);break e;case 1:u=KA(null,u,w,l,v);break e;case 11:u=qA(null,u,w,l,v);break e;case 14:u=UA(null,u,w,Ba(w.type,l),v);break e}throw Error(n(306,w,""))}return u;case 0:return w=u.type,_=u.pendingProps,_=u.elementType===w?_:Ba(w,_),Fx(l,u,w,_,v);case 1:return w=u.type,_=u.pendingProps,_=u.elementType===w?_:Ba(w,_),KA(l,u,w,_,v);case 3:e:{if(GA(u),l===null)throw Error(n(387));w=u.pendingProps,k=u.memoizedState,_=k.element,cA(l,u),_p(u,w,null,v);var M=u.memoizedState;if(w=M.element,k.isDehydrated)if(k={element:w,isDehydrated:!1,cache:M.cache,pendingSuspenseBoundaries:M.pendingSuspenseBoundaries,transitions:M.transitions},u.updateQueue.baseState=k,u.memoizedState=k,u.flags&256){_=Yl(Error(n(423)),u),u=YA(l,u,w,v,_);break e}else if(w!==_){_=Yl(Error(n(424)),u),u=YA(l,u,w,v,_);break e}else for(ta=Oi(u.stateNode.containerInfo.firstChild),ea=u,Tn=!0,Fa=null,v=oA(u,null,w,v),u.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling;else{if(Wl(),w===_){u=Hs(l,u,v);break e}jr(l,u,w,v)}u=u.child}return u;case 5:return fA(u),l===null&&mx(u),w=u.type,_=u.pendingProps,k=l!==null?l.memoizedProps:null,M=_.children,ix(w,_)?M=null:k!==null&&ix(w,k)&&(u.flags|=32),HA(l,u),jr(l,u,M,v),u.child;case 6:return l===null&&mx(u),null;case 13:return XA(l,u,v);case 4:return Sx(u,u.stateNode.containerInfo),w=u.pendingProps,l===null?u.child=Vl(u,null,w,v):jr(l,u,w,v),u.child;case 11:return w=u.type,_=u.pendingProps,_=u.elementType===w?_:Ba(w,_),qA(l,u,w,_,v);case 7:return jr(l,u,u.pendingProps,v),u.child;case 8:return jr(l,u,u.pendingProps.children,v),u.child;case 12:return jr(l,u,u.pendingProps.children,v),u.child;case 10:e:{if(w=u.type._context,_=u.pendingProps,k=u.memoizedProps,M=_.value,yn(Sp,w._currentValue),w._currentValue=M,k!==null)if(La(k.value,M)){if(k.children===_.children&&!Ir.current){u=Hs(l,u,v);break e}}else for(k=u.child,k!==null&&(k.return=u);k!==null;){var te=k.dependencies;if(te!==null){M=k.child;for(var ie=te.firstContext;ie!==null;){if(ie.context===w){if(k.tag===1){ie=Vs(-1,v&-v),ie.tag=2;var be=k.updateQueue;if(be!==null){be=be.shared;var Oe=be.pending;Oe===null?ie.next=ie:(ie.next=Oe.next,Oe.next=ie),be.pending=ie}}k.lanes|=v,ie=k.alternate,ie!==null&&(ie.lanes|=v),bx(k.return,v,u),te.lanes|=v;break}ie=ie.next}}else if(k.tag===10)M=k.type===u.type?null:k.child;else if(k.tag===18){if(M=k.return,M===null)throw Error(n(341));M.lanes|=v,te=M.alternate,te!==null&&(te.lanes|=v),bx(M,v,u),M=k.sibling}else M=k.child;if(M!==null)M.return=k;else for(M=k;M!==null;){if(M===u){M=null;break}if(k=M.sibling,k!==null){k.return=M.return,M=k;break}M=M.return}k=M}jr(l,u,_.children,v),u=u.child}return u;case 9:return _=u.type,w=u.pendingProps.children,Kl(u,v),_=ya(_),w=w(_),u.flags|=1,jr(l,u,w,v),u.child;case 14:return w=u.type,_=Ba(w,u.pendingProps),_=Ba(w.type,_),UA(l,u,w,_,v);case 15:return WA(l,u,u.type,u.pendingProps,v);case 17:return w=u.type,_=u.pendingProps,_=u.elementType===w?_:Ba(w,_),Mp(l,u),u.tag=1,Mr(w)?(l=!0,gp(u)):l=!1,Kl(u,v),MA(u,w,_),$x(u,w,_,v),Bx(null,u,w,!0,l,v);case 19:return JA(l,u,v);case 22:return VA(l,u,v)}throw Error(n(156,u.tag))};function jE(l,u){return Vt(l,u)}function sU(l,u,v,w){this.tag=l,this.key=v,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 ja(l,u,v,w){return new sU(l,u,v,w)}function iy(l){return l=l.prototype,!(!l||!l.isReactComponent)}function iU(l){if(typeof l=="function")return iy(l)?1:0;if(l!=null){if(l=l.$$typeof,l===F)return 11;if(l===R)return 14}return 2}function qi(l,u){var v=l.alternate;return v===null?(v=ja(l.tag,u,l.key,l.mode),v.elementType=l.elementType,v.type=l.type,v.stateNode=l.stateNode,v.alternate=l,l.alternate=v):(v.pendingProps=u,v.type=l.type,v.flags=0,v.subtreeFlags=0,v.deletions=null),v.flags=l.flags&14680064,v.childLanes=l.childLanes,v.lanes=l.lanes,v.child=l.child,v.memoizedProps=l.memoizedProps,v.memoizedState=l.memoizedState,v.updateQueue=l.updateQueue,u=l.dependencies,v.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},v.sibling=l.sibling,v.index=l.index,v.ref=l.ref,v}function Hp(l,u,v,w,_,k){var M=2;if(w=l,typeof l=="function")iy(l)&&(M=1);else if(typeof l=="string")M=5;else e:switch(l){case O:return Oo(v.children,_,k,u);case T:M=8,_|=8;break;case $:return l=ja(12,v,u,_|2),l.elementType=$,l.lanes=k,l;case H:return l=ja(13,v,u,_),l.elementType=H,l.lanes=k,l;case U:return l=ja(19,v,u,_),l.elementType=U,l.lanes=k,l;case X:return Kp(v,_,k,u);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case z:M=10;break e;case q:M=9;break e;case F:M=11;break e;case R:M=14;break e;case W:M=16,w=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return u=ja(M,v,u,_),u.elementType=l,u.type=w,u.lanes=k,u}function Oo(l,u,v,w){return l=ja(7,l,w,u),l.lanes=v,l}function Kp(l,u,v,w){return l=ja(22,l,w,u),l.elementType=X,l.lanes=v,l.stateNode={isHidden:!1},l}function oy(l,u,v){return l=ja(6,l,null,u),l.lanes=v,l}function ly(l,u,v){return u=ja(4,l.children!==null?l.children:[],l.key,u),u.lanes=v,u.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},u}function oU(l,u,v,w,_){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=sr(0),this.expirationTimes=sr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=sr(0),this.identifierPrefix=w,this.onRecoverableError=_,this.mutableSourceEagerHydrationData=null}function cy(l,u,v,w,_,k,M,te,ie){return l=new oU(l,u,v,te,ie),u===1?(u=1,k===!0&&(u|=8)):u=0,k=ja(3,null,null,u),l.current=k,k.stateNode=l,k.memoizedState={element:w,isDehydrated:v,cache:null,transitions:null,pendingSuspenseBoundaries:null},jx(k),l}function lU(l,u,v){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:P,key:w==null?null:""+w,children:l,containerInfo:u,implementation:v}}function SE(l){if(!l)return Ri;l=l._reactInternals;e:{if(Da(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(Mr(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break e}}u=u.return}while(u!==null);throw Error(n(171))}if(l.tag===1){var v=l.type;if(Mr(v))return Q_(l,v,u)}return u}function NE(l,u,v,w,_,k,M,te,ie){return l=cy(v,w,!0,l,_,k,M,te,ie),l.context=SE(null),v=l.current,w=Sr(),_=Bi(v),k=Vs(w,_),k.callback=u??null,$i(v,k,_),l.current.lanes=_,ln(l,_,w),Lr(l,w),l}function Gp(l,u,v,w){var _=u.current,k=Sr(),M=Bi(_);return v=SE(v),u.context===null?u.context=v:u.pendingContext=v,u=Vs(k,M),u.payload={element:l},w=w===void 0?null:w,w!==null&&(u.callback=w),l=$i(_,u,M),l!==null&&(Ua(l,_,M,k),Cp(l,_,M)),M}function Yp(l){return l=l.current,l.child?(l.child.tag===5,l.child.stateNode):null}function CE(l,u){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var v=l.retryLane;l.retryLane=v!==0&&v<u?v:u}}function uy(l,u){CE(l,u),(l=l.alternate)&&CE(l,u)}function cU(){return null}var _E=typeof reportError=="function"?reportError:function(l){console.error(l)};function dy(l){this._internalRoot=l}Xp.prototype.render=dy.prototype.render=function(l){var u=this._internalRoot;if(u===null)throw Error(n(409));Gp(l,u,null,null)},Xp.prototype.unmount=dy.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var u=l.containerInfo;Eo(function(){Gp(null,l,null,null)}),u[Bs]=null}};function Xp(l){this._internalRoot=l}Xp.prototype.unstable_scheduleHydration=function(l){if(l){var u=c_();l={blockedOn:null,target:l,priority:u};for(var v=0;v<Ei.length&&u!==0&&u<Ei[v].priority;v++);Ei.splice(v,0,l),v===0&&f_(l)}};function fy(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function Qp(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function AE(){}function uU(l,u,v,w,_){if(_){if(typeof w=="function"){var k=w;w=function(){var be=Yp(M);k.call(be)}}var M=NE(u,w,l,0,null,!1,!1,"",AE);return l._reactRootContainer=M,l[Bs]=M.current,qu(l.nodeType===8?l.parentNode:l),Eo(),M}for(;_=l.lastChild;)l.removeChild(_);if(typeof w=="function"){var te=w;w=function(){var be=Yp(ie);te.call(be)}}var ie=cy(l,0,!1,null,null,!1,!1,"",AE);return l._reactRootContainer=ie,l[Bs]=ie.current,qu(l.nodeType===8?l.parentNode:l),Eo(function(){Gp(u,ie,v,w)}),ie}function Jp(l,u,v,w,_){var k=v._reactRootContainer;if(k){var M=k;if(typeof _=="function"){var te=_;_=function(){var ie=Yp(M);te.call(ie)}}Gp(u,M,l,_)}else M=uU(v,u,l,_,w);return Yp(M)}Zf=function(l){switch(l.tag){case 3:var u=l.stateNode;if(u.current.memoizedState.isDehydrated){var v=we(u.pendingLanes);v!==0&&(kl(u,v|1),Lr(u,Ae()),(en&6)===0&&(Jl=Ae()+500,Ii()))}break;case 13:Eo(function(){var w=Ws(l,1);if(w!==null){var _=Sr();Ua(w,l,1,_)}}),uy(l,1)}},Dg=function(l){if(l.tag===13){var u=Ws(l,134217728);if(u!==null){var v=Sr();Ua(u,l,134217728,v)}uy(l,134217728)}},l_=function(l){if(l.tag===13){var u=Bi(l),v=Ws(l,u);if(v!==null){var w=Sr();Ua(v,l,u,w)}uy(l,u)}},c_=function(){return sn},u_=function(l,u){var v=sn;try{return sn=l,u()}finally{sn=v}},Ze=function(l,u,v){switch(u){case"input":if(oe(l,v),u=v.name,v.type==="radio"&&u!=null){for(v=l;v.parentNode;)v=v.parentNode;for(v=v.querySelectorAll("input[name="+JSON.stringify(""+u)+'][type="radio"]'),u=0;u<v.length;u++){var w=v[u];if(w!==l&&w.form===l.form){var _=mp(w);if(!_)throw Error(n(90));ae(w),oe(w,_)}}}break;case"textarea":zt(l,v);break;case"select":u=v.value,u!=null&<(l,!!v.multiple,u,!1)}},It=ry,Lt=Eo;var dU={usingClientEntryPoint:!1,Events:[Vu,Fl,mp,Pn,mt,ry]},sd={findFiberByHostInstance:bo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},fU={bundleType:sd.bundleType,version:sd.version,rendererPackageName:sd.rendererPackageName,rendererConfig:sd.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:E.ReactCurrentDispatcher,findHostInstanceByFiber:function(l){return l=He(l),l===null?null:l.stateNode},findFiberByHostInstance:sd.findFiberByHostInstance||cU,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 Zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zp.isDisabled&&Zp.supportsFiber)try{El=Zp.inject(fU),va=Zp}catch{}}return Fr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=dU,Fr.createPortal=function(l,u){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!fy(u))throw Error(n(200));return lU(l,u,null,v)},Fr.createRoot=function(l,u){if(!fy(l))throw Error(n(299));var v=!1,w="",_=_E;return u!=null&&(u.unstable_strictMode===!0&&(v=!0),u.identifierPrefix!==void 0&&(w=u.identifierPrefix),u.onRecoverableError!==void 0&&(_=u.onRecoverableError)),u=cy(l,1,!1,null,null,v,!1,w,_),l[Bs]=u.current,qu(l.nodeType===8?l.parentNode:l),new dy(u)},Fr.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=He(u),l=l===null?null:l.stateNode,l},Fr.flushSync=function(l){return Eo(l)},Fr.hydrate=function(l,u,v){if(!Qp(u))throw Error(n(200));return Jp(null,l,u,!0,v)},Fr.hydrateRoot=function(l,u,v){if(!fy(l))throw Error(n(405));var w=v!=null&&v.hydratedSources||null,_=!1,k="",M=_E;if(v!=null&&(v.unstable_strictMode===!0&&(_=!0),v.identifierPrefix!==void 0&&(k=v.identifierPrefix),v.onRecoverableError!==void 0&&(M=v.onRecoverableError)),u=NE(u,null,l,1,v??null,_,!1,k,M),l[Bs]=u.current,qu(l),w)for(l=0;l<w.length;l++)v=w[l],_=v._getVersion,_=_(v._source),u.mutableSourceEagerHydrationData==null?u.mutableSourceEagerHydrationData=[v,_]:u.mutableSourceEagerHydrationData.push(v,_);return new Xp(u)},Fr.render=function(l,u,v){if(!Qp(u))throw Error(n(200));return Jp(null,l,u,!1,v)},Fr.unmountComponentAtNode=function(l){if(!Qp(l))throw Error(n(40));return l._reactRootContainer?(Eo(function(){Jp(null,null,l,!1,function(){l._reactRootContainer=null,l[Bs]=null})}),!0):!1},Fr.unstable_batchedUpdates=ry,Fr.unstable_renderSubtreeIntoContainer=function(l,u,v,w){if(!Qp(v))throw Error(n(200));if(l==null||l._reactInternals===void 0)throw Error(n(38));return Jp(l,u,v,!1,w)},Fr.version="18.3.1-next-f1338f8080-20240426",Fr}var ME;function N$(){if(ME)return my.exports;ME=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(),my.exports=bU(),my.exports}var $E;function wU(){if($E)return th;$E=1;var e=N$();return th.createRoot=e.createRoot,th.hydrateRoot=e.hydrateRoot,th}var jU=wU(),m=sN();const Y=fn(m),tv=hU({__proto__:null,default:Y},[m]),SU=1,NU=1e6;let xy=0;function CU(){return xy=(xy+1)%Number.MAX_SAFE_INTEGER,xy.toString()}const yy=new Map,DE=e=>{if(yy.has(e))return;const t=setTimeout(()=>{yy.delete(e),Cd({type:"REMOVE_TOAST",toastId:e})},NU);yy.set(e,t)},_U=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,SU)};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?DE(n):e.toasts.forEach(r=>{DE(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)}}},Ah=[];let Eh={toasts:[]};function Cd(e){Eh=_U(Eh,e),Ah.forEach(t=>{t(Eh)})}function _e({...e}){const t=CU(),n=s=>Cd({type:"UPDATE_TOAST",toast:{...s,id:t}}),r=()=>Cd({type:"DISMISS_TOAST",toastId:t});return Cd({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||r()}}}),{id:t,dismiss:r,update:n}}function AU(){const[e,t]=m.useState(Eh);return m.useEffect(()=>(Ah.push(t),()=>{const n=Ah.indexOf(t);n>-1&&Ah.splice(n,1)}),[e]),{...e,toast:_e,dismiss:n=>Cd({type:"DISMISS_TOAST",toastId:n})}}var lu=N$();const C$=fn(lu);function Te(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e?.(s),n===!1||!s.defaultPrevented)return t?.(s)}}function LE(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function kr(...e){return t=>{let n=!1;const r=e.map(s=>{const i=LE(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():LE(e[s],null)}}}}function St(...e){return m.useCallback(kr(...e),e)}function EU(e,t){const n=m.createContext(t),r=i=>{const{children:o,...c}=i,d=m.useMemo(()=>c,Object.values(c));return a.jsx(n.Provider,{value:d,children:o})};r.displayName=e+"Provider";function s(i){const o=m.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,s]}function mr(e,t=[]){let n=[];function r(i,o){const c=m.createContext(o),d=n.length;n=[...n,o];const f=p=>{const{scope:x,children:g,...j}=p,b=x?.[e]?.[d]||c,y=m.useMemo(()=>j,Object.values(j));return a.jsx(b.Provider,{value:y,children:g})};f.displayName=i+"Provider";function h(p,x){const g=x?.[e]?.[d]||c,j=m.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 s=()=>{const i=n.map(o=>m.createContext(o));return function(c){const d=c?.[e]||i;return m.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return s.scopeName=e,[r,PU(s,...t)]}function PU(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((c,{useScope:d,scopeName:f})=>{const p=d(i)[`__scope${f}`];return{...c,...p}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function FE(e){const t=kU(e),n=m.forwardRef((r,s)=>{const{children:i,...o}=r,c=m.Children.toArray(i),d=c.find(TU);if(d){const f=d.props.children,h=c.map(p=>p===d?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:p);return a.jsx(t,{...o,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return a.jsx(t,{...o,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function kU(e){const t=m.forwardRef((n,r)=>{const{children:s,...i}=n;if(m.isValidElement(s)){const o=IU(s),c=RU(i,s.props);return s.type!==m.Fragment&&(c.ref=r?kr(r,o):o),m.cloneElement(s,c)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var OU=Symbol("radix.slottable");function TU(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===OU}function RU(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...c)=>{const d=i(...c);return s(...c),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function IU(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 Cf(e){const t=e+"CollectionProvider",[n,r]=mr(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=b=>{const{scope:y,children:S}=b,C=Y.useRef(null),N=Y.useRef(new Map).current;return a.jsx(s,{scope:y,itemMap:N,collectionRef:C,children:S})};o.displayName=t;const c=e+"CollectionSlot",d=FE(c),f=Y.forwardRef((b,y)=>{const{scope:S,children:C}=b,N=i(c,S),E=St(y,N.collectionRef);return a.jsx(d,{ref:E,children:C})});f.displayName=c;const h=e+"CollectionItemSlot",p="data-radix-collection-item",x=FE(h),g=Y.forwardRef((b,y)=>{const{scope:S,children:C,...N}=b,E=Y.useRef(null),A=St(y,E),P=i(h,S);return Y.useEffect(()=>(P.itemMap.set(E,{ref:E,...N}),()=>{P.itemMap.delete(E)})),a.jsx(x,{[p]:"",ref:A,children:C})});g.displayName=h;function j(b){const y=i(e+"CollectionConsumer",b);return Y.useCallback(()=>{const C=y.collectionRef.current;if(!C)return[];const N=Array.from(C.querySelectorAll(`[${p}]`));return Array.from(y.itemMap.values()).sort((P,O)=>N.indexOf(P.ref.current)-N.indexOf(O.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:f,ItemSlot:g},j,r]}function MU(e){const t=$U(e),n=m.forwardRef((r,s)=>{const{children:i,...o}=r,c=m.Children.toArray(i),d=c.find(LU);if(d){const f=d.props.children,h=c.map(p=>p===d?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:p);return a.jsx(t,{...o,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return a.jsx(t,{...o,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function $U(e){const t=m.forwardRef((n,r)=>{const{children:s,...i}=n;if(m.isValidElement(s)){const o=BU(s),c=FU(i,s.props);return s.type!==m.Fragment&&(c.ref=r?kr(r,o):o),m.cloneElement(s,c)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var DU=Symbol("radix.slottable");function LU(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===DU}function FU(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...c)=>{const d=i(...c);return s(...c),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function BU(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 zU=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ye=zU.reduce((e,t)=>{const n=MU(`Primitive.${t}`),r=m.forwardRef((s,i)=>{const{asChild:o,...c}=s,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function iN(e,t){e&&lu.flushSync(()=>e.dispatchEvent(t))}function Vn(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>t.current?.(...n),[])}function qU(e,t=globalThis?.document){const n=Vn(e);m.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var UU="DismissableLayer",Yj="dismissableLayer.update",WU="dismissableLayer.pointerDownOutside",VU="dismissableLayer.focusOutside",BE,_$=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),vl=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:c,...d}=e,f=m.useContext(_$),[h,p]=m.useState(null),x=h?.ownerDocument??globalThis?.document,[,g]=m.useState({}),j=St(t,O=>p(O)),b=Array.from(f.layers),[y]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),S=b.indexOf(y),C=h?b.indexOf(h):-1,N=f.layersWithOutsidePointerEventsDisabled.size>0,E=C>=S,A=KU(O=>{const T=O.target,$=[...f.branches].some(z=>z.contains(T));!E||$||(s?.(O),o?.(O),O.defaultPrevented||c?.())},x),P=GU(O=>{const T=O.target;[...f.branches].some(z=>z.contains(T))||(i?.(O),o?.(O),O.defaultPrevented||c?.())},x);return qU(O=>{C===f.layers.size-1&&(r?.(O),!O.defaultPrevented&&c&&(O.preventDefault(),c()))},x),m.useEffect(()=>{if(h)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(BE=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),zE(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=BE)}},[h,x,n,f]),m.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),zE())},[h,f]),m.useEffect(()=>{const O=()=>g({});return document.addEventListener(Yj,O),()=>document.removeEventListener(Yj,O)},[]),a.jsx(Ye.div,{...d,ref:j,style:{pointerEvents:N?E?"auto":"none":void 0,...e.style},onFocusCapture:Te(e.onFocusCapture,P.onFocusCapture),onBlurCapture:Te(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:Te(e.onPointerDownCapture,A.onPointerDownCapture)})});vl.displayName=UU;var HU="DismissableLayerBranch",A$=m.forwardRef((e,t)=>{const n=m.useContext(_$),r=m.useRef(null),s=St(t,r);return m.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),a.jsx(Ye.div,{...e,ref:s})});A$.displayName=HU;function KU(e,t=globalThis?.document){const n=Vn(e),r=m.useRef(!1),s=m.useRef(()=>{});return m.useEffect(()=>{const i=c=>{if(c.target&&!r.current){let d=function(){E$(WU,n,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=d,t.addEventListener("click",s.current,{once:!0})):d()}else t.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function GU(e,t=globalThis?.document){const n=Vn(e),r=m.useRef(!1);return m.useEffect(()=>{const s=i=>{i.target&&!r.current&&E$(VU,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function zE(){const e=new CustomEvent(Yj);document.dispatchEvent(e)}function E$(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?iN(s,i):s.dispatchEvent(i)}var YU=vl,XU=A$,rr=globalThis?.document?m.useLayoutEffect:()=>{},QU="Portal",gl=m.forwardRef((e,t)=>{const{container:n,...r}=e,[s,i]=m.useState(!1);rr(()=>i(!0),[]);const o=n||s&&globalThis?.document?.body;return o?C$.createPortal(a.jsx(Ye.div,{...r,ref:t}),o):null});gl.displayName=QU;function JU(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var Yn=e=>{const{present:t,children:n}=e,r=ZU(t),s=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=St(r.ref,e7(s));return typeof n=="function"||r.isPresent?m.cloneElement(s,{ref:i}):null};Yn.displayName="Presence";function ZU(e){const[t,n]=m.useState(),r=m.useRef(null),s=m.useRef(e),i=m.useRef("none"),o=e?"mounted":"unmounted",[c,d]=JU(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const f=nh(r.current);i.current=c==="mounted"?f:"none"},[c]),rr(()=>{const f=r.current,h=s.current;if(h!==e){const x=i.current,g=nh(f);e?d("MOUNT"):g==="none"||f?.display==="none"?d("UNMOUNT"):d(h&&x!==g?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,d]),rr(()=>{if(t){let f;const h=t.ownerDocument.defaultView??window,p=g=>{const b=nh(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&b&&(d("ANIMATION_END"),!s.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",f=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},x=g=>{g.target===t&&(i.current=nh(r.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{h.clearTimeout(f),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:m.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function nh(e){return e?.animationName||"none"}function e7(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var t7=tv[" useInsertionEffect ".trim().toString()]||rr;function ha({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,i,o]=n7({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:s;{const h=m.useRef(e!==void 0);m.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=m.useCallback(h=>{if(c){const p=r7(h)?h(e):h;p!==e&&o.current?.(p)}else i(h)},[c,e,i,o]);return[d,f]}function n7({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),s=m.useRef(n),i=m.useRef(t);return t7(()=>{i.current=t},[t]),m.useEffect(()=>{s.current!==n&&(i.current?.(n),s.current=n)},[n,s]),[n,r,i]}function r7(e){return typeof e=="function"}var P$=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"}),a7="VisuallyHidden",nv=m.forwardRef((e,t)=>a.jsx(Ye.span,{...e,ref:t,style:{...P$,...e.style}}));nv.displayName=a7;var s7=nv,oN="ToastProvider",[lN,i7,o7]=Cf("Toast"),[k$]=mr("Toast",[o7]),[l7,rv]=k$(oN),O$=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:o}=e,[c,d]=m.useState(null),[f,h]=m.useState(0),p=m.useRef(!1),x=m.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${oN}\`. Expected non-empty \`string\`.`),a.jsx(lN.Provider,{scope:t,children:a.jsx(l7,{scope:t,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:f,viewport:c,onViewportChange:d,onToastAdd:m.useCallback(()=>h(g=>g+1),[]),onToastRemove:m.useCallback(()=>h(g=>g-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:x,children:o})})};O$.displayName=oN;var T$="ToastViewport",c7=["F8"],Xj="toast.viewportPause",Qj="toast.viewportResume",R$=m.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=c7,label:s="Notifications ({hotkey})",...i}=e,o=rv(T$,n),c=i7(n),d=m.useRef(null),f=m.useRef(null),h=m.useRef(null),p=m.useRef(null),x=St(t,p,o.onViewportChange),g=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=o.toastCount>0;m.useEffect(()=>{const y=S=>{r.length!==0&&r.every(N=>S[N]||S.code===N)&&p.current?.focus()};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),m.useEffect(()=>{const y=d.current,S=p.current;if(j&&y&&S){const C=()=>{if(!o.isClosePausedRef.current){const P=new CustomEvent(Xj);S.dispatchEvent(P),o.isClosePausedRef.current=!0}},N=()=>{if(o.isClosePausedRef.current){const P=new CustomEvent(Qj);S.dispatchEvent(P),o.isClosePausedRef.current=!1}},E=P=>{!y.contains(P.relatedTarget)&&N()},A=()=>{y.contains(document.activeElement)||N()};return y.addEventListener("focusin",C),y.addEventListener("focusout",E),y.addEventListener("pointermove",C),y.addEventListener("pointerleave",A),window.addEventListener("blur",C),window.addEventListener("focus",N),()=>{y.removeEventListener("focusin",C),y.removeEventListener("focusout",E),y.removeEventListener("pointermove",C),y.removeEventListener("pointerleave",A),window.removeEventListener("blur",C),window.removeEventListener("focus",N)}}},[j,o.isClosePausedRef]);const b=m.useCallback(({tabbingDirection:y})=>{const C=c().map(N=>{const E=N.ref.current,A=[E,...j7(E)];return y==="forwards"?A:A.reverse()});return(y==="forwards"?C.reverse():C).flat()},[c]);return m.useEffect(()=>{const y=p.current;if(y){const S=C=>{const N=C.altKey||C.ctrlKey||C.metaKey;if(C.key==="Tab"&&!N){const A=document.activeElement,P=C.shiftKey;if(C.target===y&&P){f.current?.focus();return}const $=b({tabbingDirection:P?"backwards":"forwards"}),z=$.findIndex(q=>q===A);by($.slice(z+1))?C.preventDefault():P?f.current?.focus():h.current?.focus()}};return y.addEventListener("keydown",S),()=>y.removeEventListener("keydown",S)}},[c,b]),a.jsxs(XU,{ref:d,role:"region","aria-label":s.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:j?void 0:"none"},children:[j&&a.jsx(Jj,{ref:f,onFocusFromOutsideViewport:()=>{const y=b({tabbingDirection:"forwards"});by(y)}}),a.jsx(lN.Slot,{scope:n,children:a.jsx(Ye.ol,{tabIndex:-1,...i,ref:x})}),j&&a.jsx(Jj,{ref:h,onFocusFromOutsideViewport:()=>{const y=b({tabbingDirection:"backwards"});by(y)}})]})});R$.displayName=T$;var I$="ToastFocusProxy",Jj=m.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=e,i=rv(I$,n);return a.jsx(nv,{tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:o=>{const c=o.relatedTarget;!i.viewport?.contains(c)&&r()}})});Jj.displayName=I$;var _f="Toast",u7="toast.swipeStart",d7="toast.swipeMove",f7="toast.swipeCancel",p7="toast.swipeEnd",M$=m.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...o}=e,[c,d]=ha({prop:r,defaultProp:s??!0,onChange:i,caller:_f});return a.jsx(Yn,{present:n||c,children:a.jsx(v7,{open:c,...o,ref:t,onClose:()=>d(!1),onPause:Vn(e.onPause),onResume:Vn(e.onResume),onSwipeStart:Te(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Te(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:Te(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:Te(e.onSwipeEnd,f=>{const{x:h,y:p}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","end"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${h}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${p}px`),d(!1)})})})});M$.displayName=_f;var[h7,m7]=k$(_f,{onClose(){}}),v7=m.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:c,onPause:d,onResume:f,onSwipeStart:h,onSwipeMove:p,onSwipeCancel:x,onSwipeEnd:g,...j}=e,b=rv(_f,n),[y,S]=m.useState(null),C=St(t,U=>S(U)),N=m.useRef(null),E=m.useRef(null),A=s||b.duration,P=m.useRef(0),O=m.useRef(A),T=m.useRef(0),{onToastAdd:$,onToastRemove:z}=b,q=Vn(()=>{y?.contains(document.activeElement)&&b.viewport?.focus(),o()}),F=m.useCallback(U=>{!U||U===1/0||(window.clearTimeout(T.current),P.current=new Date().getTime(),T.current=window.setTimeout(q,U))},[q]);m.useEffect(()=>{const U=b.viewport;if(U){const R=()=>{F(O.current),f?.()},W=()=>{const X=new Date().getTime()-P.current;O.current=O.current-X,window.clearTimeout(T.current),d?.()};return U.addEventListener(Xj,W),U.addEventListener(Qj,R),()=>{U.removeEventListener(Xj,W),U.removeEventListener(Qj,R)}}},[b.viewport,A,d,f,F]),m.useEffect(()=>{i&&!b.isClosePausedRef.current&&F(A)},[i,A,b.isClosePausedRef,F]),m.useEffect(()=>($(),()=>z()),[$,z]);const H=m.useMemo(()=>y?q$(y):null,[y]);return b.viewport?a.jsxs(a.Fragment,{children:[H&&a.jsx(g7,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:H}),a.jsx(h7,{scope:n,onClose:q,children:lu.createPortal(a.jsx(lN.ItemSlot,{scope:n,children:a.jsx(YU,{asChild:!0,onEscapeKeyDown:Te(c,()=>{b.isFocusedToastEscapeKeyDownRef.current||q(),b.isFocusedToastEscapeKeyDownRef.current=!1}),children:a.jsx(Ye.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":b.swipeDirection,...j,ref:C,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Te(e.onKeyDown,U=>{U.key==="Escape"&&(c?.(U.nativeEvent),U.nativeEvent.defaultPrevented||(b.isFocusedToastEscapeKeyDownRef.current=!0,q()))}),onPointerDown:Te(e.onPointerDown,U=>{U.button===0&&(N.current={x:U.clientX,y:U.clientY})}),onPointerMove:Te(e.onPointerMove,U=>{if(!N.current)return;const R=U.clientX-N.current.x,W=U.clientY-N.current.y,X=!!E.current,G=["left","right"].includes(b.swipeDirection),B=["left","up"].includes(b.swipeDirection)?Math.min:Math.max,J=G?B(0,R):0,D=G?0:B(0,W),I=U.pointerType==="touch"?10:2,re={x:J,y:D},ne={originalEvent:U,delta:re};X?(E.current=re,rh(d7,p,ne,{discrete:!1})):qE(re,b.swipeDirection,I)?(E.current=re,rh(u7,h,ne,{discrete:!1}),U.target.setPointerCapture(U.pointerId)):(Math.abs(R)>I||Math.abs(W)>I)&&(N.current=null)}),onPointerUp:Te(e.onPointerUp,U=>{const R=E.current,W=U.target;if(W.hasPointerCapture(U.pointerId)&&W.releasePointerCapture(U.pointerId),E.current=null,N.current=null,R){const X=U.currentTarget,G={originalEvent:U,delta:R};qE(R,b.swipeDirection,b.swipeThreshold)?rh(p7,g,G,{discrete:!0}):rh(f7,x,G,{discrete:!0}),X.addEventListener("click",B=>B.preventDefault(),{once:!0})}})})})}),b.viewport)})]}):null}),g7=e=>{const{__scopeToast:t,children:n,...r}=e,s=rv(_f,t),[i,o]=m.useState(!1),[c,d]=m.useState(!1);return b7(()=>o(!0)),m.useEffect(()=>{const f=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(f)},[]),c?null:a.jsx(gl,{asChild:!0,children:a.jsx(nv,{...r,children:i&&a.jsxs(a.Fragment,{children:[s.label," ",n]})})})},x7="ToastTitle",$$=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return a.jsx(Ye.div,{...r,ref:t})});$$.displayName=x7;var y7="ToastDescription",D$=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return a.jsx(Ye.div,{...r,ref:t})});D$.displayName=y7;var L$="ToastAction",F$=m.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?a.jsx(z$,{altText:n,asChild:!0,children:a.jsx(cN,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${L$}\`. Expected non-empty \`string\`.`),null)});F$.displayName=L$;var B$="ToastClose",cN=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,s=m7(B$,n);return a.jsx(z$,{asChild:!0,children:a.jsx(Ye.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,s.onClose)})})});cN.displayName=B$;var z$=m.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...s}=e;return a.jsx(Ye.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:t})});function q$(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),w7(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const o=r.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...q$(r))}}),t}function rh(e,t,n,{discrete:r}){const s=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?iN(s,i):s.dispatchEvent(i)}var qE=(e,t,n=0)=>{const r=Math.abs(e.x),s=Math.abs(e.y),i=r>s;return t==="left"||t==="right"?i&&r>n:!i&&s>n};function b7(e=()=>{}){const t=Vn(e);rr(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function w7(e){return e.nodeType===e.ELEMENT_NODE}function j7(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function by(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var S7=O$,U$=R$,W$=M$,V$=$$,H$=D$,K$=F$,G$=cN;function Y$(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=Y$(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Dt(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Y$(e))&&(r&&(r+=" "),r+=t);return r}const UE=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,WE=Dt,xl=(e,t)=>n=>{var r;if(t?.variants==null)return WE(e,n?.class,n?.className);const{variants:s,defaultVariants:i}=t,o=Object.keys(s).map(f=>{const h=n?.[f],p=i?.[f];if(h===null)return null;const x=UE(h)||UE(p);return s[f][x]}),c=n&&Object.entries(n).reduce((f,h)=>{let[p,x]=h;return x===void 0||(f[p]=x),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,h)=>{let{class:p,className:x,...g}=h;return Object.entries(g).every(j=>{let[b,y]=j;return Array.isArray(y)?y.includes({...i,...c}[b]):{...i,...c}[b]===y})?[...f,p,x]:f},[]);return WE(e,o,d,n?.class,n?.className)};const N7=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),X$=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var C7={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 _7=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:o,...c},d)=>m.createElement("svg",{ref:d,...C7,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:X$("lucide",s),...c},[...o.map(([f,h])=>m.createElement(f,h)),...Array.isArray(i)?i:[i]]));const ot=(e,t)=>{const n=m.forwardRef(({className:r,...s},i)=>m.createElement(_7,{ref:i,iconNode:t,className:X$(`lucide-${N7(e)}`,r),...s}));return n.displayName=`${e}`,n};const Q$=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 J$=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 Jo=ot("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const Pr=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 Ac=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 Ec=ot("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Yt=ot("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const uN=ot("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const ws=ot("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const xc=ot("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);const wy=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 Qi=ot("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const A7=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 yc=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 E7=ot("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const P7=ot("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);const hi=ot("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const _s=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 Z$=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 Ea=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 av=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 $h=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 eD=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 VE=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 tD=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 O7=ot("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);const dN=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 T7=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 R7=ot("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);const I7=ot("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);const Zj=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 nD=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 M7=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 eS=ot("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);const $7=ot("ListPlus",[["path",{d:"M11 12H3",key:"51ecnj"}],["path",{d:"M16 6H3",key:"1wxfjs"}],["path",{d:"M16 18H3",key:"12xzn7"}],["path",{d:"M18 9v6",key:"1twb98"}],["path",{d:"M21 12h-6",key:"bt1uis"}]]);const wr=ot("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const rD=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 D7=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 aD=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 fc=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 L7=ot("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);const tS=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 nS=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 sv=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 ti=ot("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const oi=ot("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const fN=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 ma=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 F7=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 pN=ot("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const B7=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 hN=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 z7=ot("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const qr=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 Ph=ot("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const sD=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 Ta=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 kh=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 q7=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 Pc=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 iD=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 Ja=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 As=ot("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),mN="-",U7=e=>{const t=V7(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const c=o.split(mN);return c[0]===""&&c.length!==1&&c.shift(),oD(c,t)||W7(o)},getConflictingClassGroupIds:(o,c)=>{const d=n[o]||[];return c&&r[o]?[...d,...r[o]]:d}}},oD=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?oD(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(mN);return t.validators.find(({validator:o})=>o(i))?.classGroupId},HE=/^\[(.+)\]$/,W7=e=>{if(HE.test(e)){const t=HE.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},V7=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return K7(Object.entries(e.classGroups),n).forEach(([i,o])=>{rS(o,r,i,t)}),r},rS=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:KE(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(H7(s)){rS(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{rS(o,KE(t,i),n,r)})})},KE=(e,t)=>{let n=e;return t.split(mN).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},H7=e=>e.isThemeGetter,K7=(e,t)=>t?e.map(([n,r])=>{const s=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,s]}):e,G7=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(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 s(i,o),o},set(i,o){n.has(i)?n.set(i,o):s(i,o)}}},lD="!",Y7=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],i=t.length,o=c=>{const d=[];let f=0,h=0,p;for(let y=0;y<c.length;y++){let S=c[y];if(f===0){if(S===s&&(r||c.slice(y,y+i)===t)){d.push(c.slice(h,y)),h=y+i;continue}if(S==="/"){p=y;continue}}S==="["?f++:S==="]"&&f--}const x=d.length===0?c:c.substring(h),g=x.startsWith(lD),j=g?x.substring(1):x,b=p&&p>h?p-h:void 0;return{modifiers:d,hasImportantModifier:g,baseClassName:j,maybePostfixModifierPosition:b}};return n?c=>n({className:c,parseClassName:o}):o},X7=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},Q7=e=>({cache:G7(e.cacheSize),parseClassName:Y7(e),...U7(e)}),J7=/\s+/,Z7=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(J7);let c="";for(let d=o.length-1;d>=0;d-=1){const f=o[d],{modifiers:h,hasImportantModifier:p,baseClassName:x,maybePostfixModifierPosition:g}=n(f);let j=!!g,b=r(j?x.substring(0,g):x);if(!b){if(!j){c=f+(c.length>0?" "+c:c);continue}if(b=r(x),!b){c=f+(c.length>0?" "+c:c);continue}j=!1}const y=X7(h).join(":"),S=p?y+lD:y,C=S+b;if(i.includes(C))continue;i.push(C);const N=s(b,j);for(let E=0;E<N.length;++E){const A=N[E];i.push(S+A)}c=f+(c.length>0?" "+c:c)}return c};function e9(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=cD(t))&&(r&&(r+=" "),r+=n);return r}const cD=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=cD(e[r]))&&(n&&(n+=" "),n+=t);return n};function t9(e,...t){let n,r,s,i=o;function o(d){const f=t.reduce((h,p)=>p(h),e());return n=Q7(f),r=n.cache.get,s=n.cache.set,i=c,c(d)}function c(d){const f=r(d);if(f)return f;const h=Z7(d,n);return s(d,h),h}return function(){return i(e9.apply(null,arguments))}}const An=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},uD=/^\[(?:([a-z-]+):)?(.+)\]$/i,n9=/^\d+\/\d+$/,r9=new Set(["px","full","screen"]),a9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,s9=/\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$/,i9=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,o9=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,l9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Gs=e=>bc(e)||r9.has(e)||n9.test(e),Wi=e=>cu(e,"length",v9),bc=e=>!!e&&!Number.isNaN(Number(e)),jy=e=>cu(e,"number",bc),od=e=>!!e&&Number.isInteger(Number(e)),c9=e=>e.endsWith("%")&&bc(e.slice(0,-1)),Bt=e=>uD.test(e),Vi=e=>a9.test(e),u9=new Set(["length","size","percentage"]),d9=e=>cu(e,u9,dD),f9=e=>cu(e,"position",dD),p9=new Set(["image","url"]),h9=e=>cu(e,p9,x9),m9=e=>cu(e,"",g9),ld=()=>!0,cu=(e,t,n)=>{const r=uD.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},v9=e=>s9.test(e)&&!i9.test(e),dD=()=>!1,g9=e=>o9.test(e),x9=e=>l9.test(e),y9=()=>{const e=An("colors"),t=An("spacing"),n=An("blur"),r=An("brightness"),s=An("borderColor"),i=An("borderRadius"),o=An("borderSpacing"),c=An("borderWidth"),d=An("contrast"),f=An("grayscale"),h=An("hueRotate"),p=An("invert"),x=An("gap"),g=An("gradientColorStops"),j=An("gradientColorStopPositions"),b=An("inset"),y=An("margin"),S=An("opacity"),C=An("padding"),N=An("saturate"),E=An("scale"),A=An("sepia"),P=An("skew"),O=An("space"),T=An("translate"),$=()=>["auto","contain","none"],z=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",Bt,t],F=()=>[Bt,t],H=()=>["",Gs,Wi],U=()=>["auto",bc,Bt],R=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],W=()=>["solid","dashed","dotted","double","none"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],G=()=>["start","end","center","between","around","evenly","stretch"],B=()=>["","0",Bt],J=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>[bc,Bt];return{cacheSize:500,separator:":",theme:{colors:[ld],spacing:[Gs,Wi],blur:["none","",Vi,Bt],brightness:D(),borderColor:[e],borderRadius:["none","","full",Vi,Bt],borderSpacing:F(),borderWidth:H(),contrast:D(),grayscale:B(),hueRotate:D(),invert:B(),gap:F(),gradientColorStops:[e],gradientColorStopPositions:[c9,Wi],inset:q(),margin:q(),opacity:D(),padding:F(),saturate:D(),scale:D(),sepia:B(),skew:D(),space:F(),translate:F()},classGroups:{aspect:[{aspect:["auto","square","video",Bt]}],container:["container"],columns:[{columns:[Vi]}],"break-after":[{"break-after":J()}],"break-before":[{"break-before":J()}],"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:[...R(),Bt]}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],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",od,Bt]}],basis:[{basis:q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Bt]}],grow:[{grow:B()}],shrink:[{shrink:B()}],order:[{order:["first","last","none",od,Bt]}],"grid-cols":[{"grid-cols":[ld]}],"col-start-end":[{col:["auto",{span:["full",od,Bt]},Bt]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[ld]}],"row-start-end":[{row:["auto",{span:[od,Bt]},Bt]}],"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",Bt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Bt]}],gap:[{gap:[x]}],"gap-x":[{"gap-x":[x]}],"gap-y":[{"gap-y":[x]}],"justify-content":[{justify:["normal",...G()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...G(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...G(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[C]}],px:[{px:[C]}],py:[{py:[C]}],ps:[{ps:[C]}],pe:[{pe:[C]}],pt:[{pt:[C]}],pr:[{pr:[C]}],pb:[{pb:[C]}],pl:[{pl:[C]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Bt,t]}],"min-w":[{"min-w":[Bt,t,"min","max","fit"]}],"max-w":[{"max-w":[Bt,t,"none","full","min","max","fit","prose",{screen:[Vi]},Vi]}],h:[{h:[Bt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Bt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Bt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Bt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Vi,Wi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",jy]}],"font-family":[{font:[ld]}],"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",Bt]}],"line-clamp":[{"line-clamp":["none",bc,jy]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Gs,Bt]}],"list-image":[{"list-image":["none",Bt]}],"list-style-type":[{list:["none","disc","decimal",Bt]}],"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:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Gs,Wi]}],"underline-offset":[{"underline-offset":["auto",Gs,Bt]}],"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:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Bt]}],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",Bt]}],"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:[...R(),f9]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",d9]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},h9]}],"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:[...W(),"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:W()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...W()]}],"outline-offset":[{"outline-offset":[Gs,Bt]}],"outline-w":[{outline:[Gs,Wi]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[Gs,Wi]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Vi,m9]}],"shadow-color":[{shadow:[ld]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...X(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":X()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",Vi,Bt]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[p]}],saturate:[{saturate:[N]}],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":[N]}],"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",Bt]}],duration:[{duration:D()}],ease:[{ease:["linear","in","out","in-out",Bt]}],delay:[{delay:D()}],animate:[{animate:["none","spin","ping","pulse","bounce",Bt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[od,Bt]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Bt]}],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",Bt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"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",Bt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Gs,Wi,jy]}],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"]}}},b9=t9(y9);function Se(...e){return b9(Dt(e))}const w9=S7,fD=m.forwardRef(({className:e,...t},n)=>a.jsx(U$,{ref:n,className:Se("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));fD.displayName=U$.displayName;const j9=xl("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"}}),pD=m.forwardRef(({className:e,variant:t,...n},r)=>a.jsx(W$,{ref:r,className:Se(j9({variant:t}),e),...n}));pD.displayName=W$.displayName;const S9=m.forwardRef(({className:e,...t},n)=>a.jsx(K$,{ref:n,className:Se("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));S9.displayName=K$.displayName;const hD=m.forwardRef(({className:e,...t},n)=>a.jsx(G$,{ref:n,className:Se("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:a.jsx(As,{className:"h-4 w-4"})}));hD.displayName=G$.displayName;const mD=m.forwardRef(({className:e,...t},n)=>a.jsx(V$,{ref:n,className:Se("text-sm font-semibold",e),...t}));mD.displayName=V$.displayName;const vD=m.forwardRef(({className:e,...t},n)=>a.jsx(H$,{ref:n,className:Se("text-sm opacity-90",e),...t}));vD.displayName=H$.displayName;function N9(){const{toasts:e}=AU();return a.jsxs(w9,{children:[e.map(function({id:t,title:n,description:r,action:s,...i}){return a.jsxs(pD,{...i,children:[a.jsxs("div",{className:"grid gap-1",children:[n&&a.jsx(mD,{children:n}),r&&a.jsx(vD,{children:r})]}),s,a.jsx(hD,{})]},t)}),a.jsx(fD,{})]})}var GE=["light","dark"],C9="(prefers-color-scheme: dark)",_9=m.createContext(void 0),A9={setTheme:e=>{},themes:[]},E9=()=>{var e;return(e=m.useContext(_9))!=null?e:A9};m.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,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=s?GE.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",x=(j,b=!1,y=!0)=>{let S=o?o[j]:j,C=b?j+"|| ''":`'${S}'`,N="";return s&&y&&!b&&GE.includes(j)&&(N+=`d.style.colorScheme = '${j}';`),n==="class"?b||S?N+=`c.add(${C})`:N+="null":S&&(N+=`d[s](n,${C})`),N},g=e?`!function(){${h}${x(e)}}()`:r?`!function(){try{${h}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${f})){var t='${C9}',m=window.matchMedia(t);if(m.media!==t||m.matches){${x("dark")}}else{${x("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${x(o?"x[e]":"e",!0)}}${f?"":"else{"+x(i,!1,!1)+"}"}${p}}catch(e){}}()`:`!function(){try{${h}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${x(o?"x[e]":"e",!0)}}else{${x(i,!1,!1)};}${p}}catch(t){}}();`;return m.createElement("script",{nonce:d,dangerouslySetInnerHTML:{__html:g}})});var P9=e=>{switch(e){case"success":return T9;case"info":return I9;case"warning":return R9;case"error":return M9;default:return null}},k9=Array(12).fill(0),O9=({visible:e,className:t})=>Y.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Y.createElement("div",{className:"sonner-spinner"},k9.map((n,r)=>Y.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),T9=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Y.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"})),R9=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Y.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"})),I9=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Y.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"})),M9=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Y.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"})),$9=Y.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"},Y.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Y.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),D9=()=>{let[e,t]=Y.useState(document.hidden);return Y.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},aS=1,L9=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,s=typeof e?.id=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:aS++,i=this.toasts.find(c=>c.id===s),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(c=>c.id===s?(this.publish({...c,...e,id:s,title:n}),{...c,...e,id:s,dismissible:o,title:n}):c):this.addToast({title:n,...r,dismissible:o,id:s}),s},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(),s=n!==void 0,i,o=r.then(async d=>{if(i=["resolve",d],Y.isValidElement(d))s=!1,this.create({id:n,type:"default",message:d});else if(B9(d)&&!d.ok){s=!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){s=!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){s=!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;s&&(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||aS++;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}},Br=new L9,F9=(e,t)=>{let n=t?.id||aS++;return Br.addToast({title:e,...t,id:n}),n},B9=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",z9=F9,q9=()=>Br.toasts,U9=()=>Br.getActiveToasts();Object.assign(z9,{success:Br.success,info:Br.info,warning:Br.warning,error:Br.error,custom:Br.custom,message:Br.message,promise:Br.promise,dismiss:Br.dismiss,loading:Br.loading},{getHistory:q9,getToasts:U9});function W9(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))}W9(`: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 ah(e){return e.label!==void 0}var V9=3,H9="32px",K9="16px",YE=4e3,G9=356,Y9=14,X9=20,Q9=200;function Wa(...e){return e.filter(Boolean).join(" ")}function J9(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var Z9=e=>{var t,n,r,s,i,o,c,d,f,h,p;let{invert:x,toast:g,unstyled:j,interacting:b,setHeights:y,visibleToasts:S,heights:C,index:N,toasts:E,expanded:A,removeToast:P,defaultRichColors:O,closeButton:T,style:$,cancelButtonStyle:z,actionButtonStyle:q,className:F="",descriptionClassName:H="",duration:U,position:R,gap:W,loadingIcon:X,expandByDefault:G,classNames:B,icons:J,closeButtonAriaLabel:D="Close toast",pauseWhenPageIsHidden:I}=e,[re,ne]=Y.useState(null),[fe,he]=Y.useState(null),[V,de]=Y.useState(!1),[Q,ee]=Y.useState(!1),[pe,ae]=Y.useState(!1),[Re,Ce]=Y.useState(!1),[Me,L]=Y.useState(!1),[oe,ve]=Y.useState(0),[Pe,Ge]=Y.useState(0),lt=Y.useRef(g.duration||U||YE),pt=Y.useRef(null),vt=Y.useRef(null),zt=N===0,qt=N+1<=S,Wt=g.type,Qt=g.dismissible!==!1,Ne=g.className||"",Xe=g.descriptionClassName||"",Fe=Y.useMemo(()=>C.findIndex(mt=>mt.toastId===g.id)||0,[C,g.id]),Ft=Y.useMemo(()=>{var mt;return(mt=g.closeButton)!=null?mt:T},[g.closeButton,T]),on=Y.useMemo(()=>g.duration||U||YE,[g.duration,U]),Ut=Y.useRef(0),ye=Y.useRef(0),Ve=Y.useRef(0),Be=Y.useRef(null),[xt,Ee]=R.split("-"),ue=Y.useMemo(()=>C.reduce((mt,It,Lt)=>Lt>=Fe?mt:mt+It.height,0),[C,Fe]),Ze=D9(),ht=g.invert||x,Ot=Wt==="loading";ye.current=Y.useMemo(()=>Fe*W+ue,[Fe,ue]),Y.useEffect(()=>{lt.current=on},[on]),Y.useEffect(()=>{de(!0)},[]),Y.useEffect(()=>{let mt=vt.current;if(mt){let It=mt.getBoundingClientRect().height;return Ge(It),y(Lt=>[{toastId:g.id,height:It,position:g.position},...Lt]),()=>y(Lt=>Lt.filter(Kt=>Kt.toastId!==g.id))}},[y,g.id]),Y.useLayoutEffect(()=>{if(!V)return;let mt=vt.current,It=mt.style.height;mt.style.height="auto";let Lt=mt.getBoundingClientRect().height;mt.style.height=It,Ge(Lt),y(Kt=>Kt.find(qn=>qn.toastId===g.id)?Kt.map(qn=>qn.toastId===g.id?{...qn,height:Lt}:qn):[{toastId:g.id,height:Lt,position:g.position},...Kt])},[V,g.title,g.description,y,g.id]);let Jt=Y.useCallback(()=>{ee(!0),ve(ye.current),y(mt=>mt.filter(It=>It.toastId!==g.id)),setTimeout(()=>{P(g)},Q9)},[g,P,y,ye]);Y.useEffect(()=>{if(g.promise&&Wt==="loading"||g.duration===1/0||g.type==="loading")return;let mt;return A||b||I&&Ze?(()=>{if(Ve.current<Ut.current){let It=new Date().getTime()-Ut.current;lt.current=lt.current-It}Ve.current=new Date().getTime()})():lt.current!==1/0&&(Ut.current=new Date().getTime(),mt=setTimeout(()=>{var It;(It=g.onAutoClose)==null||It.call(g,g),Jt()},lt.current)),()=>clearTimeout(mt)},[A,b,g,Wt,I,Ze,Jt]),Y.useEffect(()=>{g.delete&&Jt()},[Jt,g.delete]);function Pn(){var mt,It,Lt;return J!=null&&J.loading?Y.createElement("div",{className:Wa(B?.loader,(mt=g?.classNames)==null?void 0:mt.loader,"sonner-loader"),"data-visible":Wt==="loading"},J.loading):X?Y.createElement("div",{className:Wa(B?.loader,(It=g?.classNames)==null?void 0:It.loader,"sonner-loader"),"data-visible":Wt==="loading"},X):Y.createElement(O9,{className:Wa(B?.loader,(Lt=g?.classNames)==null?void 0:Lt.loader),visible:Wt==="loading"})}return Y.createElement("li",{tabIndex:0,ref:vt,className:Wa(F,Ne,B?.toast,(t=g?.classNames)==null?void 0:t.toast,B?.default,B?.[Wt],(n=g?.classNames)==null?void 0:n[Wt]),"data-sonner-toast":"","data-rich-colors":(r=g.richColors)!=null?r:O,"data-styled":!(g.jsx||g.unstyled||j),"data-mounted":V,"data-promise":!!g.promise,"data-swiped":Me,"data-removed":Q,"data-visible":qt,"data-y-position":xt,"data-x-position":Ee,"data-index":N,"data-front":zt,"data-swiping":pe,"data-dismissible":Qt,"data-type":Wt,"data-invert":ht,"data-swipe-out":Re,"data-swipe-direction":fe,"data-expanded":!!(A||G&&V),style:{"--index":N,"--toasts-before":N,"--z-index":E.length-N,"--offset":`${Q?oe:ye.current}px`,"--initial-height":G?"auto":`${Pe}px`,...$,...g.style},onDragEnd:()=>{ae(!1),ne(null),Be.current=null},onPointerDown:mt=>{Ot||!Qt||(pt.current=new Date,ve(ye.current),mt.target.setPointerCapture(mt.pointerId),mt.target.tagName!=="BUTTON"&&(ae(!0),Be.current={x:mt.clientX,y:mt.clientY}))},onPointerUp:()=>{var mt,It,Lt,Kt;if(Re||!Qt)return;Be.current=null;let qn=Number(((mt=vt.current)==null?void 0:mt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),le=Number(((It=vt.current)==null?void 0:It.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),at=new Date().getTime()-((Lt=pt.current)==null?void 0:Lt.getTime()),Ct=re==="x"?qn:le,an=Math.abs(Ct)/at;if(Math.abs(Ct)>=X9||an>.11){ve(ye.current),(Kt=g.onDismiss)==null||Kt.call(g,g),he(re==="x"?qn>0?"right":"left":le>0?"down":"up"),Jt(),Ce(!0),L(!1);return}ae(!1),ne(null)},onPointerMove:mt=>{var It,Lt,Kt,qn;if(!Be.current||!Qt||((It=window.getSelection())==null?void 0:It.toString().length)>0)return;let le=mt.clientY-Be.current.y,at=mt.clientX-Be.current.x,Ct=(Lt=e.swipeDirections)!=null?Lt:J9(R);!re&&(Math.abs(at)>1||Math.abs(le)>1)&&ne(Math.abs(at)>Math.abs(le)?"x":"y");let an={x:0,y:0};re==="y"?(Ct.includes("top")||Ct.includes("bottom"))&&(Ct.includes("top")&&le<0||Ct.includes("bottom")&&le>0)&&(an.y=le):re==="x"&&(Ct.includes("left")||Ct.includes("right"))&&(Ct.includes("left")&&at<0||Ct.includes("right")&&at>0)&&(an.x=at),(Math.abs(an.x)>0||Math.abs(an.y)>0)&&L(!0),(Kt=vt.current)==null||Kt.style.setProperty("--swipe-amount-x",`${an.x}px`),(qn=vt.current)==null||qn.style.setProperty("--swipe-amount-y",`${an.y}px`)}},Ft&&!g.jsx?Y.createElement("button",{"aria-label":D,"data-disabled":Ot,"data-close-button":!0,onClick:Ot||!Qt?()=>{}:()=>{var mt;Jt(),(mt=g.onDismiss)==null||mt.call(g,g)},className:Wa(B?.closeButton,(s=g?.classNames)==null?void 0:s.closeButton)},(i=J?.close)!=null?i:$9):null,g.jsx||m.isValidElement(g.title)?g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title:Y.createElement(Y.Fragment,null,Wt||g.icon||g.promise?Y.createElement("div",{"data-icon":"",className:Wa(B?.icon,(o=g?.classNames)==null?void 0:o.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||Pn():null,g.type!=="loading"?g.icon||J?.[Wt]||P9(Wt):null):null,Y.createElement("div",{"data-content":"",className:Wa(B?.content,(c=g?.classNames)==null?void 0:c.content)},Y.createElement("div",{"data-title":"",className:Wa(B?.title,(d=g?.classNames)==null?void 0:d.title)},typeof g.title=="function"?g.title():g.title),g.description?Y.createElement("div",{"data-description":"",className:Wa(H,Xe,B?.description,(f=g?.classNames)==null?void 0:f.description)},typeof g.description=="function"?g.description():g.description):null),m.isValidElement(g.cancel)?g.cancel:g.cancel&&ah(g.cancel)?Y.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||z,onClick:mt=>{var It,Lt;ah(g.cancel)&&Qt&&((Lt=(It=g.cancel).onClick)==null||Lt.call(It,mt),Jt())},className:Wa(B?.cancelButton,(h=g?.classNames)==null?void 0:h.cancelButton)},g.cancel.label):null,m.isValidElement(g.action)?g.action:g.action&&ah(g.action)?Y.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||q,onClick:mt=>{var It,Lt;ah(g.action)&&((Lt=(It=g.action).onClick)==null||Lt.call(It,mt),!mt.defaultPrevented&&Jt())},className:Wa(B?.actionButton,(p=g?.classNames)==null?void 0:p.actionButton)},g.action.label):null))};function XE(){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 eW(e,t){let n={};return[e,t].forEach((r,s)=>{let i=s===1,o=i?"--mobile-offset":"--offset",c=i?K9:H9;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 tW=m.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:o,className:c,offset:d,mobileOffset:f,theme:h="light",richColors:p,duration:x,style:g,visibleToasts:j=V9,toastOptions:b,dir:y=XE(),gap:S=Y9,loadingIcon:C,icons:N,containerAriaLabel:E="Notifications",pauseWhenPageIsHidden:A}=e,[P,O]=Y.useState([]),T=Y.useMemo(()=>Array.from(new Set([r].concat(P.filter(I=>I.position).map(I=>I.position)))),[P,r]),[$,z]=Y.useState([]),[q,F]=Y.useState(!1),[H,U]=Y.useState(!1),[R,W]=Y.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),X=Y.useRef(null),G=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),B=Y.useRef(null),J=Y.useRef(!1),D=Y.useCallback(I=>{O(re=>{var ne;return(ne=re.find(fe=>fe.id===I.id))!=null&&ne.delete||Br.dismiss(I.id),re.filter(({id:fe})=>fe!==I.id)})},[]);return Y.useEffect(()=>Br.subscribe(I=>{if(I.dismiss){O(re=>re.map(ne=>ne.id===I.id?{...ne,delete:!0}:ne));return}setTimeout(()=>{C$.flushSync(()=>{O(re=>{let ne=re.findIndex(fe=>fe.id===I.id);return ne!==-1?[...re.slice(0,ne),{...re[ne],...I},...re.slice(ne+1)]:[I,...re]})})})}),[]),Y.useEffect(()=>{if(h!=="system"){W(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?W("dark"):W("light")),typeof window>"u")return;let I=window.matchMedia("(prefers-color-scheme: dark)");try{I.addEventListener("change",({matches:re})=>{W(re?"dark":"light")})}catch{I.addListener(({matches:ne})=>{try{W(ne?"dark":"light")}catch(fe){console.error(fe)}})}},[h]),Y.useEffect(()=>{P.length<=1&&F(!1)},[P]),Y.useEffect(()=>{let I=re=>{var ne,fe;s.every(he=>re[he]||re.code===he)&&(F(!0),(ne=X.current)==null||ne.focus()),re.code==="Escape"&&(document.activeElement===X.current||(fe=X.current)!=null&&fe.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[s]),Y.useEffect(()=>{if(X.current)return()=>{B.current&&(B.current.focus({preventScroll:!0}),B.current=null,J.current=!1)}},[X.current]),Y.createElement("section",{ref:t,"aria-label":`${E} ${G}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},T.map((I,re)=>{var ne;let[fe,he]=I.split("-");return P.length?Y.createElement("ol",{key:I,dir:y==="auto"?XE():y,tabIndex:-1,ref:X,className:c,"data-sonner-toaster":!0,"data-theme":R,"data-y-position":fe,"data-lifted":q&&P.length>1&&!i,"data-x-position":he,style:{"--front-toast-height":`${((ne=$[0])==null?void 0:ne.height)||0}px`,"--width":`${G9}px`,"--gap":`${S}px`,...g,...eW(d,f)},onBlur:V=>{J.current&&!V.currentTarget.contains(V.relatedTarget)&&(J.current=!1,B.current&&(B.current.focus({preventScroll:!0}),B.current=null))},onFocus:V=>{V.target instanceof HTMLElement&&V.target.dataset.dismissible==="false"||J.current||(J.current=!0,B.current=V.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{H||F(!1)},onDragEnd:()=>F(!1),onPointerDown:V=>{V.target instanceof HTMLElement&&V.target.dataset.dismissible==="false"||U(!0)},onPointerUp:()=>U(!1)},P.filter(V=>!V.position&&re===0||V.position===I).map((V,de)=>{var Q,ee;return Y.createElement(Z9,{key:V.id,icons:N,index:de,toast:V,defaultRichColors:p,duration:(Q=b?.duration)!=null?Q:x,className:b?.className,descriptionClassName:b?.descriptionClassName,invert:n,visibleToasts:j,closeButton:(ee=b?.closeButton)!=null?ee:o,interacting:H,position:I,style:b?.style,unstyled:b?.unstyled,classNames:b?.classNames,cancelButtonStyle:b?.cancelButtonStyle,actionButtonStyle:b?.actionButtonStyle,removeToast:D,toasts:P.filter(pe=>pe.position==V.position),heights:$.filter(pe=>pe.position==V.position),setHeights:z,expandByDefault:i,gap:S,loadingIcon:C,expanded:q,pauseWhenPageIsHidden:A,swipeDirections:e.swipeDirections})})):null}))});const nW=({...e})=>{const{theme:t="system"}=E9();return a.jsx(tW,{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 rW=tv[" useId ".trim().toString()]||(()=>{}),aW=0;function nr(e){const[t,n]=m.useState(rW());return rr(()=>{n(r=>r??String(aW++))},[e]),e||(t?`radix-${t}`:"")}const sW=["top","right","bottom","left"],to=Math.min,oa=Math.max,Dh=Math.round,sh=Math.floor,js=e=>({x:e,y:e}),iW={left:"right",right:"left",bottom:"top",top:"bottom"},oW={start:"end",end:"start"};function sS(e,t,n){return oa(e,to(t,n))}function li(e,t){return typeof e=="function"?e(t):e}function ci(e){return e.split("-")[0]}function uu(e){return e.split("-")[1]}function vN(e){return e==="x"?"y":"x"}function gN(e){return e==="y"?"height":"width"}const lW=new Set(["top","bottom"]);function ys(e){return lW.has(ci(e))?"y":"x"}function xN(e){return vN(ys(e))}function cW(e,t,n){n===void 0&&(n=!1);const r=uu(e),s=xN(e),i=gN(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=Lh(o)),[o,Lh(o)]}function uW(e){const t=Lh(e);return[iS(e),t,iS(t)]}function iS(e){return e.replace(/start|end/g,t=>oW[t])}const QE=["left","right"],JE=["right","left"],dW=["top","bottom"],fW=["bottom","top"];function pW(e,t,n){switch(e){case"top":case"bottom":return n?t?JE:QE:t?QE:JE;case"left":case"right":return t?dW:fW;default:return[]}}function hW(e,t,n,r){const s=uu(e);let i=pW(ci(e),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),t&&(i=i.concat(i.map(iS)))),i}function Lh(e){return e.replace(/left|right|bottom|top/g,t=>iW[t])}function mW(e){return{top:0,right:0,bottom:0,left:0,...e}}function gD(e){return typeof e!="number"?mW(e):{top:e,right:e,bottom:e,left:e}}function Fh(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function ZE(e,t,n){let{reference:r,floating:s}=e;const i=ys(t),o=xN(t),c=gN(o),d=ci(t),f=i==="y",h=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,x=r[c]/2-s[c]/2;let g;switch(d){case"top":g={x:h,y:r.y-s.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-s.width,y:p};break;default:g={x:r.x,y:r.y}}switch(uu(t)){case"start":g[o]-=x*(n&&f?-1:1);break;case"end":g[o]+=x*(n&&f?-1:1);break}return g}async function vW(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:i,rects:o,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:x=!1,padding:g=0}=li(t,e),j=gD(g),y=c[x?p==="floating"?"reference":"floating":p],S=Fh(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:f,rootBoundary:h,strategy:d})),C=p==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),E=await(i.isElement==null?void 0:i.isElement(N))?await(i.getScale==null?void 0:i.getScale(N))||{x:1,y:1}:{x:1,y:1},A=Fh(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:C,offsetParent:N,strategy:d}):C);return{top:(S.top-A.top+j.top)/E.y,bottom:(A.bottom-S.bottom+j.bottom)/E.y,left:(S.left-A.left+j.left)/E.x,right:(A.right-S.right+j.right)/E.x}}const gW=async(e,t,n)=>{const{placement:r="bottom",strategy:s="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:s}),{x:h,y:p}=ZE(f,r,d),x=r,g={},j=0;for(let y=0;y<c.length;y++){var b;const{name:S,fn:C}=c[y],{x:N,y:E,data:A,reset:P}=await C({x:h,y:p,initialPlacement:r,placement:x,strategy:s,middlewareData:g,rects:f,platform:{...o,detectOverflow:(b=o.detectOverflow)!=null?b:vW},elements:{reference:e,floating:t}});h=N??h,p=E??p,g={...g,[S]:{...g[S],...A}},P&&j<=50&&(j++,typeof P=="object"&&(P.placement&&(x=P.placement),P.rects&&(f=P.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:s}):P.rects),{x:h,y:p}=ZE(f,x,d)),y=-1)}return{x:h,y:p,placement:x,strategy:s,middlewareData:g}},xW=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:i,platform:o,elements:c,middlewareData:d}=t,{element:f,padding:h=0}=li(e,t)||{};if(f==null)return{};const p=gD(h),x={x:n,y:r},g=xN(s),j=gN(g),b=await o.getDimensions(f),y=g==="y",S=y?"top":"left",C=y?"bottom":"right",N=y?"clientHeight":"clientWidth",E=i.reference[j]+i.reference[g]-x[g]-i.floating[j],A=x[g]-i.reference[g],P=await(o.getOffsetParent==null?void 0:o.getOffsetParent(f));let O=P?P[N]:0;(!O||!await(o.isElement==null?void 0:o.isElement(P)))&&(O=c.floating[N]||i.floating[j]);const T=E/2-A/2,$=O/2-b[j]/2-1,z=to(p[S],$),q=to(p[C],$),F=z,H=O-b[j]-q,U=O/2-b[j]/2+T,R=sS(F,U,H),W=!d.arrow&&uu(s)!=null&&U!==R&&i.reference[j]/2-(U<F?z:q)-b[j]/2<0,X=W?U<F?U-F:U-H:0;return{[g]:x[g]+X,data:{[g]:R,centerOffset:U-R-X,...W&&{alignmentOffset:X}},reset:W}}}),yW=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:i,rects:o,initialPlacement:c,platform:d,elements:f}=t,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:x,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:b=!0,...y}=li(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const S=ci(s),C=ys(c),N=ci(c)===c,E=await(d.isRTL==null?void 0:d.isRTL(f.floating)),A=x||(N||!b?[Lh(c)]:uW(c)),P=j!=="none";!x&&P&&A.push(...hW(c,b,j,E));const O=[c,...A],T=await d.detectOverflow(t,y),$=[];let z=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&$.push(T[S]),p){const U=cW(s,o,E);$.push(T[U[0]],T[U[1]])}if(z=[...z,{placement:s,overflows:$}],!$.every(U=>U<=0)){var q,F;const U=(((q=i.flip)==null?void 0:q.index)||0)+1,R=O[U];if(R&&(!(p==="alignment"?C!==ys(R):!1)||z.every(G=>ys(G.placement)===C?G.overflows[0]>0:!0)))return{data:{index:U,overflows:z},reset:{placement:R}};let W=(F=z.filter(X=>X.overflows[0]<=0).sort((X,G)=>X.overflows[1]-G.overflows[1])[0])==null?void 0:F.placement;if(!W)switch(g){case"bestFit":{var H;const X=(H=z.filter(G=>{if(P){const B=ys(G.placement);return B===C||B==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(B=>B>0).reduce((B,J)=>B+J,0)]).sort((G,B)=>G[1]-B[1])[0])==null?void 0:H[0];X&&(W=X);break}case"initialPlacement":W=c;break}if(s!==W)return{reset:{placement:W}}}return{}}}};function eP(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function tP(e){return sW.some(t=>e[t]>=0)}const bW=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:s="referenceHidden",...i}=li(e,t);switch(s){case"referenceHidden":{const o=await r.detectOverflow(t,{...i,elementContext:"reference"}),c=eP(o,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:tP(c)}}}case"escaped":{const o=await r.detectOverflow(t,{...i,altBoundary:!0}),c=eP(o,n.floating);return{data:{escapedOffsets:c,escaped:tP(c)}}}default:return{}}}}},xD=new Set(["left","top"]);async function wW(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=ci(n),c=uu(n),d=ys(n)==="y",f=xD.has(o)?-1:1,h=i&&d?-1:1,p=li(t,e);let{mainAxis:x,crossAxis:g,alignmentAxis:j}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof j=="number"&&(g=c==="end"?j*-1:j),d?{x:g*h,y:x*f}:{x:x*f,y:g*h}}const jW=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:i,placement:o,middlewareData:c}=t,d=await wW(t,e);return o===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+d.x,y:i+d.y,data:{...d,placement:o}}}}},SW=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:i}=t,{mainAxis:o=!0,crossAxis:c=!1,limiter:d={fn:S=>{let{x:C,y:N}=S;return{x:C,y:N}}},...f}=li(e,t),h={x:n,y:r},p=await i.detectOverflow(t,f),x=ys(ci(s)),g=vN(x);let j=h[g],b=h[x];if(o){const S=g==="y"?"top":"left",C=g==="y"?"bottom":"right",N=j+p[S],E=j-p[C];j=sS(N,j,E)}if(c){const S=x==="y"?"top":"left",C=x==="y"?"bottom":"right",N=b+p[S],E=b-p[C];b=sS(N,b,E)}const y=d.fn({...t,[g]:j,[x]:b});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[g]:o,[x]:c}}}}}},NW=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:i,middlewareData:o}=t,{offset:c=0,mainAxis:d=!0,crossAxis:f=!0}=li(e,t),h={x:n,y:r},p=ys(s),x=vN(p);let g=h[x],j=h[p];const b=li(c,t),y=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(d){const N=x==="y"?"height":"width",E=i.reference[x]-i.floating[N]+y.mainAxis,A=i.reference[x]+i.reference[N]-y.mainAxis;g<E?g=E:g>A&&(g=A)}if(f){var S,C;const N=x==="y"?"width":"height",E=xD.has(ci(s)),A=i.reference[p]-i.floating[N]+(E&&((S=o.offset)==null?void 0:S[p])||0)+(E?0:y.crossAxis),P=i.reference[p]+i.reference[N]+(E?0:((C=o.offset)==null?void 0:C[p])||0)-(E?y.crossAxis:0);j<A?j=A:j>P&&(j=P)}return{[x]:g,[p]:j}}}},CW=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:i,platform:o,elements:c}=t,{apply:d=()=>{},...f}=li(e,t),h=await o.detectOverflow(t,f),p=ci(s),x=uu(s),g=ys(s)==="y",{width:j,height:b}=i.floating;let y,S;p==="top"||p==="bottom"?(y=p,S=x===(await(o.isRTL==null?void 0:o.isRTL(c.floating))?"start":"end")?"left":"right"):(S=p,y=x==="end"?"top":"bottom");const C=b-h.top-h.bottom,N=j-h.left-h.right,E=to(b-h[y],C),A=to(j-h[S],N),P=!t.middlewareData.shift;let O=E,T=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=N),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=C),P&&!x){const z=oa(h.left,0),q=oa(h.right,0),F=oa(h.top,0),H=oa(h.bottom,0);g?T=j-2*(z!==0||q!==0?z+q:oa(h.left,h.right)):O=b-2*(F!==0||H!==0?F+H:oa(h.top,h.bottom))}await d({...t,availableWidth:T,availableHeight:O});const $=await o.getDimensions(c.floating);return j!==$.width||b!==$.height?{reset:{rects:!0}}:{}}}};function iv(){return typeof window<"u"}function du(e){return yD(e)?(e.nodeName||"").toLowerCase():"#document"}function da(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ts(e){var t;return(t=(yD(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function yD(e){return iv()?e instanceof Node||e instanceof da(e).Node:!1}function es(e){return iv()?e instanceof Element||e instanceof da(e).Element:!1}function Es(e){return iv()?e instanceof HTMLElement||e instanceof da(e).HTMLElement:!1}function nP(e){return!iv()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof da(e).ShadowRoot}const _W=new Set(["inline","contents"]);function Af(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=ts(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!_W.has(s)}const AW=new Set(["table","td","th"]);function EW(e){return AW.has(du(e))}const PW=[":popover-open",":modal"];function ov(e){return PW.some(t=>{try{return e.matches(t)}catch{return!1}})}const kW=["transform","translate","scale","rotate","perspective"],OW=["transform","translate","scale","rotate","perspective","filter"],TW=["paint","layout","strict","content"];function yN(e){const t=bN(),n=es(e)?ts(e):e;return kW.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)||OW.some(r=>(n.willChange||"").includes(r))||TW.some(r=>(n.contain||"").includes(r))}function RW(e){let t=no(e);for(;Es(t)&&!kc(t);){if(yN(t))return t;if(ov(t))return null;t=no(t)}return null}function bN(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const IW=new Set(["html","body","#document"]);function kc(e){return IW.has(du(e))}function ts(e){return da(e).getComputedStyle(e)}function lv(e){return es(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function no(e){if(du(e)==="html")return e;const t=e.assignedSlot||e.parentNode||nP(e)&&e.host||Ts(e);return nP(t)?t.host:t}function bD(e){const t=no(e);return kc(t)?e.ownerDocument?e.ownerDocument.body:e.body:Es(t)&&Af(t)?t:bD(t)}function Rd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=bD(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),o=da(s);if(i){const c=oS(o);return t.concat(o,o.visualViewport||[],Af(s)?s:[],c&&n?Rd(c):[])}return t.concat(s,Rd(s,[],n))}function oS(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wD(e){const t=ts(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Es(e),i=s?e.offsetWidth:n,o=s?e.offsetHeight:r,c=Dh(n)!==i||Dh(r)!==o;return c&&(n=i,r=o),{width:n,height:r,$:c}}function wN(e){return es(e)?e:e.contextElement}function wc(e){const t=wN(e);if(!Es(t))return js(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=wD(t);let o=(i?Dh(n.width):n.width)/r,c=(i?Dh(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!c||!Number.isFinite(c))&&(c=1),{x:o,y:c}}const MW=js(0);function jD(e){const t=da(e);return!bN()||!t.visualViewport?MW:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $W(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==da(e)?!1:t}function Zo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=wN(e);let o=js(1);t&&(r?es(r)&&(o=wc(r)):o=wc(e));const c=$W(i,n,r)?jD(i):js(0);let d=(s.left+c.x)/o.x,f=(s.top+c.y)/o.y,h=s.width/o.x,p=s.height/o.y;if(i){const x=da(i),g=r&&es(r)?da(r):r;let j=x,b=oS(j);for(;b&&r&&g!==j;){const y=wc(b),S=b.getBoundingClientRect(),C=ts(b),N=S.left+(b.clientLeft+parseFloat(C.paddingLeft))*y.x,E=S.top+(b.clientTop+parseFloat(C.paddingTop))*y.y;d*=y.x,f*=y.y,h*=y.x,p*=y.y,d+=N,f+=E,j=da(b),b=oS(j)}}return Fh({width:h,height:p,x:d,y:f})}function cv(e,t){const n=lv(e).scrollLeft;return t?t.left+n:Zo(Ts(e)).left+n}function SD(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-cv(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function DW(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",o=Ts(r),c=t?ov(t.floating):!1;if(r===o||c&&i)return n;let d={scrollLeft:0,scrollTop:0},f=js(1);const h=js(0),p=Es(r);if((p||!p&&!i)&&((du(r)!=="body"||Af(o))&&(d=lv(r)),Es(r))){const g=Zo(r);f=wc(r),h.x=g.x+r.clientLeft,h.y=g.y+r.clientTop}const x=o&&!p&&!i?SD(o,d):js(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+h.x+x.x,y:n.y*f.y-d.scrollTop*f.y+h.y+x.y}}function LW(e){return Array.from(e.getClientRects())}function FW(e){const t=Ts(e),n=lv(e),r=e.ownerDocument.body,s=oa(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=oa(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+cv(e);const c=-n.scrollTop;return ts(r).direction==="rtl"&&(o+=oa(t.clientWidth,r.clientWidth)-s),{width:s,height:i,x:o,y:c}}const rP=25;function BW(e,t){const n=da(e),r=Ts(e),s=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,c=0,d=0;if(s){i=s.width,o=s.height;const h=bN();(!h||h&&t==="fixed")&&(c=s.offsetLeft,d=s.offsetTop)}const f=cv(r);if(f<=0){const h=r.ownerDocument,p=h.body,x=getComputedStyle(p),g=h.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,j=Math.abs(r.clientWidth-p.clientWidth-g);j<=rP&&(i-=j)}else f<=rP&&(i+=f);return{width:i,height:o,x:c,y:d}}const zW=new Set(["absolute","fixed"]);function qW(e,t){const n=Zo(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=Es(e)?wc(e):js(1),o=e.clientWidth*i.x,c=e.clientHeight*i.y,d=s*i.x,f=r*i.y;return{width:o,height:c,x:d,y:f}}function aP(e,t,n){let r;if(t==="viewport")r=BW(e,n);else if(t==="document")r=FW(Ts(e));else if(es(t))r=qW(t,n);else{const s=jD(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Fh(r)}function ND(e,t){const n=no(e);return n===t||!es(n)||kc(n)?!1:ts(n).position==="fixed"||ND(n,t)}function UW(e,t){const n=t.get(e);if(n)return n;let r=Rd(e,[],!1).filter(c=>es(c)&&du(c)!=="body"),s=null;const i=ts(e).position==="fixed";let o=i?no(e):e;for(;es(o)&&!kc(o);){const c=ts(o),d=yN(o);!d&&c.position==="fixed"&&(s=null),(i?!d&&!s:!d&&c.position==="static"&&!!s&&zW.has(s.position)||Af(o)&&!d&&ND(e,o))?r=r.filter(h=>h!==o):s=c,o=no(o)}return t.set(e,r),r}function WW(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const o=[...n==="clippingAncestors"?ov(t)?[]:UW(t,this._c):[].concat(n),r],c=o[0],d=o.reduce((f,h)=>{const p=aP(t,h,s);return f.top=oa(p.top,f.top),f.right=to(p.right,f.right),f.bottom=to(p.bottom,f.bottom),f.left=oa(p.left,f.left),f},aP(t,c,s));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function VW(e){const{width:t,height:n}=wD(e);return{width:t,height:n}}function HW(e,t,n){const r=Es(t),s=Ts(t),i=n==="fixed",o=Zo(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const d=js(0);function f(){d.x=cv(s)}if(r||!r&&!i)if((du(t)!=="body"||Af(s))&&(c=lv(t)),r){const g=Zo(t,!0,i,t);d.x=g.x+t.clientLeft,d.y=g.y+t.clientTop}else s&&f();i&&!r&&s&&f();const h=s&&!r&&!i?SD(s,c):js(0),p=o.left+c.scrollLeft-d.x-h.x,x=o.top+c.scrollTop-d.y-h.y;return{x:p,y:x,width:o.width,height:o.height}}function Sy(e){return ts(e).position==="static"}function sP(e,t){if(!Es(e)||ts(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ts(e)===n&&(n=n.ownerDocument.body),n}function CD(e,t){const n=da(e);if(ov(e))return n;if(!Es(e)){let s=no(e);for(;s&&!kc(s);){if(es(s)&&!Sy(s))return s;s=no(s)}return n}let r=sP(e,t);for(;r&&EW(r)&&Sy(r);)r=sP(r,t);return r&&kc(r)&&Sy(r)&&!yN(r)?n:r||RW(e)||n}const KW=async function(e){const t=this.getOffsetParent||CD,n=this.getDimensions,r=await n(e.floating);return{reference:HW(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function GW(e){return ts(e).direction==="rtl"}const YW={convertOffsetParentRelativeRectToViewportRelativeRect:DW,getDocumentElement:Ts,getClippingRect:WW,getOffsetParent:CD,getElementRects:KW,getClientRects:LW,getDimensions:VW,getScale:wc,isElement:es,isRTL:GW};function _D(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function XW(e,t){let n=null,r;const s=Ts(e);function i(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function o(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),i();const f=e.getBoundingClientRect(),{left:h,top:p,width:x,height:g}=f;if(c||t(),!x||!g)return;const j=sh(p),b=sh(s.clientWidth-(h+x)),y=sh(s.clientHeight-(p+g)),S=sh(h),N={rootMargin:-j+"px "+-b+"px "+-y+"px "+-S+"px",threshold:oa(0,to(1,d))||1};let E=!0;function A(P){const O=P[0].intersectionRatio;if(O!==d){if(!E)return o();O?o(!1,O):r=setTimeout(()=>{o(!1,1e-7)},1e3)}O===1&&!_D(f,e.getBoundingClientRect())&&o(),E=!1}try{n=new IntersectionObserver(A,{...N,root:s.ownerDocument})}catch{n=new IntersectionObserver(A,N)}n.observe(e)}return o(!0),i}function QW(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=wN(e),h=s||i?[...f?Rd(f):[],...Rd(t)]:[];h.forEach(S=>{s&&S.addEventListener("scroll",n,{passive:!0}),i&&S.addEventListener("resize",n)});const p=f&&c?XW(f,n):null;let x=-1,g=null;o&&(g=new ResizeObserver(S=>{let[C]=S;C&&C.target===f&&g&&(g.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var N;(N=g)==null||N.observe(t)})),n()}),f&&!d&&g.observe(f),g.observe(t));let j,b=d?Zo(e):null;d&&y();function y(){const S=Zo(e);b&&!_D(b,S)&&n(),b=S,j=requestAnimationFrame(y)}return n(),()=>{var S;h.forEach(C=>{s&&C.removeEventListener("scroll",n),i&&C.removeEventListener("resize",n)}),p?.(),(S=g)==null||S.disconnect(),g=null,d&&cancelAnimationFrame(j)}}const JW=jW,ZW=SW,eV=yW,tV=CW,nV=bW,iP=xW,rV=NW,aV=(e,t,n)=>{const r=new Map,s={platform:YW,...n},i={...s.platform,_c:r};return gW(e,t,{...s,platform:i})};var sV=typeof document<"u",iV=function(){},Oh=sV?m.useLayoutEffect:iV;function Bh(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,s;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(!Bh(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&e.$$typeof)&&!Bh(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function AD(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function oP(e,t){const n=AD(e);return Math.round(t*n)/n}function Ny(e){const t=m.useRef(e);return Oh(()=>{t.current=e}),t}function oV(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:c=!0,whileElementsMounted:d,open:f}=e,[h,p]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[x,g]=m.useState(r);Bh(x,r)||g(r);const[j,b]=m.useState(null),[y,S]=m.useState(null),C=m.useCallback(G=>{G!==P.current&&(P.current=G,b(G))},[]),N=m.useCallback(G=>{G!==O.current&&(O.current=G,S(G))},[]),E=i||j,A=o||y,P=m.useRef(null),O=m.useRef(null),T=m.useRef(h),$=d!=null,z=Ny(d),q=Ny(s),F=Ny(f),H=m.useCallback(()=>{if(!P.current||!O.current)return;const G={placement:t,strategy:n,middleware:x};q.current&&(G.platform=q.current),aV(P.current,O.current,G).then(B=>{const J={...B,isPositioned:F.current!==!1};U.current&&!Bh(T.current,J)&&(T.current=J,lu.flushSync(()=>{p(J)}))})},[x,t,n,q,F]);Oh(()=>{f===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,p(G=>({...G,isPositioned:!1})))},[f]);const U=m.useRef(!1);Oh(()=>(U.current=!0,()=>{U.current=!1}),[]),Oh(()=>{if(E&&(P.current=E),A&&(O.current=A),E&&A){if(z.current)return z.current(E,A,H);H()}},[E,A,H,z,$]);const R=m.useMemo(()=>({reference:P,floating:O,setReference:C,setFloating:N}),[C,N]),W=m.useMemo(()=>({reference:E,floating:A}),[E,A]),X=m.useMemo(()=>{const G={position:n,left:0,top:0};if(!W.floating)return G;const B=oP(W.floating,h.x),J=oP(W.floating,h.y);return c?{...G,transform:"translate("+B+"px, "+J+"px)",...AD(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:B,top:J}},[n,c,W.floating,h.x,h.y]);return m.useMemo(()=>({...h,update:H,refs:R,elements:W,floatingStyles:X}),[h,H,R,W,X])}const lV=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?iP({element:r.current,padding:s}).fn(n):{}:r?iP({element:r,padding:s}).fn(n):{}}}},cV=(e,t)=>({...JW(e),options:[e,t]}),uV=(e,t)=>({...ZW(e),options:[e,t]}),dV=(e,t)=>({...rV(e),options:[e,t]}),fV=(e,t)=>({...eV(e),options:[e,t]}),pV=(e,t)=>({...tV(e),options:[e,t]}),hV=(e,t)=>({...nV(e),options:[e,t]}),mV=(e,t)=>({...lV(e),options:[e,t]});var vV="Arrow",ED=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...i}=e;return a.jsx(Ye.svg,{...i,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});ED.displayName=vV;var gV=ED;function uv(e){const[t,n]=m.useState(void 0);return rr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[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 jN="Popper",[PD,co]=mr(jN),[xV,kD]=PD(jN),OD=e=>{const{__scopePopper:t,children:n}=e,[r,s]=m.useState(null);return a.jsx(xV,{scope:t,anchor:r,onAnchorChange:s,children:n})};OD.displayName=jN;var TD="PopperAnchor",RD=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,i=kD(TD,n),o=m.useRef(null),c=St(t,o),d=m.useRef(null);return m.useEffect(()=>{const f=d.current;d.current=r?.current||o.current,f!==d.current&&i.onAnchorChange(d.current)}),r?null:a.jsx(Ye.div,{...s,ref:c})});RD.displayName=TD;var SN="PopperContent",[yV,bV]=PD(SN),ID=m.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:o=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:h=0,sticky:p="partial",hideWhenDetached:x=!1,updatePositionStrategy:g="optimized",onPlaced:j,...b}=e,y=kD(SN,n),[S,C]=m.useState(null),N=St(t,V=>C(V)),[E,A]=m.useState(null),P=uv(E),O=P?.width??0,T=P?.height??0,$=r+(i!=="center"?"-"+i:""),z=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},q=Array.isArray(f)?f:[f],F=q.length>0,H={padding:z,boundary:q.filter(jV),altBoundary:F},{refs:U,floatingStyles:R,placement:W,isPositioned:X,middlewareData:G}=oV({strategy:"fixed",placement:$,whileElementsMounted:(...V)=>QW(...V,{animationFrame:g==="always"}),elements:{reference:y.anchor},middleware:[cV({mainAxis:s+T,alignmentAxis:o}),d&&uV({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?dV():void 0,...H}),d&&fV({...H}),pV({...H,apply:({elements:V,rects:de,availableWidth:Q,availableHeight:ee})=>{const{width:pe,height:ae}=de.reference,Re=V.floating.style;Re.setProperty("--radix-popper-available-width",`${Q}px`),Re.setProperty("--radix-popper-available-height",`${ee}px`),Re.setProperty("--radix-popper-anchor-width",`${pe}px`),Re.setProperty("--radix-popper-anchor-height",`${ae}px`)}}),E&&mV({element:E,padding:c}),SV({arrowWidth:O,arrowHeight:T}),x&&hV({strategy:"referenceHidden",...H})]}),[B,J]=DD(W),D=Vn(j);rr(()=>{X&&D?.()},[X,D]);const I=G.arrow?.x,re=G.arrow?.y,ne=G.arrow?.centerOffset!==0,[fe,he]=m.useState();return rr(()=>{S&&he(window.getComputedStyle(S).zIndex)},[S]),a.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:X?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[G.transformOrigin?.x,G.transformOrigin?.y].join(" "),...G.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(yV,{scope:n,placedSide:B,onArrowChange:A,arrowX:I,arrowY:re,shouldHideArrow:ne,children:a.jsx(Ye.div,{"data-side":B,"data-align":J,...b,ref:N,style:{...b.style,animation:X?void 0:"none"}})})})});ID.displayName=SN;var MD="PopperArrow",wV={top:"bottom",right:"left",bottom:"top",left:"right"},$D=m.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,i=bV(MD,r),o=wV[i.placedSide];return a.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:a.jsx(gV,{...s,ref:n,style:{...s.style,display:"block"}})})});$D.displayName=MD;function jV(e){return e!==null}var SV=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:s}=t,o=s.arrow?.centerOffset!==0,c=o?0:e.arrowWidth,d=o?0:e.arrowHeight,[f,h]=DD(n),p={start:"0%",center:"50%",end:"100%"}[h],x=(s.arrow?.x??0)+c/2,g=(s.arrow?.y??0)+d/2;let j="",b="";return f==="bottom"?(j=o?p:`${x}px`,b=`${-d}px`):f==="top"?(j=o?p:`${x}px`,b=`${r.floating.height+d}px`):f==="right"?(j=`${-d}px`,b=o?p:`${g}px`):f==="left"&&(j=`${r.floating.width+d}px`,b=o?p:`${g}px`),{data:{x:j,y:b}}}});function DD(e){const[t,n="center"]=e.split("-");return[t,n]}var dv=OD,Ef=RD,fv=ID,pv=$D,NV=Symbol("radix.slottable");function CV(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=NV,t}var[hv]=mr("Tooltip",[co]),mv=co(),LD="TooltipProvider",_V=700,lS="tooltip.open",[AV,NN]=hv(LD),FD=e=>{const{__scopeTooltip:t,delayDuration:n=_V,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=e,o=m.useRef(!0),c=m.useRef(!1),d=m.useRef(0);return m.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),a.jsx(AV,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(d.current),o.current=!1},[]),onClose:m.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:m.useCallback(f=>{c.current=f},[]),disableHoverableContent:s,children:i})};FD.displayName=LD;var Id="Tooltip",[EV,Pf]=hv(Id),BD=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:o,delayDuration:c}=e,d=NN(Id,e.__scopeTooltip),f=mv(t),[h,p]=m.useState(null),x=nr(),g=m.useRef(0),j=o??d.disableHoverableContent,b=c??d.delayDuration,y=m.useRef(!1),[S,C]=ha({prop:r,defaultProp:s??!1,onChange:O=>{O?(d.onOpen(),document.dispatchEvent(new CustomEvent(lS))):d.onClose(),i?.(O)},caller:Id}),N=m.useMemo(()=>S?y.current?"delayed-open":"instant-open":"closed",[S]),E=m.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,C(!0)},[C]),A=m.useCallback(()=>{window.clearTimeout(g.current),g.current=0,C(!1)},[C]),P=m.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,C(!0),g.current=0},b)},[b,C]);return m.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),a.jsx(dv,{...f,children:a.jsx(EV,{scope:t,contentId:x,open:S,stateAttribute:N,trigger:h,onTriggerChange:p,onTriggerEnter:m.useCallback(()=>{d.isOpenDelayedRef.current?P():E()},[d.isOpenDelayedRef,P,E]),onTriggerLeave:m.useCallback(()=>{j?A():(window.clearTimeout(g.current),g.current=0)},[A,j]),onOpen:E,onClose:A,disableHoverableContent:j,children:n})})};BD.displayName=Id;var cS="TooltipTrigger",zD=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Pf(cS,n),i=NN(cS,n),o=mv(n),c=m.useRef(null),d=St(t,c,s.onTriggerChange),f=m.useRef(!1),h=m.useRef(!1),p=m.useCallback(()=>f.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),a.jsx(Ef,{asChild:!0,...o,children:a.jsx(Ye.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:d,onPointerMove:Te(e.onPointerMove,x=>{x.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),h.current=!0)}),onPointerLeave:Te(e.onPointerLeave,()=>{s.onTriggerLeave(),h.current=!1}),onPointerDown:Te(e.onPointerDown,()=>{s.open&&s.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Te(e.onFocus,()=>{f.current||s.onOpen()}),onBlur:Te(e.onBlur,s.onClose),onClick:Te(e.onClick,s.onClose)})})});zD.displayName=cS;var CN="TooltipPortal",[PV,kV]=hv(CN,{forceMount:void 0}),qD=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,i=Pf(CN,t);return a.jsx(PV,{scope:t,forceMount:n,children:a.jsx(Yn,{present:n||i.open,children:a.jsx(gl,{asChild:!0,container:s,children:r})})})};qD.displayName=CN;var Oc="TooltipContent",UD=m.forwardRef((e,t)=>{const n=kV(Oc,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=e,o=Pf(Oc,e.__scopeTooltip);return a.jsx(Yn,{present:r||o.open,children:o.disableHoverableContent?a.jsx(WD,{side:s,...i,ref:t}):a.jsx(OV,{side:s,...i,ref:t})})}),OV=m.forwardRef((e,t)=>{const n=Pf(Oc,e.__scopeTooltip),r=NN(Oc,e.__scopeTooltip),s=m.useRef(null),i=St(t,s),[o,c]=m.useState(null),{trigger:d,onClose:f}=n,h=s.current,{onPointerInTransitChange:p}=r,x=m.useCallback(()=>{c(null),p(!1)},[p]),g=m.useCallback((j,b)=>{const y=j.currentTarget,S={x:j.clientX,y:j.clientY},C=$V(S,y.getBoundingClientRect()),N=DV(S,C),E=LV(b.getBoundingClientRect()),A=BV([...N,...E]);c(A),p(!0)},[p]);return m.useEffect(()=>()=>x(),[x]),m.useEffect(()=>{if(d&&h){const j=y=>g(y,h),b=y=>g(y,d);return d.addEventListener("pointerleave",j),h.addEventListener("pointerleave",b),()=>{d.removeEventListener("pointerleave",j),h.removeEventListener("pointerleave",b)}}},[d,h,g,x]),m.useEffect(()=>{if(o){const j=b=>{const y=b.target,S={x:b.clientX,y:b.clientY},C=d?.contains(y)||h?.contains(y),N=!FV(S,o);C?x():N&&(x(),f())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[d,h,o,f,x]),a.jsx(WD,{...e,ref:i})}),[TV,RV]=hv(Id,{isInside:!1}),IV=CV("TooltipContent"),WD=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...c}=e,d=Pf(Oc,n),f=mv(n),{onClose:h}=d;return m.useEffect(()=>(document.addEventListener(lS,h),()=>document.removeEventListener(lS,h)),[h]),m.useEffect(()=>{if(d.trigger){const p=x=>{x.target?.contains(d.trigger)&&h()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,h]),a.jsx(vl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:p=>p.preventDefault(),onDismiss:h,children:a.jsxs(fv,{"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:[a.jsx(IV,{children:r}),a.jsx(TV,{scope:n,isInside:!0,children:a.jsx(s7,{id:d.contentId,role:"tooltip",children:s||r})})]})})});UD.displayName=Oc;var VD="TooltipArrow",MV=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=mv(n);return RV(VD,n).isInside?null:a.jsx(pv,{...s,...r,ref:t})});MV.displayName=VD;function $V(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function DV(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 LV(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function FV(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const c=t[i],d=t[o],f=c.x,h=c.y,p=d.x,x=d.y;h>r!=x>r&&n<(p-f)*(r-h)/(x-h)+f&&(s=!s)}return s}function BV(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),zV(t)}function zV(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}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 qV=FD,UV=BD,WV=zD,VV=qD,HD=UD;const ro=qV,ao=UV,so=WV,ui=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>a.jsx(VV,{children:a.jsx(HD,{ref:r,sideOffset:t,className:Se("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));ui.displayName=HD.displayName;var vv=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(){}},HV={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},KV=class{#e=HV;#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)}},uS=new KV;function GV(e){setTimeout(e,0)}var gv=typeof window>"u"||"Deno"in globalThis;function Ka(){}function YV(e,t){return typeof e=="function"?e(t):e}function XV(e){return typeof e=="number"&&e>=0&&e!==1/0}function QV(e,t){return Math.max(e+(t||0)-Date.now(),0)}function dS(e,t){return typeof e=="function"?e(t):e}function JV(e,t){return typeof e=="function"?e(t):e}function lP(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:c}=e;if(o){if(r){if(t.queryHash!==_N(o,t.options))return!1}else if(!$d(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||s&&s!==t.state.fetchStatus||i&&!i(t))}function cP(e,t){const{exact:n,status:r,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Md(t.options.mutationKey)!==Md(i))return!1}else if(!$d(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function _N(e,t){return(t?.queryKeyHashFn||Md)(e)}function Md(e){return JSON.stringify(e,(t,n)=>fS(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function $d(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>$d(e[n],t[n])):!1}var ZV=Object.prototype.hasOwnProperty;function KD(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=uP(e)&&uP(t);if(!r&&!(fS(e)&&fS(t)))return t;const i=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),c=o.length,d=r?new Array(c):{};let f=0;for(let h=0;h<c;h++){const p=r?h:o[h],x=e[p],g=t[p];if(x===g){d[p]=x,(r?h<i:ZV.call(e,p))&&f++;continue}if(x===null||g===null||typeof x!="object"||typeof g!="object"){d[p]=g;continue}const j=KD(x,g,n+1);d[p]=j,j===x&&f++}return i===c&&f===i?e:d}function uP(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function fS(e){if(!dP(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!dP(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function dP(e){return Object.prototype.toString.call(e)==="[object Object]"}function eH(e){return new Promise(t=>{uS.setTimeout(t,e)})}function tH(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?KD(e,t):t}function nH(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function rH(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var AN=Symbol();function GD(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===AN?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function aH(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t(),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var sH=class extends vv{#e;#n;#t;constructor(){super(),this.#t=e=>{if(!gv&&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"}},YD=new sH;function iH(){let e,t;const n=new Promise((s,i)=>{e=s,t=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var oH=GV;function lH(){let e=[],t=0,n=c=>{c()},r=c=>{c()},s=oH;const i=c=>{t?e.push(c):s(()=>{n(c)})},o=()=>{const c=e;e=[],c.length&&s(()=>{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=>{s=c}}}var Cr=lH(),cH=class extends vv{#e=!0;#n;#t;constructor(){super(),this.#t=e=>{if(!gv&&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}},zh=new cH;function uH(e){return Math.min(1e3*2**e,3e4)}function XD(e){return(e??"online")==="online"?zh.isOnline():!0}var pS=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function QD(e){let t=!1,n=0,r;const s=iH(),i=()=>s.status!=="pending",o=b=>{if(!i()){const y=new pS(b);x(y),e.onCancel?.(y)}},c=()=>{t=!0},d=()=>{t=!1},f=()=>YD.isFocused()&&(e.networkMode==="always"||zh.isOnline())&&e.canRun(),h=()=>XD(e.networkMode)&&e.canRun(),p=b=>{i()||(r?.(),s.resolve(b))},x=b=>{i()||(r?.(),s.reject(b))},g=()=>new Promise(b=>{r=y=>{(i()||f())&&b(y)},e.onPause?.()}).then(()=>{r=void 0,i()||e.onContinue?.()}),j=()=>{if(i())return;let b;const y=n===0?e.initialPromise:void 0;try{b=y??e.fn()}catch(S){b=Promise.reject(S)}Promise.resolve(b).then(p).catch(S=>{if(i())return;const C=e.retry??(gv?0:3),N=e.retryDelay??uH,E=typeof N=="function"?N(n,S):N,A=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,S);if(t||!A){x(S);return}n++,e.onFail?.(n,S),eH(E).then(()=>f()?void 0:g()).then(()=>{t?x(S):j()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(r?.(),s),cancelRetry:c,continueRetry:d,canStart:h,start:()=>(h()?j():g().then(j),s)}}var JD=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),XV(this.gcTime)&&(this.#e=uS.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(gv?1/0:300*1e3))}clearGcTimeout(){this.#e&&(uS.clearTimeout(this.#e),this.#e=void 0)}},dH=class extends JD{#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=pP(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=pP(this.options);t.data!==void 0&&(this.setState(fP(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#t.remove(this)}setData(e,t){const n=tH(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(Ka).catch(Ka):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>JV(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===AN||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>dS(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:!QV(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)})},s=()=>{const c=GD(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:s};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=QD({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:c=>{c instanceof pS&&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 pS){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,...fH(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...fP(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 s=e.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Cr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#t.notify({query:this,type:"updated",action:e})})}};function fH(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:XD(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function fP(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function pP(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 hP(e){return{onFetch:(t,n)=>{const r=t.options,s=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=>{aH(j,()=>t.signal,()=>h=!0)},x=GD(t.options,t.fetchOptions),g=async(j,b,y)=>{if(h)return Promise.reject();if(b==null&&j.pages.length)return Promise.resolve(j);const C=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:b,direction:y?"backward":"forward",meta:t.options.meta};return p(P),P})(),N=await x(C),{maxPages:E}=t.options,A=y?rH:nH;return{pages:A(j.pages,N,E),pageParams:A(j.pageParams,b,E)}};if(s&&i.length){const j=s==="backward",b=j?pH:mP,y={pages:i,pageParams:o},S=b(r,y);c=await g(y,S,j)}else{const j=e??i.length;do{const b=d===0?o[0]??r.initialPageParam:mP(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 mP(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 pH(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var hH=class extends JD{#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||mH(),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=QD({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",s=!this.#a.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:s}),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:s})}const i=await this.#a.start();return await this.#t.config.onSuccess?.(i,e,this.state.context,this,n),await this.options.onSuccess?.(i,e,this.state.context,n),await this.#t.config.onSettled?.(i,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(i,null,e,this.state.context,n),this.#r({type:"success",data:i}),i}catch(i){try{await this.#t.config.onError?.(i,e,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onError?.(i,e,this.state.context,n)}catch(o){Promise.reject(o)}try{await this.#t.config.onSettled?.(void 0,i,this.state.variables,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,i,e,this.state.context,n)}catch(o){Promise.reject(o)}throw this.#r({type:"error",error:i}),i}finally{this.#t.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Cr.batch(()=>{this.#n.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function mH(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var vH=class extends vv{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 hH({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=ih(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=ih(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=ih(e);if(typeof t=="string"){const r=this.#n.get(t)?.find(s=>s.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=ih(e);return typeof t=="string"?this.#n.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Cr.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#n.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>cP(t,n))}findAll(e={}){return this.getAll().filter(t=>cP(e,t))}notify(e){Cr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Cr.batch(()=>Promise.all(e.map(t=>t.continue().catch(Ka))))}};function ih(e){return e.options.scope?.id}var gH=class extends vv{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,s=t.queryHash??_N(r,t);let i=this.get(s);return i||(i=new dH({client:e,queryKey:r,queryHash:s,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(i)),i}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Cr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>lP(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>lP(e,n)):t}notify(e){Cr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Cr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Cr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},xH=class{#e;#n;#t;#a;#r;#i;#o;#s;constructor(e={}){this.#e=e.queryCache||new gH,this.#n=e.mutationCache||new vH,this.#t=e.defaultOptions||{},this.#a=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=YD.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=zh.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(dS(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=YV(t,i);if(o!==void 0)return this.#e.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Cr.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Cr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Cr.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Cr.batch(()=>this.#e.findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Ka).catch(Ka)}invalidateQueries(e,t={}){return Cr.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Cr.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Ka)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ka)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(dS(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ka).catch(Ka)}fetchInfiniteQuery(e){return e.behavior=hP(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ka).catch(Ka)}ensureInfiniteQueryData(e){return e.behavior=hP(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return zh.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(Md(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#a.values()],n={};return t.forEach(r=>{$d(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Md(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{$d(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=_N(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===AN&&(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()}},yH=m.createContext(void 0),bH=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),a.jsx(yH.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 Yi;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Yi||(Yi={}));const vP="popstate";function wH(e){e===void 0&&(e={});function t(r,s){let{pathname:i,search:o,hash:c}=r.location;return hS("",{pathname:i,search:o,hash:c},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:qh(s)}return SH(t,n,null,e)}function Dn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function EN(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function jH(){return Math.random().toString(36).substr(2,8)}function gP(e,t){return{usr:e.state,key:e.key,idx:t}}function hS(e,t,n,r){return n===void 0&&(n=null),Dd({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?fu(t):t,{state:n,key:t&&t.key||r||jH()})}function qh(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 fu(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 SH(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,c=Yi.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=Yi.Pop;let y=h(),S=y==null?null:y-f;f=y,d&&d({action:c,location:b.location,delta:S})}function x(y,S){c=Yi.Push;let C=hS(b.location,y,S);f=h()+1;let N=gP(C,f),E=b.createHref(C);try{o.pushState(N,"",E)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;s.location.assign(E)}i&&d&&d({action:c,location:b.location,delta:1})}function g(y,S){c=Yi.Replace;let C=hS(b.location,y,S);f=h();let N=gP(C,f),E=b.createHref(C);o.replaceState(N,"",E),i&&d&&d({action:c,location:b.location,delta:0})}function j(y){let S=s.location.origin!=="null"?s.location.origin:s.location.href,C=typeof y=="string"?y:qh(y);return C=C.replace(/ $/,"%20"),Dn(S,"No window.location.(origin|href) available to create URL for href: "+C),new URL(C,S)}let b={get action(){return c},get location(){return e(s,o)},listen(y){if(d)throw new Error("A history only accepts one active listener");return s.addEventListener(vP,p),d=y,()=>{s.removeEventListener(vP,p),d=null}},createHref(y){return t(s,y)},createURL:j,encodeLocation(y){let S=j(y);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:x,replace:g,go(y){return o.go(y)}};return b}var xP;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(xP||(xP={}));function NH(e,t,n){return n===void 0&&(n="/"),CH(e,t,n)}function CH(e,t,n,r){let s=typeof t=="string"?fu(t):t,i=Tc(s.pathname||"/",n);if(i==null)return null;let o=ZD(e);_H(o);let c=null;for(let d=0;c==null&&d<o.length;++d){let f=DH(i);c=MH(o[d],f)}return c}function ZD(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(i,o,c)=>{let d={relativePath:c===void 0?i.path||"":c,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};d.relativePath.startsWith("/")&&(Dn(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=Ji([r,d.relativePath]),h=n.concat(d);i.children&&i.children.length>0&&(Dn(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),ZD(i.children,t,h,f)),!(i.path==null&&!i.index)&&t.push({path:f,score:RH(f,i.index),routesMeta:h})};return e.forEach((i,o)=>{var c;if(i.path===""||!((c=i.path)!=null&&c.includes("?")))s(i,o);else for(let d of e5(i.path))s(i,o,d)}),t}function e5(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let o=e5(r.join("/")),c=[];return c.push(...o.map(d=>d===""?i:[i,d].join("/"))),s&&c.push(...o),c.map(d=>e.startsWith("/")&&d===""?"/":d)}function _H(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:IH(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const AH=/^:[\w-]+$/,EH=3,PH=2,kH=1,OH=10,TH=-2,yP=e=>e==="*";function RH(e,t){let n=e.split("/"),r=n.length;return n.some(yP)&&(r+=TH),t&&(r+=PH),n.filter(s=>!yP(s)).reduce((s,i)=>s+(AH.test(i)?EH:i===""?kH:OH),r)}function IH(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function MH(e,t,n){let{routesMeta:r}=e,s={},i="/",o=[];for(let c=0;c<r.length;++c){let d=r[c],f=c===r.length-1,h=i==="/"?t:t.slice(i.length)||"/",p=dn({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},h),x=d.route;if(!p)return null;Object.assign(s,p.params),o.push({params:s,pathname:Ji([i,p.pathname]),pathnameBase:qH(Ji([i,p.pathnameBase])),route:x}),p.pathnameBase!=="/"&&(i=Ji([i,p.pathnameBase]))}return o}function dn(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=$H(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let i=s[0],o=i.replace(/(.)\/+$/,"$1"),c=s.slice(1);return{params:r.reduce((f,h,p)=>{let{paramName:x,isOptional:g}=h;if(x==="*"){let b=c[p]||"";o=i.slice(0,i.length-b.length).replace(/(.)\/+$/,"$1")}const j=c[p];return g&&!j?f[x]=void 0:f[x]=(j||"").replace(/%2F/g,"/"),f},{}),pathname:i,pathnameBase:o,pattern:e}}function $H(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),EN(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=[],s="^"+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:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function DH(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return EN(!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 Tc(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 LH=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,FH=e=>LH.test(e);function BH(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?fu(e):e,i;if(n)if(FH(n))i=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),EN(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?i=bP(n.substring(1),"/"):i=bP(n,t)}else i=t;return{pathname:i,search:UH(r),hash:WH(s)}}function bP(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Cy(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 zH(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function PN(e,t){let n=zH(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function kN(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=fu(e):(s=Dd({},e),Dn(!s.pathname||!s.pathname.includes("?"),Cy("?","pathname","search",s)),Dn(!s.pathname||!s.pathname.includes("#"),Cy("#","pathname","hash",s)),Dn(!s.search||!s.search.includes("#"),Cy("#","search","hash",s)));let i=e===""||s.pathname==="",o=i?"/":s.pathname,c;if(o==null)c=n;else{let p=t.length-1;if(!r&&o.startsWith("..")){let x=o.split("/");for(;x[0]==="..";)x.shift(),p-=1;s.pathname=x.join("/")}c=p>=0?t[p]:"/"}let d=BH(s,c),f=o&&o!=="/"&&o.endsWith("/"),h=(i||o===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||h)&&(d.pathname+="/"),d}const Ji=e=>e.join("/").replace(/\/\/+/g,"/"),qH=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),UH=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,WH=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function VH(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const t5=["post","put","patch","delete"];new Set(t5);const HH=["get",...t5];new Set(HH);function Ld(){return Ld=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},Ld.apply(this,arguments)}const xv=m.createContext(null),n5=m.createContext(null),mi=m.createContext(null),yv=m.createContext(null),Rs=m.createContext({outlet:null,matches:[],isDataRoute:!1}),r5=m.createContext(null);function KH(e,t){let{relative:n}=t===void 0?{}:t;pu()||Dn(!1);let{basename:r,navigator:s}=m.useContext(mi),{hash:i,pathname:o,search:c}=bv(e,{relative:n}),d=o;return r!=="/"&&(d=o==="/"?r:Ji([r,o])),s.createHref({pathname:d,search:c,hash:i})}function pu(){return m.useContext(yv)!=null}function Is(){return pu()||Dn(!1),m.useContext(yv).location}function a5(e){m.useContext(mi).static||m.useLayoutEffect(e)}function Ia(){let{isDataRoute:e}=m.useContext(Rs);return e?lK():GH()}function GH(){pu()||Dn(!1);let e=m.useContext(xv),{basename:t,future:n,navigator:r}=m.useContext(mi),{matches:s}=m.useContext(Rs),{pathname:i}=Is(),o=JSON.stringify(PN(s,n.v7_relativeSplatPath)),c=m.useRef(!1);return a5(()=>{c.current=!0}),m.useCallback(function(f,h){if(h===void 0&&(h={}),!c.current)return;if(typeof f=="number"){r.go(f);return}let p=kN(f,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Ji([t,p.pathname])),(h.replace?r.replace:r.push)(p,h.state,h)},[t,r,o,i,e])}const YH=m.createContext(null);function XH(e){let t=m.useContext(Rs).outlet;return t&&m.createElement(YH.Provider,{value:e},t)}function yl(){let{matches:e}=m.useContext(Rs),t=e[e.length-1];return t?t.params:{}}function bv(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=m.useContext(mi),{matches:s}=m.useContext(Rs),{pathname:i}=Is(),o=JSON.stringify(PN(s,r.v7_relativeSplatPath));return m.useMemo(()=>kN(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function QH(e,t){return JH(e,t)}function JH(e,t,n,r){pu()||Dn(!1);let{navigator:s}=m.useContext(mi),{matches:i}=m.useContext(Rs),o=i[i.length-1],c=o?o.params:{};o&&o.pathname;let d=o?o.pathnameBase:"/";o&&o.route;let f=Is(),h;if(t){var p;let y=typeof t=="string"?fu(t):t;d==="/"||(p=y.pathname)!=null&&p.startsWith(d)||Dn(!1),h=y}else h=f;let x=h.pathname||"/",g=x;if(d!=="/"){let y=d.replace(/^\//,"").split("/");g="/"+x.replace(/^\//,"").split("/").slice(y.length).join("/")}let j=NH(e,{pathname:g}),b=rK(j&&j.map(y=>Object.assign({},y,{params:Object.assign({},c,y.params),pathname:Ji([d,s.encodeLocation?s.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?d:Ji([d,s.encodeLocation?s.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),i,n,r);return t&&b?m.createElement(yv.Provider,{value:{location:Ld({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:Yi.Pop}},b):b}function ZH(){let e=oK(),t=VH(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:s},n):null,null)}const eK=m.createElement(ZH,null);class tK extends m.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?m.createElement(Rs.Provider,{value:this.props.routeContext},m.createElement(r5.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function nK(e){let{routeContext:t,match:n,children:r}=e,s=m.useContext(xv);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(Rs.Provider,{value:t},r)}function rK(e,t,n,r){var s;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=(s=n)==null?void 0:s.errors;if(c!=null){let h=o.findIndex(p=>p.route.id&&c?.[p.route.id]!==void 0);h>=0||Dn(!1),o=o.slice(0,Math.min(o.length,h+1))}let d=!1,f=-1;if(n&&r&&r.v7_partialHydration)for(let h=0;h<o.length;h++){let p=o[h];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(f=h),p.route.id){let{loaderData:x,errors:g}=n,j=p.route.loader&&x[p.route.id]===void 0&&(!g||g[p.route.id]===void 0);if(p.route.lazy||j){d=!0,f>=0?o=o.slice(0,f+1):o=[o[0]];break}}}return o.reduceRight((h,p,x)=>{let g,j=!1,b=null,y=null;n&&(g=c&&p.route.id?c[p.route.id]:void 0,b=p.route.errorElement||eK,d&&(f<0&&x===0?(cK("route-fallback"),j=!0,y=null):f===x&&(j=!0,y=p.route.hydrateFallbackElement||null)));let S=t.concat(o.slice(0,x+1)),C=()=>{let N;return g?N=b:j?N=y:p.route.Component?N=m.createElement(p.route.Component,null):p.route.element?N=p.route.element:N=h,m.createElement(nK,{match:p,routeContext:{outlet:h,matches:S,isDataRoute:n!=null},children:N})};return n&&(p.route.ErrorBoundary||p.route.errorElement||x===0)?m.createElement(tK,{location:n.location,revalidation:n.revalidation,component:b,error:g,children:C(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):C()},null)}var s5=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(s5||{}),i5=(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})(i5||{});function aK(e){let t=m.useContext(xv);return t||Dn(!1),t}function sK(e){let t=m.useContext(n5);return t||Dn(!1),t}function iK(e){let t=m.useContext(Rs);return t||Dn(!1),t}function o5(e){let t=iK(),n=t.matches[t.matches.length-1];return n.route.id||Dn(!1),n.route.id}function oK(){var e;let t=m.useContext(r5),n=sK(),r=o5();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function lK(){let{router:e}=aK(s5.UseNavigateStable),t=o5(i5.UseNavigateStable),n=m.useRef(!1);return a5(()=>{n.current=!0}),m.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,Ld({fromRouteId:t},i)))},[e,t])}const wP={};function cK(e,t,n){wP[e]||(wP[e]=!0)}function uK(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function l5(e){let{to:t,replace:n,state:r,relative:s}=e;pu()||Dn(!1);let{future:i,static:o}=m.useContext(mi),{matches:c}=m.useContext(Rs),{pathname:d}=Is(),f=Ia(),h=kN(t,PN(c,i.v7_relativeSplatPath),d,s==="path"),p=JSON.stringify(h);return m.useEffect(()=>f(JSON.parse(p),{replace:n,state:r,relative:s}),[f,p,s,n,r]),null}function jP(e){return XH(e.context)}function pn(e){Dn(!1)}function dK(e){let{basename:t="/",children:n=null,location:r,navigationType:s=Yi.Pop,navigator:i,static:o=!1,future:c}=e;pu()&&Dn(!1);let d=t.replace(/^\/*/,"/"),f=m.useMemo(()=>({basename:d,navigator:i,static:o,future:Ld({v7_relativeSplatPath:!1},c)}),[d,c,i,o]);typeof r=="string"&&(r=fu(r));let{pathname:h="/",search:p="",hash:x="",state:g=null,key:j="default"}=r,b=m.useMemo(()=>{let y=Tc(h,d);return y==null?null:{location:{pathname:y,search:p,hash:x,state:g,key:j},navigationType:s}},[d,h,p,x,g,j,s]);return b==null?null:m.createElement(mi.Provider,{value:f},m.createElement(yv.Provider,{children:n,value:b}))}function fK(e){let{children:t,location:n}=e;return QH(mS(t),n)}new Promise(()=>{});function mS(e,t){t===void 0&&(t=[]);let n=[];return m.Children.forEach(e,(r,s)=>{if(!m.isValidElement(r))return;let i=[...t,s];if(r.type===m.Fragment){n.push.apply(n,mS(r.props.children,i));return}r.type!==pn&&Dn(!1),!r.props.index||!r.props.children||Dn(!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=mS(r.props.children,i)),n.push(o)}),n}function Uh(){return Uh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Uh.apply(this,arguments)}function c5(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function pK(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function hK(e,t){return e.button===0&&(!t||t==="_self")&&!pK(e)}function vS(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(s=>[n,s]):[[n,r]])},[]))}function mK(e,t){let n=vS(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(i=>{n.append(s,i)})}),n}const vK=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],gK=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],xK="6";try{window.__reactRouterVersion=xK}catch{}const yK=m.createContext({isTransitioning:!1}),bK="startTransition",SP=tv[bK];function wK(e){let{basename:t,children:n,future:r,window:s}=e,i=m.useRef();i.current==null&&(i.current=wH({window:s,v5Compat:!0}));let o=i.current,[c,d]=m.useState({action:o.action,location:o.location}),{v7_startTransition:f}=r||{},h=m.useCallback(p=>{f&&SP?SP(()=>d(p)):d(p)},[d,f]);return m.useLayoutEffect(()=>o.listen(h),[o,h]),m.useEffect(()=>uK(r),[r]),m.createElement(dK,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:o,future:r})}const jK=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",SK=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,At=m.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:i,replace:o,state:c,target:d,to:f,preventScrollReset:h,viewTransition:p}=t,x=c5(t,vK),{basename:g}=m.useContext(mi),j,b=!1;if(typeof f=="string"&&SK.test(f)&&(j=f,jK))try{let N=new URL(window.location.href),E=f.startsWith("//")?new URL(N.protocol+f):new URL(f),A=Tc(E.pathname,g);E.origin===N.origin&&A!=null?f=A+E.search+E.hash:b=!0}catch{}let y=KH(f,{relative:s}),S=_K(f,{replace:o,state:c,target:d,preventScrollReset:h,relative:s,viewTransition:p});function C(N){r&&r(N),N.defaultPrevented||S(N)}return m.createElement("a",Uh({},x,{href:j||y,onClick:b||i?r:C,ref:n,target:d}))}),NK=m.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:s=!1,className:i="",end:o=!1,style:c,to:d,viewTransition:f,children:h}=t,p=c5(t,gK),x=bv(d,{relative:p.relative}),g=Is(),j=m.useContext(n5),{navigator:b,basename:y}=m.useContext(mi),S=j!=null&&AK(x)&&f===!0,C=b.encodeLocation?b.encodeLocation(x).pathname:x.pathname,N=g.pathname,E=j&&j.navigation&&j.navigation.location?j.navigation.location.pathname:null;s||(N=N.toLowerCase(),E=E?E.toLowerCase():null,C=C.toLowerCase()),E&&y&&(E=Tc(E,y)||E);const A=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let P=N===C||!o&&N.startsWith(C)&&N.charAt(A)==="/",O=E!=null&&(E===C||!o&&E.startsWith(C)&&E.charAt(C.length)==="/"),T={isActive:P,isPending:O,isTransitioning:S},$=P?r:void 0,z;typeof i=="function"?z=i(T):z=[i,P?"active":null,O?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let q=typeof c=="function"?c(T):c;return m.createElement(At,Uh({},p,{"aria-current":$,className:z,ref:n,style:q,to:d,viewTransition:f}),typeof h=="function"?h(T):h)});var gS;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(gS||(gS={}));var NP;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(NP||(NP={}));function CK(e){let t=m.useContext(xv);return t||Dn(!1),t}function _K(e,t){let{target:n,replace:r,state:s,preventScrollReset:i,relative:o,viewTransition:c}=t===void 0?{}:t,d=Ia(),f=Is(),h=bv(e,{relative:o});return m.useCallback(p=>{if(hK(p,n)){p.preventDefault();let x=r!==void 0?r:qh(f)===qh(h);d(e,{replace:x,state:s,preventScrollReset:i,relative:o,viewTransition:c})}},[f,d,h,r,s,n,e,i,o,c])}function vi(e){let t=m.useRef(vS(e)),n=m.useRef(!1),r=Is(),s=m.useMemo(()=>mK(r.search,n.current?null:t.current),[r.search]),i=Ia(),o=m.useCallback((c,d)=>{const f=vS(typeof c=="function"?c(s):c);n.current=!0,i("?"+f,d)},[i,s]);return[s,o]}function AK(e,t){t===void 0&&(t={});let n=m.useContext(yK);n==null&&Dn(!1);let{basename:r}=CK(gS.useViewTransitionState),s=bv(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Tc(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Tc(n.nextLocation.pathname,r)||n.nextLocation.pathname;return dn(s.pathname,o)!=null||dn(s.pathname,i)!=null}var EK=Symbol.for("react.lazy"),Wh=tv[" use ".trim().toString()];function PK(e){return typeof e=="object"&&e!==null&&"then"in e}function u5(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===EK&&"_payload"in e&&PK(e._payload)}function wv(e){const t=kK(e),n=m.forwardRef((r,s)=>{let{children:i,...o}=r;u5(i)&&typeof Wh=="function"&&(i=Wh(i._payload));const c=m.Children.toArray(i),d=c.find(TK);if(d){const f=d.props.children,h=c.map(p=>p===d?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:p);return a.jsx(t,{...o,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return a.jsx(t,{...o,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}var uo=wv("Slot");function kK(e){const t=m.forwardRef((n,r)=>{let{children:s,...i}=n;if(u5(s)&&typeof Wh=="function"&&(s=Wh(s._payload)),m.isValidElement(s)){const o=IK(s),c=RK(i,s.props);return s.type!==m.Fragment&&(c.ref=r?kr(r,o):o),m.cloneElement(s,c)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var OK=Symbol("radix.slottable");function TK(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===OK}function RK(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...c)=>{const d=i(...c);return s(...c),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function IK(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 _y=768;function MK(){const[e,t]=m.useState(void 0);return m.useEffect(()=>{const n=window.matchMedia(`(max-width: ${_y-1}px)`),r=()=>{t(window.innerWidth<_y)};return n.addEventListener("change",r),t(window.innerWidth<_y),()=>n.removeEventListener("change",r)},[]),!!e}const ON=xl("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=m.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},i)=>{const o=r?uo:"button";return a.jsx(o,{className:Se(ON({variant:t,size:n,className:e})),ref:i,...s})});se.displayName="Button";const gt=m.forwardRef(({className:e,type:t,...n},r)=>a.jsx("input",{type:t,className:Se("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));gt.displayName="Input";var $K=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],DK=$K.reduce((e,t)=>{const n=wv(`Primitive.${t}`),r=m.forwardRef((s,i)=>{const{asChild:o,...c}=s,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),LK="Separator",CP="horizontal",FK=["horizontal","vertical"],d5=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=CP,...s}=e,i=BK(r)?r:CP,c=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return a.jsx(DK.div,{"data-orientation":i,...c,...s,ref:t})});d5.displayName=LK;function BK(e){return FK.includes(e)}var f5=d5;const p5=m.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>a.jsx(f5,{ref:s,decorative:n,orientation:t,className:Se("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));p5.displayName=f5.displayName;var Ay="focusScope.autoFocusOnMount",Ey="focusScope.autoFocusOnUnmount",_P={bubbles:!1,cancelable:!0},zK="FocusScope",kf=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=e,[c,d]=m.useState(null),f=Vn(s),h=Vn(i),p=m.useRef(null),x=St(t,b=>d(b)),g=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let b=function(N){if(g.paused||!c)return;const E=N.target;c.contains(E)?p.current=E:Ki(p.current,{select:!0})},y=function(N){if(g.paused||!c)return;const E=N.relatedTarget;E!==null&&(c.contains(E)||Ki(p.current,{select:!0}))},S=function(N){if(document.activeElement===document.body)for(const A of N)A.removedNodes.length>0&&Ki(c)};document.addEventListener("focusin",b),document.addEventListener("focusout",y);const C=new MutationObserver(S);return c&&C.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",y),C.disconnect()}}},[r,c,g.paused]),m.useEffect(()=>{if(c){EP.add(g);const b=document.activeElement;if(!c.contains(b)){const S=new CustomEvent(Ay,_P);c.addEventListener(Ay,f),c.dispatchEvent(S),S.defaultPrevented||(qK(KK(h5(c)),{select:!0}),document.activeElement===b&&Ki(c))}return()=>{c.removeEventListener(Ay,f),setTimeout(()=>{const S=new CustomEvent(Ey,_P);c.addEventListener(Ey,h),c.dispatchEvent(S),S.defaultPrevented||Ki(b??document.body,{select:!0}),c.removeEventListener(Ey,h),EP.remove(g)},0)}}},[c,f,h,g]);const j=m.useCallback(b=>{if(!n&&!r||g.paused)return;const y=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,S=document.activeElement;if(y&&S){const C=b.currentTarget,[N,E]=UK(C);N&&E?!b.shiftKey&&S===E?(b.preventDefault(),n&&Ki(N,{select:!0})):b.shiftKey&&S===N&&(b.preventDefault(),n&&Ki(E,{select:!0})):S===C&&b.preventDefault()}},[n,r,g.paused]);return a.jsx(Ye.div,{tabIndex:-1,...o,ref:x,onKeyDown:j})});kf.displayName=zK;function qK(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ki(r,{select:t}),document.activeElement!==n)return}function UK(e){const t=h5(e),n=AP(t,e),r=AP(t.reverse(),e);return[n,r]}function h5(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function AP(e,t){for(const n of e)if(!WK(n,{upTo:t}))return n}function WK(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 VK(e){return e instanceof HTMLInputElement&&"select"in e}function Ki(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&VK(e)&&t&&e.select()}}var EP=HK();function HK(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=PP(e,t),e.unshift(t)},remove(t){e=PP(e,t),e[0]?.resume()}}}function PP(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function KK(e){return e.filter(t=>t.tagName!=="A")}var Py=0;function jv(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??kP()),document.body.insertAdjacentElement("beforeend",e[1]??kP()),Py++,()=>{Py===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Py--}},[])}function kP(){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 gs=function(){return gs=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},gs.apply(this,arguments)};function m5(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 s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function GK(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Th="right-scroll-bar-position",Rh="width-before-scroll-bar",YK="with-scroll-bars-hidden",XK="--removed-body-scroll-bar-size";function ky(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function QK(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var JK=typeof window<"u"?m.useLayoutEffect:m.useEffect,OP=new WeakMap;function ZK(e,t){var n=QK(null,function(r){return e.forEach(function(s){return ky(s,r)})});return JK(function(){var r=OP.get(n);if(r){var s=new Set(r),i=new Set(e),o=n.current;s.forEach(function(c){i.has(c)||ky(c,null)}),i.forEach(function(c){s.has(c)||ky(c,o)})}OP.set(n,e)},[e]),n}function eG(e){return e}function tG(e,t){t===void 0&&(t=eG);var n=[],r=!1,s={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 s}function nG(e){e===void 0&&(e={});var t=tG(null);return t.options=gs({async:!0,ssr:!1},e),t}var v5=function(e){var t=e.sideCar,n=m5(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 m.createElement(r,gs({},n))};v5.isSideCarExport=!0;function rG(e,t){return e.useMedium(t),v5}var g5=nG(),Oy=function(){},Sv=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:Oy,onWheelCapture:Oy,onTouchMoveCapture:Oy}),s=r[0],i=r[1],o=e.forwardProps,c=e.children,d=e.className,f=e.removeScrollBar,h=e.enabled,p=e.shards,x=e.sideCar,g=e.noRelative,j=e.noIsolation,b=e.inert,y=e.allowPinchZoom,S=e.as,C=S===void 0?"div":S,N=e.gapMode,E=m5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=x,P=ZK([n,t]),O=gs(gs({},E),s);return m.createElement(m.Fragment,null,h&&m.createElement(A,{sideCar:g5,removeScrollBar:f,shards:p,noRelative:g,noIsolation:j,inert:b,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:N}),o?m.cloneElement(m.Children.only(c),gs(gs({},O),{ref:P})):m.createElement(C,gs({},O,{className:d,ref:P}),c))});Sv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Sv.classNames={fullWidth:Rh,zeroRight:Th};var aG=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function sG(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=aG();return t&&e.setAttribute("nonce",t),e}function iG(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function oG(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var lG=function(){var e=0,t=null;return{add:function(n){e==0&&(t=sG())&&(iG(t,n),oG(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},cG=function(){var e=lG();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},x5=function(){var e=cG(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},uG={left:0,top:0,right:0,gap:0},Ty=function(e){return parseInt(e||"",10)||0},dG=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Ty(n),Ty(r),Ty(s)]},fG=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return uG;var t=dG(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])}},pG=x5(),jc="data-scroll-locked",hG=function(e,t,n,r){var s=e.left,i=e.top,o=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
10
|
+
.`.concat(YK,` {
|
|
11
|
+
overflow: hidden `).concat(r,`;
|
|
12
|
+
padding-right: `).concat(c,"px ").concat(r,`;
|
|
13
|
+
}
|
|
14
|
+
body[`).concat(jc,`] {
|
|
15
|
+
overflow: hidden `).concat(r,`;
|
|
16
|
+
overscroll-behavior: contain;
|
|
17
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
18
|
+
padding-left: `.concat(s,`px;
|
|
19
|
+
padding-top: `).concat(i,`px;
|
|
20
|
+
padding-right: `).concat(o,`px;
|
|
21
|
+
margin-left:0;
|
|
22
|
+
margin-top:0;
|
|
23
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
24
|
+
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.`).concat(Th,` {
|
|
28
|
+
right: `).concat(c,"px ").concat(r,`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.`).concat(Rh,` {
|
|
32
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.`).concat(Th," .").concat(Th,` {
|
|
36
|
+
right: 0 `).concat(r,`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.`).concat(Rh," .").concat(Rh,` {
|
|
40
|
+
margin-right: 0 `).concat(r,`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
body[`).concat(jc,`] {
|
|
44
|
+
`).concat(XK,": ").concat(c,`px;
|
|
45
|
+
}
|
|
46
|
+
`)},TP=function(){var e=parseInt(document.body.getAttribute(jc)||"0",10);return isFinite(e)?e:0},mG=function(){m.useEffect(function(){return document.body.setAttribute(jc,(TP()+1).toString()),function(){var e=TP()-1;e<=0?document.body.removeAttribute(jc):document.body.setAttribute(jc,e.toString())}},[])},vG=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;mG();var i=m.useMemo(function(){return fG(s)},[s]);return m.createElement(pG,{styles:hG(i,!t,s,n?"":"!important")})},xS=!1;if(typeof window<"u")try{var oh=Object.defineProperty({},"passive",{get:function(){return xS=!0,!0}});window.addEventListener("test",oh,oh),window.removeEventListener("test",oh,oh)}catch{xS=!1}var ec=xS?{passive:!1}:!1,gG=function(e){return e.tagName==="TEXTAREA"},y5=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!gG(e)&&n[t]==="visible")},xG=function(e){return y5(e,"overflowY")},yG=function(e){return y5(e,"overflowX")},RP=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=b5(e,r);if(s){var i=w5(e,r),o=i[1],c=i[2];if(o>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},bG=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},wG=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},b5=function(e,t){return e==="v"?xG(t):yG(t)},w5=function(e,t){return e==="v"?bG(t):wG(t)},jG=function(e,t){return e==="h"&&t==="rtl"?-1:1},SG=function(e,t,n,r,s){var i=jG(e,window.getComputedStyle(t).direction),o=i*r,c=n.target,d=t.contains(c),f=!1,h=o>0,p=0,x=0;do{if(!c)break;var g=w5(e,c),j=g[0],b=g[1],y=g[2],S=b-y-i*j;(j||S)&&b5(e,c)&&(p+=S,x+=j);var C=c.parentNode;c=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(h&&Math.abs(p)<1||!h&&Math.abs(x)<1)&&(f=!0),f},lh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},IP=function(e){return[e.deltaX,e.deltaY]},MP=function(e){return e&&"current"in e?e.current:e},NG=function(e,t){return e[0]===t[0]&&e[1]===t[1]},CG=function(e){return`
|
|
47
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
48
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
49
|
+
`)},_G=0,tc=[];function AG(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),s=m.useState(_G++)[0],i=m.useState(x5)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var b=GK([e.lockRef.current],(e.shards||[]).map(MP),!0).filter(Boolean);return b.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),b.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=m.useCallback(function(b,y){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!o.current.allowPinchZoom;var S=lh(b),C=n.current,N="deltaX"in b?b.deltaX:C[0]-S[0],E="deltaY"in b?b.deltaY:C[1]-S[1],A,P=b.target,O=Math.abs(N)>Math.abs(E)?"h":"v";if("touches"in b&&O==="h"&&P.type==="range")return!1;var T=window.getSelection(),$=T&&T.anchorNode,z=$?$===P||$.contains(P):!1;if(z)return!1;var q=RP(O,P);if(!q)return!0;if(q?A=O:(A=O==="v"?"h":"v",q=RP(O,P)),!q)return!1;if(!r.current&&"changedTouches"in b&&(N||E)&&(r.current=A),!A)return!0;var F=r.current||A;return SG(F,y,b,F==="h"?N:E)},[]),d=m.useCallback(function(b){var y=b;if(!(!tc.length||tc[tc.length-1]!==i)){var S="deltaY"in y?IP(y):lh(y),C=t.current.filter(function(A){return A.name===y.type&&(A.target===y.target||y.target===A.shadowParent)&&NG(A.delta,S)})[0];if(C&&C.should){y.cancelable&&y.preventDefault();return}if(!C){var N=(o.current.shards||[]).map(MP).filter(Boolean).filter(function(A){return A.contains(y.target)}),E=N.length>0?c(y,N[0]):!o.current.noIsolation;E&&y.cancelable&&y.preventDefault()}}},[]),f=m.useCallback(function(b,y,S,C){var N={name:b,delta:y,target:S,should:C,shadowParent:EG(S)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(E){return E!==N})},1)},[]),h=m.useCallback(function(b){n.current=lh(b),r.current=void 0},[]),p=m.useCallback(function(b){f(b.type,IP(b),b.target,c(b,e.lockRef.current))},[]),x=m.useCallback(function(b){f(b.type,lh(b),b.target,c(b,e.lockRef.current))},[]);m.useEffect(function(){return tc.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:x}),document.addEventListener("wheel",d,ec),document.addEventListener("touchmove",d,ec),document.addEventListener("touchstart",h,ec),function(){tc=tc.filter(function(b){return b!==i}),document.removeEventListener("wheel",d,ec),document.removeEventListener("touchmove",d,ec),document.removeEventListener("touchstart",h,ec)}},[]);var g=e.removeScrollBar,j=e.inert;return m.createElement(m.Fragment,null,j?m.createElement(i,{styles:CG(s)}):null,g?m.createElement(vG,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function EG(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const PG=rG(g5,AG);var Of=m.forwardRef(function(e,t){return m.createElement(Sv,gs({},e,{ref:t,sideCar:PG}))});Of.classNames=Sv.classNames;var kG=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},nc=new WeakMap,ch=new WeakMap,uh={},Ry=0,j5=function(e){return e&&(e.host||j5(e.parentNode))},OG=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=j5(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})},TG=function(e,t,n,r){var s=OG(t,Array.isArray(e)?e:[e]);uh[n]||(uh[n]=new WeakMap);var i=uh[n],o=[],c=new Set,d=new Set(s),f=function(p){!p||c.has(p)||(c.add(p),f(p.parentNode))};s.forEach(f);var h=function(p){!p||d.has(p)||Array.prototype.forEach.call(p.children,function(x){if(c.has(x))h(x);else try{var g=x.getAttribute(r),j=g!==null&&g!=="false",b=(nc.get(x)||0)+1,y=(i.get(x)||0)+1;nc.set(x,b),i.set(x,y),o.push(x),b===1&&j&&ch.set(x,!0),y===1&&x.setAttribute(n,"true"),j||x.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",x,S)}})};return h(t),c.clear(),Ry++,function(){o.forEach(function(p){var x=nc.get(p)-1,g=i.get(p)-1;nc.set(p,x),i.set(p,g),x||(ch.has(p)||p.removeAttribute(r),ch.delete(p)),g||p.removeAttribute(n)}),Ry--,Ry||(nc=new WeakMap,nc=new WeakMap,ch=new WeakMap,uh={})}},Nv=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=kG(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),TG(r,s,n,"aria-hidden")):function(){return null}};function RG(e){const t=IG(e),n=m.forwardRef((r,s)=>{const{children:i,...o}=r,c=m.Children.toArray(i),d=c.find($G);if(d){const f=d.props.children,h=c.map(p=>p===d?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:p);return a.jsx(t,{...o,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return a.jsx(t,{...o,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function IG(e){const t=m.forwardRef((n,r)=>{const{children:s,...i}=n;if(m.isValidElement(s)){const o=LG(s),c=DG(i,s.props);return s.type!==m.Fragment&&(c.ref=r?kr(r,o):o),m.cloneElement(s,c)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var MG=Symbol("radix.slottable");function $G(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===MG}function DG(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...c)=>{const d=i(...c);return s(...c),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function LG(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 Cv="Dialog",[S5,N5]=mr(Cv),[FG,ns]=S5(Cv),C5=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=e,c=m.useRef(null),d=m.useRef(null),[f,h]=ha({prop:r,defaultProp:s??!1,onChange:i,caller:Cv});return a.jsx(FG,{scope:t,triggerRef:c,contentRef:d,contentId:nr(),titleId:nr(),descriptionId:nr(),open:f,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(p=>!p),[h]),modal:o,children:n})};C5.displayName=Cv;var _5="DialogTrigger",A5=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ns(_5,n),i=St(t,s.triggerRef);return a.jsx(Ye.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":IN(s.open),...r,ref:i,onClick:Te(e.onClick,s.onOpenToggle)})});A5.displayName=_5;var TN="DialogPortal",[BG,E5]=S5(TN,{forceMount:void 0}),P5=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,i=ns(TN,t);return a.jsx(BG,{scope:t,forceMount:n,children:m.Children.map(r,o=>a.jsx(Yn,{present:n||i.open,children:a.jsx(gl,{asChild:!0,container:s,children:o})}))})};P5.displayName=TN;var Vh="DialogOverlay",k5=m.forwardRef((e,t)=>{const n=E5(Vh,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=ns(Vh,e.__scopeDialog);return i.modal?a.jsx(Yn,{present:r||i.open,children:a.jsx(qG,{...s,ref:t})}):null});k5.displayName=Vh;var zG=RG("DialogOverlay.RemoveScroll"),qG=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ns(Vh,n);return a.jsx(Of,{as:zG,allowPinchZoom:!0,shards:[s.contentRef],children:a.jsx(Ye.div,{"data-state":IN(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),el="DialogContent",O5=m.forwardRef((e,t)=>{const n=E5(el,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=ns(el,e.__scopeDialog);return a.jsx(Yn,{present:r||i.open,children:i.modal?a.jsx(UG,{...s,ref:t}):a.jsx(WG,{...s,ref:t})})});O5.displayName=el;var UG=m.forwardRef((e,t)=>{const n=ns(el,e.__scopeDialog),r=m.useRef(null),s=St(t,n.contentRef,r);return m.useEffect(()=>{const i=r.current;if(i)return Nv(i)},[]),a.jsx(T5,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Te(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Te(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0;(o.button===2||c)&&i.preventDefault()}),onFocusOutside:Te(e.onFocusOutside,i=>i.preventDefault())})}),WG=m.forwardRef((e,t)=>{const n=ns(el,e.__scopeDialog),r=m.useRef(!1),s=m.useRef(!1);return a.jsx(T5,{...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,s.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;n.triggerRef.current?.contains(o)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),T5=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=e,c=ns(el,n),d=m.useRef(null),f=St(t,d);return jv(),a.jsxs(a.Fragment,{children:[a.jsx(kf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(vl,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":IN(c.open),...o,ref:f,onDismiss:()=>c.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(HG,{titleId:c.titleId}),a.jsx(GG,{contentRef:d,descriptionId:c.descriptionId})]})]})}),RN="DialogTitle",R5=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ns(RN,n);return a.jsx(Ye.h2,{id:s.titleId,...r,ref:t})});R5.displayName=RN;var I5="DialogDescription",M5=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ns(I5,n);return a.jsx(Ye.p,{id:s.descriptionId,...r,ref:t})});M5.displayName=I5;var $5="DialogClose",D5=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ns($5,n);return a.jsx(Ye.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,()=>s.onOpenChange(!1))})});D5.displayName=$5;function IN(e){return e?"open":"closed"}var L5="DialogTitleWarning",[VG,F5]=EU(L5,{contentName:el,titleName:RN,docsSlug:"dialog"}),HG=({titleId:e})=>{const t=F5(L5),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 m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},KG="DialogDescriptionWarning",GG=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${F5(KG).contentName}}.`;return m.useEffect(()=>{const s=e.current?.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},_v=C5,YG=A5,Av=P5,hu=k5,mu=O5,Tf=R5,Rf=M5,Ev=D5;const B5=_v,XG=Av,z5=m.forwardRef(({className:e,...t},n)=>a.jsx(hu,{className:Se("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));z5.displayName=hu.displayName;const QG=xl("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"}}),MN=m.forwardRef(({side:e="right",className:t,children:n,...r},s)=>a.jsxs(XG,{children:[a.jsx(z5,{}),a.jsxs(mu,{ref:s,className:Se(QG({side:e}),t),...r,children:[n,a.jsxs(Ev,{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:[a.jsx(As,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));MN.displayName=mu.displayName;const q5=({className:e,...t})=>a.jsx("div",{className:Se("flex flex-col space-y-2 text-center sm:text-left",e),...t});q5.displayName="SheetHeader";const U5=m.forwardRef(({className:e,...t},n)=>a.jsx(Tf,{ref:n,className:Se("text-lg font-semibold text-foreground",e),...t}));U5.displayName=Tf.displayName;const JG=m.forwardRef(({className:e,...t},n)=>a.jsx(Rf,{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));JG.displayName=Rf.displayName;function $P({className:e,...t}){return a.jsx("div",{className:Se("animate-pulse rounded-md bg-muted",e),...t})}const ZG="sidebar:state",eY=3600*24*7,tY="16rem",nY="18rem",rY="3rem",aY="b",W5=m.createContext(null);function If(){const e=m.useContext(W5);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const V5=m.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:s,children:i,...o},c)=>{const d=MK(),[f,h]=m.useState(!1),[p,x]=m.useState(e),g=t??p,j=m.useCallback(C=>{const N=typeof C=="function"?C(g):C;n?n(N):x(N),document.cookie=`${ZG}=${N}; path=/; max-age=${eY}`},[n,g]),b=m.useCallback(()=>d?h(C=>!C):j(C=>!C),[d,j,h]);m.useEffect(()=>{const C=N=>{N.key===aY&&(N.metaKey||N.ctrlKey)&&(N.preventDefault(),b())};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[b]);const y=g?"expanded":"collapsed",S=m.useMemo(()=>({state:y,open:g,setOpen:j,isMobile:d,openMobile:f,setOpenMobile:h,toggleSidebar:b}),[y,g,j,d,f,h,b]);return a.jsx(W5.Provider,{value:S,children:a.jsx(ro,{delayDuration:0,children:a.jsx("div",{style:{"--sidebar-width":tY,"--sidebar-width-icon":rY,...s},className:Se("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:c,...o,children:i})})})});V5.displayName="SidebarProvider";const H5=m.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:s,...i},o)=>{const{isMobile:c,state:d,openMobile:f,setOpenMobile:h}=If();return n==="none"?a.jsx("div",{className:Se("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",r),ref:o,...i,children:s}):c?a.jsx(B5,{open:f,onOpenChange:h,...i,children:a.jsx(MN,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":nY},side:e,children:a.jsx("div",{className:"flex h-full w-full flex-col",children:s})})}):a.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:[a.jsx("div",{className:Se("relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),a.jsx("div",{className:Se("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...i,children:a.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:s})})]})});H5.displayName="Sidebar";const K5=m.forwardRef(({className:e,onClick:t,...n},r)=>{const{toggleSidebar:s}=If();return a.jsxs(se,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:Se("h-7 w-7",e),onClick:i=>{t?.(i),s()},...n,children:[a.jsx(L7,{}),a.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});K5.displayName="SidebarTrigger";const sY=m.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=If();return a.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:Se("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] group-data-[side=left]:-right-4 group-data-[side=right]:left-0 hover:after:bg-sidebar-border sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});sY.displayName="SidebarRail";const iY=m.forwardRef(({className:e,...t},n)=>a.jsx("main",{ref:n,className:Se("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));iY.displayName="SidebarInset";const oY=m.forwardRef(({className:e,...t},n)=>a.jsx(gt,{ref:n,"data-sidebar":"input",className:Se("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));oY.displayName="SidebarInput";const G5=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"header",className:Se("flex flex-col gap-2 p-2",e),...t}));G5.displayName="SidebarHeader";const Y5=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"footer",className:Se("flex flex-col gap-2 p-2",e),...t}));Y5.displayName="SidebarFooter";const yS=m.forwardRef(({className:e,...t},n)=>a.jsx(p5,{ref:n,"data-sidebar":"separator",className:Se("mx-2 w-auto bg-sidebar-border",e),...t}));yS.displayName="SidebarSeparator";const X5=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"content",className:Se("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));X5.displayName="SidebarContent";const Q5=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"group",className:Se("relative flex w-full min-w-0 flex-col p-2",e),...t}));Q5.displayName="SidebarGroup";const J5=m.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const s=t?uo:"div";return a.jsx(s,{ref:r,"data-sidebar":"group-label",className:Se("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...n})});J5.displayName="SidebarGroupLabel";const lY=m.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const s=t?uo:"button";return a.jsx(s,{ref:r,"data-sidebar":"group-action",className:Se("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...n})});lY.displayName="SidebarGroupAction";const Z5=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"group-content",className:Se("w-full text-sm",e),...t}));Z5.displayName="SidebarGroupContent";const e3=m.forwardRef(({className:e,...t},n)=>a.jsx("ul",{ref:n,"data-sidebar":"menu",className:Se("flex w-full min-w-0 flex-col gap-1",e),...t}));e3.displayName="SidebarMenu";const t3=m.forwardRef(({className:e,...t},n)=>a.jsx("li",{ref:n,"data-sidebar":"menu-item",className:Se("group/menu-item relative",e),...t}));t3.displayName="SidebarMenuItem";const cY=xl("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"}}),n3=m.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:s,className:i,...o},c)=>{const d=e?uo:"button",{isMobile:f,state:h}=If(),p=a.jsx(d,{ref:c,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:Se(cY({variant:n,size:r}),i),...o});return s?(typeof s=="string"&&(s={children:s}),a.jsxs(ao,{children:[a.jsx(so,{asChild:!0,children:p}),a.jsx(ui,{side:"right",align:"center",hidden:h!=="collapsed"||f,...s})]})):p});n3.displayName="SidebarMenuButton";const uY=m.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},s)=>{const i=t?uo:"button";return a.jsx(i,{ref:s,"data-sidebar":"menu-action",className:Se("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...r})});uY.displayName="SidebarMenuAction";const dY=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:Se("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));dY.displayName="SidebarMenuBadge";const fY=m.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{const s=m.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return a.jsxs("div",{ref:r,"data-sidebar":"menu-skeleton",className:Se("flex h-8 items-center gap-2 rounded-md px-2",e),...n,children:[t&&a.jsx($P,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),a.jsx($P,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":s}})]})});fY.displayName="SidebarMenuSkeleton";const pY=m.forwardRef(({className:e,...t},n)=>a.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:Se("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));pY.displayName="SidebarMenuSub";const hY=m.forwardRef(({...e},t)=>a.jsx("li",{ref:t,...e}));hY.displayName="SidebarMenuSubItem";const mY=m.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...s},i)=>{const o=e?uo:"a";return a.jsx(o,{ref:i,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:Se("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),...s})});mY.displayName="SidebarMenuSubButton";const r3=m.forwardRef(({className:e,activeClassName:t,pendingClassName:n,to:r,...s},i)=>a.jsx(NK,{ref:i,to:r,className:({isActive:o,isPending:c})=>Se(e,o&&t,c&&n),...s}));r3.displayName="NavLink";function vY({width:e=24,height:t=24,from:n="#53afba",to:r="#76fffb",...s}){const i=`grad-${m.useId().slice(1)}`;return a.jsxs("svg",{className:"inline-block",width:e,height:t,viewBox:"0 0 1648 1648",xmlns:"http://www.w3.org/2000/svg",...s,children:[a.jsx("defs",{children:a.jsxs("linearGradient",{id:i,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[a.jsx("stop",{offset:"0%",style:{stopColor:n}}),a.jsx("stop",{offset:"100%",style:{stopColor:r}})]})}),a.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 gY=[{title:"Home",items:[{title:"Dashboard",url:"/",icon:nD}]},{title:"Lab",items:[{title:"MCP Evaluations",url:"/mcp-evaluations",icon:tD},{title:"Analyze MCP",url:"/tool-analysis",icon:rD},{title:"OAuth Debugger",url:"/oauth-debugger",icon:z7}]},{title:"Libraries",items:[{title:"Test Cases",url:"/libraries/test-cases",icon:eD},{title:"MCP servers",url:"/libraries/servers",icon:Z$},{title:"Agents",url:"/libraries/agents",icon:Pr}]},{title:"Execution",items:[{title:"Run Evaluation",url:"/run",icon:ti},{title:"Evaluation Results",url:"/results",icon:Ac},{title:"Compare Evaluations",url:"/compare",icon:dN},{title:"MCP Analysis Results",url:"/tool-analysis-results",icon:aD},{title:"Custom Reports",url:"/markdown-reports",icon:fc}]},{title:"Workspace",items:[{title:"Settings",url:"/settings",icon:hN},{title:"MCPLab MCP server",url:"/settings/mcp",icon:eS}]}];function xY(e={version:null}){const t=e.version??null,{state:n}=If(),r=n==="collapsed",s=Is(),i=m.useMemo(()=>gY,[]);return a.jsxs(H5,{collapsible:"icon",children:[a.jsx(G5,{className:`border-b border-sidebar-border py-3 ${r?"px-2":"px-4"}`,children:a.jsxs("div",{className:`flex items-center ${r?"justify-center overflow-visible":"gap-2.5 overflow-hidden"}`,children:[a.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:a.jsx(vY,{width:22,height:22,from:"#f97316",to:"#fb923c"})}),!r&&a.jsxs("div",{className:"flex flex-col",children:[a.jsx("span",{className:"text-sm font-semibold text-sidebar-foreground",children:"MCPLab"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"MCP Evaluation Lab"})]})]})}),a.jsx(X5,{children:i.map((o,c)=>a.jsxs("div",{children:[c>0&&!r&&a.jsx(yS,{className:"my-1.5"}),a.jsxs(Q5,{className:r?"px-2":"px-3 py-2",children:[!r&&a.jsx(J5,{className:"px-1 pb-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground/90",children:o.title}),a.jsx(Z5,{children:a.jsx(e3,{children:o.items.map(d=>a.jsx(t3,{children:a.jsx(n3,{asChild:!0,isActive:d.url==="/"?s.pathname==="/":d.url==="/settings"?s.pathname==="/settings":s.pathname.startsWith(d.url),tooltip:d.title,children:a.jsxs(r3,{to:d.url,end:d.url==="/"||d.url==="/settings",activeClassName:"bg-sidebar-accent text-sidebar-accent-foreground",children:[a.jsx(d.icon,{className:"h-4 w-4"}),a.jsx("span",{children:d.title})]})})},d.title))})})]})]},o.title))}),a.jsxs(Y5,{className:r?"px-2 py-2":"px-3 py-3",children:[a.jsx(yS,{className:"my-1.5"}),a.jsxs("div",{className:`flex ${r?"justify-center":"items-center justify-center gap-2"} w-full`,children:[a.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:[a.jsx(T7,{className:"h-4 w-4 shrink-0"}),!r&&a.jsx("span",{className:"text-xs text-sidebar-foreground/85",children:`v${t??"unknown"}`})]}),!r&&a.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 ",a.jsx("span",{className:"text-[#00e5ff] hover:text-[#00b8d4]",children:"Inspectr"})]})]})]})]})}const a3=m.forwardRef(({...e},t)=>a.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));a3.displayName="Breadcrumb";const s3=m.forwardRef(({className:e,...t},n)=>a.jsx("ol",{ref:n,className:Se("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));s3.displayName="BreadcrumbList";const i3=m.forwardRef(({className:e,...t},n)=>a.jsx("li",{ref:n,className:Se("inline-flex items-center gap-1.5",e),...t}));i3.displayName="BreadcrumbItem";const o3=m.forwardRef(({asChild:e,className:t,...n},r)=>{const s=e?uo:"a";return a.jsx(s,{ref:r,className:Se("transition-colors hover:text-foreground",t),...n})});o3.displayName="BreadcrumbLink";const l3=m.forwardRef(({className:e,...t},n)=>a.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:Se("font-normal text-foreground",e),...t}));l3.displayName="BreadcrumbPage";const c3=({children:e,className:t,...n})=>a.jsx("li",{role:"presentation","aria-hidden":"true",className:Se("[&>svg]:size-3.5",t),...n,children:e??a.jsx(uN,{})});c3.displayName="BreadcrumbSeparator";function xs(){return{input:0,output:0,total:0,hasInput:!1,hasOutput:!1,hasTotal:!1}}function oc(e,t){t&&(typeof t.inputTokens=="number"&&(e.input+=t.inputTokens,e.hasInput=!0),typeof t.outputTokens=="number"&&(e.output+=t.outputTokens,e.hasOutput=!0),typeof t.totalTokens=="number"&&(e.total+=t.totalTokens,e.hasTotal=!0))}function Qs(e){return!e.hasInput&&!e.hasOutput&&!e.hasTotal?null:{inputTokens:e.hasInput?e.input:null,outputTokens:e.hasOutput?e.output:null,totalTokens:e.hasTotal?e.total:null}}function yY(e){const t=xs();for(const n of e)oc(t,n);return Qs(t)}function bY(e,t){return`${e}-${t+1}`}function wY(e){switch(e.type){case"regex":return{type:"response_regex",value:e.pattern};case"contains":return{type:"response_contains",value:e.value};case"not_contains":return{type:"response_not_contains",value:e.value};case"starts_with":return{type:"response_starts_with",value:e.value};case"ends_with":return{type:"response_ends_with",value:e.value};case"equals":return{type:"response_equals",value:e.value};case"jsonpath":return{type:"response_jsonpath",path:e.path,equals:e.equals};case"jsonpath_exists":return{type:"response_jsonpath_exists",path:e.path};case"jsonpath_not_exists":return{type:"response_jsonpath_not_exists",path:e.path};default:throw new Error(`Unsupported response assertion type in config: ${String(e?.type??"(missing type)")}`)}}function u3(e){return e.type==="required_tool"||e.type==="forbidden_tool"?null:e.type==="response_contains"?e.value?{type:"contains",value:e.value}:null:e.type==="response_not_contains"?e.value?{type:"not_contains",value:e.value}:null:e.type==="response_starts_with"?e.value?{type:"starts_with",value:e.value}:null:e.type==="response_ends_with"?e.value?{type:"ends_with",value:e.value}:null:e.type==="response_equals"?e.value?{type:"equals",value:e.value}:null:e.type==="response_regex"?e.value?{type:"regex",pattern:e.value}:null:e.type==="response_jsonpath"?e.path?.trim()?e.equals!==void 0?{type:"jsonpath",path:e.path.trim(),equals:e.equals}:{type:"jsonpath",path:e.path.trim()}:null:e.type==="response_jsonpath_exists"?e.path?.trim()?{type:"jsonpath_exists",path:e.path.trim()}:null:e.type==="response_jsonpath_not_exists"&&e.path?.trim()?{type:"jsonpath_not_exists",path:e.path.trim()}:null}function DP(e){if(!("id"in e)||!e.id)return null;const t=String(e.id),n=e.auth,r={id:t,name:String(e.name||t),transport:"streamable-http",url:String(e.url||""),authType:n?.type==="bearer"?"bearer":n?.type==="api_key"||n?.type==="oauth_client_credentials"?"api-key":n?.type==="oauth_authorization_code"?"oauth2":"none",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,oauthMode:n?.type==="oauth_authorization_code"?n.mode:void 0,oauthAuthorizationUrl:n?.type==="oauth_authorization_code"&&String(n.authorization_url||"")||void 0,oauthTokenEndpoint:n?.type==="oauth_authorization_code"&&String(n.token_url||"")||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};return{id:t,server:r}}function lc(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:[],s=new Map,i=[],o=[];for(const p of n){if("ref"in p){const y=String(p.ref||"").trim();if(!y)continue;s.set(y,y),o.push({kind:"referenced",ref:y});continue}const x=String(p.id||p.name||"").trim();if(!x)continue;const g=x;s.set(x,g);const j=p.auth?.type==="bearer"?"bearer":p.auth?.type==="api_key"||p.auth?.type==="oauth_client_credentials"?"api-key":p.auth?.type==="oauth_authorization_code"?"oauth2":"none",b={id:g,name:String(p.name||x),transport:"streamable-http",url:p.url,authType:j,authValue:p.auth?.type==="bearer"?p.auth.token??(p.auth.env?`\${${p.auth.env}}`:void 0):p.auth?.type==="api_key"?p.auth.value:void 0,apiKeyHeaderName:p.auth?.type==="api_key"?p.auth.header_name:void 0,oauthClientId:p.auth?.type==="oauth_authorization_code"?p.auth.client_id:void 0,oauthClientSecret:p.auth?.type==="oauth_authorization_code"?p.auth.client_secret:void 0,oauthRedirectUrl:p.auth?.type==="oauth_authorization_code"?p.auth.redirect_url:void 0,oauthScope:p.auth?.type==="oauth_authorization_code"||p.auth?.type==="oauth_client_credentials"?p.auth.scope:void 0,oauthMode:p.auth?.type==="oauth_authorization_code"?p.auth.mode:void 0,oauthAuthorizationUrl:p.auth?.type==="oauth_authorization_code"?p.auth.authorization_url:void 0,oauthTokenEndpoint:p.auth?.type==="oauth_authorization_code"?p.auth.token_url:void 0,oauthTokenUrl:p.auth?.type==="oauth_client_credentials"?p.auth.token_url:void 0,oauthClientIdEnv:p.auth?.type==="oauth_client_credentials"?p.auth.client_id_env:void 0,oauthClientSecretEnv:p.auth?.type==="oauth_client_credentials"?p.auth.client_secret_env:void 0,oauthAudience:p.auth?.type==="oauth_client_credentials"?p.auth.audience:void 0};i.push(b),o.push({kind:"inline",server:b})}const c=[],d=[];for(const p of r){if("ref"in p){const y=String(p.ref||"").trim();if(!y)continue;d.push({kind:"referenced",ref:y});continue}const x=String(p.id||p.name||"").trim();if(!x)continue;const g=x,j=p.provider==="azure_openai"?"azure":p.provider,b={id:g,name:String(p.name||x),provider:j,model:p.model,temperature:p.temperature??0,maxTokens:p.max_tokens??2048,maxTurns:p.max_turns,systemPrompt:p.system};c.push(b),d.push({kind:"inline",agent:b})}const f=[],h=[];return e.config.scenarios.forEach((p,x)=>{if("ref"in p){const b=String(p.ref||"").trim();if(!b)return;const y=p.mcp_servers,S=Array.isArray(y)?y.flatMap(C=>{if("ref"in C&&C.ref)return[{kind:"referenced",ref:String(C.ref)}];const N=DP(C);return N?[{kind:"inline",server:N.server}]:[]}):void 0;h.push({kind:"referenced",ref:b,...S?{mcpServers:S}:{}});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??[])g.push(wY(b));const j={id:p.id||bY("scn",x),name:p.name||p.id||`Scenario ${x+1}`,serverIds:(()=>{if((p.servers??[]).length>0)return p.servers.map(y=>s.get(y)??y).filter(Boolean);const b=p.mcp_servers;return Array.isArray(b)?b.flatMap(y=>{if("ref"in y&&y.ref)return[String(y.ref)];const S=DP(y);if(S){const C=S.id;return s.has(C)||(s.set(C,C),i.push(S.server),o.push({kind:"inline",server:i[i.length-1]})),[C]}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,...e.relativePath?{relativePath:e.relativePath}:{},...e.suitePath!==void 0?{suitePath:e.suitePath}:{},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 jY(e){const t={id:"library",name:"library",path:"library",mtime:new Date(0).toISOString(),config:{servers:Object.entries(e.servers).map(([r,s])=>({id:r,name:s.name||r,transport:s.transport,url:s.url,auth:s.auth})),agents:Object.entries(e.agents).map(([r,s])=>({id:r,name:s.name||r,provider:s.provider,model:s.model,temperature:s.temperature,max_tokens:s.max_tokens,max_turns:s.max_turns,system:s.system})),scenarios:e.scenarios}},n=lc(t);return{servers:n.servers,agents:n.agents,scenarios:n.scenarios}}function LP(e){const t=new Map,n=g=>{const j=g.id,b=g.authValue?.trim()??"",y=g.apiKeyHeaderName?.trim()??"",S=g.authType==="bearer"?(()=>{if(!b)throw new Error(`Server '${j}' is missing bearer token value`);return{type:"bearer",token:b}})():g.authType==="api-key"&&!g.oauthTokenUrl?{type:"api_key",...y?{header_name:y}:{},value:(()=>{if(!b)throw new Error(`Server '${j}' is missing API key value`);return b})()}:g.authType==="api-key"?{type:"oauth_client_credentials",token_url:g.oauthTokenUrl||"",client_id_env:g.oauthClientIdEnv||"",client_secret_env:g.oauthClientSecretEnv||"",...g.oauthScope?{scope:g.oauthScope}:{},...g.oauthAudience?{audience:g.oauthAudience}:{}}:g.authType==="oauth2"?{type:"oauth_authorization_code",...g.oauthMode==="dcr"?{mode:"dcr"}:{},...g.oauthMode!=="dcr"&&g.oauthClientId?{client_id:g.oauthClientId}:{},...g.oauthClientSecret?{client_secret:g.oauthClientSecret}:{},...g.oauthRedirectUrl?{redirect_url:g.oauthRedirectUrl}:{},...g.oauthScope?{scope:g.oauthScope}:{},...g.oauthAuthorizationUrl?{authorization_url:g.oauthAuthorizationUrl}:{},...g.oauthTokenEndpoint?{token_url:g.oauthTokenEndpoint}:{}}:void 0;return{id:j,...g.name&&g.name!==j?{name:g.name}:{},transport:"http",url:g.url||"http://localhost:3000/mcp",...S!==void 0?{auth:S}:{}}},r=e.serverEntries&&e.serverEntries.length>0?e.serverEntries:[...e.servers.map(g=>({kind:"inline",server:g}))],s=new Set,i=new Map,o=r.flatMap(g=>{if(g.kind==="referenced"){const b=String(g.ref||"").trim();return!b||s.has(b)?[]:(s.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).filter(S=>typeof S=="string"&&S.length>0),b=g.evalRules.filter(S=>S.type==="forbidden_tool").map(S=>S.value).filter(S=>typeof S=="string"&&S.length>0),y=g.evalRules.map(S=>u3(S)).filter(S=>!!S);return{id:g.id,name:g.name||void 0,mcp_servers:g.serverIds.length>0?g.serverIds.map(S=>{const C=t.get(S)??S;return i.get(C)??{ref:C}}):void 0,prompt:g.prompt,...g.snapshotEval?{snapshot_eval:{enabled:g.snapshotEval.enabled,baseline_snapshot_id:g.snapshotEval.baselineSnapshotId,baseline_source_run_id:g.snapshotEval.baselineSourceRunId,last_updated_at:g.snapshotEval.lastUpdatedAt}}:{},eval:{tool_constraints:{required_tools:j,forbidden_tools:b},response_assertions:y},extract:g.extractRules.map(S=>({name:S.name,from:"final_text",regex:S.pattern}))}},x=e.scenarioEntries&&e.scenarioEntries.length>0?e.scenarioEntries.map(g=>g.kind==="referenced"?{ref:g.ref,...Array.isArray(g.mcpServers)?{mcp_servers:g.mcpServers.map(j=>j.kind==="referenced"?{ref:j.ref}:n(j.server))}:{}}:p(g.scenario)):[...e.scenarios.map(g=>p(g))];return{name:e.configName?.trim()||void 0,servers:o,agents:h,scenarios:x,run_defaults:e.runDefaults?.selectedAgentNames&&e.runDefaults.selectedAgentNames.length>0?{selected_agents:[...e.runDefaults.selectedAgentNames]}:void 0,snapshot_eval:e.snapshotEval?{enabled:e.snapshotEval.enabled,mode:e.snapshotEval.mode,baseline_snapshot_id:e.snapshotEval.baselineSnapshotId,baseline_source_run_id:e.snapshotEval.baselineSourceRunId,last_updated_at:e.snapshotEval.lastUpdatedAt}:void 0}}function SY(e){const t=Object.fromEntries((e.servers??[]).map(r=>[r.id,(()=>{const s=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(!s)throw new Error(`Server '${r.id}' is missing bearer token value`);return{type:"bearer",token:s}})():r.authType==="api-key"&&!r.oauthTokenUrl?{type:"api_key",...i?{header_name:i}:{},value:(()=>{if(!s)throw new Error(`Server '${r.id}' is missing API key value`);return s})()}:r.authType==="api-key"?{type:"oauth_client_credentials",token_url:r.oauthTokenUrl||"",client_id_env:r.oauthClientIdEnv||"",client_secret_env:r.oauthClientSecretEnv||"",...r.oauthScope?{scope:r.oauthScope}:{},...r.oauthAudience?{audience:r.oauthAudience}:{}}:r.authType==="oauth2"?{type:"oauth_authorization_code",...r.oauthMode==="dcr"?{mode:"dcr"}:{},...r.oauthMode!=="dcr"&&r.oauthClientId?{client_id:r.oauthClientId}:{},...r.oauthClientSecret?{client_secret:r.oauthClientSecret}:{},...r.oauthRedirectUrl?{redirect_url:r.oauthRedirectUrl}:{},...r.oauthScope?{scope:r.oauthScope}:{},...r.oauthAuthorizationUrl?{authorization_url:r.oauthAuthorizationUrl}:{},...r.oauthTokenEndpoint?{token_url:r.oauthTokenEndpoint}:{}}:void 0}})()])),n=Object.fromEntries(e.agents.map(r=>[r.id,{...r.name&&r.name!==r.id?{name:r.name}:{},provider:r.provider==="azure"?"azure_openai":r.provider==="anthropic"?"anthropic":"openai",model:r.model,temperature:r.temperature,max_tokens:r.maxTokens,max_turns:r.maxTurns,system:r.systemPrompt}]));return{servers:t,agents:n,scenarios:e.scenarios.map(r=>({id:r.id,name:r.name||void 0,mcp_servers:r.serverIds.length>0?r.serverIds.map(s=>({ref:s})):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(s=>s.type==="required_tool").map(s=>s.value).filter(s=>typeof s=="string"&&s.length>0),forbidden_tools:r.evalRules.filter(s=>s.type==="forbidden_tool").map(s=>s.value).filter(s=>typeof s=="string"&&s.length>0)},response_assertions:r.evalRules.map(s=>u3(s)).filter(s=>!!s)},extract:r.extractRules.map(s=>({name:s.name,from:"final_text",regex:s.pattern}))}))}}function NY(e,t){if(e)return`${e}::${t??""}`}function dh(e){return e.type==="text"}function d3(e,t){if(!t)return e.tool_calls.map((s,i)=>({name:s,arguments:{},duration:e.tool_durations_ms[i]??0,timestamp:new Date().toISOString()}));const n=[],r=new Map;for(const s of t.messages)for(const i of s.content)i.type==="tool_use"?n.push({id:i.id,name:i.name,input:i.input??{},ts:s.ts}):i.type==="tool_result"&&r.set(i.tool_use_id,{durationMs:i.duration_ms,tsEnd:i.ts_end});return n.map((s,i)=>{const o=r.get(s.id);return{name:s.name,arguments:s.input,duration:o?.durationMs??e.tool_durations_ms[i]??0,timestamp:o?.tsEnd??s.ts??new Date().toISOString()}})}function f3(e,t){const n=[];if(!e)return n;let r;const s=e.messages??[];for(let i=0;i<s.length;i+=1){const o=s[i];if(o.role==="user"){const c=o.content.filter(dh);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=s[i+1],f=d?.role==="tool";if(c.length>0&&f){const h=new Map,p=[];for(const x of d.content)x.type==="tool_result"&&(x.tool_use_id?h.set(x.tool_use_id,x):p.push(x));for(const x of c){n.push({id:`tool_call-${n.length}`,kind:"tool_call",text:FP(x.input??{}),toolName:x.name,timestamp:o.ts,estimatedTokens:x.estimated_tokens?{inputTokens:x.estimated_tokens.input,outputTokens:x.estimated_tokens.output,totalTokens:x.estimated_tokens.total}:void 0,estimatedTokenMethod:x.estimated_tokens?.method});const g=h.get(x.id);if(!g)continue;const j=g.content.filter(dh).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,estimatedTokens:g.estimated_tokens?{inputTokens:g.estimated_tokens.input,outputTokens:g.estimated_tokens.output,totalTokens:g.estimated_tokens.total}:void 0,estimatedTokenMethod:g.estimated_tokens?.method}),h.delete(x.id)}for(const x of[...h.values(),...p]){const g=x.content.filter(dh).map(j=>j.text).join(`
|
|
55
|
+
`);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:g,toolName:x.name,ok:!x.is_error,durationMs:x.duration_ms,timestamp:x.ts_end??d.ts,estimatedTokens:x.estimated_tokens?{inputTokens:x.estimated_tokens.input,outputTokens:x.estimated_tokens.output,totalTokens:x.estimated_tokens.total}:void 0,estimatedTokenMethod:x.estimated_tokens?.method})}i+=1}else for(const h of c)n.push({id:`tool_call-${n.length}`,kind:"tool_call",text:FP(h.input??{}),toolName:h.name,timestamp:o.ts,estimatedTokens:h.estimated_tokens?{inputTokens:h.estimated_tokens.input,outputTokens:h.estimated_tokens.output,totalTokens:h.estimated_tokens.total}:void 0,estimatedTokenMethod:h.estimated_tokens?.method});continue}if(o.role==="tool")for(const c of o.content){if(c.type!=="tool_result")continue;const d=c.content.filter(dh).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,estimatedTokens:c.estimated_tokens?{inputTokens:c.estimated_tokens.input,outputTokens:c.estimated_tokens.output,totalTokens:c.estimated_tokens.total}:void 0,estimatedTokenMethod:c.estimated_tokens?.method})}}return typeof r=="number"&&n[r]&&(n[r]={...n[r],kind:"assistant_final"}),n}function FP(e){try{return JSON.stringify(e)}catch{return String(e)}}function BP(e,t){t&&(typeof t.input_tokens=="number"&&(e.input+=t.input_tokens,e.hasInput=!0),typeof t.output_tokens=="number"&&(e.output+=t.output_tokens,e.hasOutput=!0),typeof t.total_tokens=="number"&&(e.total+=t.total_tokens,e.hasTotal=!0))}function Iy(e,t){if(typeof e!="number"||t<=0)return new Array(t).fill(void 0);const n=Math.floor(e/t),r=e%t;return Array.from({length:t},(s,i)=>n+(i<r?1:0))}function p3(e){const t=xs(),n=xs(),r=new Map;if(!e)return{assistant:null,tool:null,perTool:{}};for(const i of e.messages??[]){if(i.role!=="assistant")continue;BP(t,i.usage);const o=i.content.filter(p=>p.type==="tool_use");if(o.length===0)continue;if(o.every(p=>!!p.estimated_tokens)){for(const p of o){const x=p.estimated_tokens;n.input+=x.input,n.hasInput=!0,n.output+=x.output,n.hasOutput=!0,n.total+=x.total,n.hasTotal=!0;const g=r.get(p.name)??xs();g.input+=x.input,g.hasInput=!0,g.output+=x.output,g.hasOutput=!0,g.total+=x.total,g.hasTotal=!0,r.set(p.name,g)}continue}BP(n,i.usage);const d=Iy(i.usage?.input_tokens,o.length),f=Iy(i.usage?.output_tokens,o.length),h=Iy(i.usage?.total_tokens,o.length);for(let p=0;p<o.length;p+=1){const x=o[p].name,g=r.get(x)??xs(),j=d[p],b=f[p],y=h[p];typeof j=="number"&&(g.input+=j,g.hasInput=!0),typeof b=="number"&&(g.output+=b,g.hasOutput=!0),typeof y=="number"&&(g.total+=y,g.hasTotal=!0),r.set(x,g)}}const s={};for(const[i,o]of Array.from(r.entries()).sort((c,d)=>c[0].localeCompare(d[0]))){const c=Qs(o);c&&(s[i]=c)}return{assistant:Qs(t),tool:Qs(n),perTool:s}}function zP(e,t=[]){const n=new Map;for(const o of t){const c=NY(o.scenario_id,o.agent);if(!c)continue;const d=n.get(c)??[];d.push(o),n.set(c,d)}const r=e.scenarios.map(o=>{const c=n.get(`${o.scenario_id}::${o.agent}`)??[],d=new Map;for(const y of c)d.set(y.run_index,y);const f=o.runs.map((y,S)=>{const C=d.get(y.run_index)??c[S],N=p3(C);return{runIndex:y.run_index,passed:y.pass,toolCalls:d3(y,C),assistantTokenUsage:N.assistant,toolTokenUsage:N.tool,toolTokenUsageByTool:N.perTool,finalAnswer:y.final_text,conversation:f3(C),duration:y.tool_durations_ms.reduce((E,A)=>E+A,0),extractedValues:Object.fromEntries(Object.entries(y.extracted).map(([E,A])=>[E,String(A??"")])),failureReasons:y.failures}}),h=xs(),p=xs(),x=new Map;for(const y of f){oc(h,y.assistantTokenUsage),oc(p,y.toolTokenUsage);for(const[S,C]of Object.entries(y.toolTokenUsageByTool??{})){const N=x.get(S)??xs();oc(N,C),x.set(S,N)}}const g={};for(const[y,S]of Array.from(x.entries()).sort((C,N)=>C[0].localeCompare(N[0]))){const C=Qs(S);C&&(g[y]=C)}const j=f.length===0?0:Math.round(f.reduce((y,S)=>y+S.duration,0)/f.length),b=f.length===0?0:f.reduce((y,S)=>y+S.toolCalls.length,0)/f.length;return{scenarioId:o.scenario_id,scenarioName:o.scenario_name||o.scenario_id,agentId:o.agent,agentName:o.agent,provider:o.provider,model:o.model,runs:f,passRate:o.pass_rate,avgToolCalls:b,avgDuration:j,assistantTokenUsage:Qs(h),toolTokenUsage:Qs(p),toolTokenUsageByTool:g}}),s=xs(),i=xs();for(const o of r)oc(s,o.assistantTokenUsage),oc(i,o.toolTokenUsage);return{id:e.metadata.run_id,configId:"",configHash:e.metadata.config_hash,configPath:e.metadata.config_path,configName:e.metadata.config_name,timestamp:e.metadata.timestamp,runNote:e.metadata.run_note,mcpServerVersions:e.metadata.mcp_server_versions??{},scenarios:r,assistantTokenUsage:Qs(s),toolTokenUsage:Qs(i),overallPassRate:e.summary.pass_rate,totalScenarios:e.summary.total_scenarios,totalRuns:e.summary.total_runs,avgToolCalls:e.summary.avg_tool_calls_per_run,avgLatency:Math.round(e.summary.avg_tool_latency_ms??0),snapshotEval:e.metadata.snapshot_eval?{applied:e.metadata.snapshot_eval.applied,mode:e.metadata.snapshot_eval.mode,baselineSnapshotId:e.metadata.snapshot_eval.baseline_snapshot_id,baselineSourceRunId:e.metadata.snapshot_eval.baseline_source_run_id,overallScore:e.metadata.snapshot_eval.overall_score,status:e.metadata.snapshot_eval.status,impactedScenarios:e.metadata.snapshot_eval.impacted_scenarios}:void 0}}function CY(e,t){const n=p3(t??void 0);return{runIndex:e.run_index,passed:e.pass,toolCalls:d3(e,t??void 0),assistantTokenUsage:n.assistant,toolTokenUsage:n.tool,toolTokenUsageByTool:n.perTool,finalAnswer:e.final_text,conversation:f3(t??void 0),duration:e.tool_durations_ms.reduce((r,s)=>r+s,0),extractedValues:Object.fromEntries(Object.entries(e.extracted).map(([r,s])=>[r,String(s??"")])),failureReasons:e.failures}}function _Y(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}const Vo=_Y();class $N extends Error{constructor(t,n){super(n),this.status=t,this.name="ApiError"}}async function ut(e,t){const n=await fetch(`${Vo}${e}`,{...t,headers:{"content-type":"application/json",...t?.headers||{}}});if(!n.ok){const r=await n.text();throw new $N(n.status,`Request failed (${n.status}): ${r}`)}return await n.json()}async function AY(e,t){const n=await fetch(`${Vo}${e}`,{...t,headers:{}});if(!n.ok){const r=await n.text();throw new $N(n.status,`Request failed (${n.status}): ${r}`)}return n.text()}function qP(e,t){const n=new EventSource(`${Vo}${e}`),r=e.replace(/\/events$/,""),s=["session_started","turn_started","tool_call_requested","tool_call_approved","tool_call_denied","tool_call_resolved","assistant_message_completed","session_warning","session_error","session_finished"];let i=!1;const o=()=>{i||(i=!0,n.close())},c=d=>{if(!i&&!(typeof d.data!="string"||!d.data))try{const f=JSON.parse(d.data);f.type==="session_finished"&&o(),t(f)}catch{}};for(const d of s)n.addEventListener(d,c);return n.onerror=()=>{if(!i){if(n.readyState===2){o();return}fetch(`${Vo}${r}`,{method:"GET",cache:"no-store",headers:{accept:"application/json"}}).then(d=>{(d.status===404||d.status===410)&&o()}).catch(()=>{})}},()=>o()}const Qe={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})}),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(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(()=>{}),subscribeResultAssistantSessionEvents:(e,t)=>qP(`/api/result-assistant/sessions/${e}/events`,t),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)}),runScenarioPreview:e=>ut("/api/runs/preview",{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"}),subscribeScenarioAssistantSessionEvents:(e,t)=>qP(`/api/scenario-assistant/sessions/${e}/events`,t),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(`${Vo}/api/tool-analysis/jobs/${e}/events`);let r=!1;const s=()=>{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")&&s()}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"}}),s())},()=>s()},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(`${Vo}/api/oauth-debugger/sessions/${e}/events`);let r=!1;const s=()=>{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")&&s()}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"}}),s())},()=>s()},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`):AY(`/api/oauth-debugger/sessions/${e}/export?format=${t}`),createOAuthRuntimeSession:e=>ut("/api/oauth-runtime/sessions",{method:"POST",body:JSON.stringify(e)}),getOAuthRuntimeSession:e=>ut(`/api/oauth-runtime/sessions/${e}`),getOAuthRuntimeSessionToken:e=>ut(`/api/oauth-runtime/sessions/${e}/token`),submitOAuthRuntimeCallback:(e,t)=>ut(`/api/oauth-runtime/sessions/${e}/callback`,{method:"POST",body:JSON.stringify(t)}),cancelOAuthRuntimeSession:e=>ut(`/api/oauth-runtime/sessions/${e}/cancel`,{method:"POST",body:JSON.stringify({})}),ensureOAuthServers:e=>ut("/api/oauth-runtime/servers/ensure",{method:"POST",body:JSON.stringify(e)}),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(()=>{}),resumeQueue:()=>ut("/api/runs/queue/resume",{method:"POST"}),subscribeRunJob:(e,t)=>{const n=new EventSource(`${Vo}/api/runs/jobs/${e}/events`);let r=!1;const s=()=>{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")&&s()}catch{}};return n.addEventListener("queued",i),n.addEventListener("started",i),n.addEventListener("log",i),n.addEventListener("completed",i),n.addEventListener("error",i),n.addEventListener("oauth_required",i),n.onerror=()=>{r||(t({type:"error",ts:new Date().toISOString(),payload:{message:"SSE connection error"}}),s())},()=>{s()}}};function EY(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 PY(e){return e||`config-${Date.now()}`}const kY={async health(){return Qe.health()},async listConfigs(){return(await Qe.listConfigs()).map(lc)},async createConfig(e){const t=await Qe.createConfig(EY(e),LP(e));return lc(t)},async updateConfig(e){const t=await Qe.updateConfig(e.id,LP(e),PY(e.name));return lc(t)},async deleteConfig(e){await Qe.deleteConfig(e)},async listResults(){const t=(await Qe.listRuns()).map(async n=>{const[{results:r},s]=await Promise.all([Qe.getRun(n.runId),Qe.getRunTrace(n.runId)]);return zP(r,s.records)});return Promise.all(t)},async getResult(e){try{const[{results:t},n]=await Promise.all([Qe.getRun(e),Qe.getRunTrace(e)]);return zP(t,n.records)}catch{return}},async deleteResult(e){await Qe.deleteRun(e)},async updateRunNote(e,t){await Qe.updateRunNote(e,t)},async listMarkdownReports(){return Qe.listMarkdownReports()},async getMarkdownReport(e){return Qe.getMarkdownReport(e)},async deleteMarkdownReport(e){await Qe.deleteMarkdownReport(e)},async startRun(e){return Qe.startRun(e)},async runScenarioPreview(e){const t=await Qe.runScenarioPreview(e),n=t.scenario.run;if(!n)throw new Error("Preview run did not return a run result");return{runId:t.runId,scenarioId:t.scenario.scenarioId,agentName:t.scenario.agent,run:CY(n,t.scenario.traceRecord)}},async stopRun(e){await Qe.stopRun(e)},async getRunQueue(){return Qe.getRunQueue()},async removeQueuedRun(e){await Qe.removeQueuedRun(e)},async resumeQueue(){return Qe.resumeQueue()},subscribeRunJob(e,t){return Qe.subscribeRunJob(e,t)},async listSnapshots(){return Qe.listSnapshots()},async createSnapshotFromRun(e,t){return Qe.createSnapshotFromRun(e,t)},async getSnapshot(e){try{return await Qe.getSnapshot(e)}catch{return}},async compareSnapshot(e,t){return Qe.compareSnapshot(e,t)},async applyResultAssistantReport(e){return Qe.applyResultAssistantReport(e)},async createResultAssistantSession(e){return Qe.createResultAssistantSession(e)},async getResultAssistantSession(e){return Qe.getResultAssistantSession(e)},async sendResultAssistantMessage(e,t){return Qe.sendResultAssistantMessage(e,t)},async approveResultAssistantToolCall(e,t,n){return Qe.approveResultAssistantToolCall(e,t,n)},async denyResultAssistantToolCall(e,t){return Qe.denyResultAssistantToolCall(e,t)},async closeResultAssistantSession(e){await Qe.closeResultAssistantSession(e)},subscribeResultAssistantSessionEvents(e,t){return Qe.subscribeResultAssistantSessionEvents(e,t)},async generateSnapshotEvalBaseline(e,t,n){const r=await Qe.generateSnapshotEvalBaseline(e,t,n);return{snapshot:r.snapshot,config:lc(r.config)}},async updateSnapshotPolicy(e,t){const n=await Qe.updateSnapshotPolicy(e,t);return lc(n)},async getLibraries(){const e=await Qe.getLibraries();return jY(e)},async saveLibraries(e){await Qe.saveLibraries(SY(e))},async listProviderModels(e){return Qe.listProviderModels(e)},async getWorkspaceSettings(){return Qe.getSettings()},async updateWorkspaceSettings(e){return Qe.updateSettings(e)},async createScenarioAssistantSession(e){return Qe.createScenarioAssistantSession(e)},async getScenarioAssistantSession(e){return Qe.getScenarioAssistantSession(e)},async sendScenarioAssistantMessage(e,t){return Qe.sendScenarioAssistantMessage(e,t)},async approveScenarioAssistantToolCall(e,t){return Qe.approveScenarioAssistantToolCall(e,t)},async denyScenarioAssistantToolCall(e,t){return Qe.denyScenarioAssistantToolCall(e,t)},async approveAllScenarioAssistantToolCalls(e){return Qe.approveAllScenarioAssistantToolCalls(e)},async closeScenarioAssistantSession(e){await Qe.closeScenarioAssistantSession(e)},subscribeScenarioAssistantSessionEvents(e,t){return Qe.subscribeScenarioAssistantSessionEvents(e,t)},async discoverToolsForAnalysis(e){return Qe.discoverToolsForAnalysis(e)},async startToolAnalysis(e){return Qe.startToolAnalysis(e)},subscribeToolAnalysisJob(e,t){return Qe.subscribeToolAnalysisJob(e,t)},async getToolAnalysisResult(e){return Qe.getToolAnalysisResult(e)},async stopToolAnalysis(e){return Qe.stopToolAnalysis(e)},async listToolAnalysisResults(){return Qe.listToolAnalysisResults()},async getToolAnalysisSavedResult(e){return Qe.getToolAnalysisSavedResult(e)},async deleteToolAnalysisSavedResult(e){await Qe.deleteToolAnalysisSavedResult(e)},async createOAuthDebuggerSession(e){return Qe.createOAuthDebuggerSession(e)},async getOAuthDebuggerSession(e){return Qe.getOAuthDebuggerSession(e)},async startOAuthDebuggerSession(e){return Qe.startOAuthDebuggerSession(e)},subscribeOAuthDebuggerSession(e,t){return Qe.subscribeOAuthDebuggerSession(e,t)},async submitOAuthDebuggerManualCallback(e,t){return Qe.submitOAuthDebuggerManualCallback(e,t)},async stopOAuthDebuggerSession(e){return Qe.stopOAuthDebuggerSession(e)},async exportOAuthDebuggerSession(e,t){return Qe.exportOAuthDebuggerSession(e,t)},async createOAuthRuntimeSession(e){return Qe.createOAuthRuntimeSession(e)},async getOAuthRuntimeSession(e){return Qe.getOAuthRuntimeSession(e)},async getOAuthRuntimeSessionToken(e){return Qe.getOAuthRuntimeSessionToken(e)},async submitOAuthRuntimeCallback(e,t){return Qe.submitOAuthRuntimeCallback(e,t)},async cancelOAuthRuntimeSession(e){return Qe.cancelOAuthRuntimeSession(e)},async ensureOAuthServers(e){return Qe.ensureOAuthServers(e)}},h3=m.createContext(null);function OY({children:e}){const t="workspace",[n,r]=m.useState("checking"),[s,i]=m.useState(null);m.useEffect(()=>{r("checking"),Qe.health().then(c=>{r("connected"),i(typeof c?.version=="string"?c.version:null)}).catch(()=>{r("disconnected"),i(null)})},[t]);const o=m.useMemo(()=>kY,[]);return a.jsx(h3.Provider,{value:{mode:t,connection:n,version:s,source:o},children:e})}function Ln(){const e=m.useContext(h3);if(!e)throw new Error("useDataSource must be used within DataSourceProvider");return e}const TY=(e,t)=>{if(e==="/")return[{label:"Dashboard"}];const n=[{label:"Dashboard",to:"/"}];if(dn("/mcp-evaluations/:id/edit",e))return n.push({label:"MCP Evaluations",to:"/mcp-evaluations"},{label:"MCP Evaluation",to:e.replace(/\/edit$/,"")},{label:"Edit"}),n;if(dn("/mcp-evaluations/:id",e))return n.push({label:"MCP Evaluations",to:"/mcp-evaluations"},{label:"MCP Evaluation"}),n;if(dn("/mcp-evaluations",e))return n.push({label:"MCP Evaluations"}),n;if(dn("/settings/mcp",e))return n.push({label:"Settings",to:"/settings"},{label:"MCP Connection"}),n;if(dn("/settings",e))return n.push({label:"Settings"}),n;if(dn("/tool-analysis",e))return n.push({label:"Analyze MCP Tools"}),n;if(dn("/tool-analysis-results/:id",e)){const r=dn("/tool-analysis-results/:id",e);return n.push({label:"Tool Analysis Results",to:"/tool-analysis-results"},{label:r?.params.id??"Report"}),n}if(dn("/tool-analysis-results",e))return n.push({label:"Tool Analysis Results"}),n;if(dn("/markdown-reports/view",e))return n.push({label:"Markdown Reports",to:"/markdown-reports"},{label:"View Report"}),n;if(dn("/markdown-reports",e))return n.push({label:"Markdown Reports"}),n;if(dn("/oauth-debugger",e))return n.push({label:"OAuth Debugger"}),n;if(dn("/results/:id",e))return n.push({label:"Evaluation Results",to:"/results"},{label:"Result"}),n;if(dn("/results",e))return n.push({label:"Evaluation Results"}),n;if(dn("/run",e))return n.push({label:"Run Evaluation"}),n;if(dn("/libraries/servers/:serverId",e)){const r=dn("/libraries/servers/:serverId",e),s=r?.params.serverId?decodeURIComponent(r.params.serverId):"Server";return n.push({label:"Libraries",to:"/libraries/servers"},{label:"MCP servers",to:"/libraries/servers"},{label:s==="new"?"New Server":s}),n}if(dn("/libraries/servers",e))return n.push({label:"Libraries",to:"/libraries/servers"},{label:"MCP servers"}),n;if(dn("/libraries/agents/:agentName",e)){const r=dn("/libraries/agents/:agentName",e),s=r?.params.agentName?decodeURIComponent(r.params.agentName):"Agent";return n.push({label:"Libraries",to:"/libraries/agents"},{label:"Agents",to:"/libraries/agents"},{label:s==="new"?"New Agent":s}),n}if(dn("/libraries/agents",e))return n.push({label:"Libraries",to:"/libraries/agents"},{label:"Agents"}),n;if(dn("/libraries/test-cases/:testCaseId",e)){const r=dn("/libraries/test-cases/:testCaseId",e),s=r?.params.testCaseId?decodeURIComponent(r.params.testCaseId):"Test Case";return n.push({label:"Libraries",to:"/libraries/test-cases"},{label:"Test Cases",to:"/libraries/test-cases"},{label:s}),n}if(dn("/libraries/test-cases",e))return n.push({label:"Libraries",to:"/libraries/test-cases"},{label:"Test Cases"}),n;if(dn("/compare/results",e))return n.push({label:"Compare Evaluations",to:"/compare"},{label:"Full Result Compare"}),n;if(dn("/compare",e)){const s=new URLSearchParams(t).get("mode")==="within-run"?"Agents":"Runs";return n.push({label:"Compare Evaluations",to:"/compare"},{label:s}),n}return n};function RY(){const e=Is(),t=new URLSearchParams(e.search).get("embed")==="1",n=TY(e.pathname,e.search),{connection:r,version:s}=Ln();return t?a.jsx("main",{className:"min-h-screen overflow-auto bg-background p-4",children:a.jsx(jP,{})}):a.jsx(V5,{children:a.jsxs("div",{className:"flex min-h-screen w-full",children:[a.jsx(xY,{version:s}),a.jsxs("div",{className:"flex flex-1 flex-col",children:[a.jsxs("header",{className:"flex h-12 items-center gap-2 border-b bg-card px-4",children:[a.jsx(K5,{}),a.jsx(a3,{children:a.jsx(s3,{children:n.map((i,o)=>{const c=o===n.length-1;return a.jsxs(m.Fragment,{children:[a.jsx(i3,{children:i.to&&!c?a.jsx(o3,{asChild:!0,children:a.jsx(At,{to:i.to,children:i.label})}):a.jsx(l3,{children:i.label})}),!c&&a.jsx(c3,{})]},`${i.label}-${o}`)})})}),a.jsx("div",{className:"ml-auto flex items-center gap-2",children:a.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border px-2.5 py-1",children:[a.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"}),a.jsx("span",{className:`text-xs ${r==="connected"?"text-emerald-700":r==="checking"?"text-muted-foreground":"text-destructive"}`,children:r})]})})]}),a.jsx("main",{className:"flex-1 overflow-auto p-6",children:a.jsx(jP,{})})]})]})})}const m3=m.createContext(null);function IY({children:e}){const{source:t}=Ln(),[n,r]=m.useState([]),[s,i]=m.useState(!0),o=m.useCallback(async()=>{i(!0);try{const x=await t.listConfigs();r(x)}finally{i(!1)}},[t]);m.useEffect(()=>{o()},[o]);const c=m.useCallback(x=>n.find(g=>g.id===x),[n]),d=m.useCallback(async x=>{const g=await t.createConfig(x);return r(j=>[...j,g]),g},[t]),f=m.useCallback(async(x,g)=>{const j=await t.updateConfig({...g,id:x});return r(b=>b.map(y=>y.id===x?j:y)),j},[t]),h=m.useCallback(async x=>{await t.deleteConfig(x),r(g=>g.filter(j=>j.id!==x))},[t]),p=m.useCallback(async x=>{const g=n.find(y=>y.id===x);if(!g)throw new Error("Config not found");const j={...structuredClone(g),id:`cfg-${Date.now()}`,name:`${g.name} (Copy)`,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()},b=await t.createConfig(j);return r(y=>[...y,b]),b},[n,t]);return a.jsx(m3.Provider,{value:{configs:n,loading:s,getConfig:c,addConfig:d,updateConfig:f,deleteConfig:h,cloneConfig:p,reload:o},children:e})}function Mf(){const e=m.useContext(m3);if(!e)throw new Error("useConfigs must be used within ConfigProvider");return e}const v3=m.createContext(null);function MY({children:e}){const{source:t}=Ln(),[n,r]=m.useState({servers:[],agents:[],scenarios:[]}),[s,i]=m.useState(!0),o=m.useCallback(async()=>{i(!0);try{const f=await t.getLibraries();r(f)}finally{i(!1)}},[t]);m.useEffect(()=>{o()},[t]),m.useEffect(()=>{const f=()=>{o()};return window.addEventListener("focus",f),()=>{window.removeEventListener("focus",f)}},[t]);const c=m.useCallback(async f=>{r(f),await t.saveLibraries(f)},[t]),d=m.useMemo(()=>({...n,loading:s,setServers:async f=>c({...n,servers:f}),setAgents:async f=>c({...n,agents:f}),setScenarios:async f=>c({...n,scenarios:f}),reload:o}),[n,s,o,c]);return a.jsx(v3.Provider,{value:d,children:e})}function rs(){const e=m.useContext(v3);if(!e)throw new Error("useLibraries must be used within LibraryProvider");return e}const Ue=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Se("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Ue.displayName="Card";const Pt=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Se("flex flex-col space-y-1.5 p-6",e),...t}));Pt.displayName="CardHeader";const kt=m.forwardRef(({className:e,...t},n)=>a.jsx("h3",{ref:n,className:Se("text-2xl font-semibold leading-none tracking-tight",e),...t}));kt.displayName="CardTitle";const Ur=m.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));Ur.displayName="CardDescription";const We=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Se("p-6 pt-0",e),...t}));We.displayName="CardContent";const $Y=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Se("flex items-center p-6 pt-0",e),...t}));$Y.displayName="CardFooter";const Wr=m.forwardRef(({className:e,containerClassName:t,...n},r)=>a.jsx("div",{className:Se("relative w-full overflow-auto",t),children:a.jsx("table",{ref:r,className:Se("w-full caption-bottom text-sm",e),...n})}));Wr.displayName="Table";const Vr=m.forwardRef(({className:e,...t},n)=>a.jsx("thead",{ref:n,className:Se("[&_tr]:border-b",e),...t}));Vr.displayName="TableHeader";const Hr=m.forwardRef(({className:e,...t},n)=>a.jsx("tbody",{ref:n,className:Se("[&_tr:last-child]:border-0",e),...t}));Hr.displayName="TableBody";const DY=m.forwardRef(({className:e,...t},n)=>a.jsx("tfoot",{ref:n,className:Se("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));DY.displayName="TableFooter";const Gt=m.forwardRef(({className:e,...t},n)=>a.jsx("tr",{ref:n,className:Se("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));Gt.displayName="TableRow";const rt=m.forwardRef(({className:e,...t},n)=>a.jsx("th",{ref:n,className:Se("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));rt.displayName="TableHead";const ze=m.forwardRef(({className:e,...t},n)=>a.jsx("td",{ref:n,className:Se("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));ze.displayName="TableCell";const LY=m.forwardRef(({className:e,...t},n)=>a.jsx("caption",{ref:n,className:Se("mt-4 text-sm text-muted-foreground",e),...t}));LY.displayName="TableCaption";function vs({title:e,value:t,subtitle:n,icon:r,trend:s}){return a.jsx(Ue,{children:a.jsx(We,{className:"p-4",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:e}),a.jsx("p",{className:"text-2xl font-bold",children:t}),n&&a.jsxs("p",{className:`text-xs ${s==="up"?"text-success":s==="down"?"text-destructive":"text-muted-foreground"}`,children:[s==="up"&&"↑ ",s==="down"&&"↓ ",n]})]}),a.jsx("div",{className:"rounded-lg bg-primary/10 p-2",children:a.jsx(r,{className:"h-4 w-4 text-primary"})})]})})})}const FY=xl("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"}}),qe=m.forwardRef(({className:e,variant:t,asChild:n,...r},s)=>{const i=n?uo:"div";return a.jsx(i,{ref:s,className:Se(FY({variant:t}),e),...r})});qe.displayName="Badge";function Js({rate:e,className:t}){const n=Math.round(e*100),r=n>=80?"default":n>=50?"secondary":"destructive";return a.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 My,UP;function Xr(){if(UP)return My;UP=1;var e=Array.isArray;return My=e,My}var $y,WP;function g3(){if(WP)return $y;WP=1;var e=typeof eh=="object"&&eh&&eh.Object===Object&&eh;return $y=e,$y}var Dy,VP;function Ms(){if(VP)return Dy;VP=1;var e=g3(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Dy=n,Dy}var Ly,HP;function $f(){if(HP)return Ly;HP=1;var e=Ms(),t=e.Symbol;return Ly=t,Ly}var Fy,KP;function BY(){if(KP)return Fy;KP=1;var e=$f(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,s=e?e.toStringTag:void 0;function i(o){var c=n.call(o,s),d=o[s];try{o[s]=void 0;var f=!0}catch{}var h=r.call(o);return f&&(c?o[s]=d:delete o[s]),h}return Fy=i,Fy}var By,GP;function zY(){if(GP)return By;GP=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return By=n,By}var zy,YP;function gi(){if(YP)return zy;YP=1;var e=$f(),t=BY(),n=zY(),r="[object Null]",s="[object Undefined]",i=e?e.toStringTag:void 0;function o(c){return c==null?c===void 0?s:r:i&&i in Object(c)?t(c):n(c)}return zy=o,zy}var qy,XP;function xi(){if(XP)return qy;XP=1;function e(t){return t!=null&&typeof t=="object"}return qy=e,qy}var Uy,QP;function vu(){if(QP)return Uy;QP=1;var e=gi(),t=xi(),n="[object Symbol]";function r(s){return typeof s=="symbol"||t(s)&&e(s)==n}return Uy=r,Uy}var Wy,JP;function DN(){if(JP)return Wy;JP=1;var e=Xr(),t=vu(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function s(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 Wy=s,Wy}var Vy,ZP;function fo(){if(ZP)return Vy;ZP=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return Vy=e,Vy}var Hy,ek;function LN(){if(ek)return Hy;ek=1;var e=gi(),t=fo(),n="[object AsyncFunction]",r="[object Function]",s="[object GeneratorFunction]",i="[object Proxy]";function o(c){if(!t(c))return!1;var d=e(c);return d==r||d==s||d==n||d==i}return Hy=o,Hy}var Ky,tk;function qY(){if(tk)return Ky;tk=1;var e=Ms(),t=e["__core-js_shared__"];return Ky=t,Ky}var Gy,nk;function UY(){if(nk)return Gy;nk=1;var e=qY(),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 Gy=n,Gy}var Yy,rk;function x3(){if(rk)return Yy;rk=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 Yy=n,Yy}var Xy,ak;function WY(){if(ak)return Xy;ak=1;var e=LN(),t=UY(),n=fo(),r=x3(),s=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,c=Object.prototype,d=o.toString,f=c.hasOwnProperty,h=RegExp("^"+d.call(f).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(x){if(!n(x)||t(x))return!1;var g=e(x)?h:i;return g.test(r(x))}return Xy=p,Xy}var Qy,sk;function VY(){if(sk)return Qy;sk=1;function e(t,n){return t?.[n]}return Qy=e,Qy}var Jy,ik;function bl(){if(ik)return Jy;ik=1;var e=WY(),t=VY();function n(r,s){var i=t(r,s);return e(i)?i:void 0}return Jy=n,Jy}var Zy,ok;function Pv(){if(ok)return Zy;ok=1;var e=bl(),t=e(Object,"create");return Zy=t,Zy}var eb,lk;function HY(){if(lk)return eb;lk=1;var e=Pv();function t(){this.__data__=e?e(null):{},this.size=0}return eb=t,eb}var tb,ck;function KY(){if(ck)return tb;ck=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return tb=e,tb}var nb,uk;function GY(){if(uk)return nb;uk=1;var e=Pv(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function s(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 nb=s,nb}var rb,dk;function YY(){if(dk)return rb;dk=1;var e=Pv(),t=Object.prototype,n=t.hasOwnProperty;function r(s){var i=this.__data__;return e?i[s]!==void 0:n.call(i,s)}return rb=r,rb}var ab,fk;function XY(){if(fk)return ab;fk=1;var e=Pv(),t="__lodash_hash_undefined__";function n(r,s){var i=this.__data__;return this.size+=this.has(r)?0:1,i[r]=e&&s===void 0?t:s,this}return ab=n,ab}var sb,pk;function QY(){if(pk)return sb;pk=1;var e=HY(),t=KY(),n=GY(),r=YY(),s=XY();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=s,sb=i,sb}var ib,hk;function JY(){if(hk)return ib;hk=1;function e(){this.__data__=[],this.size=0}return ib=e,ib}var ob,mk;function FN(){if(mk)return ob;mk=1;function e(t,n){return t===n||t!==t&&n!==n}return ob=e,ob}var lb,vk;function kv(){if(vk)return lb;vk=1;var e=FN();function t(n,r){for(var s=n.length;s--;)if(e(n[s][0],r))return s;return-1}return lb=t,lb}var cb,gk;function ZY(){if(gk)return cb;gk=1;var e=kv(),t=Array.prototype,n=t.splice;function r(s){var i=this.__data__,o=e(i,s);if(o<0)return!1;var c=i.length-1;return o==c?i.pop():n.call(i,o,1),--this.size,!0}return cb=r,cb}var ub,xk;function eX(){if(xk)return ub;xk=1;var e=kv();function t(n){var r=this.__data__,s=e(r,n);return s<0?void 0:r[s][1]}return ub=t,ub}var db,yk;function tX(){if(yk)return db;yk=1;var e=kv();function t(n){return e(this.__data__,n)>-1}return db=t,db}var fb,bk;function nX(){if(bk)return fb;bk=1;var e=kv();function t(n,r){var s=this.__data__,i=e(s,n);return i<0?(++this.size,s.push([n,r])):s[i][1]=r,this}return fb=t,fb}var pb,wk;function Ov(){if(wk)return pb;wk=1;var e=JY(),t=ZY(),n=eX(),r=tX(),s=nX();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=s,pb=i,pb}var hb,jk;function BN(){if(jk)return hb;jk=1;var e=bl(),t=Ms(),n=e(t,"Map");return hb=n,hb}var mb,Sk;function rX(){if(Sk)return mb;Sk=1;var e=QY(),t=Ov(),n=BN();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return mb=r,mb}var vb,Nk;function aX(){if(Nk)return vb;Nk=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return vb=e,vb}var gb,Ck;function Tv(){if(Ck)return gb;Ck=1;var e=aX();function t(n,r){var s=n.__data__;return e(r)?s[typeof r=="string"?"string":"hash"]:s.map}return gb=t,gb}var xb,_k;function sX(){if(_k)return xb;_k=1;var e=Tv();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return xb=t,xb}var yb,Ak;function iX(){if(Ak)return yb;Ak=1;var e=Tv();function t(n){return e(this,n).get(n)}return yb=t,yb}var bb,Ek;function oX(){if(Ek)return bb;Ek=1;var e=Tv();function t(n){return e(this,n).has(n)}return bb=t,bb}var wb,Pk;function lX(){if(Pk)return wb;Pk=1;var e=Tv();function t(n,r){var s=e(this,n),i=s.size;return s.set(n,r),this.size+=s.size==i?0:1,this}return wb=t,wb}var jb,kk;function zN(){if(kk)return jb;kk=1;var e=rX(),t=sX(),n=iX(),r=oX(),s=lX();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=s,jb=i,jb}var Sb,Ok;function y3(){if(Ok)return Sb;Ok=1;var e=zN(),t="Expected a function";function n(r,s){if(typeof r!="function"||s!=null&&typeof s!="function")throw new TypeError(t);var i=function(){var o=arguments,c=s?s.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,Sb=n,Sb}var Nb,Tk;function cX(){if(Tk)return Nb;Tk=1;var e=y3(),t=500;function n(r){var s=e(r,function(o){return i.size===t&&i.clear(),o}),i=s.cache;return s}return Nb=n,Nb}var Cb,Rk;function uX(){if(Rk)return Cb;Rk=1;var e=cX(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(s){var i=[];return s.charCodeAt(0)===46&&i.push(""),s.replace(t,function(o,c,d,f){i.push(d?f.replace(n,"$1"):c||o)}),i});return Cb=r,Cb}var _b,Ik;function qN(){if(Ik)return _b;Ik=1;function e(t,n){for(var r=-1,s=t==null?0:t.length,i=Array(s);++r<s;)i[r]=n(t[r],r,t);return i}return _b=e,_b}var Ab,Mk;function dX(){if(Mk)return Ab;Mk=1;var e=$f(),t=qN(),n=Xr(),r=vu(),s=e?e.prototype:void 0,i=s?s.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 Ab=o,Ab}var Eb,$k;function b3(){if($k)return Eb;$k=1;var e=dX();function t(n){return n==null?"":e(n)}return Eb=t,Eb}var Pb,Dk;function w3(){if(Dk)return Pb;Dk=1;var e=Xr(),t=DN(),n=uX(),r=b3();function s(i,o){return e(i)?i:t(i,o)?[i]:n(r(i))}return Pb=s,Pb}var kb,Lk;function Rv(){if(Lk)return kb;Lk=1;var e=vu();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return kb=t,kb}var Ob,Fk;function UN(){if(Fk)return Ob;Fk=1;var e=w3(),t=Rv();function n(r,s){s=e(s,r);for(var i=0,o=s.length;r!=null&&i<o;)r=r[t(s[i++])];return i&&i==o?r:void 0}return Ob=n,Ob}var Tb,Bk;function j3(){if(Bk)return Tb;Bk=1;var e=UN();function t(n,r,s){var i=n==null?void 0:e(n,r);return i===void 0?s:i}return Tb=t,Tb}var fX=j3();const fa=fn(fX);var Rb,zk;function pX(){if(zk)return Rb;zk=1;function e(t){return t==null}return Rb=e,Rb}var hX=pX();const $t=fn(hX);var Ib,qk;function mX(){if(qk)return Ib;qk=1;var e=gi(),t=Xr(),n=xi(),r="[object String]";function s(i){return typeof i=="string"||!t(i)&&n(i)&&e(i)==r}return Ib=s,Ib}var vX=mX();const tl=fn(vX);var gX=LN();const Mt=fn(gX);var xX=fo();const gu=fn(xX);var Mb={exports:{}},cn={};var Uk;function yX(){if(Uk)return cn;Uk=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),j;j=Symbol.for("react.module.reference");function b(y){if(typeof y=="object"&&y!==null){var S=y.$$typeof;switch(S){case e:switch(y=y.type,y){case n:case s:case r:case f:case h:return y;default:switch(y=y&&y.$$typeof,y){case c:case o:case d:case x:case p:case i:return y;default:return S}}case t:return S}}}return cn.ContextConsumer=o,cn.ContextProvider=i,cn.Element=e,cn.ForwardRef=d,cn.Fragment=n,cn.Lazy=x,cn.Memo=p,cn.Portal=t,cn.Profiler=s,cn.StrictMode=r,cn.Suspense=f,cn.SuspenseList=h,cn.isAsyncMode=function(){return!1},cn.isConcurrentMode=function(){return!1},cn.isContextConsumer=function(y){return b(y)===o},cn.isContextProvider=function(y){return b(y)===i},cn.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===e},cn.isForwardRef=function(y){return b(y)===d},cn.isFragment=function(y){return b(y)===n},cn.isLazy=function(y){return b(y)===x},cn.isMemo=function(y){return b(y)===p},cn.isPortal=function(y){return b(y)===t},cn.isProfiler=function(y){return b(y)===s},cn.isStrictMode=function(y){return b(y)===r},cn.isSuspense=function(y){return b(y)===f},cn.isSuspenseList=function(y){return b(y)===h},cn.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===n||y===s||y===r||y===f||y===h||y===g||typeof y=="object"&&y!==null&&(y.$$typeof===x||y.$$typeof===p||y.$$typeof===i||y.$$typeof===o||y.$$typeof===d||y.$$typeof===j||y.getModuleId!==void 0)},cn.typeOf=b,cn}var Wk;function bX(){return Wk||(Wk=1,Mb.exports=yX()),Mb.exports}var wX=bX(),$b,Vk;function S3(){if(Vk)return $b;Vk=1;var e=gi(),t=xi(),n="[object Number]";function r(s){return typeof s=="number"||t(s)&&e(s)==n}return $b=r,$b}var Db,Hk;function jX(){if(Hk)return Db;Hk=1;var e=S3();function t(n){return e(n)&&n!=+n}return Db=t,Db}var SX=jX();const Df=fn(SX);var NX=S3();const CX=fn(NX);var _r=function(t){return t===0?0:t>0?1:-1},zo=function(t){return tl(t)&&t.indexOf("%")===t.length-1},Ke=function(t){return CX(t)&&!Df(t)},_X=function(t){return $t(t)},tr=function(t){return Ke(t)||tl(t)},AX=0,xu=function(t){var n=++AX;return"".concat(t||"").concat(n)},Ar=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ke(t)&&!tl(t))return r;var i;if(zo(t)){var o=t.indexOf("%");i=n*parseFloat(t.slice(0,o))/100}else i=+t;return Df(i)&&(i=r),s&&i>n&&(i=n),i},cc=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},EX=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},s=0;s<n;s++)if(!r[t[s]])r[t[s]]=!0;else return!0;return!1},la=function(t,n){return Ke(t)&&Ke(n)?function(r){return t+r*(n-t)}:function(){return n}};function Hh(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):fa(r,t))===n})}var PX=function(t,n){return Ke(t)&&Ke(n)?t-n:tl(t)&&tl(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function Sc(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 bS(e){"@babel/helpers - typeof";return bS=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},bS(e)}var kX=["viewBox","children"],OX=["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"],Kk=["points","pathLength"],Lb={svg:kX,polygon:Kk,polyline:Kk},WN=["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"],Kh=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(m.isValidElement(t)&&(r=t.props),!gu(r))return null;var s={};return Object.keys(r).forEach(function(i){WN.includes(i)&&(s[i]=n||function(o){return r[i](r,o)})}),s},TX=function(t,n,r){return function(s){return t(n,r,s),null}},nl=function(t,n,r){if(!gu(t)||bS(t)!=="object")return null;var s=null;return Object.keys(t).forEach(function(i){var o=t[i];WN.includes(i)&&typeof o=="function"&&(s||(s={}),s[i]=TX(o,n,r))}),s},RX=["children"],IX=["children"];function Gk(e,t){if(e==null)return{};var n=MX(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function MX(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 wS(e){"@babel/helpers - typeof";return wS=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},wS(e)}var Yk={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"},ni=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},Xk=null,Fb=null,VN=function e(t){if(t===Xk&&Array.isArray(Fb))return Fb;var n=[];return m.Children.forEach(t,function(r){$t(r)||(wX.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),Fb=n,Xk=t,n};function pa(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(s){return ni(s)}):r=[ni(t)],VN(e).forEach(function(s){var i=fa(s,"type.displayName")||fa(s,"type.name");r.indexOf(i)!==-1&&n.push(s)}),n}function ia(e,t){var n=pa(e,t);return n&&n[0]}var Qk=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,s=n.height;return!(!Ke(r)||r<=0||!Ke(s)||s<=0)},$X=["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"],DX=function(t){return t&&t.type&&tl(t.type)&&$X.indexOf(t.type)>=0},LX=function(t){return t&&wS(t)==="object"&&"clipDot"in t},FX=function(t,n,r,s){var i,o=(i=Lb?.[s])!==null&&i!==void 0?i:[];return n.startsWith("data-")||!Mt(t)&&(s&&o.includes(n)||OX.includes(n))||r&&WN.includes(n)},Nt=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var s=t;if(m.isValidElement(t)&&(s=t.props),!gu(s))return null;var i={};return Object.keys(s).forEach(function(o){var c;FX((c=s)===null||c===void 0?void 0:c[o],o,n,r)&&(i[o]=s[o])}),i},jS=function e(t,n){if(t===n)return!0;var r=m.Children.count(t);if(r!==m.Children.count(n))return!1;if(r===0)return!0;if(r===1)return Jk(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var s=0;s<r;s++){var i=t[s],o=n[s];if(Array.isArray(i)||Array.isArray(o)){if(!e(i,o))return!1}else if(!Jk(i,o))return!1}return!0},Jk=function(t,n){if($t(t)&&$t(n))return!0;if(!$t(t)&&!$t(n)){var r=t.props||{},s=r.children,i=Gk(r,RX),o=n.props||{},c=o.children,d=Gk(o,IX);return s&&c?Sc(i,d)&&jS(s,c):!s&&!c?Sc(i,d):!1}return!1},Zk=function(t,n){var r=[],s={};return VN(t).forEach(function(i,o){if(DX(i))r.push(i);else if(i){var c=ni(i.type),d=n[c]||{},f=d.handler,h=d.once;if(f&&(!h||!s[c])){var p=f(i,c,o);r.push(p),s[c]=!0}}}),r},BX=function(t){var n=t&&t.type;return n&&Yk[n]?Yk[n]:null},zX=function(t,n){return VN(n).indexOf(t)},qX=["children","width","height","viewBox","className","style","title","desc"];function SS(){return SS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},SS.apply(this,arguments)}function UX(e,t){if(e==null)return{};var n=WX(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function WX(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 NS(e){var t=e.children,n=e.width,r=e.height,s=e.viewBox,i=e.className,o=e.style,c=e.title,d=e.desc,f=UX(e,qX),h=s||{width:n,height:r,x:0,y:0},p=Dt("recharts-surface",i);return Y.createElement("svg",SS({},Nt(f,!0,"svg"),{className:p,width:n,height:r,style:o,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),Y.createElement("title",null,c),Y.createElement("desc",null,d),t)}var VX=["children","className"];function CS(){return CS=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},CS.apply(this,arguments)}function HX(e,t){if(e==null)return{};var n=KX(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function KX(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 nn=Y.forwardRef(function(e,t){var n=e.children,r=e.className,s=HX(e,VX),i=Dt("recharts-layer",r);return Y.createElement("g",CS({className:i},Nt(s,!0),{ref:t}),n)}),ri=function(t,n){for(var r=arguments.length,s=new Array(r>2?r-2:0),i=2;i<r;i++)s[i-2]=arguments[i]},Bb,eO;function GX(){if(eO)return Bb;eO=1;function e(t,n,r){var s=-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);++s<i;)o[s]=t[s+n];return o}return Bb=e,Bb}var zb,tO;function YX(){if(tO)return zb;tO=1;var e=GX();function t(n,r,s){var i=n.length;return s=s===void 0?i:s,!r&&s>=i?n:e(n,r,s)}return zb=t,zb}var qb,nO;function N3(){if(nO)return qb;nO=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",s=t+n+r,i="\\ufe0e\\ufe0f",o="\\u200d",c=RegExp("["+o+e+s+i+"]");function d(f){return c.test(f)}return qb=d,qb}var Ub,rO;function XX(){if(rO)return Ub;rO=1;function e(t){return t.split("")}return Ub=e,Ub}var Wb,aO;function QX(){if(aO)return Wb;aO=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",s=t+n+r,i="\\ufe0e\\ufe0f",o="["+e+"]",c="["+s+"]",d="\\ud83c[\\udffb-\\udfff]",f="(?:"+c+"|"+d+")",h="[^"+e+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",x="[\\ud800-\\udbff][\\udc00-\\udfff]",g="\\u200d",j=f+"?",b="["+i+"]?",y="(?:"+g+"(?:"+[h,p,x].join("|")+")"+b+j+")*",S=b+j+y,C="(?:"+[h+c+"?",c,p,x,o].join("|")+")",N=RegExp(d+"(?="+d+")|"+C+S,"g");function E(A){return A.match(N)||[]}return Wb=E,Wb}var Vb,sO;function JX(){if(sO)return Vb;sO=1;var e=XX(),t=N3(),n=QX();function r(s){return t(s)?n(s):e(s)}return Vb=r,Vb}var Hb,iO;function ZX(){if(iO)return Hb;iO=1;var e=YX(),t=N3(),n=JX(),r=b3();function s(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 Hb=s,Hb}var Kb,oO;function eQ(){if(oO)return Kb;oO=1;var e=ZX(),t=e("toUpperCase");return Kb=t,Kb}var tQ=eQ();const Iv=fn(tQ);function wn(e){return function(){return e}}const C3=Math.cos,Gh=Math.sin,as=Math.sqrt,Yh=Math.PI,Mv=2*Yh,_S=Math.PI,AS=2*_S,Lo=1e-6,nQ=AS-Lo;function _3(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function rQ(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return _3;const n=10**t;return function(r){this._+=r[0];for(let s=1,i=r.length;s<i;++s)this._+=Math.round(arguments[s]*n)/n+r[s]}}class aQ{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?_3:rQ(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,s){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+s}`}bezierCurveTo(t,n,r,s,i,o){this._append`C${+t},${+n},${+r},${+s},${this._x1=+i},${this._y1=+o}`}arcTo(t,n,r,s,i){if(t=+t,n=+n,r=+r,s=+s,i=+i,i<0)throw new Error(`negative radius: ${i}`);let o=this._x1,c=this._y1,d=r-t,f=s-n,h=o-t,p=c-n,x=h*h+p*p;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(x>Lo)if(!(Math.abs(p*d-f*h)>Lo)||!i)this._append`L${this._x1=t},${this._y1=n}`;else{let g=r-o,j=s-c,b=d*d+f*f,y=g*g+j*j,S=Math.sqrt(b),C=Math.sqrt(x),N=i*Math.tan((_S-Math.acos((b+x-y)/(2*S*C)))/2),E=N/C,A=N/S;Math.abs(E-1)>Lo&&this._append`L${t+E*h},${n+E*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,s,i,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let c=r*Math.cos(s),d=r*Math.sin(s),f=t+c,h=n+d,p=1^o,x=o?s-i:i-s;this._x1===null?this._append`M${f},${h}`:(Math.abs(this._x1-f)>Lo||Math.abs(this._y1-h)>Lo)&&this._append`L${f},${h}`,r&&(x<0&&(x=x%AS+AS),x>nQ?this._append`A${r},${r},0,1,${p},${t-c},${n-d}A${r},${r},0,1,${p},${this._x1=f},${this._y1=h}`:x>Lo&&this._append`A${r},${r},0,${+(x>=_S)},${p},${this._x1=t+r*Math.cos(i)},${this._y1=n+r*Math.sin(i)}`)}rect(t,n,r,s){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+s}h${-r}Z`}toString(){return this._}}function HN(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 aQ(t)}function KN(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function A3(e){this._context=e}A3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function $v(e){return new A3(e)}function E3(e){return e[0]}function P3(e){return e[1]}function k3(e,t){var n=wn(!0),r=null,s=$v,i=null,o=HN(c);e=typeof e=="function"?e:e===void 0?E3:wn(e),t=typeof t=="function"?t:t===void 0?P3:wn(t);function c(d){var f,h=(d=KN(d)).length,p,x=!1,g;for(r==null&&(i=s(g=o())),f=0;f<=h;++f)!(f<h&&n(p=d[f],f,d))===x&&((x=!x)?i.lineStart():i.lineEnd()),x&&i.point(+e(p,f,d),+t(p,f,d));if(g)return i=null,g+""||null}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:wn(+d),c):e},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:wn(+d),c):t},c.defined=function(d){return arguments.length?(n=typeof d=="function"?d:wn(!!d),c):n},c.curve=function(d){return arguments.length?(s=d,r!=null&&(i=s(r)),c):s},c.context=function(d){return arguments.length?(d==null?r=i=null:i=s(r=d),c):r},c}function fh(e,t,n){var r=null,s=wn(!0),i=null,o=$v,c=null,d=HN(f);e=typeof e=="function"?e:e===void 0?E3:wn(+e),t=typeof t=="function"?t:wn(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?P3:wn(+n);function f(p){var x,g,j,b=(p=KN(p)).length,y,S=!1,C,N=new Array(b),E=new Array(b);for(i==null&&(c=o(C=d())),x=0;x<=b;++x){if(!(x<b&&s(y=p[x],x,p))===S)if(S=!S)g=x,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),j=x-1;j>=g;--j)c.point(N[j],E[j]);c.lineEnd(),c.areaEnd()}S&&(N[x]=+e(y,x,p),E[x]=+t(y,x,p),c.point(r?+r(y,x,p):N[x],n?+n(y,x,p):E[x]))}if(C)return c=null,C+""||null}function h(){return k3().defined(s).curve(o).context(i)}return f.x=function(p){return arguments.length?(e=typeof p=="function"?p:wn(+p),r=null,f):e},f.x0=function(p){return arguments.length?(e=typeof p=="function"?p:wn(+p),f):e},f.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:wn(+p),f):r},f.y=function(p){return arguments.length?(t=typeof p=="function"?p:wn(+p),n=null,f):t},f.y0=function(p){return arguments.length?(t=typeof p=="function"?p:wn(+p),f):t},f.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:wn(+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?(s=typeof p=="function"?p:wn(!!p),f):s},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 O3{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 sQ(e){return new O3(e,!0)}function iQ(e){return new O3(e,!1)}const GN={draw(e,t){const n=as(t/Yh);e.moveTo(n,0),e.arc(0,0,n,0,Mv)}},oQ={draw(e,t){const n=as(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},T3=as(1/3),lQ=T3*2,cQ={draw(e,t){const n=as(t/lQ),r=n*T3;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},uQ={draw(e,t){const n=as(t),r=-n/2;e.rect(r,r,n,n)}},dQ=.8908130915292852,R3=Gh(Yh/10)/Gh(7*Yh/10),fQ=Gh(Mv/10)*R3,pQ=-C3(Mv/10)*R3,hQ={draw(e,t){const n=as(t*dQ),r=fQ*n,s=pQ*n;e.moveTo(0,-n),e.lineTo(r,s);for(let i=1;i<5;++i){const o=Mv*i/5,c=C3(o),d=Gh(o);e.lineTo(d*n,-c*n),e.lineTo(c*r-d*s,d*r+c*s)}e.closePath()}},Gb=as(3),mQ={draw(e,t){const n=-as(t/(Gb*3));e.moveTo(0,n*2),e.lineTo(-Gb*n,-n),e.lineTo(Gb*n,-n),e.closePath()}},Sa=-.5,Na=as(3)/2,ES=1/as(12),vQ=(ES/2+1)*3,gQ={draw(e,t){const n=as(t/vQ),r=n/2,s=n*ES,i=r,o=n*ES+n,c=-i,d=o;e.moveTo(r,s),e.lineTo(i,o),e.lineTo(c,d),e.lineTo(Sa*r-Na*s,Na*r+Sa*s),e.lineTo(Sa*i-Na*o,Na*i+Sa*o),e.lineTo(Sa*c-Na*d,Na*c+Sa*d),e.lineTo(Sa*r+Na*s,Sa*s-Na*r),e.lineTo(Sa*i+Na*o,Sa*o-Na*i),e.lineTo(Sa*c+Na*d,Sa*d-Na*c),e.closePath()}};function xQ(e,t){let n=null,r=HN(s);e=typeof e=="function"?e:wn(e||GN),t=typeof t=="function"?t:wn(t===void 0?64:+t);function s(){let i;if(n||(n=i=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+""||null}return s.type=function(i){return arguments.length?(e=typeof i=="function"?i:wn(i),s):e},s.size=function(i){return arguments.length?(t=typeof i=="function"?i:wn(+i),s):t},s.context=function(i){return arguments.length?(n=i??null,s):n},s}function Xh(){}function Qh(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 I3(e){this._context=e}I3.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:Qh(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:Qh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function yQ(e){return new I3(e)}function M3(e){this._context=e}M3.prototype={areaStart:Xh,areaEnd:Xh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Qh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function bQ(e){return new M3(e)}function $3(e){this._context=e}$3.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:Qh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function wQ(e){return new $3(e)}function D3(e){this._context=e}D3.prototype={areaStart:Xh,areaEnd:Xh,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function jQ(e){return new D3(e)}function lO(e){return e<0?-1:1}function cO(e,t,n){var r=e._x1-e._x0,s=t-e._x1,i=(e._y1-e._y0)/(r||s<0&&-0),o=(n-e._y1)/(s||r<0&&-0),c=(i*s+o*r)/(r+s);return(lO(i)+lO(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(c))||0}function uO(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Yb(e,t,n){var r=e._x0,s=e._y0,i=e._x1,o=e._y1,c=(i-r)/3;e._context.bezierCurveTo(r+c,s+c*t,i-c,o-c*n,i,o)}function Jh(e){this._context=e}Jh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Yb(this,this._t0,uO(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Yb(this,uO(this,n=cO(this,e,t)),n);break;default:Yb(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 L3(e){this._context=new F3(e)}(L3.prototype=Object.create(Jh.prototype)).point=function(e,t){Jh.prototype.point.call(this,t,e)};function F3(e){this._context=e}F3.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,s,i){this._context.bezierCurveTo(t,e,r,n,i,s)}};function SQ(e){return new Jh(e)}function NQ(e){return new L3(e)}function B3(e){this._context=e}B3.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=dO(e),s=dO(t),i=0,o=1;o<n;++i,++o)this._context.bezierCurveTo(r[0][i],s[0][i],r[1][i],s[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 dO(e){var t,n=e.length-1,r,s=new Array(n),i=new Array(n),o=new Array(n);for(s[0]=0,i[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)s[t]=1,i[t]=4,o[t]=4*e[t]+2*e[t+1];for(s[n-1]=2,i[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=s[t]/i[t-1],i[t]-=r,o[t]-=r*o[t-1];for(s[n-1]=o[n-1]/i[n-1],t=n-2;t>=0;--t)s[t]=(o[t]-s[t+1])/i[t];for(i[n-1]=(e[n]+s[n-1])/2,t=0;t<n-1;++t)i[t]=2*e[t+1]-s[t+1];return[s,i]}function CQ(e){return new B3(e)}function Dv(e,t){this._context=e,this._t=t}Dv.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 _Q(e){return new Dv(e,.5)}function AQ(e){return new Dv(e,0)}function EQ(e){return new Dv(e,1)}function Rc(e,t){if((o=e.length)>1)for(var n=1,r,s,i=e[t[0]],o,c=i.length;n<o;++n)for(s=i,i=e[t[n]],r=0;r<c;++r)i[r][1]+=i[r][0]=isNaN(s[r][1])?s[r][0]:s[r][1]}function PS(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function PQ(e,t){return e[t]}function kQ(e){const t=[];return t.key=e,t}function OQ(){var e=wn([]),t=PS,n=Rc,r=PQ;function s(i){var o=Array.from(e.apply(this,arguments),kQ),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=KN(t(o));c<d;++c)o[h[c]].index=c;return n(o,h),o}return s.keys=function(i){return arguments.length?(e=typeof i=="function"?i:wn(Array.from(i)),s):e},s.value=function(i){return arguments.length?(r=typeof i=="function"?i:wn(+i),s):r},s.order=function(i){return arguments.length?(t=i==null?PS:typeof i=="function"?i:wn(Array.from(i)),s):t},s.offset=function(i){return arguments.length?(n=i??Rc,s):n},s}function TQ(e,t){if((r=e.length)>0){for(var n,r,s=0,i=e[0].length,o;s<i;++s){for(o=n=0;n<r;++n)o+=e[n][s][1]||0;if(o)for(n=0;n<r;++n)e[n][s][1]/=o}Rc(e,t)}}function RQ(e,t){if((s=e.length)>0){for(var n=0,r=e[t[0]],s,i=r.length;n<i;++n){for(var o=0,c=0;o<s;++o)c+=e[o][n][1]||0;r[n][1]+=r[n][0]=-c/2}Rc(e,t)}}function IQ(e,t){if(!(!((o=e.length)>0)||!((i=(s=e[t[0]]).length)>0))){for(var n=0,r=1,s,i,o;r<i;++r){for(var c=0,d=0,f=0;c<o;++c){for(var h=e[t[c]],p=h[r][1]||0,x=h[r-1][1]||0,g=(p-x)/2,j=0;j<c;++j){var b=e[t[j]],y=b[r][1]||0,S=b[r-1][1]||0;g+=y-S}d+=p,f+=g*p}s[r-1][1]+=s[r-1][0]=n,d&&(n-=f/d)}s[r-1][1]+=s[r-1][0]=n,Rc(e,t)}}function Fd(e){"@babel/helpers - typeof";return Fd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fd(e)}var MQ=["type","size","sizeType"];function kS(){return kS=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},kS.apply(this,arguments)}function fO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).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?fO(Object(n),!0).forEach(function(r){$Q(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $Q(e,t,n){return t=DQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DQ(e){var t=LQ(e,"string");return Fd(t)=="symbol"?t:t+""}function LQ(e,t){if(Fd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Fd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function FQ(e,t){if(e==null)return{};var n=BQ(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function BQ(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 z3={symbolCircle:GN,symbolCross:oQ,symbolDiamond:cQ,symbolSquare:uQ,symbolStar:hQ,symbolTriangle:mQ,symbolWye:gQ},zQ=Math.PI/180,qQ=function(t){var n="symbol".concat(Iv(t));return z3[n]||GN},UQ=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 s=18*zQ;return 1.25*t*t*(Math.tan(s)-Math.tan(s*2)*Math.pow(Math.tan(s),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}},WQ=function(t,n){z3["symbol".concat(Iv(t))]=n},YN=function(t){var n=t.type,r=n===void 0?"circle":n,s=t.size,i=s===void 0?64:s,o=t.sizeType,c=o===void 0?"area":o,d=FQ(t,MQ),f=pO(pO({},d),{},{type:r,size:i,sizeType:c}),h=function(){var y=qQ(r),S=xQ().type(y).size(UQ(i,c,r));return S()},p=f.className,x=f.cx,g=f.cy,j=Nt(f,!0);return x===+x&&g===+g&&i===+i?Y.createElement("path",kS({},j,{className:Dt("recharts-symbols",p),transform:"translate(".concat(x,", ").concat(g,")"),d:h()})):null};YN.registerSymbol=WQ;function Ic(e){"@babel/helpers - typeof";return Ic=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ic(e)}function OS(){return OS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},OS.apply(this,arguments)}function hO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function VQ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hO(Object(n),!0).forEach(function(r){Bd(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function HQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KQ(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,U3(r.key),r)}}function GQ(e,t,n){return t&&KQ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function YQ(e,t,n){return t=Zh(t),XQ(e,q3()?Reflect.construct(t,n||[],Zh(e).constructor):t.apply(e,n))}function XQ(e,t){if(t&&(Ic(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return QQ(e)}function QQ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function q3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(q3=function(){return!!e})()}function Zh(e){return Zh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Zh(e)}function JQ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&TS(e,t)}function TS(e,t){return TS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},TS(e,t)}function Bd(e,t,n){return t=U3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U3(e){var t=ZQ(e,"string");return Ic(t)=="symbol"?t:t+""}function ZQ(e,t){if(Ic(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ic(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Ca=32,XN=(function(e){function t(){return HQ(this,t),YQ(this,t,arguments)}return JQ(t,e),GQ(t,[{key:"renderIcon",value:function(r){var s=this.props.inactiveColor,i=Ca/2,o=Ca/6,c=Ca/3,d=r.inactive?s:r.color;if(r.type==="plainline")return Y.createElement("line",{strokeWidth:4,fill:"none",stroke:d,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:i,x2:Ca,y2:i,className:"recharts-legend-icon"});if(r.type==="line")return Y.createElement("path",{strokeWidth:4,fill:"none",stroke:d,d:"M0,".concat(i,"h").concat(c,`
|
|
57
|
+
A`).concat(o,",").concat(o,",0,1,1,").concat(2*c,",").concat(i,`
|
|
58
|
+
H`).concat(Ca,"M").concat(2*c,",").concat(i,`
|
|
59
|
+
A`).concat(o,",").concat(o,",0,1,1,").concat(c,",").concat(i),className:"recharts-legend-icon"});if(r.type==="rect")return Y.createElement("path",{stroke:"none",fill:d,d:"M0,".concat(Ca/8,"h").concat(Ca,"v").concat(Ca*3/4,"h").concat(-Ca,"z"),className:"recharts-legend-icon"});if(Y.isValidElement(r.legendIcon)){var f=VQ({},r);return delete f.legendIcon,Y.cloneElement(r.legendIcon,f)}return Y.createElement(YN,{fill:d,cx:i,cy:i,size:Ca,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,s=this.props,i=s.payload,o=s.iconSize,c=s.layout,d=s.formatter,f=s.inactiveColor,h={x:0,y:0,width:Ca,height:Ca},p={display:c==="horizontal"?"inline-block":"block",marginRight:10},x={display:"inline-block",verticalAlign:"middle",marginRight:4};return i.map(function(g,j){var b=g.formatter||d,y=Dt(Bd(Bd({"recharts-legend-item":!0},"legend-item-".concat(j),!0),"inactive",g.inactive));if(g.type==="none")return null;var S=Mt(g.value)?null:g.value;ri(!Mt(g.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var C=g.inactive?f:g.color;return Y.createElement("li",OS({className:y,style:p,key:"legend-item-".concat(j)},nl(r.props,g,j)),Y.createElement(NS,{width:o,height:o,viewBox:h,style:x},r.renderIcon(g)),Y.createElement("span",{className:"recharts-legend-item-text",style:{color:C}},b?b(S,g,j):S))})}},{key:"render",value:function(){var r=this.props,s=r.payload,i=r.layout,o=r.align;if(!s||!s.length)return null;var c={padding:0,margin:0,textAlign:i==="horizontal"?o:"left"};return Y.createElement("ul",{className:"recharts-default-legend",style:c},this.renderItems())}}])})(m.PureComponent);Bd(XN,"displayName","Legend");Bd(XN,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Xb,mO;function eJ(){if(mO)return Xb;mO=1;var e=Ov();function t(){this.__data__=new e,this.size=0}return Xb=t,Xb}var Qb,vO;function tJ(){if(vO)return Qb;vO=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return Qb=e,Qb}var Jb,gO;function nJ(){if(gO)return Jb;gO=1;function e(t){return this.__data__.get(t)}return Jb=e,Jb}var Zb,xO;function rJ(){if(xO)return Zb;xO=1;function e(t){return this.__data__.has(t)}return Zb=e,Zb}var e0,yO;function aJ(){if(yO)return e0;yO=1;var e=Ov(),t=BN(),n=zN(),r=200;function s(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 e0=s,e0}var t0,bO;function W3(){if(bO)return t0;bO=1;var e=Ov(),t=eJ(),n=tJ(),r=nJ(),s=rJ(),i=aJ();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=s,o.prototype.set=i,t0=o,t0}var n0,wO;function sJ(){if(wO)return n0;wO=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return n0=t,n0}var r0,jO;function iJ(){if(jO)return r0;jO=1;function e(t){return this.__data__.has(t)}return r0=e,r0}var a0,SO;function V3(){if(SO)return a0;SO=1;var e=zN(),t=sJ(),n=iJ();function r(s){var i=-1,o=s==null?0:s.length;for(this.__data__=new e;++i<o;)this.add(s[i])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,a0=r,a0}var s0,NO;function H3(){if(NO)return s0;NO=1;function e(t,n){for(var r=-1,s=t==null?0:t.length;++r<s;)if(n(t[r],r,t))return!0;return!1}return s0=e,s0}var i0,CO;function K3(){if(CO)return i0;CO=1;function e(t,n){return t.has(n)}return i0=e,i0}var o0,_O;function G3(){if(_O)return o0;_O=1;var e=V3(),t=H3(),n=K3(),r=1,s=2;function i(o,c,d,f,h,p){var x=d&r,g=o.length,j=c.length;if(g!=j&&!(x&&j>g))return!1;var b=p.get(o),y=p.get(c);if(b&&y)return b==c&&y==o;var S=-1,C=!0,N=d&s?new e:void 0;for(p.set(o,c),p.set(c,o);++S<g;){var E=o[S],A=c[S];if(f)var P=x?f(A,E,S,c,o,p):f(E,A,S,o,c,p);if(P!==void 0){if(P)continue;C=!1;break}if(N){if(!t(c,function(O,T){if(!n(N,T)&&(E===O||h(E,O,d,f,p)))return N.push(T)})){C=!1;break}}else if(!(E===A||h(E,A,d,f,p))){C=!1;break}}return p.delete(o),p.delete(c),C}return o0=i,o0}var l0,AO;function oJ(){if(AO)return l0;AO=1;var e=Ms(),t=e.Uint8Array;return l0=t,l0}var c0,EO;function lJ(){if(EO)return c0;EO=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(s,i){r[++n]=[i,s]}),r}return c0=e,c0}var u0,PO;function QN(){if(PO)return u0;PO=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(s){r[++n]=s}),r}return u0=e,u0}var d0,kO;function cJ(){if(kO)return d0;kO=1;var e=$f(),t=oJ(),n=FN(),r=G3(),s=lJ(),i=QN(),o=1,c=2,d="[object Boolean]",f="[object Date]",h="[object Error]",p="[object Map]",x="[object Number]",g="[object RegExp]",j="[object Set]",b="[object String]",y="[object Symbol]",S="[object ArrayBuffer]",C="[object DataView]",N=e?e.prototype:void 0,E=N?N.valueOf:void 0;function A(P,O,T,$,z,q,F){switch(T){case C:if(P.byteLength!=O.byteLength||P.byteOffset!=O.byteOffset)return!1;P=P.buffer,O=O.buffer;case S:return!(P.byteLength!=O.byteLength||!q(new t(P),new t(O)));case d:case f:case x:return n(+P,+O);case h:return P.name==O.name&&P.message==O.message;case g:case b:return P==O+"";case p:var H=s;case j:var U=$&o;if(H||(H=i),P.size!=O.size&&!U)return!1;var R=F.get(P);if(R)return R==O;$|=c,F.set(P,O);var W=r(H(P),H(O),$,z,q,F);return F.delete(P),W;case y:if(E)return E.call(P)==E.call(O)}return!1}return d0=A,d0}var f0,OO;function Y3(){if(OO)return f0;OO=1;function e(t,n){for(var r=-1,s=n.length,i=t.length;++r<s;)t[i+r]=n[r];return t}return f0=e,f0}var p0,TO;function uJ(){if(TO)return p0;TO=1;var e=Y3(),t=Xr();function n(r,s,i){var o=s(r);return t(r)?o:e(o,i(r))}return p0=n,p0}var h0,RO;function dJ(){if(RO)return h0;RO=1;function e(t,n){for(var r=-1,s=t==null?0:t.length,i=0,o=[];++r<s;){var c=t[r];n(c,r,t)&&(o[i++]=c)}return o}return h0=e,h0}var m0,IO;function fJ(){if(IO)return m0;IO=1;function e(){return[]}return m0=e,m0}var v0,MO;function pJ(){if(MO)return v0;MO=1;var e=dJ(),t=fJ(),n=Object.prototype,r=n.propertyIsEnumerable,s=Object.getOwnPropertySymbols,i=s?function(o){return o==null?[]:(o=Object(o),e(s(o),function(c){return r.call(o,c)}))}:t;return v0=i,v0}var g0,$O;function hJ(){if($O)return g0;$O=1;function e(t,n){for(var r=-1,s=Array(t);++r<t;)s[r]=n(r);return s}return g0=e,g0}var x0,DO;function mJ(){if(DO)return x0;DO=1;var e=gi(),t=xi(),n="[object Arguments]";function r(s){return t(s)&&e(s)==n}return x0=r,x0}var y0,LO;function JN(){if(LO)return y0;LO=1;var e=mJ(),t=xi(),n=Object.prototype,r=n.hasOwnProperty,s=n.propertyIsEnumerable,i=e((function(){return arguments})())?e:function(o){return t(o)&&r.call(o,"callee")&&!s.call(o,"callee")};return y0=i,y0}var bd={exports:{}},b0,FO;function vJ(){if(FO)return b0;FO=1;function e(){return!1}return b0=e,b0}bd.exports;var BO;function X3(){return BO||(BO=1,(function(e,t){var n=Ms(),r=vJ(),s=t&&!t.nodeType&&t,i=s&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===s,c=o?n.Buffer:void 0,d=c?c.isBuffer:void 0,f=d||r;e.exports=f})(bd,bd.exports)),bd.exports}var w0,zO;function ZN(){if(zO)return w0;zO=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,s){var i=typeof r;return s=s??e,!!s&&(i=="number"||i!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<s}return w0=n,w0}var j0,qO;function eC(){if(qO)return j0;qO=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return j0=t,j0}var S0,UO;function gJ(){if(UO)return S0;UO=1;var e=gi(),t=eC(),n=xi(),r="[object Arguments]",s="[object Array]",i="[object Boolean]",o="[object Date]",c="[object Error]",d="[object Function]",f="[object Map]",h="[object Number]",p="[object Object]",x="[object RegExp]",g="[object Set]",j="[object String]",b="[object WeakMap]",y="[object ArrayBuffer]",S="[object DataView]",C="[object Float32Array]",N="[object Float64Array]",E="[object Int8Array]",A="[object Int16Array]",P="[object Int32Array]",O="[object Uint8Array]",T="[object Uint8ClampedArray]",$="[object Uint16Array]",z="[object Uint32Array]",q={};q[C]=q[N]=q[E]=q[A]=q[P]=q[O]=q[T]=q[$]=q[z]=!0,q[r]=q[s]=q[y]=q[i]=q[S]=q[o]=q[c]=q[d]=q[f]=q[h]=q[p]=q[x]=q[g]=q[j]=q[b]=!1;function F(H){return n(H)&&t(H.length)&&!!q[e(H)]}return S0=F,S0}var N0,WO;function Q3(){if(WO)return N0;WO=1;function e(t){return function(n){return t(n)}}return N0=e,N0}var wd={exports:{}};wd.exports;var VO;function xJ(){return VO||(VO=1,(function(e,t){var n=g3(),r=t&&!t.nodeType&&t,s=r&&!0&&e&&!e.nodeType&&e,i=s&&s.exports===r,o=i&&n.process,c=(function(){try{var d=s&&s.require&&s.require("util").types;return d||o&&o.binding&&o.binding("util")}catch{}})();e.exports=c})(wd,wd.exports)),wd.exports}var C0,HO;function J3(){if(HO)return C0;HO=1;var e=gJ(),t=Q3(),n=xJ(),r=n&&n.isTypedArray,s=r?t(r):e;return C0=s,C0}var _0,KO;function yJ(){if(KO)return _0;KO=1;var e=hJ(),t=JN(),n=Xr(),r=X3(),s=ZN(),i=J3(),o=Object.prototype,c=o.hasOwnProperty;function d(f,h){var p=n(f),x=!p&&t(f),g=!p&&!x&&r(f),j=!p&&!x&&!g&&i(f),b=p||x||g||j,y=b?e(f.length,String):[],S=y.length;for(var C in f)(h||c.call(f,C))&&!(b&&(C=="length"||g&&(C=="offset"||C=="parent")||j&&(C=="buffer"||C=="byteLength"||C=="byteOffset")||s(C,S)))&&y.push(C);return y}return _0=d,_0}var A0,GO;function bJ(){if(GO)return A0;GO=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,s=typeof r=="function"&&r.prototype||e;return n===s}return A0=t,A0}var E0,YO;function Z3(){if(YO)return E0;YO=1;function e(t,n){return function(r){return t(n(r))}}return E0=e,E0}var P0,XO;function wJ(){if(XO)return P0;XO=1;var e=Z3(),t=e(Object.keys,Object);return P0=t,P0}var k0,QO;function jJ(){if(QO)return k0;QO=1;var e=bJ(),t=wJ(),n=Object.prototype,r=n.hasOwnProperty;function s(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 k0=s,k0}var O0,JO;function Lf(){if(JO)return O0;JO=1;var e=LN(),t=eC();function n(r){return r!=null&&t(r.length)&&!e(r)}return O0=n,O0}var T0,ZO;function Lv(){if(ZO)return T0;ZO=1;var e=yJ(),t=jJ(),n=Lf();function r(s){return n(s)?e(s):t(s)}return T0=r,T0}var R0,eT;function SJ(){if(eT)return R0;eT=1;var e=uJ(),t=pJ(),n=Lv();function r(s){return e(s,n,t)}return R0=r,R0}var I0,tT;function NJ(){if(tT)return I0;tT=1;var e=SJ(),t=1,n=Object.prototype,r=n.hasOwnProperty;function s(i,o,c,d,f,h){var p=c&t,x=e(i),g=x.length,j=e(o),b=j.length;if(g!=b&&!p)return!1;for(var y=g;y--;){var S=x[y];if(!(p?S in o:r.call(o,S)))return!1}var C=h.get(i),N=h.get(o);if(C&&N)return C==o&&N==i;var E=!0;h.set(i,o),h.set(o,i);for(var A=p;++y<g;){S=x[y];var P=i[S],O=o[S];if(d)var T=p?d(O,P,S,o,i,h):d(P,O,S,i,o,h);if(!(T===void 0?P===O||f(P,O,c,d,h):T)){E=!1;break}A||(A=S=="constructor")}if(E&&!A){var $=i.constructor,z=o.constructor;$!=z&&"constructor"in i&&"constructor"in o&&!(typeof $=="function"&&$ instanceof $&&typeof z=="function"&&z instanceof z)&&(E=!1)}return h.delete(i),h.delete(o),E}return I0=s,I0}var M0,nT;function CJ(){if(nT)return M0;nT=1;var e=bl(),t=Ms(),n=e(t,"DataView");return M0=n,M0}var $0,rT;function _J(){if(rT)return $0;rT=1;var e=bl(),t=Ms(),n=e(t,"Promise");return $0=n,$0}var D0,aT;function eL(){if(aT)return D0;aT=1;var e=bl(),t=Ms(),n=e(t,"Set");return D0=n,D0}var L0,sT;function AJ(){if(sT)return L0;sT=1;var e=bl(),t=Ms(),n=e(t,"WeakMap");return L0=n,L0}var F0,iT;function EJ(){if(iT)return F0;iT=1;var e=CJ(),t=BN(),n=_J(),r=eL(),s=AJ(),i=gi(),o=x3(),c="[object Map]",d="[object Object]",f="[object Promise]",h="[object Set]",p="[object WeakMap]",x="[object DataView]",g=o(e),j=o(t),b=o(n),y=o(r),S=o(s),C=i;return(e&&C(new e(new ArrayBuffer(1)))!=x||t&&C(new t)!=c||n&&C(n.resolve())!=f||r&&C(new r)!=h||s&&C(new s)!=p)&&(C=function(N){var E=i(N),A=E==d?N.constructor:void 0,P=A?o(A):"";if(P)switch(P){case g:return x;case j:return c;case b:return f;case y:return h;case S:return p}return E}),F0=C,F0}var B0,oT;function PJ(){if(oT)return B0;oT=1;var e=W3(),t=G3(),n=cJ(),r=NJ(),s=EJ(),i=Xr(),o=X3(),c=J3(),d=1,f="[object Arguments]",h="[object Array]",p="[object Object]",x=Object.prototype,g=x.hasOwnProperty;function j(b,y,S,C,N,E){var A=i(b),P=i(y),O=A?h:s(b),T=P?h:s(y);O=O==f?p:O,T=T==f?p:T;var $=O==p,z=T==p,q=O==T;if(q&&o(b)){if(!o(y))return!1;A=!0,$=!1}if(q&&!$)return E||(E=new e),A||c(b)?t(b,y,S,C,N,E):n(b,y,O,S,C,N,E);if(!(S&d)){var F=$&&g.call(b,"__wrapped__"),H=z&&g.call(y,"__wrapped__");if(F||H){var U=F?b.value():b,R=H?y.value():y;return E||(E=new e),N(U,R,S,C,E)}}return q?(E||(E=new e),r(b,y,S,C,N,E)):!1}return B0=j,B0}var z0,lT;function tC(){if(lT)return z0;lT=1;var e=PJ(),t=xi();function n(r,s,i,o,c){return r===s?!0:r==null||s==null||!t(r)&&!t(s)?r!==r&&s!==s:e(r,s,i,o,n,c)}return z0=n,z0}var q0,cT;function kJ(){if(cT)return q0;cT=1;var e=W3(),t=tC(),n=1,r=2;function s(i,o,c,d){var f=c.length,h=f,p=!d;if(i==null)return!h;for(i=Object(i);f--;){var x=c[f];if(p&&x[2]?x[1]!==i[x[0]]:!(x[0]in i))return!1}for(;++f<h;){x=c[f];var g=x[0],j=i[g],b=x[1];if(p&&x[2]){if(j===void 0&&!(g in i))return!1}else{var y=new e;if(d)var S=d(j,b,g,i,o,y);if(!(S===void 0?t(b,j,n|r,d,y):S))return!1}}return!0}return q0=s,q0}var U0,uT;function tL(){if(uT)return U0;uT=1;var e=fo();function t(n){return n===n&&!e(n)}return U0=t,U0}var W0,dT;function OJ(){if(dT)return W0;dT=1;var e=tL(),t=Lv();function n(r){for(var s=t(r),i=s.length;i--;){var o=s[i],c=r[o];s[i]=[o,c,e(c)]}return s}return W0=n,W0}var V0,fT;function nL(){if(fT)return V0;fT=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return V0=e,V0}var H0,pT;function TJ(){if(pT)return H0;pT=1;var e=kJ(),t=OJ(),n=nL();function r(s){var i=t(s);return i.length==1&&i[0][2]?n(i[0][0],i[0][1]):function(o){return o===s||e(o,s,i)}}return H0=r,H0}var K0,hT;function RJ(){if(hT)return K0;hT=1;function e(t,n){return t!=null&&n in Object(t)}return K0=e,K0}var G0,mT;function IJ(){if(mT)return G0;mT=1;var e=w3(),t=JN(),n=Xr(),r=ZN(),s=eC(),i=Rv();function o(c,d,f){d=e(d,c);for(var h=-1,p=d.length,x=!1;++h<p;){var g=i(d[h]);if(!(x=c!=null&&f(c,g)))break;c=c[g]}return x||++h!=p?x:(p=c==null?0:c.length,!!p&&s(p)&&r(g,p)&&(n(c)||t(c)))}return G0=o,G0}var Y0,vT;function MJ(){if(vT)return Y0;vT=1;var e=RJ(),t=IJ();function n(r,s){return r!=null&&t(r,s,e)}return Y0=n,Y0}var X0,gT;function $J(){if(gT)return X0;gT=1;var e=tC(),t=j3(),n=MJ(),r=DN(),s=tL(),i=nL(),o=Rv(),c=1,d=2;function f(h,p){return r(h)&&s(p)?i(o(h),p):function(x){var g=t(x,h);return g===void 0&&g===p?n(x,h):e(p,g,c|d)}}return X0=f,X0}var Q0,xT;function yu(){if(xT)return Q0;xT=1;function e(t){return t}return Q0=e,Q0}var J0,yT;function DJ(){if(yT)return J0;yT=1;function e(t){return function(n){return n?.[t]}}return J0=e,J0}var Z0,bT;function LJ(){if(bT)return Z0;bT=1;var e=UN();function t(n){return function(r){return e(r,n)}}return Z0=t,Z0}var ew,wT;function FJ(){if(wT)return ew;wT=1;var e=DJ(),t=LJ(),n=DN(),r=Rv();function s(i){return n(i)?e(r(i)):t(i)}return ew=s,ew}var tw,jT;function $s(){if(jT)return tw;jT=1;var e=TJ(),t=$J(),n=yu(),r=Xr(),s=FJ();function i(o){return typeof o=="function"?o:o==null?n:typeof o=="object"?r(o)?t(o[0],o[1]):e(o):s(o)}return tw=i,tw}var nw,ST;function rL(){if(ST)return nw;ST=1;function e(t,n,r,s){for(var i=t.length,o=r+(s?1:-1);s?o--:++o<i;)if(n(t[o],o,t))return o;return-1}return nw=e,nw}var rw,NT;function BJ(){if(NT)return rw;NT=1;function e(t){return t!==t}return rw=e,rw}var aw,CT;function zJ(){if(CT)return aw;CT=1;function e(t,n,r){for(var s=r-1,i=t.length;++s<i;)if(t[s]===n)return s;return-1}return aw=e,aw}var sw,_T;function qJ(){if(_T)return sw;_T=1;var e=rL(),t=BJ(),n=zJ();function r(s,i,o){return i===i?n(s,i,o):e(s,t,o)}return sw=r,sw}var iw,AT;function UJ(){if(AT)return iw;AT=1;var e=qJ();function t(n,r){var s=n==null?0:n.length;return!!s&&e(n,r,0)>-1}return iw=t,iw}var ow,ET;function WJ(){if(ET)return ow;ET=1;function e(t,n,r){for(var s=-1,i=t==null?0:t.length;++s<i;)if(r(n,t[s]))return!0;return!1}return ow=e,ow}var lw,PT;function VJ(){if(PT)return lw;PT=1;function e(){}return lw=e,lw}var cw,kT;function HJ(){if(kT)return cw;kT=1;var e=eL(),t=VJ(),n=QN(),r=1/0,s=e&&1/n(new e([,-0]))[1]==r?function(i){return new e(i)}:t;return cw=s,cw}var uw,OT;function KJ(){if(OT)return uw;OT=1;var e=V3(),t=UJ(),n=WJ(),r=K3(),s=HJ(),i=QN(),o=200;function c(d,f,h){var p=-1,x=t,g=d.length,j=!0,b=[],y=b;if(h)j=!1,x=n;else if(g>=o){var S=f?null:s(d);if(S)return i(S);j=!1,x=r,y=new e}else y=f?[]:b;e:for(;++p<g;){var C=d[p],N=f?f(C):C;if(C=h||C!==0?C:0,j&&N===N){for(var E=y.length;E--;)if(y[E]===N)continue e;f&&y.push(N),b.push(C)}else x(y,N,h)||(y!==b&&y.push(N),b.push(C))}return b}return uw=c,uw}var dw,TT;function GJ(){if(TT)return dw;TT=1;var e=$s(),t=KJ();function n(r,s){return r&&r.length?t(r,e(s,2)):[]}return dw=n,dw}var YJ=GJ();const RT=fn(YJ);function aL(e,t,n){return t===!0?RT(e,n):Mt(t)?RT(e,t):e}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)}var XJ=["ref"];function IT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ys(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IT(Object(n),!0).forEach(function(r){Fv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function QJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MT(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,iL(r.key),r)}}function JJ(e,t,n){return t&&MT(e.prototype,t),n&&MT(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ZJ(e,t,n){return t=em(t),eZ(e,sL()?Reflect.construct(t,n||[],em(e).constructor):t.apply(e,n))}function eZ(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 tZ(e)}function tZ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(sL=function(){return!!e})()}function em(e){return em=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},em(e)}function nZ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&RS(e,t)}function RS(e,t){return RS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},RS(e,t)}function Fv(e,t,n){return t=iL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iL(e){var t=rZ(e,"string");return Mc(t)=="symbol"?t:t+""}function rZ(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 aZ(e,t){if(e==null)return{};var n=sZ(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function sZ(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 iZ(e){return e.value}function oZ(e,t){if(Y.isValidElement(e))return Y.cloneElement(e,t);if(typeof e=="function")return Y.createElement(e,t);t.ref;var n=aZ(t,XJ);return Y.createElement(XN,n)}var $T=1,Ho=(function(e){function t(){var n;QJ(this,t);for(var r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return n=ZJ(this,t,[].concat(s)),Fv(n,"lastBoundingBox",{width:-1,height:-1}),n}return nZ(t,e),JJ(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,s=this.getBBox();s?(Math.abs(s.width-this.lastBoundingBox.width)>$T||Math.abs(s.height-this.lastBoundingBox.height)>$T)&&(this.lastBoundingBox.width=s.width,this.lastBoundingBox.height=s.height,r&&r(s)):(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?Ys({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var s=this.props,i=s.layout,o=s.align,c=s.verticalAlign,d=s.margin,f=s.chartWidth,h=s.chartHeight,p,x;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&i==="vertical"){var g=this.getBBoxSnapshot();p={left:((f||0)-g.width)/2}}else p=o==="right"?{right:d&&d.right||0}:{left:d&&d.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(c==="middle"){var j=this.getBBoxSnapshot();x={top:((h||0)-j.height)/2}}else x=c==="bottom"?{bottom:d&&d.bottom||0}:{top:d&&d.top||0};return Ys(Ys({},p),x)}},{key:"render",value:function(){var r=this,s=this.props,i=s.content,o=s.width,c=s.height,d=s.wrapperStyle,f=s.payloadUniqBy,h=s.payload,p=Ys(Ys({position:"absolute",width:o||"auto",height:c||"auto"},this.getDefaultPosition(d)),d);return Y.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(g){r.wrapperNode=g}},oZ(i,Ys(Ys({},this.props),{},{payload:aL(h,f,iZ)})))}}],[{key:"getWithHeight",value:function(r,s){var i=Ys(Ys({},this.defaultProps),r.props),o=i.layout;return o==="vertical"&&Ke(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||s}:null}}])})(m.PureComponent);Fv(Ho,"displayName","Legend");Fv(Ho,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var fw,DT;function lZ(){if(DT)return fw;DT=1;var e=$f(),t=JN(),n=Xr(),r=e?e.isConcatSpreadable:void 0;function s(i){return n(i)||t(i)||!!(r&&i&&i[r])}return fw=s,fw}var pw,LT;function oL(){if(LT)return pw;LT=1;var e=Y3(),t=lZ();function n(r,s,i,o,c){var d=-1,f=r.length;for(i||(i=t),c||(c=[]);++d<f;){var h=r[d];s>0&&i(h)?s>1?n(h,s-1,i,o,c):e(c,h):o||(c[c.length]=h)}return c}return pw=n,pw}var hw,FT;function cZ(){if(FT)return hw;FT=1;function e(t){return function(n,r,s){for(var i=-1,o=Object(n),c=s(n),d=c.length;d--;){var f=c[t?d:++i];if(r(o[f],f,o)===!1)break}return n}}return hw=e,hw}var mw,BT;function uZ(){if(BT)return mw;BT=1;var e=cZ(),t=e();return mw=t,mw}var vw,zT;function lL(){if(zT)return vw;zT=1;var e=uZ(),t=Lv();function n(r,s){return r&&e(r,s,t)}return vw=n,vw}var gw,qT;function dZ(){if(qT)return gw;qT=1;var e=Lf();function t(n,r){return function(s,i){if(s==null)return s;if(!e(s))return n(s,i);for(var o=s.length,c=r?o:-1,d=Object(s);(r?c--:++c<o)&&i(d[c],c,d)!==!1;);return s}}return gw=t,gw}var xw,UT;function nC(){if(UT)return xw;UT=1;var e=lL(),t=dZ(),n=t(e);return xw=n,xw}var yw,WT;function cL(){if(WT)return yw;WT=1;var e=nC(),t=Lf();function n(r,s){var i=-1,o=t(r)?Array(r.length):[];return e(r,function(c,d,f){o[++i]=s(c,d,f)}),o}return yw=n,yw}var bw,VT;function fZ(){if(VT)return bw;VT=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return bw=e,bw}var ww,HT;function pZ(){if(HT)return ww;HT=1;var e=vu();function t(n,r){if(n!==r){var s=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||!s&&h||!o)return 1;if(!i&&!c&&!p&&n<r||p&&s&&o&&!i&&!c||f&&s&&o||!d&&o||!h)return-1}return 0}return ww=t,ww}var jw,KT;function hZ(){if(KT)return jw;KT=1;var e=pZ();function t(n,r,s){for(var i=-1,o=n.criteria,c=r.criteria,d=o.length,f=s.length;++i<d;){var h=e(o[i],c[i]);if(h){if(i>=f)return h;var p=s[i];return h*(p=="desc"?-1:1)}}return n.index-r.index}return jw=t,jw}var Sw,GT;function mZ(){if(GT)return Sw;GT=1;var e=qN(),t=UN(),n=$s(),r=cL(),s=fZ(),i=Q3(),o=hZ(),c=yu(),d=Xr();function f(h,p,x){p.length?p=e(p,function(b){return d(b)?function(y){return t(y,b.length===1?b[0]:b)}:b}):p=[c];var g=-1;p=e(p,i(n));var j=r(h,function(b,y,S){var C=e(p,function(N){return N(b)});return{criteria:C,index:++g,value:b}});return s(j,function(b,y){return o(b,y,x)})}return Sw=f,Sw}var Nw,YT;function vZ(){if(YT)return Nw;YT=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 Nw=e,Nw}var Cw,XT;function gZ(){if(XT)return Cw;XT=1;var e=vZ(),t=Math.max;function n(r,s,i){return s=t(s===void 0?r.length-1:s,0),function(){for(var o=arguments,c=-1,d=t(o.length-s,0),f=Array(d);++c<d;)f[c]=o[s+c];c=-1;for(var h=Array(s+1);++c<s;)h[c]=o[c];return h[s]=i(f),e(r,this,h)}}return Cw=n,Cw}var _w,QT;function xZ(){if(QT)return _w;QT=1;function e(t){return function(){return t}}return _w=e,_w}var Aw,JT;function uL(){if(JT)return Aw;JT=1;var e=bl(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return Aw=t,Aw}var Ew,ZT;function yZ(){if(ZT)return Ew;ZT=1;var e=xZ(),t=uL(),n=yu(),r=t?function(s,i){return t(s,"toString",{configurable:!0,enumerable:!1,value:e(i),writable:!0})}:n;return Ew=r,Ew}var Pw,eR;function bZ(){if(eR)return Pw;eR=1;var e=800,t=16,n=Date.now;function r(s){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 s.apply(void 0,arguments)}}return Pw=r,Pw}var kw,tR;function wZ(){if(tR)return kw;tR=1;var e=yZ(),t=bZ(),n=t(e);return kw=n,kw}var Ow,nR;function jZ(){if(nR)return Ow;nR=1;var e=yu(),t=gZ(),n=wZ();function r(s,i){return n(t(s,i,e),s+"")}return Ow=r,Ow}var Tw,rR;function Bv(){if(rR)return Tw;rR=1;var e=FN(),t=Lf(),n=ZN(),r=fo();function s(i,o,c){if(!r(c))return!1;var d=typeof o;return(d=="number"?t(c)&&n(o,c.length):d=="string"&&o in c)?e(c[o],i):!1}return Tw=s,Tw}var Rw,aR;function SZ(){if(aR)return Rw;aR=1;var e=oL(),t=mZ(),n=jZ(),r=Bv(),s=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 Rw=s,Rw}var NZ=SZ();const rC=fn(NZ);function zd(e){"@babel/helpers - typeof";return zd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zd(e)}function IS(){return IS=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},IS.apply(this,arguments)}function CZ(e,t){return PZ(e)||EZ(e,t)||AZ(e,t)||_Z()}function _Z(){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 AZ(e,t){if(e){if(typeof e=="string")return sR(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 sR(e,t)}}function sR(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 EZ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,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,s=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw s}}return c}}function PZ(e){if(Array.isArray(e))return e}function iR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Iw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iR(Object(n),!0).forEach(function(r){kZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kZ(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=TZ(e,"string");return zd(t)=="symbol"?t:t+""}function TZ(e,t){if(zd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(zd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function RZ(e){return Array.isArray(e)&&tr(e[0])&&tr(e[1])?e.join(" ~ "):e}var IZ=function(t){var n=t.separator,r=n===void 0?" : ":n,s=t.contentStyle,i=s===void 0?{}:s,o=t.itemStyle,c=o===void 0?{}:o,d=t.labelStyle,f=d===void 0?{}:d,h=t.payload,p=t.formatter,x=t.itemSorter,g=t.wrapperClassName,j=t.labelClassName,b=t.label,y=t.labelFormatter,S=t.accessibilityLayer,C=S===void 0?!1:S,N=function(){if(h&&h.length){var F={padding:0,margin:0},H=(x?rC(h,x):h).map(function(U,R){if(U.type==="none")return null;var W=Iw({display:"block",paddingTop:4,paddingBottom:4,color:U.color||"#000"},c),X=U.formatter||p||RZ,G=U.value,B=U.name,J=G,D=B;if(X&&J!=null&&D!=null){var I=X(G,B,U,R,h);if(Array.isArray(I)){var re=CZ(I,2);J=re[0],D=re[1]}else J=I}return Y.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(R),style:W},tr(D)?Y.createElement("span",{className:"recharts-tooltip-item-name"},D):null,tr(D)?Y.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,Y.createElement("span",{className:"recharts-tooltip-item-value"},J),Y.createElement("span",{className:"recharts-tooltip-item-unit"},U.unit||""))});return Y.createElement("ul",{className:"recharts-tooltip-item-list",style:F},H)}return null},E=Iw({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),A=Iw({margin:0},f),P=!$t(b),O=P?b:"",T=Dt("recharts-default-tooltip",g),$=Dt("recharts-tooltip-label",j);P&&y&&h!==void 0&&h!==null&&(O=y(b,h));var z=C?{role:"status","aria-live":"assertive"}:{};return Y.createElement("div",IS({className:T,style:E},z),Y.createElement("p",{className:$,style:A},Y.isValidElement(O)?O:"".concat(O)),N())};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 ph(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=$Z(e,"string");return qd(t)=="symbol"?t:t+""}function $Z(e,t){if(qd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(qd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var cd="recharts-tooltip-wrapper",DZ={visibility:"hidden"};function LZ(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Dt(cd,ph(ph(ph(ph({},"".concat(cd,"-right"),Ke(n)&&t&&Ke(t.x)&&n>=t.x),"".concat(cd,"-left"),Ke(n)&&t&&Ke(t.x)&&n<t.x),"".concat(cd,"-bottom"),Ke(r)&&t&&Ke(t.y)&&r>=t.y),"".concat(cd,"-top"),Ke(r)&&t&&Ke(t.y)&&r<t.y))}function oR(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,s=e.offsetTopLeft,i=e.position,o=e.reverseDirection,c=e.tooltipDimension,d=e.viewBox,f=e.viewBoxDimension;if(i&&Ke(i[r]))return i[r];var h=n[r]-c-s,p=n[r]+s;if(t[r])return o[r]?h:p;if(o[r]){var x=h,g=d[r];return x<g?Math.max(p,d[r]):Math.max(h,d[r])}var j=p+c,b=d[r]+f;return j>b?Math.max(h,d[r]):Math.max(p,d[r])}function FZ(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 BZ(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,s=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=oR({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:s,reverseDirection:i,tooltipDimension:o.width,viewBox:d,viewBoxDimension:d.width}),p=oR({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:s,reverseDirection:i,tooltipDimension:o.height,viewBox:d,viewBoxDimension:d.height}),f=FZ({translateX:h,translateY:p,useTranslate3d:c})):f=DZ,{cssProperties:f,cssClasses:LZ({translateX:h,translateY:p,coordinate:n})}}function $c(e){"@babel/helpers - typeof";return $c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$c(e)}function lR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).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?lR(Object(n),!0).forEach(function(r){$S(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qZ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,fL(r.key),r)}}function UZ(e,t,n){return t&&qZ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function WZ(e,t,n){return t=tm(t),VZ(e,dL()?Reflect.construct(t,n||[],tm(e).constructor):t.apply(e,n))}function VZ(e,t){if(t&&($c(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return HZ(e)}function HZ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(dL=function(){return!!e})()}function tm(e){return tm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},tm(e)}function KZ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&MS(e,t)}function MS(e,t){return MS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},MS(e,t)}function $S(e,t,n){return t=fL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fL(e){var t=GZ(e,"string");return $c(t)=="symbol"?t:t+""}function GZ(e,t){if($c(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if($c(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var uR=1,YZ=(function(e){function t(){var n;zZ(this,t);for(var r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return n=WZ(this,t,[].concat(s)),$S(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),$S(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 KZ(t,e),UZ(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>uR||Math.abs(r.height-this.state.lastBoundingBox.height)>uR)&&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,s;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((s=this.props.coordinate)===null||s===void 0?void 0:s.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,s=this.props,i=s.active,o=s.allowEscapeViewBox,c=s.animationDuration,d=s.animationEasing,f=s.children,h=s.coordinate,p=s.hasPayload,x=s.isAnimationActive,g=s.offset,j=s.position,b=s.reverseDirection,y=s.useTranslate3d,S=s.viewBox,C=s.wrapperStyle,N=BZ({allowEscapeViewBox:o,coordinate:h,offsetTopLeft:g,position:j,reverseDirection:b,tooltipBox:this.state.lastBoundingBox,useTranslate3d:y,viewBox:S}),E=N.cssClasses,A=N.cssProperties,P=cR(cR({transition:x&&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},C);return Y.createElement("div",{tabIndex:-1,className:E,style:P,ref:function(T){r.wrapperNode=T}},f)}}])})(m.PureComponent),XZ=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},wl={isSsr:XZ()};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 dR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function fR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dR(Object(n),!0).forEach(function(r){aC(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 QZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function JZ(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 ZZ(e,t,n){return t&&JZ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function eee(e,t,n){return t=nm(t),tee(e,pL()?Reflect.construct(t,n||[],nm(e).constructor):t.apply(e,n))}function tee(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 nee(e)}function nee(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(pL=function(){return!!e})()}function nm(e){return nm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},nm(e)}function ree(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&DS(e,t)}function DS(e,t){return DS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},DS(e,t)}function aC(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=aee(e,"string");return Dc(t)=="symbol"?t:t+""}function aee(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)}function see(e){return e.dataKey}function iee(e,t){return Y.isValidElement(e)?Y.cloneElement(e,t):typeof e=="function"?Y.createElement(e,t):Y.createElement(IZ,t)}var zr=(function(e){function t(){return QZ(this,t),eee(this,t,arguments)}return ree(t,e),ZZ(t,[{key:"render",value:function(){var r=this,s=this.props,i=s.active,o=s.allowEscapeViewBox,c=s.animationDuration,d=s.animationEasing,f=s.content,h=s.coordinate,p=s.filterNull,x=s.isAnimationActive,g=s.offset,j=s.payload,b=s.payloadUniqBy,y=s.position,S=s.reverseDirection,C=s.useTranslate3d,N=s.viewBox,E=s.wrapperStyle,A=j??[];p&&A.length&&(A=aL(j.filter(function(O){return O.value!=null&&(O.hide!==!0||r.props.includeHidden)}),b,see));var P=A.length>0;return Y.createElement(YZ,{allowEscapeViewBox:o,animationDuration:c,animationEasing:d,isAnimationActive:x,active:i,coordinate:h,hasPayload:P,offset:g,position:y,reverseDirection:S,useTranslate3d:C,viewBox:N,wrapperStyle:E},iee(f,fR(fR({},this.props),{},{payload:A})))}}])})(m.PureComponent);aC(zr,"displayName","Tooltip");aC(zr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!wl.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 Mw,pR;function oee(){if(pR)return Mw;pR=1;var e=Ms(),t=function(){return e.Date.now()};return Mw=t,Mw}var $w,hR;function lee(){if(hR)return $w;hR=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return $w=t,$w}var Dw,mR;function cee(){if(mR)return Dw;mR=1;var e=lee(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return Dw=n,Dw}var Lw,vR;function mL(){if(vR)return Lw;vR=1;var e=cee(),t=fo(),n=vu(),r=NaN,s=/^[-+]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):s.test(f)?r:+f}return Lw=d,Lw}var Fw,gR;function uee(){if(gR)return Fw;gR=1;var e=fo(),t=oee(),n=mL(),r="Expected a function",s=Math.max,i=Math.min;function o(c,d,f){var h,p,x,g,j,b,y=0,S=!1,C=!1,N=!0;if(typeof c!="function")throw new TypeError(r);d=n(d)||0,e(f)&&(S=!!f.leading,C="maxWait"in f,x=C?s(n(f.maxWait)||0,d):x,N="trailing"in f?!!f.trailing:N);function E(H){var U=h,R=p;return h=p=void 0,y=H,g=c.apply(R,U),g}function A(H){return y=H,j=setTimeout(T,d),S?E(H):g}function P(H){var U=H-b,R=H-y,W=d-U;return C?i(W,x-R):W}function O(H){var U=H-b,R=H-y;return b===void 0||U>=d||U<0||C&&R>=x}function T(){var H=t();if(O(H))return $(H);j=setTimeout(T,P(H))}function $(H){return j=void 0,N&&h?E(H):(h=p=void 0,g)}function z(){j!==void 0&&clearTimeout(j),y=0,h=b=p=j=void 0}function q(){return j===void 0?g:$(t())}function F(){var H=t(),U=O(H);if(h=arguments,p=this,b=H,U){if(j===void 0)return A(b);if(C)return clearTimeout(j),j=setTimeout(T,d),E(b)}return j===void 0&&(j=setTimeout(T,d)),g}return F.cancel=z,F.flush=q,F}return Fw=o,Fw}var Bw,xR;function dee(){if(xR)return Bw;xR=1;var e=uee(),t=fo(),n="Expected a function";function r(s,i,o){var c=!0,d=!0;if(typeof s!="function")throw new TypeError(n);return t(o)&&(c="leading"in o?!!o.leading:c,d="trailing"in o?!!o.trailing:d),e(s,i,{leading:c,maxWait:i,trailing:d})}return Bw=r,Bw}var fee=dee();const vL=fn(fee);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 yR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function hh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yR(Object(n),!0).forEach(function(r){pee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pee(e,t,n){return t=hee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hee(e){var t=mee(e,"string");return Ud(t)=="symbol"?t:t+""}function mee(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)}function vee(e,t){return bee(e)||yee(e,t)||xee(e,t)||gee()}function gee(){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 xee(e,t){if(e){if(typeof e=="string")return bR(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 bR(e,t)}}function bR(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 yee(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,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,s=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw s}}return c}}function bee(e){if(Array.isArray(e))return e}var rm=m.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,s=r===void 0?{width:-1,height:-1}:r,i=e.width,o=i===void 0?"100%":i,c=e.height,d=c===void 0?"100%":c,f=e.minWidth,h=f===void 0?0:f,p=e.minHeight,x=e.maxHeight,g=e.children,j=e.debounce,b=j===void 0?0:j,y=e.id,S=e.className,C=e.onResize,N=e.style,E=N===void 0?{}:N,A=m.useRef(null),P=m.useRef();P.current=C,m.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 O=m.useState({containerWidth:s.width,containerHeight:s.height}),T=vee(O,2),$=T[0],z=T[1],q=m.useCallback(function(H,U){z(function(R){var W=Math.round(H),X=Math.round(U);return R.containerWidth===W&&R.containerHeight===X?R:{containerWidth:W,containerHeight:X}})},[]);m.useEffect(function(){var H=function(B){var J,D=B[0].contentRect,I=D.width,re=D.height;q(I,re),(J=P.current)===null||J===void 0||J.call(P,I,re)};b>0&&(H=vL(H,b,{trailing:!0,leading:!1}));var U=new ResizeObserver(H),R=A.current.getBoundingClientRect(),W=R.width,X=R.height;return q(W,X),U.observe(A.current),function(){U.disconnect()}},[q,b]);var F=m.useMemo(function(){var H=$.containerWidth,U=$.containerHeight;if(H<0||U<0)return null;ri(zo(o)||zo(d),`The width(%s) and height(%s) are both fixed numbers,
|
|
62
|
+
maybe you don't need to use a ResponsiveContainer.`,o,d),ri(!n||n>0,"The aspect(%s) must be greater than zero.",n);var R=zo(o)?H:o,W=zo(d)?U:d;n&&n>0&&(R?W=R/n:W&&(R=W*n),x&&W>x&&(W=x)),ri(R>0||W>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.`,R,W,o,d,h,p,n);var X=!Array.isArray(g)&&ni(g.type).endsWith("Chart");return Y.Children.map(g,function(G){return Y.isValidElement(G)?m.cloneElement(G,hh({width:R,height:W},X?{style:hh({height:"100%",width:"100%",maxHeight:W,maxWidth:R},G.props.style)}:{})):G})},[n,g,d,x,p,h,$,o]);return Y.createElement("div",{id:y?"".concat(y):void 0,className:Dt("recharts-responsive-container",S),style:hh(hh({},E),{},{width:o,height:d,minWidth:h,minHeight:p,maxHeight:x}),ref:A},F)}),zv=function(t){return null};zv.displayName="Cell";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 wR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function LS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wR(Object(n),!0).forEach(function(r){wee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wee(e,t,n){return t=jee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jee(e){var t=See(e,"string");return Wd(t)=="symbol"?t:t+""}function See(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 rc={widthCache:{},cacheCount:0},Nee=2e3,Cee={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},jR="recharts_measurement_span";function _ee(e){var t=LS({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var _d=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||wl.isSsr)return{width:0,height:0};var r=_ee(n),s=JSON.stringify({text:t,copyStyle:r});if(rc.widthCache[s])return rc.widthCache[s];try{var i=document.getElementById(jR);i||(i=document.createElement("span"),i.setAttribute("id",jR),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=LS(LS({},Cee),r);Object.assign(i.style,o),i.textContent="".concat(t);var c=i.getBoundingClientRect(),d={width:c.width,height:c.height};return rc.widthCache[s]=d,++rc.cacheCount>Nee&&(rc.cacheCount=0,rc.widthCache={}),d}catch{return{width:0,height:0}}},Aee=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};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 am(e,t){return Oee(e)||kee(e,t)||Pee(e,t)||Eee()}function Eee(){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 Pee(e,t){if(e){if(typeof e=="string")return SR(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 SR(e,t)}}function SR(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 kee(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,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,s=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw s}}return c}}function Oee(e){if(Array.isArray(e))return e}function Tee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NR(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,Iee(r.key),r)}}function Ree(e,t,n){return t&&NR(e.prototype,t),n&&NR(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Iee(e){var t=Mee(e,"string");return Vd(t)=="symbol"?t:t+""}function Mee(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 String(e)}var CR=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,_R=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,$ee=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,Dee=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,gL={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Lee=Object.keys(gL),pc="NaN";function Fee(e,t){return e*gL[t]}var mh=(function(){function e(t,n){Tee(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!$ee.test(n)&&(this.num=NaN,this.unit=""),Lee.includes(n)&&(this.num=Fee(t,n),this.unit="px")}return Ree(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,s=(r=Dee.exec(n))!==null&&r!==void 0?r:[],i=am(s,3),o=i[1],c=i[2];return new e(parseFloat(o),c??"")}}])})();function xL(e){if(e.includes(pc))return pc;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=CR.exec(t))!==null&&n!==void 0?n:[],s=am(r,4),i=s[1],o=s[2],c=s[3],d=mh.parse(i??""),f=mh.parse(c??""),h=o==="*"?d.multiply(f):d.divide(f);if(h.isNaN())return pc;t=t.replace(CR,h.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var p,x=(p=_R.exec(t))!==null&&p!==void 0?p:[],g=am(x,4),j=g[1],b=g[2],y=g[3],S=mh.parse(j??""),C=mh.parse(y??""),N=b==="+"?S.add(C):S.subtract(C);if(N.isNaN())return pc;t=t.replace(_R,N.toString())}return t}var AR=/\(([^()]*)\)/;function Bee(e){for(var t=e;t.includes("(");){var n=AR.exec(t),r=am(n,2),s=r[1];t=t.replace(AR,xL(s))}return t}function zee(e){var t=e.replace(/\s+/g,"");return t=Bee(t),t=xL(t),t}function qee(e){try{return zee(e)}catch{return pc}}function zw(e){var t=qee(e.slice(5,-1));return t===pc?"":t}var Uee=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],Wee=["dx","dy","angle","className","breakAll"];function FS(){return FS=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},FS.apply(this,arguments)}function ER(e,t){if(e==null)return{};var n=Vee(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Vee(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 PR(e,t){return Yee(e)||Gee(e,t)||Kee(e,t)||Hee()}function Hee(){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 Kee(e,t){if(e){if(typeof e=="string")return kR(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 kR(e,t)}}function kR(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 Gee(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,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,s=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw s}}return c}}function Yee(e){if(Array.isArray(e))return e}var yL=/[ \f\n\r\t\v\u2028\u2029]+/,bL=function(t){var n=t.children,r=t.breakAll,s=t.style;try{var i=[];$t(n)||(r?i=n.toString().split(""):i=n.toString().split(yL));var o=i.map(function(d){return{word:d,width:_d(d,s).width}}),c=r?0:_d(" ",s).width;return{wordsWithComputedWidth:o,spaceWidth:c}}catch{return null}},Xee=function(t,n,r,s,i){var o=t.maxLines,c=t.children,d=t.style,f=t.breakAll,h=Ke(o),p=c,x=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return R.reduce(function(W,X){var G=X.word,B=X.width,J=W[W.length-1];if(J&&(s==null||i||J.width+B+r<Number(s)))J.words.push(G),J.width+=B+r;else{var D={words:[G],width:B};W.push(D)}return W},[])},g=x(n),j=function(R){return R.reduce(function(W,X){return W.width>X.width?W:X})};if(!h)return g;for(var b="…",y=function(R){var W=p.slice(0,R),X=bL({breakAll:f,style:d,children:W+b}).wordsWithComputedWidth,G=x(X),B=G.length>o||j(G).width>Number(s);return[B,G]},S=0,C=p.length-1,N=0,E;S<=C&&N<=p.length-1;){var A=Math.floor((S+C)/2),P=A-1,O=y(P),T=PR(O,2),$=T[0],z=T[1],q=y(A),F=PR(q,1),H=F[0];if(!$&&!H&&(S=A+1),$&&H&&(C=A-1),!$&&H){E=z;break}N++}return E||g},OR=function(t){var n=$t(t)?[]:t.toString().split(yL);return[{words:n}]},Qee=function(t){var n=t.width,r=t.scaleToFit,s=t.children,i=t.style,o=t.breakAll,c=t.maxLines;if((n||r)&&!wl.isSsr){var d,f,h=bL({breakAll:o,children:s,style:i});if(h){var p=h.wordsWithComputedWidth,x=h.spaceWidth;d=p,f=x}else return OR(s);return Xee({breakAll:o,children:s,maxLines:c,style:i},d,f,n,r)}return OR(s)},TR="#808080",rl=function(t){var n=t.x,r=n===void 0?0:n,s=t.y,i=s===void 0?0:s,o=t.lineHeight,c=o===void 0?"1em":o,d=t.capHeight,f=d===void 0?"0.71em":d,h=t.scaleToFit,p=h===void 0?!1:h,x=t.textAnchor,g=x===void 0?"start":x,j=t.verticalAnchor,b=j===void 0?"end":j,y=t.fill,S=y===void 0?TR:y,C=ER(t,Uee),N=m.useMemo(function(){return Qee({breakAll:C.breakAll,children:C.children,maxLines:C.maxLines,scaleToFit:p,style:C.style,width:C.width})},[C.breakAll,C.children,C.maxLines,p,C.style,C.width]),E=C.dx,A=C.dy,P=C.angle,O=C.className,T=C.breakAll,$=ER(C,Wee);if(!tr(r)||!tr(i))return null;var z=r+(Ke(E)?E:0),q=i+(Ke(A)?A:0),F;switch(b){case"start":F=zw("calc(".concat(f,")"));break;case"middle":F=zw("calc(".concat((N.length-1)/2," * -").concat(c," + (").concat(f," / 2))"));break;default:F=zw("calc(".concat(N.length-1," * -").concat(c,")"));break}var H=[];if(p){var U=N[0].width,R=C.width;H.push("scale(".concat((Ke(R)?R/U:1)/U,")"))}return P&&H.push("rotate(".concat(P,", ").concat(z,", ").concat(q,")")),H.length&&($.transform=H.join(" ")),Y.createElement("text",FS({},Nt($,!0),{x:z,y:q,className:Dt("recharts-text",O),textAnchor:g,fill:S.includes("url")?TR:S}),N.map(function(W,X){var G=W.words.join(T?"":" ");return Y.createElement("tspan",{x:z,dy:X===0?F:c,key:"".concat(G,"-").concat(X)},G)}))};function Zi(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Jee(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function sC(e){let t,n,r;e.length!==2?(t=Zi,n=(c,d)=>Zi(e(c),d),r=(c,d)=>e(c)-d):(t=e===Zi||e===Jee?e:Zee,n=e,r=e);function s(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=s(c,d,f,h-1);return p>f&&r(c[p-1],d)>-r(c[p],d)?p-1:p}return{left:s,center:o,right:i}}function Zee(){return 0}function wL(e){return e===null?NaN:+e}function*ete(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const tte=sC(Zi),Ff=tte.right;sC(wL).center;class RR extends Map{constructor(t,n=ate){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,s]of t)this.set(r,s)}get(t){return super.get(IR(this,t))}has(t){return super.has(IR(this,t))}set(t,n){return super.set(nte(this,t),n)}delete(t){return super.delete(rte(this,t))}}function IR({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function nte({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function rte({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function ate(e){return e!==null&&typeof e=="object"?e.valueOf():e}function ste(e=Zi){if(e===Zi)return jL;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 jL(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const ite=Math.sqrt(50),ote=Math.sqrt(10),lte=Math.sqrt(2);function sm(e,t,n){const r=(t-e)/Math.max(0,n),s=Math.floor(Math.log10(r)),i=r/Math.pow(10,s),o=i>=ite?10:i>=ote?5:i>=lte?2:1;let c,d,f;return s<0?(f=Math.pow(10,-s)/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,s)*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?sm(e,t,n*2):[c,d,f]}function BS(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[s,i,o]=r?sm(t,e,n):sm(e,t,n);if(!(i>=s))return[];const c=i-s+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]=(s+f)/-o;else for(let f=0;f<c;++f)d[f]=(s+f)*o;return d}function zS(e,t,n){return t=+t,e=+e,n=+n,sm(e,t,n)[2]}function qS(e,t,n){t=+t,e=+e,n=+n;const r=t<e,s=r?zS(t,e,n):zS(e,t,n);return(r?-1:1)*(s<0?1/-s:s)}function MR(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function $R(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function SL(e,t,n=0,r=1/0,s){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(s=s===void 0?jL:ste(s);r>n;){if(r-n>600){const d=r-n+1,f=t-n+1,h=Math.log(d),p=.5*Math.exp(2*h/3),x=.5*Math.sqrt(h*p*(d-p)/d)*(f-d/2<0?-1:1),g=Math.max(n,Math.floor(t-f*p/d+x)),j=Math.min(r,Math.floor(t+(d-f)*p/d+x));SL(e,t,g,j,s)}const i=e[t];let o=n,c=r;for(ud(e,n,t),s(e[r],i)>0&&ud(e,n,r);o<c;){for(ud(e,o,c),++o,--c;s(e[o],i)<0;)++o;for(;s(e[c],i)>0;)--c}s(e[n],i)===0?ud(e,n,c):(++c,ud(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function ud(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function cte(e,t,n){if(e=Float64Array.from(ete(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return $R(e);if(t>=1)return MR(e);var r,s=(r-1)*t,i=Math.floor(s),o=MR(SL(e,i).subarray(0,i+1)),c=$R(e.subarray(i+1));return o+(c-o)*(s-i)}}function ute(e,t,n=wL){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,s=(r-1)*t,i=Math.floor(s),o=+n(e[i],i,e),c=+n(e[i+1],i+1,e);return o+(c-o)*(s-i)}}function dte(e,t,n){e=+e,t=+t,n=(s=arguments.length)<2?(t=e,e=0,1):s<3?1:+n;for(var r=-1,s=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(s);++r<s;)i[r]=e+r*n;return i}function Ma(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function yi(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 US=Symbol("implicit");function iC(){var e=new RR,t=[],n=[],r=US;function s(i){let o=e.get(i);if(o===void 0){if(r!==US)return r;e.set(i,o=t.push(i)-1)}return n[o%n.length]}return s.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new RR;for(const o of i)e.has(o)||e.set(o,t.push(o)-1);return s},s.range=function(i){return arguments.length?(n=Array.from(i),s):n.slice()},s.unknown=function(i){return arguments.length?(r=i,s):r},s.copy=function(){return iC(t,n).unknown(r)},Ma.apply(s,arguments),s}function Hd(){var e=iC().unknown(void 0),t=e.domain,n=e.range,r=0,s=1,i,o,c=!1,d=0,f=0,h=.5;delete e.unknown;function p(){var x=t().length,g=s<r,j=g?s:r,b=g?r:s;i=(b-j)/Math.max(1,x-d+f*2),c&&(i=Math.floor(i)),j+=(b-j-i*(x-d))*h,o=i*(1-d),c&&(j=Math.round(j),o=Math.round(o));var y=dte(x).map(function(S){return j+i*S});return n(g?y.reverse():y)}return e.domain=function(x){return arguments.length?(t(x),p()):t()},e.range=function(x){return arguments.length?([r,s]=x,r=+r,s=+s,p()):[r,s]},e.rangeRound=function(x){return[r,s]=x,r=+r,s=+s,c=!0,p()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(x){return arguments.length?(c=!!x,p()):c},e.padding=function(x){return arguments.length?(d=Math.min(1,f=+x),p()):d},e.paddingInner=function(x){return arguments.length?(d=Math.min(1,x),p()):d},e.paddingOuter=function(x){return arguments.length?(f=+x,p()):f},e.align=function(x){return arguments.length?(h=Math.max(0,Math.min(1,x)),p()):h},e.copy=function(){return Hd(t(),[r,s]).round(c).paddingInner(d).paddingOuter(f).align(h)},Ma.apply(p(),arguments)}function NL(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return NL(t())},e}function Ad(){return NL(Hd.apply(null,arguments).paddingInner(1))}function oC(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function CL(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Bf(){}var Kd=.7,im=1/Kd,Nc="\\s*([+-]?\\d+)\\s*",Gd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ss="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",fte=/^#([0-9a-f]{3,8})$/,pte=new RegExp(`^rgb\\(${Nc},${Nc},${Nc}\\)$`),hte=new RegExp(`^rgb\\(${Ss},${Ss},${Ss}\\)$`),mte=new RegExp(`^rgba\\(${Nc},${Nc},${Nc},${Gd}\\)$`),vte=new RegExp(`^rgba\\(${Ss},${Ss},${Ss},${Gd}\\)$`),gte=new RegExp(`^hsl\\(${Gd},${Ss},${Ss}\\)$`),xte=new RegExp(`^hsla\\(${Gd},${Ss},${Ss},${Gd}\\)$`),DR={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};oC(Bf,Yd,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:LR,formatHex:LR,formatHex8:yte,formatHsl:bte,formatRgb:FR,toString:FR});function LR(){return this.rgb().formatHex()}function yte(){return this.rgb().formatHex8()}function bte(){return _L(this).formatHsl()}function FR(){return this.rgb().formatRgb()}function Yd(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=fte.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?BR(t):n===3?new Kr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?vh(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?vh(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=pte.exec(e))?new Kr(t[1],t[2],t[3],1):(t=hte.exec(e))?new Kr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=mte.exec(e))?vh(t[1],t[2],t[3],t[4]):(t=vte.exec(e))?vh(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=gte.exec(e))?UR(t[1],t[2]/100,t[3]/100,1):(t=xte.exec(e))?UR(t[1],t[2]/100,t[3]/100,t[4]):DR.hasOwnProperty(e)?BR(DR[e]):e==="transparent"?new Kr(NaN,NaN,NaN,0):null}function BR(e){return new Kr(e>>16&255,e>>8&255,e&255,1)}function vh(e,t,n,r){return r<=0&&(e=t=n=NaN),new Kr(e,t,n,r)}function wte(e){return e instanceof Bf||(e=Yd(e)),e?(e=e.rgb(),new Kr(e.r,e.g,e.b,e.opacity)):new Kr}function WS(e,t,n,r){return arguments.length===1?wte(e):new Kr(e,t,n,r??1)}function Kr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}oC(Kr,WS,CL(Bf,{brighter(e){return e=e==null?im:Math.pow(im,e),new Kr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Kd:Math.pow(Kd,e),new Kr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Kr(Ko(this.r),Ko(this.g),Ko(this.b),om(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:zR,formatHex:zR,formatHex8:jte,formatRgb:qR,toString:qR}));function zR(){return`#${qo(this.r)}${qo(this.g)}${qo(this.b)}`}function jte(){return`#${qo(this.r)}${qo(this.g)}${qo(this.b)}${qo((isNaN(this.opacity)?1:this.opacity)*255)}`}function qR(){const e=om(this.opacity);return`${e===1?"rgb(":"rgba("}${Ko(this.r)}, ${Ko(this.g)}, ${Ko(this.b)}${e===1?")":`, ${e})`}`}function om(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ko(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function qo(e){return e=Ko(e),(e<16?"0":"")+e.toString(16)}function UR(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 _L(e){if(e instanceof Za)return new Za(e.h,e.s,e.l,e.opacity);if(e instanceof Bf||(e=Yd(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,s=Math.min(t,n,r),i=Math.max(t,n,r),o=NaN,c=i-s,d=(i+s)/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+s:2-i-s,o*=60):c=d>0&&d<1?0:o,new Za(o,c,d,e.opacity)}function Ste(e,t,n,r){return arguments.length===1?_L(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}oC(Za,Ste,CL(Bf,{brighter(e){return e=e==null?im:Math.pow(im,e),new Za(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Kd:Math.pow(Kd,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,s=2*n-r;return new Kr(qw(e>=240?e-240:e+120,s,r),qw(e,s,r),qw(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Za(WR(this.h),gh(this.s),gh(this.l),om(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=om(this.opacity);return`${e===1?"hsl(":"hsla("}${WR(this.h)}, ${gh(this.s)*100}%, ${gh(this.l)*100}%${e===1?")":`, ${e})`}`}}));function WR(e){return e=(e||0)%360,e<0?e+360:e}function gh(e){return Math.max(0,Math.min(1,e||0))}function qw(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 lC=e=>()=>e;function Nte(e,t){return function(n){return e+n*t}}function Cte(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 _te(e){return(e=+e)==1?AL:function(t,n){return n-t?Cte(t,n,e):lC(isNaN(t)?n:t)}}function AL(e,t){var n=t-e;return n?Nte(e,n):lC(isNaN(e)?t:e)}const VR=(function e(t){var n=_te(t);function r(s,i){var o=n((s=WS(s)).r,(i=WS(i)).r),c=n(s.g,i.g),d=n(s.b,i.b),f=AL(s.opacity,i.opacity);return function(h){return s.r=o(h),s.g=c(h),s.b=d(h),s.opacity=f(h),s+""}}return r.gamma=e,r})(1);function Ate(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(i){for(s=0;s<n;++s)r[s]=e[s]*(1-i)+t[s]*i;return r}}function Ete(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Pte(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,s=new Array(r),i=new Array(n),o;for(o=0;o<r;++o)s[o]=bu(e[o],t[o]);for(;o<n;++o)i[o]=t[o];return function(c){for(o=0;o<r;++o)i[o]=s[o](c);return i}}function kte(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function lm(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Ote(e,t){var n={},r={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?n[s]=bu(e[s],t[s]):r[s]=t[s];return function(i){for(s in n)r[s]=n[s](i);return r}}var VS=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Uw=new RegExp(VS.source,"g");function Tte(e){return function(){return e}}function Rte(e){return function(t){return e(t)+""}}function Ite(e,t){var n=VS.lastIndex=Uw.lastIndex=0,r,s,i,o=-1,c=[],d=[];for(e=e+"",t=t+"";(r=VS.exec(e))&&(s=Uw.exec(t));)(i=s.index)>n&&(i=t.slice(n,i),c[o]?c[o]+=i:c[++o]=i),(r=r[0])===(s=s[0])?c[o]?c[o]+=s:c[++o]=s:(c[++o]=null,d.push({i:o,x:lm(r,s)})),n=Uw.lastIndex;return n<t.length&&(i=t.slice(n),c[o]?c[o]+=i:c[++o]=i),c.length<2?d[0]?Rte(d[0].x):Tte(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 bu(e,t){var n=typeof t,r;return t==null||n==="boolean"?lC(t):(n==="number"?lm:n==="string"?(r=Yd(t))?(t=r,VR):Ite:t instanceof Yd?VR:t instanceof Date?kte:Ete(t)?Ate:Array.isArray(t)?Pte:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Ote:lm)(e,t)}function cC(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Mte(e,t){t===void 0&&(t=e,e=bu);for(var n=0,r=t.length-1,s=t[0],i=new Array(r<0?0:r);n<r;)i[n]=e(s,s=t[++n]);return function(o){var c=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return i[c](o-c)}}function $te(e){return function(){return e}}function cm(e){return+e}var HR=[0,1];function Er(e){return e}function HS(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:$te(isNaN(t)?NaN:.5)}function Dte(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Lte(e,t,n){var r=e[0],s=e[1],i=t[0],o=t[1];return s<r?(r=HS(s,r),i=n(o,i)):(r=HS(r,s),i=n(i,o)),function(c){return i(r(c))}}function Fte(e,t,n){var r=Math.min(e.length,t.length)-1,s=new Array(r),i=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)s[o]=HS(e[o],e[o+1]),i[o]=n(t[o],t[o+1]);return function(c){var d=Ff(e,c,1,r)-1;return i[d](s[d](c))}}function zf(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function qv(){var e=HR,t=HR,n=bu,r,s,i,o=Er,c,d,f;function h(){var x=Math.min(e.length,t.length);return o!==Er&&(o=Dte(e[0],e[x-1])),c=x>2?Fte:Lte,d=f=null,p}function p(x){return x==null||isNaN(x=+x)?i:(d||(d=c(e.map(r),t,n)))(r(o(x)))}return p.invert=function(x){return o(s((f||(f=c(t,e.map(r),lm)))(x)))},p.domain=function(x){return arguments.length?(e=Array.from(x,cm),h()):e.slice()},p.range=function(x){return arguments.length?(t=Array.from(x),h()):t.slice()},p.rangeRound=function(x){return t=Array.from(x),n=cC,h()},p.clamp=function(x){return arguments.length?(o=x?!0:Er,h()):o!==Er},p.interpolate=function(x){return arguments.length?(n=x,h()):n},p.unknown=function(x){return arguments.length?(i=x,p):i},function(x,g){return r=x,s=g,h()}}function uC(){return qv()(Er,Er)}function Bte(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function um(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 Lc(e){return e=um(Math.abs(e)),e?e[1]:NaN}function zte(e,t){return function(n,r){for(var s=n.length,i=[],o=0,c=e[0],d=0;s>0&&c>0&&(d+c+1>r&&(c=Math.max(1,r-d)),i.push(n.substring(s-=c,s+c)),!((d+=c+1)>r));)c=e[o=(o+1)%e.length];return i.reverse().join(t)}}function qte(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Ute=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Xd(e){if(!(t=Ute.exec(e)))throw new Error("invalid format: "+e);var t;return new dC({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]})}Xd.prototype=dC.prototype;function dC(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+""}dC.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 Wte(e){e:for(var t=e.length,n=1,r=-1,s;n<t;++n)switch(e[n]){case".":r=s=n;break;case"0":r===0&&(r=n),s=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(s+1):e}var dm;function Vte(e,t){var n=um(e,t);if(!n)return dm=void 0,e.toPrecision(t);var r=n[0],s=n[1],i=s-(dm=Math.max(-8,Math.min(8,Math.floor(s/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")+um(e,Math.max(0,t+i-1))[0]}function KR(e,t){var n=um(e,t);if(!n)return e+"";var r=n[0],s=n[1];return s<0?"0."+new Array(-s).join("0")+r:r.length>s+1?r.slice(0,s+1)+"."+r.slice(s+1):r+new Array(s-r.length+2).join("0")}const GR={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Bte,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)=>KR(e*100,t),r:KR,s:Vte,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function YR(e){return e}var XR=Array.prototype.map,QR=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Hte(e){var t=e.grouping===void 0||e.thousands===void 0?YR:zte(XR.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",s=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?YR:qte(XR.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function f(p,x){p=Xd(p);var g=p.fill,j=p.align,b=p.sign,y=p.symbol,S=p.zero,C=p.width,N=p.comma,E=p.precision,A=p.trim,P=p.type;P==="n"?(N=!0,P="g"):GR[P]||(E===void 0&&(E=12),A=!0,P="g"),(S||g==="0"&&j==="=")&&(S=!0,g="0",j="=");var O=(x&&x.prefix!==void 0?x.prefix:"")+(y==="$"?n:y==="#"&&/[boxX]/.test(P)?"0"+P.toLowerCase():""),T=(y==="$"?r:/[%p]/.test(P)?o:"")+(x&&x.suffix!==void 0?x.suffix:""),$=GR[P],z=/[defgprs%]/.test(P);E=E===void 0?6:/[gprs]/.test(P)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function q(F){var H=O,U=T,R,W,X;if(P==="c")U=$(F)+U,F="";else{F=+F;var G=F<0||1/F<0;if(F=isNaN(F)?d:$(Math.abs(F),E),A&&(F=Wte(F)),G&&+F==0&&b!=="+"&&(G=!1),H=(G?b==="("?b:c:b==="-"||b==="("?"":b)+H,U=(P==="s"&&!isNaN(F)&&dm!==void 0?QR[8+dm/3]:"")+U+(G&&b==="("?")":""),z){for(R=-1,W=F.length;++R<W;)if(X=F.charCodeAt(R),48>X||X>57){U=(X===46?s+F.slice(R+1):F.slice(R))+U,F=F.slice(0,R);break}}}N&&!S&&(F=t(F,1/0));var B=H.length+F.length+U.length,J=B<C?new Array(C-B+1).join(g):"";switch(N&&S&&(F=t(J+F,J.length?C-U.length:1/0),J=""),j){case"<":F=H+F+U+J;break;case"=":F=H+J+F+U;break;case"^":F=J.slice(0,B=J.length>>1)+H+F+U+J.slice(B);break;default:F=J+H+F+U;break}return i(F)}return q.toString=function(){return p+""},q}function h(p,x){var g=Math.max(-8,Math.min(8,Math.floor(Lc(x)/3)))*3,j=Math.pow(10,-g),b=f((p=Xd(p),p.type="f",p),{suffix:QR[8+g/3]});return function(y){return b(j*y)}}return{format:f,formatPrefix:h}}var xh,fC,EL;Kte({thousands:",",grouping:[3],currency:["$",""]});function Kte(e){return xh=Hte(e),fC=xh.format,EL=xh.formatPrefix,xh}function Gte(e){return Math.max(0,-Lc(Math.abs(e)))}function Yte(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Lc(t)/3)))*3-Lc(Math.abs(e)))}function Xte(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Lc(t)-Lc(e))+1}function PL(e,t,n,r){var s=qS(e,t,n),i;switch(r=Xd(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(i=Yte(s,o))&&(r.precision=i),EL(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=Xte(s,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=Gte(s))&&(r.precision=i-(r.type==="%")*2);break}}return fC(r)}function po(e){var t=e.domain;return e.ticks=function(n){var r=t();return BS(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var s=t();return PL(s[0],s[s.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),s=0,i=r.length-1,o=r[s],c=r[i],d,f,h=10;for(c<o&&(f=o,o=c,c=f,f=s,s=i,i=f);h-- >0;){if(f=zS(o,c,n),f===d)return r[s]=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 fm(){var e=uC();return e.copy=function(){return zf(e,fm())},Ma.apply(e,arguments),po(e)}function kL(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,cm),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return kL(e).unknown(t)},e=arguments.length?Array.from(e,cm):[0,1],po(n)}function OL(e,t){e=e.slice();var n=0,r=e.length-1,s=e[n],i=e[r],o;return i<s&&(o=n,n=r,r=o,o=s,s=i,i=o),e[n]=t.floor(s),e[r]=t.ceil(i),e}function JR(e){return Math.log(e)}function ZR(e){return Math.exp(e)}function Qte(e){return-Math.log(-e)}function Jte(e){return-Math.exp(-e)}function Zte(e){return isFinite(e)?+("1e"+e):e<0?0:e}function ene(e){return e===10?Zte:e===Math.E?Math.exp:t=>Math.pow(e,t)}function tne(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 e2(e){return(t,n)=>-e(-t,n)}function pC(e){const t=e(JR,ZR),n=t.domain;let r=10,s,i;function o(){return s=tne(r),i=ene(r),n()[0]<0?(s=e2(s),i=e2(i),e(Qte,Jte)):e(JR,ZR),t}return t.base=function(c){return arguments.length?(r=+c,o()):r},t.domain=function(c){return arguments.length?(n(c),o()):n()},t.ticks=c=>{const d=n();let f=d[0],h=d[d.length-1];const p=h<f;p&&([f,h]=[h,f]);let x=s(f),g=s(h),j,b;const y=c==null?10:+c;let S=[];if(!(r%1)&&g-x<y){if(x=Math.floor(x),g=Math.ceil(g),f>0){for(;x<=g;++x)for(j=1;j<r;++j)if(b=x<0?j/i(-x):j*i(x),!(b<f)){if(b>h)break;S.push(b)}}else for(;x<=g;++x)for(j=r-1;j>=1;--j)if(b=x>0?j/i(-x):j*i(x),!(b<f)){if(b>h)break;S.push(b)}S.length*2<y&&(S=BS(f,h,y))}else S=BS(x,g,Math.min(g-x,y)).map(i);return p?S.reverse():S},t.tickFormat=(c,d)=>{if(c==null&&(c=10),d==null&&(d=r===10?"s":","),typeof d!="function"&&(!(r%1)&&(d=Xd(d)).precision==null&&(d.trim=!0),d=fC(d)),c===1/0)return d;const f=Math.max(1,r*c/t.ticks().length);return h=>{let p=h/i(Math.round(s(h)));return p*r<r-.5&&(p*=r),p<=f?d(h):""}},t.nice=()=>n(OL(n(),{floor:c=>i(Math.floor(s(c))),ceil:c=>i(Math.ceil(s(c)))})),t}function TL(){const e=pC(qv()).domain([1,10]);return e.copy=()=>zf(e,TL()).base(e.base()),Ma.apply(e,arguments),e}function t2(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function n2(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function hC(e){var t=1,n=e(t2(t),n2(t));return n.constant=function(r){return arguments.length?e(t2(t=+r),n2(t)):t},po(n)}function RL(){var e=hC(qv());return e.copy=function(){return zf(e,RL()).constant(e.constant())},Ma.apply(e,arguments)}function r2(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function nne(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function rne(e){return e<0?-e*e:e*e}function mC(e){var t=e(Er,Er),n=1;function r(){return n===1?e(Er,Er):n===.5?e(nne,rne):e(r2(n),r2(1/n))}return t.exponent=function(s){return arguments.length?(n=+s,r()):n},po(t)}function vC(){var e=mC(qv());return e.copy=function(){return zf(e,vC()).exponent(e.exponent())},Ma.apply(e,arguments),e}function ane(){return vC.apply(null,arguments).exponent(.5)}function a2(e){return Math.sign(e)*e*e}function sne(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function IL(){var e=uC(),t=[0,1],n=!1,r;function s(i){var o=sne(e(i));return isNaN(o)?r:n?Math.round(o):o}return s.invert=function(i){return e.invert(a2(i))},s.domain=function(i){return arguments.length?(e.domain(i),s):e.domain()},s.range=function(i){return arguments.length?(e.range((t=Array.from(i,cm)).map(a2)),s):t.slice()},s.rangeRound=function(i){return s.range(i).round(!0)},s.round=function(i){return arguments.length?(n=!!i,s):n},s.clamp=function(i){return arguments.length?(e.clamp(i),s):e.clamp()},s.unknown=function(i){return arguments.length?(r=i,s):r},s.copy=function(){return IL(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Ma.apply(s,arguments),po(s)}function ML(){var e=[],t=[],n=[],r;function s(){var o=0,c=Math.max(1,t.length);for(n=new Array(c-1);++o<c;)n[o-1]=ute(e,o/c);return i}function i(o){return o==null||isNaN(o=+o)?r:t[Ff(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(Zi),s()},i.range=function(o){return arguments.length?(t=Array.from(o),s()):t.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.quantiles=function(){return n.slice()},i.copy=function(){return ML().domain(e).range(t).unknown(r)},Ma.apply(i,arguments)}function $L(){var e=0,t=1,n=1,r=[.5],s=[0,1],i;function o(d){return d!=null&&d<=d?s[Ff(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=(s=Array.from(d)).length-1,c()):s.slice()},o.invertExtent=function(d){var f=s.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 $L().domain([e,t]).range(s).unknown(i)},Ma.apply(po(o),arguments)}function DL(){var e=[.5],t=[0,1],n,r=1;function s(i){return i!=null&&i<=i?t[Ff(e,i,0,r)]:n}return s.domain=function(i){return arguments.length?(e=Array.from(i),r=Math.min(e.length,t.length-1),s):e.slice()},s.range=function(i){return arguments.length?(t=Array.from(i),r=Math.min(e.length,t.length-1),s):t.slice()},s.invertExtent=function(i){var o=t.indexOf(i);return[e[o-1],e[o]]},s.unknown=function(i){return arguments.length?(n=i,s):n},s.copy=function(){return DL().domain(e).range(t).unknown(n)},Ma.apply(s,arguments)}const Ww=new Date,Vw=new Date;function ar(e,t,n,r){function s(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return s.floor=i=>(e(i=new Date(+i)),i),s.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),s.round=i=>{const o=s(i),c=s.ceil(i);return i-o<c-i?o:c},s.offset=(i,o)=>(t(i=new Date(+i),o==null?1:Math.floor(o)),i),s.range=(i,o,c)=>{const d=[];if(i=s.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},s.filter=i=>ar(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&&(s.count=(i,o)=>(Ww.setTime(+i),Vw.setTime(+o),e(Ww),e(Vw),Math.floor(n(Ww,Vw))),s.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?s.filter(r?o=>r(o)%i===0:o=>s.count(0,o)%i===0):s)),s}const pm=ar(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);pm.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?ar(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):pm);pm.range;const Zs=1e3,Pa=Zs*60,ei=Pa*60,di=ei*24,gC=di*7,s2=di*30,Hw=di*365,Uo=ar(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Zs)},(e,t)=>(t-e)/Zs,e=>e.getUTCSeconds());Uo.range;const xC=ar(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Zs)},(e,t)=>{e.setTime(+e+t*Pa)},(e,t)=>(t-e)/Pa,e=>e.getMinutes());xC.range;const yC=ar(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Pa)},(e,t)=>(t-e)/Pa,e=>e.getUTCMinutes());yC.range;const bC=ar(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Zs-e.getMinutes()*Pa)},(e,t)=>{e.setTime(+e+t*ei)},(e,t)=>(t-e)/ei,e=>e.getHours());bC.range;const wC=ar(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ei)},(e,t)=>(t-e)/ei,e=>e.getUTCHours());wC.range;const qf=ar(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Pa)/di,e=>e.getDate()-1);qf.range;const Uv=ar(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/di,e=>e.getUTCDate()-1);Uv.range;const LL=ar(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/di,e=>Math.floor(e/di));LL.range;function jl(e){return ar(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Pa)/gC)}const Wv=jl(0),hm=jl(1),ine=jl(2),one=jl(3),Fc=jl(4),lne=jl(5),cne=jl(6);Wv.range;hm.range;ine.range;one.range;Fc.range;lne.range;cne.range;function Sl(e){return ar(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)/gC)}const Vv=Sl(0),mm=Sl(1),une=Sl(2),dne=Sl(3),Bc=Sl(4),fne=Sl(5),pne=Sl(6);Vv.range;mm.range;une.range;dne.range;Bc.range;fne.range;pne.range;const jC=ar(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());jC.range;const SC=ar(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());SC.range;const fi=ar(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());fi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ar(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)});fi.range;const pi=ar(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());pi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ar(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)});pi.range;function FL(e,t,n,r,s,i){const o=[[Uo,1,Zs],[Uo,5,5*Zs],[Uo,15,15*Zs],[Uo,30,30*Zs],[i,1,Pa],[i,5,5*Pa],[i,15,15*Pa],[i,30,30*Pa],[s,1,ei],[s,3,3*ei],[s,6,6*ei],[s,12,12*ei],[r,1,di],[r,2,2*di],[n,1,gC],[t,1,s2],[t,3,3*s2],[e,1,Hw]];function c(f,h,p){const x=h<f;x&&([f,h]=[h,f]);const g=p&&typeof p.range=="function"?p:d(f,h,p),j=g?g.range(f,+h+1):[];return x?j.reverse():j}function d(f,h,p){const x=Math.abs(h-f)/p,g=sC(([,,y])=>y).right(o,x);if(g===o.length)return e.every(qS(f/Hw,h/Hw,p));if(g===0)return pm.every(Math.max(qS(f,h,p),1));const[j,b]=o[x/o[g-1][2]<o[g][2]/x?g-1:g];return j.every(b)}return[c,d]}const[hne,mne]=FL(pi,SC,Vv,LL,wC,yC),[vne,gne]=FL(fi,jC,Wv,qf,bC,xC);function Kw(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Gw(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function dd(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function xne(e){var t=e.dateTime,n=e.date,r=e.time,s=e.periods,i=e.days,o=e.shortDays,c=e.months,d=e.shortMonths,f=fd(s),h=pd(s),p=fd(i),x=pd(i),g=fd(o),j=pd(o),b=fd(c),y=pd(c),S=fd(d),C=pd(d),N={a:X,A:G,b:B,B:J,c:null,d:d2,e:d2,f:zne,g:Qne,G:Zne,H:Lne,I:Fne,j:Bne,L:BL,m:qne,M:Une,p:D,q:I,Q:h2,s:m2,S:Wne,u:Vne,U:Hne,V:Kne,w:Gne,W:Yne,x:null,X:null,y:Xne,Y:Jne,Z:ere,"%":p2},E={a:re,A:ne,b:fe,B:he,c:null,d:f2,e:f2,f:are,g:hre,G:vre,H:tre,I:nre,j:rre,L:qL,m:sre,M:ire,p:V,q:de,Q:h2,s:m2,S:ore,u:lre,U:cre,V:ure,w:dre,W:fre,x:null,X:null,y:pre,Y:mre,Z:gre,"%":p2},A={a:z,A:q,b:F,B:H,c:U,d:c2,e:c2,f:Ine,g:l2,G:o2,H:u2,I:u2,j:kne,L:Rne,m:Pne,M:One,p:$,q:Ene,Q:$ne,s:Dne,S:Tne,u:Sne,U:Nne,V:Cne,w:jne,W:_ne,x:R,X:W,y:l2,Y:o2,Z:Ane,"%":Mne};N.x=P(n,N),N.X=P(r,N),N.c=P(t,N),E.x=P(n,E),E.X=P(r,E),E.c=P(t,E);function P(Q,ee){return function(pe){var ae=[],Re=-1,Ce=0,Me=Q.length,L,oe,ve;for(pe instanceof Date||(pe=new Date(+pe));++Re<Me;)Q.charCodeAt(Re)===37&&(ae.push(Q.slice(Ce,Re)),(oe=i2[L=Q.charAt(++Re)])!=null?L=Q.charAt(++Re):oe=L==="e"?" ":"0",(ve=ee[L])&&(L=ve(pe,oe)),ae.push(L),Ce=Re+1);return ae.push(Q.slice(Ce,Re)),ae.join("")}}function O(Q,ee){return function(pe){var ae=dd(1900,void 0,1),Re=T(ae,Q,pe+="",0),Ce,Me;if(Re!=pe.length)return null;if("Q"in ae)return new Date(ae.Q);if("s"in ae)return new Date(ae.s*1e3+("L"in ae?ae.L:0));if(ee&&!("Z"in ae)&&(ae.Z=0),"p"in ae&&(ae.H=ae.H%12+ae.p*12),ae.m===void 0&&(ae.m="q"in ae?ae.q:0),"V"in ae){if(ae.V<1||ae.V>53)return null;"w"in ae||(ae.w=1),"Z"in ae?(Ce=Gw(dd(ae.y,0,1)),Me=Ce.getUTCDay(),Ce=Me>4||Me===0?mm.ceil(Ce):mm(Ce),Ce=Uv.offset(Ce,(ae.V-1)*7),ae.y=Ce.getUTCFullYear(),ae.m=Ce.getUTCMonth(),ae.d=Ce.getUTCDate()+(ae.w+6)%7):(Ce=Kw(dd(ae.y,0,1)),Me=Ce.getDay(),Ce=Me>4||Me===0?hm.ceil(Ce):hm(Ce),Ce=qf.offset(Ce,(ae.V-1)*7),ae.y=Ce.getFullYear(),ae.m=Ce.getMonth(),ae.d=Ce.getDate()+(ae.w+6)%7)}else("W"in ae||"U"in ae)&&("w"in ae||(ae.w="u"in ae?ae.u%7:"W"in ae?1:0),Me="Z"in ae?Gw(dd(ae.y,0,1)).getUTCDay():Kw(dd(ae.y,0,1)).getDay(),ae.m=0,ae.d="W"in ae?(ae.w+6)%7+ae.W*7-(Me+5)%7:ae.w+ae.U*7-(Me+6)%7);return"Z"in ae?(ae.H+=ae.Z/100|0,ae.M+=ae.Z%100,Gw(ae)):Kw(ae)}}function T(Q,ee,pe,ae){for(var Re=0,Ce=ee.length,Me=pe.length,L,oe;Re<Ce;){if(ae>=Me)return-1;if(L=ee.charCodeAt(Re++),L===37){if(L=ee.charAt(Re++),oe=A[L in i2?ee.charAt(Re++):L],!oe||(ae=oe(Q,pe,ae))<0)return-1}else if(L!=pe.charCodeAt(ae++))return-1}return ae}function $(Q,ee,pe){var ae=f.exec(ee.slice(pe));return ae?(Q.p=h.get(ae[0].toLowerCase()),pe+ae[0].length):-1}function z(Q,ee,pe){var ae=g.exec(ee.slice(pe));return ae?(Q.w=j.get(ae[0].toLowerCase()),pe+ae[0].length):-1}function q(Q,ee,pe){var ae=p.exec(ee.slice(pe));return ae?(Q.w=x.get(ae[0].toLowerCase()),pe+ae[0].length):-1}function F(Q,ee,pe){var ae=S.exec(ee.slice(pe));return ae?(Q.m=C.get(ae[0].toLowerCase()),pe+ae[0].length):-1}function H(Q,ee,pe){var ae=b.exec(ee.slice(pe));return ae?(Q.m=y.get(ae[0].toLowerCase()),pe+ae[0].length):-1}function U(Q,ee,pe){return T(Q,t,ee,pe)}function R(Q,ee,pe){return T(Q,n,ee,pe)}function W(Q,ee,pe){return T(Q,r,ee,pe)}function X(Q){return o[Q.getDay()]}function G(Q){return i[Q.getDay()]}function B(Q){return d[Q.getMonth()]}function J(Q){return c[Q.getMonth()]}function D(Q){return s[+(Q.getHours()>=12)]}function I(Q){return 1+~~(Q.getMonth()/3)}function re(Q){return o[Q.getUTCDay()]}function ne(Q){return i[Q.getUTCDay()]}function fe(Q){return d[Q.getUTCMonth()]}function he(Q){return c[Q.getUTCMonth()]}function V(Q){return s[+(Q.getUTCHours()>=12)]}function de(Q){return 1+~~(Q.getUTCMonth()/3)}return{format:function(Q){var ee=P(Q+="",N);return ee.toString=function(){return Q},ee},parse:function(Q){var ee=O(Q+="",!1);return ee.toString=function(){return Q},ee},utcFormat:function(Q){var ee=P(Q+="",E);return ee.toString=function(){return Q},ee},utcParse:function(Q){var ee=O(Q+="",!0);return ee.toString=function(){return Q},ee}}}var i2={"-":"",_:" ",0:"0"},dr=/^\s*\d+/,yne=/^%/,bne=/[\\^$*+?|[\]().{}]/g;function rn(e,t,n){var r=e<0?"-":"",s=(r?-e:e)+"",i=s.length;return r+(i<n?new Array(n-i+1).join(t)+s:s)}function wne(e){return e.replace(bne,"\\$&")}function fd(e){return new RegExp("^(?:"+e.map(wne).join("|")+")","i")}function pd(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function jne(e,t,n){var r=dr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Sne(e,t,n){var r=dr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Nne(e,t,n){var r=dr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Cne(e,t,n){var r=dr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function _ne(e,t,n){var r=dr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function o2(e,t,n){var r=dr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function l2(e,t,n){var r=dr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Ane(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 Ene(e,t,n){var r=dr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Pne(e,t,n){var r=dr.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=dr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function kne(e,t,n){var r=dr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function u2(e,t,n){var r=dr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function One(e,t,n){var r=dr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Tne(e,t,n){var r=dr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Rne(e,t,n){var r=dr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Ine(e,t,n){var r=dr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Mne(e,t,n){var r=yne.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function $ne(e,t,n){var r=dr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Dne(e,t,n){var r=dr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function d2(e,t){return rn(e.getDate(),t,2)}function Lne(e,t){return rn(e.getHours(),t,2)}function Fne(e,t){return rn(e.getHours()%12||12,t,2)}function Bne(e,t){return rn(1+qf.count(fi(e),e),t,3)}function BL(e,t){return rn(e.getMilliseconds(),t,3)}function zne(e,t){return BL(e,t)+"000"}function qne(e,t){return rn(e.getMonth()+1,t,2)}function Une(e,t){return rn(e.getMinutes(),t,2)}function Wne(e,t){return rn(e.getSeconds(),t,2)}function Vne(e){var t=e.getDay();return t===0?7:t}function Hne(e,t){return rn(Wv.count(fi(e)-1,e),t,2)}function zL(e){var t=e.getDay();return t>=4||t===0?Fc(e):Fc.ceil(e)}function Kne(e,t){return e=zL(e),rn(Fc.count(fi(e),e)+(fi(e).getDay()===4),t,2)}function Gne(e){return e.getDay()}function Yne(e,t){return rn(hm.count(fi(e)-1,e),t,2)}function Xne(e,t){return rn(e.getFullYear()%100,t,2)}function Qne(e,t){return e=zL(e),rn(e.getFullYear()%100,t,2)}function Jne(e,t){return rn(e.getFullYear()%1e4,t,4)}function Zne(e,t){var n=e.getDay();return e=n>=4||n===0?Fc(e):Fc.ceil(e),rn(e.getFullYear()%1e4,t,4)}function ere(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+rn(t/60|0,"0",2)+rn(t%60,"0",2)}function f2(e,t){return rn(e.getUTCDate(),t,2)}function tre(e,t){return rn(e.getUTCHours(),t,2)}function nre(e,t){return rn(e.getUTCHours()%12||12,t,2)}function rre(e,t){return rn(1+Uv.count(pi(e),e),t,3)}function qL(e,t){return rn(e.getUTCMilliseconds(),t,3)}function are(e,t){return qL(e,t)+"000"}function sre(e,t){return rn(e.getUTCMonth()+1,t,2)}function ire(e,t){return rn(e.getUTCMinutes(),t,2)}function ore(e,t){return rn(e.getUTCSeconds(),t,2)}function lre(e){var t=e.getUTCDay();return t===0?7:t}function cre(e,t){return rn(Vv.count(pi(e)-1,e),t,2)}function UL(e){var t=e.getUTCDay();return t>=4||t===0?Bc(e):Bc.ceil(e)}function ure(e,t){return e=UL(e),rn(Bc.count(pi(e),e)+(pi(e).getUTCDay()===4),t,2)}function dre(e){return e.getUTCDay()}function fre(e,t){return rn(mm.count(pi(e)-1,e),t,2)}function pre(e,t){return rn(e.getUTCFullYear()%100,t,2)}function hre(e,t){return e=UL(e),rn(e.getUTCFullYear()%100,t,2)}function mre(e,t){return rn(e.getUTCFullYear()%1e4,t,4)}function vre(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Bc(e):Bc.ceil(e),rn(e.getUTCFullYear()%1e4,t,4)}function gre(){return"+0000"}function p2(){return"%"}function h2(e){return+e}function m2(e){return Math.floor(+e/1e3)}var ac,WL,VL;xre({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 xre(e){return ac=xne(e),WL=ac.format,ac.parse,VL=ac.utcFormat,ac.utcParse,ac}function yre(e){return new Date(e)}function bre(e){return e instanceof Date?+e:+new Date(+e)}function NC(e,t,n,r,s,i,o,c,d,f){var h=uC(),p=h.invert,x=h.domain,g=f(".%L"),j=f(":%S"),b=f("%I:%M"),y=f("%I %p"),S=f("%a %d"),C=f("%b %d"),N=f("%B"),E=f("%Y");function A(P){return(d(P)<P?g:c(P)<P?j:o(P)<P?b:i(P)<P?y:r(P)<P?s(P)<P?S:C:n(P)<P?N:E)(P)}return h.invert=function(P){return new Date(p(P))},h.domain=function(P){return arguments.length?x(Array.from(P,bre)):x().map(yre)},h.ticks=function(P){var O=x();return e(O[0],O[O.length-1],P??10)},h.tickFormat=function(P,O){return O==null?A:f(O)},h.nice=function(P){var O=x();return(!P||typeof P.range!="function")&&(P=t(O[0],O[O.length-1],P??10)),P?x(OL(O,P)):h},h.copy=function(){return zf(h,NC(e,t,n,r,s,i,o,c,d,f))},h}function wre(){return Ma.apply(NC(vne,gne,fi,jC,Wv,qf,bC,xC,Uo,WL).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function jre(){return Ma.apply(NC(hne,mne,pi,SC,Vv,Uv,wC,yC,Uo,VL).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Hv(){var e=0,t=1,n,r,s,i,o=Er,c=!1,d;function f(p){return p==null||isNaN(p=+p)?d:o(s===0?.5:(p=(i(p)-n)*s,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),s=n===r?0:1/(r-n),f):[e,t]},f.clamp=function(p){return arguments.length?(c=!!p,f):c},f.interpolator=function(p){return arguments.length?(o=p,f):o};function h(p){return function(x){var g,j;return arguments.length?([g,j]=x,o=p(g,j),f):[o(0),o(1)]}}return f.range=h(bu),f.rangeRound=h(cC),f.unknown=function(p){return arguments.length?(d=p,f):d},function(p){return i=p,n=p(e),r=p(t),s=n===r?0:1/(r-n),f}}function ho(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function HL(){var e=po(Hv()(Er));return e.copy=function(){return ho(e,HL())},yi.apply(e,arguments)}function KL(){var e=pC(Hv()).domain([1,10]);return e.copy=function(){return ho(e,KL()).base(e.base())},yi.apply(e,arguments)}function GL(){var e=hC(Hv());return e.copy=function(){return ho(e,GL()).constant(e.constant())},yi.apply(e,arguments)}function CC(){var e=mC(Hv());return e.copy=function(){return ho(e,CC()).exponent(e.exponent())},yi.apply(e,arguments)}function Sre(){return CC.apply(null,arguments).exponent(.5)}function YL(){var e=[],t=Er;function n(r){if(r!=null&&!isNaN(r=+r))return t((Ff(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let s of r)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(Zi),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,s)=>t(s/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(s,i)=>cte(e,i/r))},n.copy=function(){return YL(t).domain(e)},yi.apply(n,arguments)}function Kv(){var e=0,t=.5,n=1,r=1,s,i,o,c,d,f=Er,h,p=!1,x;function g(b){return isNaN(b=+b)?x:(b=.5+((b=+h(b))-i)*(r*b<r*i?c:d),f(p?Math.max(0,Math.min(1,b)):b))}g.domain=function(b){return arguments.length?([e,t,n]=b,s=h(e=+e),i=h(t=+t),o=h(n=+n),c=s===i?0:.5/(i-s),d=i===o?0:.5/(o-i),r=i<s?-1:1,g):[e,t,n]},g.clamp=function(b){return arguments.length?(p=!!b,g):p},g.interpolator=function(b){return arguments.length?(f=b,g):f};function j(b){return function(y){var S,C,N;return arguments.length?([S,C,N]=y,f=Mte(b,[S,C,N]),g):[f(0),f(.5),f(1)]}}return g.range=j(bu),g.rangeRound=j(cC),g.unknown=function(b){return arguments.length?(x=b,g):x},function(b){return h=b,s=b(e),i=b(t),o=b(n),c=s===i?0:.5/(i-s),d=i===o?0:.5/(o-i),r=i<s?-1:1,g}}function XL(){var e=po(Kv()(Er));return e.copy=function(){return ho(e,XL())},yi.apply(e,arguments)}function QL(){var e=pC(Kv()).domain([.1,1,10]);return e.copy=function(){return ho(e,QL()).base(e.base())},yi.apply(e,arguments)}function JL(){var e=hC(Kv());return e.copy=function(){return ho(e,JL()).constant(e.constant())},yi.apply(e,arguments)}function _C(){var e=mC(Kv());return e.copy=function(){return ho(e,_C()).exponent(e.exponent())},yi.apply(e,arguments)}function Nre(){return _C.apply(null,arguments).exponent(.5)}const v2=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Hd,scaleDiverging:XL,scaleDivergingLog:QL,scaleDivergingPow:_C,scaleDivergingSqrt:Nre,scaleDivergingSymlog:JL,scaleIdentity:kL,scaleImplicit:US,scaleLinear:fm,scaleLog:TL,scaleOrdinal:iC,scalePoint:Ad,scalePow:vC,scaleQuantile:ML,scaleQuantize:$L,scaleRadial:IL,scaleSequential:HL,scaleSequentialLog:KL,scaleSequentialPow:CC,scaleSequentialQuantile:YL,scaleSequentialSqrt:Sre,scaleSequentialSymlog:GL,scaleSqrt:ane,scaleSymlog:RL,scaleThreshold:DL,scaleTime:wre,scaleUtc:jre,tickFormat:PL},Symbol.toStringTag,{value:"Module"}));var Yw,g2;function Gv(){if(g2)return Yw;g2=1;var e=vu();function t(n,r,s){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):s(d,f)))var f=d,h=c}return h}return Yw=t,Yw}var Xw,x2;function ZL(){if(x2)return Xw;x2=1;function e(t,n){return t>n}return Xw=e,Xw}var Qw,y2;function Cre(){if(y2)return Qw;y2=1;var e=Gv(),t=ZL(),n=yu();function r(s){return s&&s.length?e(s,n,t):void 0}return Qw=r,Qw}var _re=Cre();const Yv=fn(_re);var Jw,b2;function e4(){if(b2)return Jw;b2=1;function e(t,n){return t<n}return Jw=e,Jw}var Zw,w2;function Are(){if(w2)return Zw;w2=1;var e=Gv(),t=e4(),n=yu();function r(s){return s&&s.length?e(s,n,t):void 0}return Zw=r,Zw}var Ere=Are();const Xv=fn(Ere);var ej,j2;function Pre(){if(j2)return ej;j2=1;var e=qN(),t=$s(),n=cL(),r=Xr();function s(i,o){var c=r(i)?e:n;return c(i,t(o,3))}return ej=s,ej}var tj,S2;function kre(){if(S2)return tj;S2=1;var e=oL(),t=Pre();function n(r,s){return e(t(r,s),1)}return tj=n,tj}var Ore=kre();const Tre=fn(Ore);var nj,N2;function Rre(){if(N2)return nj;N2=1;var e=tC();function t(n,r){return e(n,r)}return nj=t,nj}var Ire=Rre();const Uf=fn(Ire);var wu=1e9,Mre={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},EC,Rn=!0,Ra="[DecimalError] ",Go=Ra+"Invalid argument: ",AC=Ra+"Exponent out of range: ",ju=Math.floor,Fo=Math.pow,$re=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ca,cr=1e7,En=7,t4=9007199254740991,vm=ju(t4/En),nt={};nt.absoluteValue=nt.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};nt.comparedTo=nt.cmp=function(e){var t,n,r,s,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,s=e.d.length,t=0,n=r<s?r:s;t<n;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return r===s?0:r>s^i.s<0?1:-1};nt.decimalPlaces=nt.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*En;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};nt.dividedBy=nt.div=function(e){return ai(this,new this.constructor(e))};nt.dividedToIntegerBy=nt.idiv=function(e){var t=this,n=t.constructor;return gn(ai(t,new n(e),0,1),n.precision)};nt.equals=nt.eq=function(e){return!this.cmp(e)};nt.exponent=function(){return Gn(this)};nt.greaterThan=nt.gt=function(e){return this.cmp(e)>0};nt.greaterThanOrEqualTo=nt.gte=function(e){return this.cmp(e)>=0};nt.isInteger=nt.isint=function(){return this.e>this.d.length-2};nt.isNegative=nt.isneg=function(){return this.s<0};nt.isPositive=nt.ispos=function(){return this.s>0};nt.isZero=function(){return this.s===0};nt.lessThan=nt.lt=function(e){return this.cmp(e)<0};nt.lessThanOrEqualTo=nt.lte=function(e){return this.cmp(e)<1};nt.logarithm=nt.log=function(e){var t,n=this,r=n.constructor,s=r.precision,i=s+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(ca))throw Error(Ra+"NaN");if(n.s<1)throw Error(Ra+(n.s?"NaN":"-Infinity"));return n.eq(ca)?new r(0):(Rn=!1,t=ai(Qd(n,i),Qd(e,i),i),Rn=!0,gn(t,s))};nt.minus=nt.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?a4(t,e):n4(t,(e.s=-e.s,e))};nt.modulo=nt.mod=function(e){var t,n=this,r=n.constructor,s=r.precision;if(e=new r(e),!e.s)throw Error(Ra+"NaN");return n.s?(Rn=!1,t=ai(n,e,0,1).times(e),Rn=!0,n.minus(t)):gn(new r(n),s)};nt.naturalExponential=nt.exp=function(){return r4(this)};nt.naturalLogarithm=nt.ln=function(){return Qd(this)};nt.negated=nt.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};nt.plus=nt.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?n4(t,e):a4(t,(e.s=-e.s,e))};nt.precision=nt.sd=function(e){var t,n,r,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Go+e);if(t=Gn(s)+1,r=s.d.length-1,n=r*En+1,r=s.d[r],r){for(;r%10==0;r/=10)n--;for(r=s.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};nt.squareRoot=nt.sqrt=function(){var e,t,n,r,s,i,o,c=this,d=c.constructor;if(c.s<1){if(!c.s)return new d(0);throw Error(Ra+"NaN")}for(e=Gn(c),Rn=!1,s=Math.sqrt(+c),s==0||s==1/0?(t=bs(c.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=ju((e+1)/2)-(e<0||e%2),s==1/0?t="5e"+e:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new d(t)):r=new d(s.toString()),n=d.precision,s=o=n+3;;)if(i=r,r=i.plus(ai(c,i,o+2)).times(.5),bs(i.d).slice(0,o)===(t=bs(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),s==o&&t=="4999"){if(gn(i,n+1,0),i.times(i).eq(c)){r=i;break}}else if(t!="9999")break;o+=4}return Rn=!0,gn(r,n)};nt.times=nt.mul=function(e){var t,n,r,s,i,o,c,d,f,h=this,p=h.constructor,x=h.d,g=(e=new p(e)).d;if(!h.s||!e.s)return new p(0);for(e.s*=h.s,n=h.e+e.e,d=x.length,f=g.length,d<f&&(i=x,x=g,g=i,o=d,d=f,f=o),i=[],o=d+f,r=o;r--;)i.push(0);for(r=f;--r>=0;){for(t=0,s=d+r;s>r;)c=i[s]+g[r]*x[s-r-1]+t,i[s--]=c%cr|0,t=c/cr|0;i[s]=(i[s]+t)%cr|0}for(;!i[--o];)i.pop();return t?++n:i.shift(),e.d=i,e.e=n,Rn?gn(e,p.precision):e};nt.toDecimalPlaces=nt.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Ps(e,0,wu),t===void 0?t=r.rounding:Ps(t,0,8),gn(n,e+Gn(n)+1,t))};nt.toExponential=function(e,t){var n,r=this,s=r.constructor;return e===void 0?n=al(r,!0):(Ps(e,0,wu),t===void 0?t=s.rounding:Ps(t,0,8),r=gn(new s(r),e+1,t),n=al(r,!0,e+1)),n};nt.toFixed=function(e,t){var n,r,s=this,i=s.constructor;return e===void 0?al(s):(Ps(e,0,wu),t===void 0?t=i.rounding:Ps(t,0,8),r=gn(new i(s),e+Gn(s)+1,t),n=al(r.abs(),!1,e+Gn(r)+1),s.isneg()&&!s.isZero()?"-"+n:n)};nt.toInteger=nt.toint=function(){var e=this,t=e.constructor;return gn(new t(e),Gn(e)+1,t.rounding)};nt.toNumber=function(){return+this};nt.toPower=nt.pow=function(e){var t,n,r,s,i,o,c=this,d=c.constructor,f=12,h=+(e=new d(e));if(!e.s)return new d(ca);if(c=new d(c),!c.s){if(e.s<1)throw Error(Ra+"Infinity");return c}if(c.eq(ca))return c;if(r=d.precision,e.eq(ca))return gn(c,r);if(t=e.e,n=e.d.length-1,o=t>=n,i=c.s,o){if((n=h<0?-h:h)<=t4){for(s=new d(ca),t=Math.ceil(r/En+4),Rn=!1;n%2&&(s=s.times(c),_2(s.d,t)),n=ju(n/2),n!==0;)c=c.times(c),_2(c.d,t);return Rn=!0,e.s<0?new d(ca).div(s):gn(s,r)}}else if(i<0)throw Error(Ra+"NaN");return i=i<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,Rn=!1,s=e.times(Qd(c,r+f)),Rn=!0,s=r4(s),s.s=i,s};nt.toPrecision=function(e,t){var n,r,s=this,i=s.constructor;return e===void 0?(n=Gn(s),r=al(s,n<=i.toExpNeg||n>=i.toExpPos)):(Ps(e,1,wu),t===void 0?t=i.rounding:Ps(t,0,8),s=gn(new i(s),e,t),n=Gn(s),r=al(s,e<=n||n<=i.toExpNeg,e)),r};nt.toSignificantDigits=nt.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Ps(e,1,wu),t===void 0?t=r.rounding:Ps(t,0,8)),gn(new r(n),e,t)};nt.toString=nt.valueOf=nt.val=nt.toJSON=nt[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Gn(e),n=e.constructor;return al(e,t<=n.toExpNeg||t>=n.toExpPos)};function n4(e,t){var n,r,s,i,o,c,d,f,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s||(t=new h(e)),Rn?gn(t,p):t;if(d=e.d,f=t.d,o=e.e,s=t.e,d=d.slice(),i=o-s,i){for(i<0?(r=d,i=-i,c=f.length):(r=f,s=o,c=d.length),o=Math.ceil(p/En),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)/cr|0,d[i]%=cr;for(n&&(d.unshift(n),++s),c=d.length;d[--c]==0;)d.pop();return t.d=d,t.e=s,Rn?gn(t,p):t}function Ps(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Go+e)}function bs(e){var t,n,r,s=e.length-1,i="",o=e[0];if(s>0){for(i+=o,t=1;t<s;t++)r=e[t]+"",n=En-r.length,n&&(i+=Gi(n)),i+=r;o=e[t],r=o+"",n=En-r.length,n&&(i+=Gi(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var ai=(function(){function e(r,s){var i,o=0,c=r.length;for(r=r.slice();c--;)i=r[c]*s+o,r[c]=i%cr|0,o=i/cr|0;return o&&r.unshift(o),r}function t(r,s,i,o){var c,d;if(i!=o)d=i>o?1:-1;else for(c=d=0;c<i;c++)if(r[c]!=s[c]){d=r[c]>s[c]?1:-1;break}return d}function n(r,s,i){for(var o=0;i--;)r[i]-=o,o=r[i]<s[i]?1:0,r[i]=o*cr+r[i]-s[i];for(;!r[0]&&r.length>1;)r.shift()}return function(r,s,i,o){var c,d,f,h,p,x,g,j,b,y,S,C,N,E,A,P,O,T,$=r.constructor,z=r.s==s.s?1:-1,q=r.d,F=s.d;if(!r.s)return new $(r);if(!s.s)throw Error(Ra+"Division by zero");for(d=r.e-s.e,O=F.length,A=q.length,g=new $(z),j=g.d=[],f=0;F[f]==(q[f]||0);)++f;if(F[f]>(q[f]||0)&&--d,i==null?C=i=$.precision:o?C=i+(Gn(r)-Gn(s))+1:C=i,C<0)return new $(0);if(C=C/En+2|0,f=0,O==1)for(h=0,F=F[0],C++;(f<A||h)&&C--;f++)N=h*cr+(q[f]||0),j[f]=N/F|0,h=N%F|0;else{for(h=cr/(F[0]+1)|0,h>1&&(F=e(F,h),q=e(q,h),O=F.length,A=q.length),E=O,b=q.slice(0,O),y=b.length;y<O;)b[y++]=0;T=F.slice(),T.unshift(0),P=F[0],F[1]>=cr/2&&++P;do h=0,c=t(F,b,O,y),c<0?(S=b[0],O!=y&&(S=S*cr+(b[1]||0)),h=S/P|0,h>1?(h>=cr&&(h=cr-1),p=e(F,h),x=p.length,y=b.length,c=t(p,b,x,y),c==1&&(h--,n(p,O<x?T:F,x))):(h==0&&(c=h=1),p=F.slice()),x=p.length,x<y&&p.unshift(0),n(b,p,y),c==-1&&(y=b.length,c=t(F,b,O,y),c<1&&(h++,n(b,O<y?T:F,y))),y=b.length):c===0&&(h++,b=[0]),j[f++]=h,c&&b[0]?b[y++]=q[E]||0:(b=[q[E]],y=1);while((E++<A||b[0]!==void 0)&&C--)}return j[0]||j.shift(),g.e=d,gn(g,o?i+Gn(g)+1:i)}})();function r4(e,t){var n,r,s,i,o,c,d=0,f=0,h=e.constructor,p=h.precision;if(Gn(e)>16)throw Error(AC+Gn(e));if(!e.s)return new h(ca);for(Rn=!1,c=p,o=new h(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(r=Math.log(Fo(2,f))/Math.LN10*2+5|0,c+=r,n=s=i=new h(ca),h.precision=c;;){if(s=gn(s.times(e),c),n=n.times(++d),o=i.plus(ai(s,n,c)),bs(o.d).slice(0,c)===bs(i.d).slice(0,c)){for(;f--;)i=gn(i.times(i),c);return h.precision=p,t==null?(Rn=!0,gn(i,p)):i}i=o}}function Gn(e){for(var t=e.e*En,n=e.d[0];n>=10;n/=10)t++;return t}function rj(e,t,n){if(t>e.LN10.sd())throw Rn=!0,n&&(e.precision=n),Error(Ra+"LN10 precision limit exceeded");return gn(new e(e.LN10),t)}function Gi(e){for(var t="";e--;)t+="0";return t}function Qd(e,t){var n,r,s,i,o,c,d,f,h,p=1,x=10,g=e,j=g.d,b=g.constructor,y=b.precision;if(g.s<1)throw Error(Ra+(g.s?"NaN":"-Infinity"));if(g.eq(ca))return new b(0);if(t==null?(Rn=!1,f=y):f=t,g.eq(10))return t==null&&(Rn=!0),rj(b,f);if(f+=x,b.precision=f,n=bs(j),r=n.charAt(0),i=Gn(g),Math.abs(i)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=bs(g.d),r=n.charAt(0),p++;i=Gn(g),r>1?(g=new b("0."+n),i++):g=new b(r+"."+n.slice(1))}else return d=rj(b,f+2,y).times(i+""),g=Qd(new b(r+"."+n.slice(1)),f-x).plus(d),b.precision=y,t==null?(Rn=!0,gn(g,y)):g;for(c=o=g=ai(g.minus(ca),g.plus(ca),f),h=gn(g.times(g),f),s=3;;){if(o=gn(o.times(h),f),d=c.plus(ai(o,new b(s),f)),bs(d.d).slice(0,f)===bs(c.d).slice(0,f))return c=c.times(2),i!==0&&(c=c.plus(rj(b,f+2,y).times(i+""))),c=ai(c,new b(p),f),b.precision=y,t==null?(Rn=!0,gn(c,y)):c;c=d,s+=2}}function C2(e,t){var n,r,s;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(s=t.length;t.charCodeAt(s-1)===48;)--s;if(t=t.slice(r,s),t){if(s-=r,n=n-r-1,e.e=ju(n/En),e.d=[],r=(n+1)%En,n<0&&(r+=En),r<s){for(r&&e.d.push(+t.slice(0,r)),s-=En;r<s;)e.d.push(+t.slice(r,r+=En));t=t.slice(r),r=En-t.length}else r-=s;for(;r--;)t+="0";if(e.d.push(+t),Rn&&(e.e>vm||e.e<-vm))throw Error(AC+n)}else e.s=0,e.e=0,e.d=[0];return e}function gn(e,t,n){var r,s,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+=En,s=t,f=p[h=0];else{if(h=Math.ceil((r+1)/En),i=p.length,h>=i)return e;for(f=i=p[h],o=1;i>=10;i/=10)o++;r%=En,s=r-En+o}if(n!==void 0&&(i=Fo(10,o-s-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?s>0?f/Fo(10,o-s):0:p[h-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return d?(i=Gn(e),p.length=1,t=t-i-1,p[0]=Fo(10,(En-t%En)%En),e.e=ju(-t/En)||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=Fo(10,En-r),p[h]=s>0?(f/Fo(10,o-s)%Fo(10,s)|0)*i:0),d)for(;;)if(h==0){(p[0]+=i)==cr&&(p[0]=1,++e.e);break}else{if(p[h]+=i,p[h]!=cr)break;p[h--]=0,i=1}for(r=p.length;p[--r]===0;)p.pop();if(Rn&&(e.e>vm||e.e<-vm))throw Error(AC+Gn(e));return e}function a4(e,t){var n,r,s,i,o,c,d,f,h,p,x=e.constructor,g=x.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new x(e),Rn?gn(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),s=Math.max(Math.ceil(g/En),c)+2,o>s&&(o=s,n.length=1),n.reverse(),s=o;s--;)n.push(0);n.reverse()}else{for(s=d.length,c=p.length,h=s<c,h&&(c=s),s=0;s<c;s++)if(d[s]!=p[s]){h=d[s]<p[s];break}o=0}for(h&&(n=d,d=p,p=n,t.s=-t.s),c=d.length,s=p.length-c;s>0;--s)d[c++]=0;for(s=p.length;s>o;){if(d[--s]<p[s]){for(i=s;i&&d[--i]===0;)d[i]=cr-1;--d[i],d[s]+=cr}d[s]-=p[s]}for(;d[--c]===0;)d.pop();for(;d[0]===0;d.shift())--r;return d[0]?(t.d=d,t.e=r,Rn?gn(t,g):t):new x(0)}function al(e,t,n){var r,s=Gn(e),i=bs(e.d),o=i.length;return t?(n&&(r=n-o)>0?i=i.charAt(0)+"."+i.slice(1)+Gi(r):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(s<0?"e":"e+")+s):s<0?(i="0."+Gi(-s-1)+i,n&&(r=n-o)>0&&(i+=Gi(r))):s>=o?(i+=Gi(s+1-o),n&&(r=n-s-1)>0&&(i=i+"."+Gi(r))):((r=s+1)<o&&(i=i.slice(0,r)+"."+i.slice(r)),n&&(r=n-o)>0&&(s+1===o&&(i+="."),i+=Gi(r))),e.s<0?"-"+i:i}function _2(e,t){if(e.length>t)return e.length=t,!0}function s4(e){var t,n,r;function s(i){var o=this;if(!(o instanceof s))return new s(i);if(o.constructor=s,i instanceof s){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(Go+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 C2(o,i.toString())}else if(typeof i!="string")throw Error(Go+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,$re.test(i))C2(o,i);else throw Error(Go+i)}if(s.prototype=nt,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.clone=s4,s.config=s.set=Dre,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 s.config(e),s}function Dre(e){if(!e||typeof e!="object")throw Error(Ra+"Object expected");var t,n,r,s=["precision",1,wu,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<s.length;t+=3)if((r=e[n=s[t]])!==void 0)if(ju(r)===r&&r>=s[t+1]&&r<=s[t+2])this[n]=r;else throw Error(Go+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Go+n+": "+r);return this}var EC=s4(Mre);ca=new EC(1);const hn=EC;function Lre(e){return qre(e)||zre(e)||Bre(e)||Fre()}function Fre(){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 Bre(e,t){if(e){if(typeof e=="string")return KS(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 KS(e,t)}}function zre(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function qre(e){if(Array.isArray(e))return KS(e)}function KS(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 Ure=function(t){return t},i4={},o4=function(t){return t===i4},A2=function(t){return function n(){return arguments.length===0||arguments.length===1&&o4(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},Wre=function e(t,n){return t===1?n:A2(function(){for(var r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];var o=s.filter(function(c){return c!==i4}).length;return o>=t?n.apply(void 0,s):e(t-o,A2(function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];var h=s.map(function(p){return o4(p)?d.shift():p});return n.apply(void 0,Lre(h).concat(d))}))})},Qv=function(t){return Wre(t.length,t)},GS=function(t,n){for(var r=[],s=t;s<n;++s)r[s-t]=s;return r},Vre=Qv(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),Hre=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return Ure;var s=n.reverse(),i=s[0],o=s.slice(1);return function(){return o.reduce(function(c,d){return d(c)},i.apply(void 0,arguments))}},YS=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},l4=function(t){var n=null,r=null;return function(){for(var s=arguments.length,i=new Array(s),o=0;o<s;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 Kre(e){var t;return e===0?t=1:t=Math.floor(new hn(e).abs().log(10).toNumber())+1,t}function Gre(e,t,n){for(var r=new hn(e),s=0,i=[];r.lt(t)&&s<1e5;)i.push(r.toNumber()),r=r.add(n),s++;return i}var Yre=Qv(function(e,t,n){var r=+e,s=+t;return r+n*(s-r)}),Xre=Qv(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),Qre=Qv(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const Jv={rangeStep:Gre,getDigitCount:Kre,interpolateNumber:Yre,uninterpolateNumber:Xre,uninterpolateTruncation:Qre};function XS(e){return eae(e)||Zre(e)||c4(e)||Jre()}function Jre(){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 Zre(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function eae(e){if(Array.isArray(e))return QS(e)}function Jd(e,t){return rae(e)||nae(e,t)||c4(e,t)||tae()}function tae(){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 c4(e,t){if(e){if(typeof e=="string")return QS(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 QS(e,t)}}function QS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function nae(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,s=!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){s=!0,i=d}finally{try{!r&&o.return!=null&&o.return()}finally{if(s)throw i}}return n}}function rae(e){if(Array.isArray(e))return e}function u4(e){var t=Jd(e,2),n=t[0],r=t[1],s=n,i=r;return n>r&&(s=r,i=n),[s,i]}function d4(e,t,n){if(e.lte(0))return new hn(0);var r=Jv.getDigitCount(e.toNumber()),s=new hn(10).pow(r),i=e.div(s),o=r!==1?.05:.1,c=new hn(Math.ceil(i.div(o).toNumber())).add(n).mul(o),d=c.mul(s);return t?d:new hn(Math.ceil(d))}function aae(e,t,n){var r=1,s=new hn(e);if(!s.isint()&&n){var i=Math.abs(e);i<1?(r=new hn(10).pow(Jv.getDigitCount(e)-1),s=new hn(Math.floor(s.div(r).toNumber())).mul(r)):i>1&&(s=new hn(Math.floor(e)))}else e===0?s=new hn(Math.floor((t-1)/2)):n||(s=new hn(Math.floor(e)));var o=Math.floor((t-1)/2),c=Hre(Vre(function(d){return s.add(new hn(d-o).mul(r)).toNumber()}),GS);return c(0,t)}function f4(e,t,n,r){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new hn(0),tickMin:new hn(0),tickMax:new hn(0)};var i=d4(new hn(t).sub(e).div(n-1),r,s),o;e<=0&&t>=0?o=new hn(0):(o=new hn(e).add(t).div(2),o=o.sub(new hn(o).mod(i)));var c=Math.ceil(o.sub(e).div(i).toNumber()),d=Math.ceil(new hn(t).sub(o).div(i).toNumber()),f=c+d+1;return f>n?f4(e,t,n,r,s+1):(f<n&&(d=t>0?d+(n-f):d,c=t>0?c:c+(n-f)),{step:i,tickMin:o.sub(new hn(c).mul(i)),tickMax:o.add(new hn(d).mul(i))})}function sae(e){var t=Jd(e,2),n=t[0],r=t[1],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(s,2),c=u4([n,r]),d=Jd(c,2),f=d[0],h=d[1];if(f===-1/0||h===1/0){var p=h===1/0?[f].concat(XS(GS(0,s-1).map(function(){return 1/0}))):[].concat(XS(GS(0,s-1).map(function(){return-1/0})),[h]);return n>r?YS(p):p}if(f===h)return aae(f,s,i);var x=f4(f,h,o,i),g=x.step,j=x.tickMin,b=x.tickMax,y=Jv.rangeStep(j,b.add(new hn(.1).mul(g)),g);return n>r?YS(y):y}function iae(e,t){var n=Jd(e,2),r=n[0],s=n[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=u4([r,s]),c=Jd(o,2),d=c[0],f=c[1];if(d===-1/0||f===1/0)return[r,s];if(d===f)return[d];var h=Math.max(t,2),p=d4(new hn(f).sub(d).div(h-1),i,0),x=[].concat(XS(Jv.rangeStep(new hn(d),new hn(f).sub(new hn(.99).mul(p)),p)),[f]);return r>s?YS(x):x}var oae=l4(sae),lae=l4(iae),cae="Invariant failed";function sl(e,t){throw new Error(cae)}var uae=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function zc(e){"@babel/helpers - typeof";return zc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zc(e)}function gm(){return gm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gm.apply(this,arguments)}function dae(e,t){return mae(e)||hae(e,t)||pae(e,t)||fae()}function fae(){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 pae(e,t){if(e){if(typeof e=="string")return E2(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 E2(e,t)}}function E2(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 hae(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,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,s=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw s}}return c}}function mae(e){if(Array.isArray(e))return e}function vae(e,t){if(e==null)return{};var n=gae(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function gae(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 xae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yae(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,m4(r.key),r)}}function bae(e,t,n){return t&&yae(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function wae(e,t,n){return t=xm(t),jae(e,p4()?Reflect.construct(t,n||[],xm(e).constructor):t.apply(e,n))}function jae(e,t){if(t&&(zc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Sae(e)}function Sae(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(p4=function(){return!!e})()}function xm(e){return xm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},xm(e)}function Nae(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&&JS(e,t)}function JS(e,t){return JS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},JS(e,t)}function h4(e,t,n){return t=m4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m4(e){var t=Cae(e,"string");return zc(t)=="symbol"?t:t+""}function Cae(e,t){if(zc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(zc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Wf=(function(e){function t(){return xae(this,t),wae(this,t,arguments)}return Nae(t,e),bae(t,[{key:"render",value:function(){var r=this.props,s=r.offset,i=r.layout,o=r.width,c=r.dataKey,d=r.data,f=r.dataPointFormatter,h=r.xAxis,p=r.yAxis,x=vae(r,uae),g=Nt(x,!1);this.props.direction==="x"&&h.type!=="number"&&sl();var j=d.map(function(b){var y=f(b,c),S=y.x,C=y.y,N=y.value,E=y.errorVal;if(!E)return null;var A=[],P,O;if(Array.isArray(E)){var T=dae(E,2);P=T[0],O=T[1]}else P=O=E;if(i==="vertical"){var $=h.scale,z=C+s,q=z+o,F=z-o,H=$(N-P),U=$(N+O);A.push({x1:U,y1:q,x2:U,y2:F}),A.push({x1:H,y1:z,x2:U,y2:z}),A.push({x1:H,y1:q,x2:H,y2:F})}else if(i==="horizontal"){var R=p.scale,W=S+s,X=W-o,G=W+o,B=R(N-P),J=R(N+O);A.push({x1:X,y1:J,x2:G,y2:J}),A.push({x1:W,y1:B,x2:W,y2:J}),A.push({x1:X,y1:B,x2:G,y2:B})}return Y.createElement(nn,gm({className:"recharts-errorBar",key:"bar-".concat(A.map(function(D){return"".concat(D.x1,"-").concat(D.x2,"-").concat(D.y1,"-").concat(D.y2)}))},g),A.map(function(D){return Y.createElement("line",gm({},D,{key:"line-".concat(D.x1,"-").concat(D.x2,"-").concat(D.y1,"-").concat(D.y2)}))}))});return Y.createElement(nn,{className:"recharts-errorBars"},j)}}])})(Y.Component);h4(Wf,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});h4(Wf,"displayName","ErrorBar");function Zd(e){"@babel/helpers - typeof";return Zd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zd(e)}function P2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function To(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?P2(Object(n),!0).forEach(function(r){_ae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _ae(e,t,n){return t=Aae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Aae(e){var t=Eae(e,"string");return Zd(t)=="symbol"?t:t+""}function Eae(e,t){if(Zd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Zd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var v4=function(t){var n=t.children,r=t.formattedGraphicalItems,s=t.legendWidth,i=t.legendContent,o=ia(n,Ho);if(!o)return null;var c=Ho.defaultProps,d=c!==void 0?To(To({},c),o.props):{},f;return o.props&&o.props.payload?f=o.props&&o.props.payload:i==="children"?f=(r||[]).reduce(function(h,p){var x=p.item,g=p.props,j=g.sectors||g.data||[];return h.concat(j.map(function(b){return{type:o.props.iconType||x.props.legendType,value:b.name,color:b.fill,payload:b}}))},[]):f=(r||[]).map(function(h){var p=h.item,x=p.type.defaultProps,g=x!==void 0?To(To({},x),p.props):{},j=g.dataKey,b=g.name,y=g.legendType,S=g.hide;return{inactive:S,dataKey:j,type:d.iconType||y||"square",color:PC(p),value:b||j,payload:g}}),To(To(To({},d),Ho.getWithHeight(o,s)),{},{payload:f,item:o})};function ef(e){"@babel/helpers - typeof";return ef=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ef(e)}function k2(e){return Tae(e)||Oae(e)||kae(e)||Pae()}function Pae(){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 kae(e,t){if(e){if(typeof e=="string")return ZS(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 ZS(e,t)}}function Oae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Tae(e){if(Array.isArray(e))return ZS(e)}function ZS(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 O2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).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?O2(Object(n),!0).forEach(function(r){Cc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cc(e,t,n){return t=Rae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rae(e){var t=Iae(e,"string");return ef(t)=="symbol"?t:t+""}function Iae(e,t){if(ef(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ef(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function er(e,t,n){return $t(e)||$t(t)?n:tr(t)?fa(e,t,n):Mt(t)?t(e):n}function Ed(e,t,n,r){var s=Tre(e,function(c){return er(c,t)});if(n==="number"){var i=s.filter(function(c){return Ke(c)||parseFloat(c)});return i.length?[Xv(i),Yv(i)]:[1/0,-1/0]}var o=r?s.filter(function(c){return!$t(c)}):s;return o.map(function(c){return tr(c)||c instanceof Date?c:""})}var Mae=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=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?s[f-1].coordinate:s[c-1].coordinate,p=s[f].coordinate,x=f>=c-1?s[0].coordinate:s[f+1].coordinate,g=void 0;if(_r(p-h)!==_r(x-p)){var j=[];if(_r(x-p)===_r(d[1]-d[0])){g=x;var b=p+d[1]-d[0];j[0]=Math.min(b,(b+h)/2),j[1]=Math.max(b,(b+h)/2)}else{g=h;var y=x+d[1]-d[0];j[0]=Math.min(p,(y+p)/2),j[1]=Math.max(p,(y+p)/2)}var S=[Math.min(p,(g+p)/2),Math.max(p,(g+p)/2)];if(t>S[0]&&t<=S[1]||t>=j[0]&&t<=j[1]){o=s[f].index;break}}else{var C=Math.min(h,x),N=Math.max(h,x);if(t>(C+p)/2&&t<=(N+p)/2){o=s[f].index;break}}}else for(var E=0;E<c;E++)if(E===0&&t<=(r[E].coordinate+r[E+1].coordinate)/2||E>0&&E<c-1&&t>(r[E].coordinate+r[E-1].coordinate)/2&&t<=(r[E].coordinate+r[E+1].coordinate)/2||E===c-1&&t>(r[E].coordinate+r[E-1].coordinate)/2){o=r[E].index;break}return o},PC=function(t){var n,r=t,s=r.type.displayName,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?zn(zn({},t.type.defaultProps),t.props):t.props,o=i.stroke,c=i.fill,d;switch(s){case"Line":d=o;break;case"Area":case"Radar":d=o&&o!=="none"?o:c;break;default:d=c;break}return d},$ae=function(t){var n=t.barSize,r=t.totalSize,s=t.stackGroups,i=s===void 0?{}:s;if(!i)return{};for(var o={},c=Object.keys(i),d=0,f=c.length;d<f;d++)for(var h=i[c[d]].stackGroups,p=Object.keys(h),x=0,g=p.length;x<g;x++){var j=h[p[x]],b=j.items,y=j.cateAxisId,S=b.filter(function(O){return ni(O.type).indexOf("Bar")>=0});if(S&&S.length){var C=S[0].type.defaultProps,N=C!==void 0?zn(zn({},C),S[0].props):S[0].props,E=N.barSize,A=N[y];o[A]||(o[A]=[]);var P=$t(E)?n:E;o[A].push({item:S[0],stackList:S.slice(1),barSize:$t(P)?void 0:Ar(P,r,0)})}}return o},Dae=function(t){var n=t.barGap,r=t.barCategoryGap,s=t.bandSize,i=t.sizeList,o=i===void 0?[]:i,c=t.maxBarSize,d=o.length;if(d<1)return null;var f=Ar(n,s,0,!0),h,p=[];if(o[0].barSize===+o[0].barSize){var x=!1,g=s/d,j=o.reduce(function(E,A){return E+A.barSize||0},0);j+=(d-1)*f,j>=s&&(j-=(d-1)*f,f=0),j>=s&&g>0&&(x=!0,g*=.9,j=d*g);var b=(s-j)/2>>0,y={offset:b-f,size:0};h=o.reduce(function(E,A){var P={item:A.item,position:{offset:y.offset+y.size+f,size:x?g:A.barSize}},O=[].concat(k2(E),[P]);return y=O[O.length-1].position,A.stackList&&A.stackList.length&&A.stackList.forEach(function(T){O.push({item:T,position:y})}),O},p)}else{var S=Ar(r,s,0,!0);s-2*S-(d-1)*f<=0&&(f=0);var C=(s-2*S-(d-1)*f)/d;C>1&&(C>>=0);var N=c===+c?Math.min(C,c):C;h=o.reduce(function(E,A,P){var O=[].concat(k2(E),[{item:A.item,position:{offset:S+(C+f)*P+(C-N)/2,size:N}}]);return A.stackList&&A.stackList.length&&A.stackList.forEach(function(T){O.push({item:T,position:O[O.length-1].position})}),O},p)}return h},Lae=function(t,n,r,s){var i=r.children,o=r.width,c=r.margin,d=o-(c.left||0)-(c.right||0),f=v4({children:i,legendWidth:d});if(f){var h=s||{},p=h.width,x=h.height,g=f.align,j=f.verticalAlign,b=f.layout;if((b==="vertical"||b==="horizontal"&&j==="middle")&&g!=="center"&&Ke(t[g]))return zn(zn({},t),{},Cc({},g,t[g]+(p||0)));if((b==="horizontal"||b==="vertical"&&g==="center")&&j!=="middle"&&Ke(t[j]))return zn(zn({},t),{},Cc({},j,t[j]+(x||0)))}return t},Fae=function(t,n,r){return $t(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},g4=function(t,n,r,s,i){var o=n.props.children,c=pa(o,Wf).filter(function(f){return Fae(s,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=er(h,r);if($t(p))return f;var x=Array.isArray(p)?[Xv(p),Yv(p)]:[p,p],g=d.reduce(function(j,b){var y=er(h,b,0),S=x[0]-Math.abs(Array.isArray(y)?y[0]:y),C=x[1]+Math.abs(Array.isArray(y)?y[1]:y);return[Math.min(S,j[0]),Math.max(C,j[1])]},[1/0,-1/0]);return[Math.min(g[0],f[0]),Math.max(g[1],f[1])]},[1/0,-1/0])}return null},Bae=function(t,n,r,s,i){var o=n.map(function(c){return g4(t,c,r,i,s)}).filter(function(c){return!$t(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},x4=function(t,n,r,s,i){var o=n.map(function(d){var f=d.props.dataKey;return r==="number"&&f&&g4(t,d,f,s)||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},[])},y4=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},Wo=function(t,n,r){if(!t)return null;var s=t.scale,i=t.duplicateDomain,o=t.type,c=t.range,d=t.realScaleType==="scaleBand"?s.bandwidth()/2:2,f=(n||r)&&o==="category"&&s.bandwidth?s.bandwidth()/d:0;if(f=t.axisType==="angleAxis"&&c?.length>=2?_r(c[0]-c[1])*2*f:f,n&&(t.ticks||t.niceTicks)){var h=(t.ticks||t.niceTicks).map(function(p){var x=i?i.indexOf(p):p;return{coordinate:s(x)+f,value:p,offset:f}});return h.filter(function(p){return!Df(p.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(p,x){return{coordinate:s(p)+f,value:p,index:x,offset:f}}):s.ticks&&!r?s.ticks(t.tickCount).map(function(p){return{coordinate:s(p)+f,value:p,offset:f}}):s.domain().map(function(p,x){return{coordinate:s(p)+f,value:i?i[p]:p,index:x,offset:f}})},aj=new WeakMap,yh=function(t,n){if(typeof n!="function")return t;aj.has(t)||aj.set(t,new WeakMap);var r=aj.get(t);if(r.has(n))return r.get(n);var s=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,s),s},b4=function(t,n,r){var s=t.scale,i=t.type,o=t.layout,c=t.axisType;if(s==="auto")return o==="radial"&&c==="radiusAxis"?{scale:Hd(),realScaleType:"band"}:o==="radial"&&c==="angleAxis"?{scale:fm(),realScaleType:"linear"}:i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:Ad(),realScaleType:"point"}:i==="category"?{scale:Hd(),realScaleType:"band"}:{scale:fm(),realScaleType:"linear"};if(tl(s)){var d="scale".concat(Iv(s));return{scale:(v2[d]||Ad)(),realScaleType:v2[d]?d:"point"}}return Mt(s)?{scale:s}:{scale:Ad(),realScaleType:"point"}},T2=1e-4,w4=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,s=t.range(),i=Math.min(s[0],s[1])-T2,o=Math.max(s[0],s[1])+T2,c=t(n[0]),d=t(n[r-1]);(c<i||c>o||d<i||d>o)&&t.domain([n[0],n[r-1]])}},zae=function(t,n){if(!t)return null;for(var r=0,s=t.length;r<s;r++)if(t[r].item===n)return t[r].position;return null},qae=function(t,n){if(!n||n.length!==2||!Ke(n[0])||!Ke(n[1]))return t;var r=Math.min(n[0],n[1]),s=Math.max(n[0],n[1]),i=[t[0],t[1]];return(!Ke(t[0])||t[0]<r)&&(i[0]=r),(!Ke(t[1])||t[1]>s)&&(i[1]=s),i[0]>s&&(i[0]=s),i[1]<r&&(i[1]=r),i},Uae=function(t){var n=t.length;if(!(n<=0))for(var r=0,s=t[0].length;r<s;++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])}},Wae=function(t){var n=t.length;if(!(n<=0))for(var r=0,s=t[0].length;r<s;++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)}},Vae={sign:Uae,expand:TQ,none:Rc,silhouette:RQ,wiggle:IQ,positive:Wae},Hae=function(t,n,r){var s=n.map(function(c){return c.props.dataKey}),i=Vae[r],o=OQ().keys(s).value(function(c,d){return+er(c,d,0)}).order(PS).offset(i);return o(t)},Kae=function(t,n,r,s,i,o){if(!t)return null;var c=o?n.reverse():n,d={},f=c.reduce(function(p,x){var g,j=(g=x.type)!==null&&g!==void 0&&g.defaultProps?zn(zn({},x.type.defaultProps),x.props):x.props,b=j.stackId,y=j.hide;if(y)return p;var S=j[r],C=p[S]||{hasStack:!1,stackGroups:{}};if(tr(b)){var N=C.stackGroups[b]||{numericAxisId:r,cateAxisId:s,items:[]};N.items.push(x),C.hasStack=!0,C.stackGroups[b]=N}else C.stackGroups[xu("_stackId_")]={numericAxisId:r,cateAxisId:s,items:[x]};return zn(zn({},p),{},Cc({},S,C))},d),h={};return Object.keys(f).reduce(function(p,x){var g=f[x];if(g.hasStack){var j={};g.stackGroups=Object.keys(g.stackGroups).reduce(function(b,y){var S=g.stackGroups[y];return zn(zn({},b),{},Cc({},y,{numericAxisId:r,cateAxisId:s,items:S.items,stackedData:Hae(t,S.items,i)}))},j)}return zn(zn({},p),{},Cc({},x,g))},h)},j4=function(t,n){var r=n.realScaleType,s=n.type,i=n.tickCount,o=n.originalDomain,c=n.allowDecimals,d=r||n.scale;if(d!=="auto"&&d!=="linear")return null;if(i&&s==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var f=t.domain();if(!f.length)return null;var h=oae(f,i,c);return t.domain([Xv(h),Yv(h)]),{niceTicks:h}}if(i&&s==="number"){var p=t.domain(),x=lae(p,i,c);return{niceTicks:x}}return null};function R2(e){var t=e.axis,n=e.ticks,r=e.bandSize,s=e.entry,i=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!$t(s[t.dataKey])){var c=Hh(n,"value",s[t.dataKey]);if(c)return c.coordinate+r/2}return n[i]?n[i].coordinate+r/2:null}var d=er(s,$t(o)?t.dataKey:o);return $t(d)?null:t.scale(d)}var I2=function(t){var n=t.axis,r=t.ticks,s=t.offset,i=t.bandSize,o=t.entry,c=t.index;if(n.type==="category")return r[c]?r[c].coordinate+s:null;var d=er(o,n.dataKey,n.domain[c]);return $t(d)?null:n.scale(d)-i/2+s},Gae=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var s=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return s<=0&&i>=0?0:i<0?i:s}return r[0]},Yae=function(t,n){var r,s=(r=t.type)!==null&&r!==void 0&&r.defaultProps?zn(zn({},t.type.defaultProps),t.props):t.props,i=s.stackId;if(tr(i)){var o=n[i];if(o){var c=o.items.indexOf(t);return c>=0?o.stackedData[c]:null}}return null},Xae=function(t){return t.reduce(function(n,r){return[Xv(r.concat([n[0]]).filter(Ke)),Yv(r.concat([n[1]]).filter(Ke))]},[1/0,-1/0])},S4=function(t,n,r){return Object.keys(t).reduce(function(s,i){var o=t[i],c=o.stackedData,d=c.reduce(function(f,h){var p=Xae(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],s[0]),Math.max(d[1],s[1])]},[1/0,-1/0]).map(function(s){return s===1/0||s===-1/0?0:s})},M2=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,$2=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,e1=function(t,n,r){if(Mt(t))return t(n,r);if(!Array.isArray(t))return n;var s=[];if(Ke(t[0]))s[0]=r?t[0]:Math.min(t[0],n[0]);else if(M2.test(t[0])){var i=+M2.exec(t[0])[1];s[0]=n[0]-i}else Mt(t[0])?s[0]=t[0](n[0]):s[0]=n[0];if(Ke(t[1]))s[1]=r?t[1]:Math.max(t[1],n[1]);else if($2.test(t[1])){var o=+$2.exec(t[1])[1];s[1]=n[1]+o}else Mt(t[1])?s[1]=t[1](n[1]):s[1]=n[1];return s},ym=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var s=t.scale.bandwidth();if(!r||s>0)return s}if(t&&n&&n.length>=2){for(var i=rC(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},D2=function(t,n,r){return!t||!t.length||Uf(t,fa(r,"type.defaultProps.domain"))?n:t},N4=function(t,n){var r=t.type.defaultProps?zn(zn({},t.type.defaultProps),t.props):t.props,s=r.dataKey,i=r.name,o=r.unit,c=r.formatter,d=r.tooltipType,f=r.chartType,h=r.hide;return zn(zn({},Nt(t,!1)),{},{dataKey:s,unit:o,formatter:c,name:i||s,color:PC(t),value:er(n,s),type:d,payload:n,chartType:f,hide:h})};function tf(e){"@babel/helpers - typeof";return tf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tf(e)}function L2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Xs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?L2(Object(n),!0).forEach(function(r){C4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function C4(e,t,n){return t=Qae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qae(e){var t=Jae(e,"string");return tf(t)=="symbol"?t:t+""}function Jae(e,t){if(tf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(tf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Zae(e,t){return rse(e)||nse(e,t)||tse(e,t)||ese()}function ese(){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 tse(e,t){if(e){if(typeof e=="string")return F2(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 F2(e,t)}}function F2(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 nse(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,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,s=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw s}}return c}}function rse(e){if(Array.isArray(e))return e}var bm=Math.PI/180,ase=function(t){return t*180/Math.PI},Nn=function(t,n,r,s){return{x:t+Math.cos(-bm*s)*r,y:n+Math.sin(-bm*s)*r}},_4=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},sse=function(t,n,r,s,i){var o=t.width,c=t.height,d=t.startAngle,f=t.endAngle,h=Ar(t.cx,o,o/2),p=Ar(t.cy,c,c/2),x=_4(o,c,r),g=Ar(t.innerRadius,x,0),j=Ar(t.outerRadius,x,x*.8),b=Object.keys(n);return b.reduce(function(y,S){var C=n[S],N=C.domain,E=C.reversed,A;if($t(C.range))s==="angleAxis"?A=[d,f]:s==="radiusAxis"&&(A=[g,j]),E&&(A=[A[1],A[0]]);else{A=C.range;var P=A,O=Zae(P,2);d=O[0],f=O[1]}var T=b4(C,i),$=T.realScaleType,z=T.scale;z.domain(N).range(A),w4(z);var q=j4(z,Xs(Xs({},C),{},{realScaleType:$})),F=Xs(Xs(Xs({},C),q),{},{range:A,radius:j,realScaleType:$,scale:z,cx:h,cy:p,innerRadius:g,outerRadius:j,startAngle:d,endAngle:f});return Xs(Xs({},y),{},C4({},S,F))},{})},ise=function(t,n){var r=t.x,s=t.y,i=n.x,o=n.y;return Math.sqrt(Math.pow(r-i,2)+Math.pow(s-o,2))},ose=function(t,n){var r=t.x,s=t.y,i=n.cx,o=n.cy,c=ise({x:r,y:s},{x:i,y:o});if(c<=0)return{radius:c};var d=(r-i)/c,f=Math.acos(d);return s>o&&(f=2*Math.PI-f),{radius:c,angle:ase(f),angleInRadian:f}},lse=function(t){var n=t.startAngle,r=t.endAngle,s=Math.floor(n/360),i=Math.floor(r/360),o=Math.min(s,i);return{startAngle:n-o*360,endAngle:r-o*360}},cse=function(t,n){var r=n.startAngle,s=n.endAngle,i=Math.floor(r/360),o=Math.floor(s/360),c=Math.min(i,o);return t+c*360},B2=function(t,n){var r=t.x,s=t.y,i=ose({x:r,y:s},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=lse(n),p=h.startAngle,x=h.endAngle,g=c,j;if(p<=x){for(;g>x;)g-=360;for(;g<p;)g+=360;j=g>=p&&g<=x}else{for(;g>p;)g-=360;for(;g<x;)g+=360;j=g>=x&&g<=p}return j?Xs(Xs({},n),{},{radius:o,angle:cse(g,n)}):null},A4=function(t){return!m.isValidElement(t)&&!Mt(t)&&typeof t!="boolean"?t.className:""};function nf(e){"@babel/helpers - typeof";return nf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nf(e)}var use=["offset"];function dse(e){return mse(e)||hse(e)||pse(e)||fse()}function fse(){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 pse(e,t){if(e){if(typeof e=="string")return t1(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 t1(e,t)}}function hse(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function mse(e){if(Array.isArray(e))return t1(e)}function t1(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 vse(e,t){if(e==null)return{};var n=gse(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function gse(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function z2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).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?z2(Object(n),!0).forEach(function(r){xse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xse(e,t,n){return t=yse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yse(e){var t=bse(e,"string");return nf(t)=="symbol"?t:t+""}function bse(e,t){if(nf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(nf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rf(){return rf=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},rf.apply(this,arguments)}var wse=function(t){var n=t.value,r=t.formatter,s=$t(t.children)?n:t.children;return Mt(r)?r(s):s},jse=function(t,n){var r=_r(n-t),s=Math.min(Math.abs(n-t),360);return r*s},Sse=function(t,n,r){var s=t.position,i=t.viewBox,o=t.offset,c=t.className,d=i,f=d.cx,h=d.cy,p=d.innerRadius,x=d.outerRadius,g=d.startAngle,j=d.endAngle,b=d.clockWise,y=(p+x)/2,S=jse(g,j),C=S>=0?1:-1,N,E;s==="insideStart"?(N=g+C*o,E=b):s==="insideEnd"?(N=j-C*o,E=!b):s==="end"&&(N=j+C*o,E=b),E=S<=0?E:!E;var A=Nn(f,h,y,N),P=Nn(f,h,y,N+(E?1:-1)*359),O="M".concat(A.x,",").concat(A.y,`
|
|
75
|
+
A`).concat(y,",").concat(y,",0,1,").concat(E?0:1,`,
|
|
76
|
+
`).concat(P.x,",").concat(P.y),T=$t(t.id)?xu("recharts-radial-line-"):t.id;return Y.createElement("text",rf({},r,{dominantBaseline:"central",className:Dt("recharts-radial-bar-label",c)}),Y.createElement("defs",null,Y.createElement("path",{id:T,d:O})),Y.createElement("textPath",{xlinkHref:"#".concat(T)},n))},Nse=function(t){var n=t.viewBox,r=t.offset,s=t.position,i=n,o=i.cx,c=i.cy,d=i.innerRadius,f=i.outerRadius,h=i.startAngle,p=i.endAngle,x=(h+p)/2;if(s==="outside"){var g=Nn(o,c,f+r,x),j=g.x,b=g.y;return{x:j,y:b,textAnchor:j>=o?"start":"end",verticalAnchor:"middle"}}if(s==="center")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"middle"};if(s==="centerTop")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"start"};if(s==="centerBottom")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"end"};var y=(d+f)/2,S=Nn(o,c,y,x),C=S.x,N=S.y;return{x:C,y:N,textAnchor:"middle",verticalAnchor:"middle"}},Cse=function(t){var n=t.viewBox,r=t.parentViewBox,s=t.offset,i=t.position,o=n,c=o.x,d=o.y,f=o.width,h=o.height,p=h>=0?1:-1,x=p*s,g=p>0?"end":"start",j=p>0?"start":"end",b=f>=0?1:-1,y=b*s,S=b>0?"end":"start",C=b>0?"start":"end";if(i==="top"){var N={x:c+f/2,y:d-p*s,textAnchor:"middle",verticalAnchor:g};return Zn(Zn({},N),r?{height:Math.max(d-r.y,0),width:f}:{})}if(i==="bottom"){var E={x:c+f/2,y:d+h+x,textAnchor:"middle",verticalAnchor:j};return Zn(Zn({},E),r?{height:Math.max(r.y+r.height-(d+h),0),width:f}:{})}if(i==="left"){var A={x:c-y,y:d+h/2,textAnchor:S,verticalAnchor:"middle"};return Zn(Zn({},A),r?{width:Math.max(A.x-r.x,0),height:h}:{})}if(i==="right"){var P={x:c+f+y,y:d+h/2,textAnchor:C,verticalAnchor:"middle"};return Zn(Zn({},P),r?{width:Math.max(r.x+r.width-P.x,0),height:h}:{})}var O=r?{width:f,height:h}:{};return i==="insideLeft"?Zn({x:c+y,y:d+h/2,textAnchor:C,verticalAnchor:"middle"},O):i==="insideRight"?Zn({x:c+f-y,y:d+h/2,textAnchor:S,verticalAnchor:"middle"},O):i==="insideTop"?Zn({x:c+f/2,y:d+x,textAnchor:"middle",verticalAnchor:j},O):i==="insideBottom"?Zn({x:c+f/2,y:d+h-x,textAnchor:"middle",verticalAnchor:g},O):i==="insideTopLeft"?Zn({x:c+y,y:d+x,textAnchor:C,verticalAnchor:j},O):i==="insideTopRight"?Zn({x:c+f-y,y:d+x,textAnchor:S,verticalAnchor:j},O):i==="insideBottomLeft"?Zn({x:c+y,y:d+h-x,textAnchor:C,verticalAnchor:g},O):i==="insideBottomRight"?Zn({x:c+f-y,y:d+h-x,textAnchor:S,verticalAnchor:g},O):gu(i)&&(Ke(i.x)||zo(i.x))&&(Ke(i.y)||zo(i.y))?Zn({x:c+Ar(i.x,f),y:d+Ar(i.y,h),textAnchor:"end",verticalAnchor:"end"},O):Zn({x:c+f/2,y:d+h/2,textAnchor:"middle",verticalAnchor:"middle"},O)},_se=function(t){return"cx"in t&&Ke(t.cx)};function ur(e){var t=e.offset,n=t===void 0?5:t,r=vse(e,use),s=Zn({offset:n},r),i=s.viewBox,o=s.position,c=s.value,d=s.children,f=s.content,h=s.className,p=h===void 0?"":h,x=s.textBreakAll;if(!i||$t(c)&&$t(d)&&!m.isValidElement(f)&&!Mt(f))return null;if(m.isValidElement(f))return m.cloneElement(f,s);var g;if(Mt(f)){if(g=m.createElement(f,s),m.isValidElement(g))return g}else g=wse(s);var j=_se(i),b=Nt(s,!0);if(j&&(o==="insideStart"||o==="insideEnd"||o==="end"))return Sse(s,g,b);var y=j?Nse(s):Cse(s);return Y.createElement(rl,rf({className:Dt("recharts-label",p)},b,y,{breakAll:x}),g)}ur.displayName="Label";var E4=function(t){var n=t.cx,r=t.cy,s=t.angle,i=t.startAngle,o=t.endAngle,c=t.r,d=t.radius,f=t.innerRadius,h=t.outerRadius,p=t.x,x=t.y,g=t.top,j=t.left,b=t.width,y=t.height,S=t.clockWise,C=t.labelViewBox;if(C)return C;if(Ke(b)&&Ke(y)){if(Ke(p)&&Ke(x))return{x:p,y:x,width:b,height:y};if(Ke(g)&&Ke(j))return{x:g,y:j,width:b,height:y}}return Ke(p)&&Ke(x)?{x:p,y:x,width:0,height:0}:Ke(n)&&Ke(r)?{cx:n,cy:r,startAngle:i||s||0,endAngle:o||s||0,innerRadius:f||0,outerRadius:h||d||c||0,clockWise:S}:t.viewBox?t.viewBox:{}},Ase=function(t,n){return t?t===!0?Y.createElement(ur,{key:"label-implicit",viewBox:n}):tr(t)?Y.createElement(ur,{key:"label-implicit",viewBox:n,value:t}):m.isValidElement(t)?t.type===ur?m.cloneElement(t,{key:"label-implicit",viewBox:n}):Y.createElement(ur,{key:"label-implicit",content:t,viewBox:n}):Mt(t)?Y.createElement(ur,{key:"label-implicit",content:t,viewBox:n}):gu(t)?Y.createElement(ur,rf({viewBox:n},t,{key:"label-implicit"})):null:null},Ese=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 s=t.children,i=E4(t),o=pa(s,ur).map(function(d,f){return m.cloneElement(d,{viewBox:n||i,key:"label-".concat(f)})});if(!r)return o;var c=Ase(t.label,n||i);return[c].concat(dse(o))};ur.parseViewBox=E4;ur.renderCallByParent=Ese;var sj,q2;function Pse(){if(q2)return sj;q2=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return sj=e,sj}var kse=Pse();const Ose=fn(kse);function af(e){"@babel/helpers - typeof";return af=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},af(e)}var Tse=["valueAccessor"],Rse=["data","dataKey","clockWise","id","textBreakAll"];function Ise(e){return Lse(e)||Dse(e)||$se(e)||Mse()}function Mse(){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 $se(e,t){if(e){if(typeof e=="string")return n1(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 n1(e,t)}}function Dse(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Lse(e){if(Array.isArray(e))return n1(e)}function n1(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 wm(){return wm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wm.apply(this,arguments)}function U2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function W2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?U2(Object(n),!0).forEach(function(r){Fse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fse(e,t,n){return t=Bse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bse(e){var t=zse(e,"string");return af(t)=="symbol"?t:t+""}function zse(e,t){if(af(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(af(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function V2(e,t){if(e==null)return{};var n=qse(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qse(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 Use=function(t){return Array.isArray(t.value)?Ose(t.value):t.value};function si(e){var t=e.valueAccessor,n=t===void 0?Use:t,r=V2(e,Tse),s=r.data,i=r.dataKey,o=r.clockWise,c=r.id,d=r.textBreakAll,f=V2(r,Rse);return!s||!s.length?null:Y.createElement(nn,{className:"recharts-label-list"},s.map(function(h,p){var x=$t(i)?n(h,p):er(h&&h.payload,i),g=$t(c)?{}:{id:"".concat(c,"-").concat(p)};return Y.createElement(ur,wm({},Nt(h,!0),f,g,{parentViewBox:h.parentViewBox,value:x,textBreakAll:d,viewBox:ur.parseViewBox($t(o)?h:W2(W2({},h),{},{clockWise:o})),key:"label-".concat(p),index:p}))}))}si.displayName="LabelList";function Wse(e,t){return e?e===!0?Y.createElement(si,{key:"labelList-implicit",data:t}):Y.isValidElement(e)||Mt(e)?Y.createElement(si,{key:"labelList-implicit",data:t,content:e}):gu(e)?Y.createElement(si,wm({data:t},e,{key:"labelList-implicit"})):null:null}function Vse(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,s=pa(r,si).map(function(o,c){return m.cloneElement(o,{data:t,key:"labelList-".concat(c)})});if(!n)return s;var i=Wse(e.label,t);return[i].concat(Ise(s))}si.renderCallByParent=Vse;function sf(e){"@babel/helpers - typeof";return sf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sf(e)}function r1(){return r1=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},r1.apply(this,arguments)}function H2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function K2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?H2(Object(n),!0).forEach(function(r){Hse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hse(e,t,n){return t=Kse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kse(e){var t=Gse(e,"string");return sf(t)=="symbol"?t:t+""}function Gse(e,t){if(sf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(sf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Yse=function(t,n){var r=_r(n-t),s=Math.min(Math.abs(n-t),359.999);return r*s},bh=function(t){var n=t.cx,r=t.cy,s=t.radius,i=t.angle,o=t.sign,c=t.isExternal,d=t.cornerRadius,f=t.cornerIsExternal,h=d*(c?1:-1)+s,p=Math.asin(d/h)/bm,x=f?i:i+o*p,g=Nn(n,r,h,x),j=Nn(n,r,s,x),b=f?i-o*p:i,y=Nn(n,r,h*Math.cos(p*bm),b);return{center:g,circleTangency:j,lineTangency:y,theta:p}},P4=function(t){var n=t.cx,r=t.cy,s=t.innerRadius,i=t.outerRadius,o=t.startAngle,c=t.endAngle,d=Yse(o,c),f=o+d,h=Nn(n,r,i,o),p=Nn(n,r,i,f),x="M ".concat(h.x,",").concat(h.y,`
|
|
78
|
+
A `).concat(i,",").concat(i,`,0,
|
|
79
|
+
`).concat(+(Math.abs(d)>180),",").concat(+(o>f),`,
|
|
80
|
+
`).concat(p.x,",").concat(p.y,`
|
|
81
|
+
`);if(s>0){var g=Nn(n,r,s,o),j=Nn(n,r,s,f);x+="L ".concat(j.x,",").concat(j.y,`
|
|
82
|
+
A `).concat(s,",").concat(s,`,0,
|
|
83
|
+
`).concat(+(Math.abs(d)>180),",").concat(+(o<=f),`,
|
|
84
|
+
`).concat(g.x,",").concat(g.y," Z")}else x+="L ".concat(n,",").concat(r," Z");return x},Xse=function(t){var n=t.cx,r=t.cy,s=t.innerRadius,i=t.outerRadius,o=t.cornerRadius,c=t.forceCornerRadius,d=t.cornerIsExternal,f=t.startAngle,h=t.endAngle,p=_r(h-f),x=bh({cx:n,cy:r,radius:i,angle:f,sign:p,cornerRadius:o,cornerIsExternal:d}),g=x.circleTangency,j=x.lineTangency,b=x.theta,y=bh({cx:n,cy:r,radius:i,angle:h,sign:-p,cornerRadius:o,cornerIsExternal:d}),S=y.circleTangency,C=y.lineTangency,N=y.theta,E=d?Math.abs(f-h):Math.abs(f-h)-b-N;if(E<0)return c?"M ".concat(j.x,",").concat(j.y,`
|
|
85
|
+
a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0
|
|
86
|
+
a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0
|
|
87
|
+
`):P4({cx:n,cy:r,innerRadius:s,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(+(E>180),",").concat(+(p<0),",").concat(S.x,",").concat(S.y,`
|
|
90
|
+
A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(C.x,",").concat(C.y,`
|
|
91
|
+
`);if(s>0){var P=bh({cx:n,cy:r,radius:s,angle:f,sign:p,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),O=P.circleTangency,T=P.lineTangency,$=P.theta,z=bh({cx:n,cy:r,radius:s,angle:h,sign:-p,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),q=z.circleTangency,F=z.lineTangency,H=z.theta,U=d?Math.abs(f-h):Math.abs(f-h)-$-H;if(U<0&&o===0)return"".concat(A,"L").concat(n,",").concat(r,"Z");A+="L".concat(F.x,",").concat(F.y,`
|
|
92
|
+
A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(q.x,",").concat(q.y,`
|
|
93
|
+
A`).concat(s,",").concat(s,",0,").concat(+(U>180),",").concat(+(p>0),",").concat(O.x,",").concat(O.y,`
|
|
94
|
+
A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(T.x,",").concat(T.y,"Z")}else A+="L".concat(n,",").concat(r,"Z");return A},Qse={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},k4=function(t){var n=K2(K2({},Qse),t),r=n.cx,s=n.cy,i=n.innerRadius,o=n.outerRadius,c=n.cornerRadius,d=n.forceCornerRadius,f=n.cornerIsExternal,h=n.startAngle,p=n.endAngle,x=n.className;if(o<i||h===p)return null;var g=Dt("recharts-sector",x),j=o-i,b=Ar(c,j,0,!0),y;return b>0&&Math.abs(h-p)<360?y=Xse({cx:r,cy:s,innerRadius:i,outerRadius:o,cornerRadius:Math.min(b,j/2),forceCornerRadius:d,cornerIsExternal:f,startAngle:h,endAngle:p}):y=P4({cx:r,cy:s,innerRadius:i,outerRadius:o,startAngle:h,endAngle:p}),Y.createElement("path",r1({},Nt(n,!0),{className:g,d:y,role:"img"}))};function of(e){"@babel/helpers - typeof";return of=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},of(e)}function a1(){return a1=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},a1.apply(this,arguments)}function G2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Y2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?G2(Object(n),!0).forEach(function(r){Jse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jse(e,t,n){return t=Zse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zse(e){var t=eie(e,"string");return of(t)=="symbol"?t:t+""}function eie(e,t){if(of(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(of(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var X2={curveBasisClosed:bQ,curveBasisOpen:wQ,curveBasis:yQ,curveBumpX:sQ,curveBumpY:iQ,curveLinearClosed:jQ,curveLinear:$v,curveMonotoneX:SQ,curveMonotoneY:NQ,curveNatural:CQ,curveStep:_Q,curveStepAfter:EQ,curveStepBefore:AQ},wh=function(t){return t.x===+t.x&&t.y===+t.y},hd=function(t){return t.x},md=function(t){return t.y},tie=function(t,n){if(Mt(t))return t;var r="curve".concat(Iv(t));return(r==="curveMonotone"||r==="curveBump")&&n?X2["".concat(r).concat(n==="vertical"?"Y":"X")]:X2[r]||$v},nie=function(t){var n=t.type,r=n===void 0?"linear":n,s=t.points,i=s===void 0?[]:s,o=t.baseLine,c=t.layout,d=t.connectNulls,f=d===void 0?!1:d,h=tie(r,c),p=f?i.filter(function(b){return wh(b)}):i,x;if(Array.isArray(o)){var g=f?o.filter(function(b){return wh(b)}):o,j=p.map(function(b,y){return Y2(Y2({},b),{},{base:g[y]})});return c==="vertical"?x=fh().y(md).x1(hd).x0(function(b){return b.base.x}):x=fh().x(hd).y1(md).y0(function(b){return b.base.y}),x.defined(wh).curve(h),x(j)}return c==="vertical"&&Ke(o)?x=fh().y(md).x1(hd).x0(o):Ke(o)?x=fh().x(hd).y1(md).y0(o):x=k3().x(hd).y(md),x.defined(wh).curve(h),x(p)},jm=function(t){var n=t.className,r=t.points,s=t.path,i=t.pathRef;if((!r||!r.length)&&!s)return null;var o=r&&r.length?nie(t):s;return m.createElement("path",a1({},Nt(t,!1),Kh(t),{className:Dt("recharts-curve",n),d:o,ref:i}))},ij={exports:{}},oj,Q2;function rie(){if(Q2)return oj;Q2=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return oj=e,oj}var lj,J2;function aie(){if(J2)return lj;J2=1;var e=rie();function t(){}function n(){}return n.resetWarningCache=t,lj=function(){function r(o,c,d,f,h,p){if(p!==e){var x=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw x.name="Invariant Violation",x}}r.isRequired=r;function s(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:s,element:r,elementType:r,instanceOf:s,node:r,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},lj}var Z2;function sie(){return Z2||(Z2=1,ij.exports=aie()()),ij.exports}var iie=sie();const un=fn(iie),{getOwnPropertyNames:oie,getOwnPropertySymbols:lie}=Object,{hasOwnProperty:cie}=Object.prototype;function cj(e,t){return function(r,s,i){return e(r,s,i)&&t(r,s,i)}}function jh(e){return function(n,r,s){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,s);const{cache:i}=s,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,s);return i.delete(n),i.delete(r),d}}function uie(e){return e?.[Symbol.toStringTag]}function eI(e){return oie(e).concat(lie(e))}const die=Object.hasOwn||((e,t)=>cie.call(e,t));function Nl(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const fie="__v",pie="__o",hie="_owner",{getOwnPropertyDescriptor:tI,keys:nI}=Object;function mie(e,t){return e.byteLength===t.byteLength&&Sm(new Uint8Array(e),new Uint8Array(t))}function vie(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 gie(e,t){return e.byteLength===t.byteLength&&Sm(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function xie(e,t){return Nl(e.getTime(),t.getTime())}function yie(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function bie(e,t){return e===t}function rI(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const s=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(s[p]){p++;continue}const x=o.value,g=c.value;if(n.equals(x[0],g[0],d,p,e,t,n)&&n.equals(x[1],g[1],x[0],g[0],e,t,n)){h=s[p]=!0;break}p++}if(!h)return!1;d++}return!0}const wie=Nl;function jie(e,t,n){const r=nI(e);let s=r.length;if(nI(t).length!==s)return!1;for(;s-- >0;)if(!O4(e,t,n,r[s]))return!1;return!0}function vd(e,t,n){const r=eI(e);let s=r.length;if(eI(t).length!==s)return!1;let i,o,c;for(;s-- >0;)if(i=r[s],!O4(e,t,n,i)||(o=tI(e,i),c=tI(t,i),(o||c)&&(!o||!c||o.configurable!==c.configurable||o.enumerable!==c.enumerable||o.writable!==c.writable)))return!1;return!0}function Sie(e,t){return Nl(e.valueOf(),t.valueOf())}function Nie(e,t){return e.source===t.source&&e.flags===t.flags}function aI(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const s=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(!s[h]&&n.equals(o.value,c.value,o.value,c.value,e,t,n)){f=s[h]=!0;break}h++}if(!f)return!1}return!0}function Sm(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 Cie(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 O4(e,t,n,r){return(r===hie||r===pie||r===fie)&&(e.$$typeof||t.$$typeof)?!0:die(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const _ie="[object ArrayBuffer]",Aie="[object Arguments]",Eie="[object Boolean]",Pie="[object DataView]",kie="[object Date]",Oie="[object Error]",Tie="[object Map]",Rie="[object Number]",Iie="[object Object]",Mie="[object RegExp]",$ie="[object Set]",Die="[object String]",Lie={"[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},Fie="[object URL]",Bie=Object.prototype.toString;function zie({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:s,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:c,areObjectsEqual:d,arePrimitiveWrappersEqual:f,areRegExpsEqual:h,areSetsEqual:p,areTypedArraysEqual:x,areUrlsEqual:g,unknownTagComparators:j}){return function(y,S,C){if(y===S)return!0;if(y==null||S==null)return!1;const N=typeof y;if(N!==typeof S)return!1;if(N!=="object")return N==="number"?c(y,S,C):N==="function"?i(y,S,C):!1;const E=y.constructor;if(E!==S.constructor)return!1;if(E===Object)return d(y,S,C);if(Array.isArray(y))return t(y,S,C);if(E===Date)return r(y,S,C);if(E===RegExp)return h(y,S,C);if(E===Map)return o(y,S,C);if(E===Set)return p(y,S,C);const A=Bie.call(y);if(A===kie)return r(y,S,C);if(A===Mie)return h(y,S,C);if(A===Tie)return o(y,S,C);if(A===$ie)return p(y,S,C);if(A===Iie)return typeof y.then!="function"&&typeof S.then!="function"&&d(y,S,C);if(A===Fie)return g(y,S,C);if(A===Oie)return s(y,S,C);if(A===Aie)return d(y,S,C);if(Lie[A])return x(y,S,C);if(A===_ie)return e(y,S,C);if(A===Pie)return n(y,S,C);if(A===Eie||A===Rie||A===Die)return f(y,S,C);if(j){let P=j[A];if(!P){const O=uie(y);O&&(P=j[O])}if(P)return P(y,S,C)}return!1}}function qie({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:mie,areArraysEqual:n?vd:vie,areDataViewsEqual:gie,areDatesEqual:xie,areErrorsEqual:yie,areFunctionsEqual:bie,areMapsEqual:n?cj(rI,vd):rI,areNumbersEqual:wie,areObjectsEqual:n?vd:jie,arePrimitiveWrappersEqual:Sie,areRegExpsEqual:Nie,areSetsEqual:n?cj(aI,vd):aI,areTypedArraysEqual:n?cj(Sm,vd):Sm,areUrlsEqual:Cie,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const s=jh(r.areArraysEqual),i=jh(r.areMapsEqual),o=jh(r.areObjectsEqual),c=jh(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:s,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:c})}return r}function Uie(e){return function(t,n,r,s,i,o,c){return e(t,n,c)}}function Wie({circular:e,comparator:t,createState:n,equals:r,strict:s}){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:s})};if(e)return function(c,d){return t(c,d,{cache:new WeakMap,equals:r,meta:void 0,strict:s})};const i={cache:void 0,equals:r,meta:void 0,strict:s};return function(c,d){return t(c,d,i)}}const Vie=mo();mo({strict:!0});mo({circular:!0});mo({circular:!0,strict:!0});mo({createInternalComparator:()=>Nl});mo({strict:!0,createInternalComparator:()=>Nl});mo({circular:!0,createInternalComparator:()=>Nl});mo({circular:!0,createInternalComparator:()=>Nl,strict:!0});function mo(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:s=!1}=e,i=qie(e),o=zie(i),c=n?n(o):Uie(o);return Wie({circular:t,comparator:o,createState:r,equals:c,strict:s})}function Hie(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function sI(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function s(i){n<0&&(n=i),i-n>t?(e(i),n=-1):Hie(s)};requestAnimationFrame(r)}function s1(e){"@babel/helpers - typeof";return s1=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},s1(e)}function Kie(e){return Qie(e)||Xie(e)||Yie(e)||Gie()}function Gie(){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 Yie(e,t){if(e){if(typeof e=="string")return iI(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 iI(e,t)}}function iI(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 Xie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Qie(e){if(Array.isArray(e))return e}function Jie(){var e={},t=function(){return null},n=!1,r=function s(i){if(!n){if(Array.isArray(i)){if(!i.length)return;var o=i,c=Kie(o),d=c[0],f=c.slice(1);if(typeof d=="number"){sI(s.bind(null,f),d);return}s(d),sI(s.bind(null,f));return}s1(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 lf(e){"@babel/helpers - typeof";return lf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lf(e)}function oI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).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){T4(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 T4(e,t,n){return t=Zie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zie(e){var t=eoe(e,"string");return lf(t)==="symbol"?t:String(t)}function eoe(e,t){if(lf(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(lf(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var toe=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,s){return r.filter(function(i){return s.includes(i)})})},noe=function(t){return t},roe=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},Pd=function(t,n){return Object.keys(n).reduce(function(r,s){return lI(lI({},r),{},T4({},s,t(s,n[s])))},{})},cI=function(t,n,r){return t.map(function(s){return"".concat(roe(s)," ").concat(n,"ms ").concat(r)}).join(",")};function aoe(e,t){return ooe(e)||ioe(e,t)||R4(e,t)||soe()}function soe(){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 ioe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,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,s=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw s}}return c}}function ooe(e){if(Array.isArray(e))return e}function loe(e){return doe(e)||uoe(e)||R4(e)||coe()}function coe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
97
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R4(e,t){if(e){if(typeof e=="string")return i1(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 i1(e,t)}}function uoe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function doe(e){if(Array.isArray(e))return i1(e)}function i1(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 Nm=1e-4,I4=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},M4=function(t,n){return t.map(function(r,s){return r*Math.pow(n,s)}).reduce(function(r,s){return r+s})},uI=function(t,n){return function(r){var s=I4(t,n);return M4(s,r)}},foe=function(t,n){return function(r){var s=I4(t,n),i=[].concat(loe(s.map(function(o,c){return o*c}).slice(1)),[0]);return M4(i,r)}},dI=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var s=n[0],i=n[1],o=n[2],c=n[3];if(n.length===1)switch(n[0]){case"linear":s=0,i=0,o=1,c=1;break;case"ease":s=.25,i=.1,o=.25,c=1;break;case"ease-in":s=.42,i=0,o=1,c=1;break;case"ease-out":s=.42,i=0,o=.58,c=1;break;case"ease-in-out":s=0,i=0,o=.58,c=1;break;default:{var d=n[0].split("(");if(d[0]==="cubic-bezier"&&d[1].split(")")[0].split(",").length===4){var f=d[1].split(")")[0].split(",").map(function(y){return parseFloat(y)}),h=aoe(f,4);s=h[0],i=h[1],o=h[2],c=h[3]}}}var p=uI(s,o),x=uI(i,c),g=foe(s,o),j=function(S){return S>1?1:S<0?0:S},b=function(S){for(var C=S>1?1:S,N=C,E=0;E<8;++E){var A=p(N)-C,P=g(N);if(Math.abs(A-C)<Nm||P<Nm)return x(N);N=j(N-A/P)}return x(N)};return b.isStepper=!1,b},poe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,s=t.damping,i=s===void 0?8:s,o=t.dt,c=o===void 0?17:o,d=function(h,p,x){var g=-(h-p)*r,j=x*i,b=x+(g-j)*c/1e3,y=x*c/1e3+h;return Math.abs(y-p)<Nm&&Math.abs(b)<Nm?[p,0]:[y,b]};return d.isStepper=!0,d.dt=c,d},hoe=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var s=n[0];if(typeof s=="string")switch(s){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return dI(s);case"spring":return poe();default:if(s.split("(")[0]==="cubic-bezier")return dI(s)}return typeof s=="function"?s:null};function cf(e){"@babel/helpers - typeof";return cf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cf(e)}function fI(e){return goe(e)||voe(e)||$4(e)||moe()}function moe(){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 voe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function goe(e){if(Array.isArray(e))return l1(e)}function pI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).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?pI(Object(n),!0).forEach(function(r){o1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function o1(e,t,n){return t=xoe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xoe(e){var t=yoe(e,"string");return cf(t)==="symbol"?t:String(t)}function yoe(e,t){if(cf(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(cf(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function boe(e,t){return Soe(e)||joe(e,t)||$4(e,t)||woe()}function woe(){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 $4(e,t){if(e){if(typeof e=="string")return l1(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 l1(e,t)}}function l1(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 joe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,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,s=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw s}}return c}}function Soe(e){if(Array.isArray(e))return e}var Cm=function(t,n,r){return t+(n-t)*r},c1=function(t){var n=t.from,r=t.to;return n!==r},Noe=function e(t,n,r){var s=Pd(function(i,o){if(c1(o)){var c=t(o.from,o.to,o.velocity),d=boe(c,2),f=d[0],h=d[1];return hr(hr({},o),{},{from:f,velocity:h})}return o},n);return r<1?Pd(function(i,o){return c1(o)?hr(hr({},o),{},{velocity:Cm(o.velocity,s[i].velocity,r),from:Cm(o.from,s[i].from,r)}):o},n):e(t,s,r-1)};const Coe=(function(e,t,n,r,s){var i=toe(e,t),o=i.reduce(function(y,S){return hr(hr({},y),{},o1({},S,[e[S],t[S]]))},{}),c=i.reduce(function(y,S){return hr(hr({},y),{},o1({},S,{from:e[S],velocity:0,to:t[S]}))},{}),d=-1,f,h,p=function(){return null},x=function(){return Pd(function(S,C){return C.from},c)},g=function(){return!Object.values(c).filter(c1).length},j=function(S){f||(f=S);var C=S-f,N=C/n.dt;c=Noe(n,c,N),s(hr(hr(hr({},e),t),x())),f=S,g()||(d=requestAnimationFrame(p))},b=function(S){h||(h=S);var C=(S-h)/r,N=Pd(function(A,P){return Cm.apply(void 0,fI(P).concat([n(C)]))},o);if(s(hr(hr(hr({},e),t),N)),C<1)d=requestAnimationFrame(p);else{var E=Pd(function(A,P){return Cm.apply(void 0,fI(P).concat([n(1)]))},o);s(hr(hr(hr({},e),t),E))}};return p=n.isStepper?j:b,function(){return requestAnimationFrame(p),function(){cancelAnimationFrame(d)}}});function qc(e){"@babel/helpers - typeof";return qc=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},qc(e)}var _oe=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function Aoe(e,t){if(e==null)return{};var n=Eoe(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Eoe(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function uj(e){return Toe(e)||Ooe(e)||koe(e)||Poe()}function Poe(){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 koe(e,t){if(e){if(typeof e=="string")return u1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u1(e,t)}}function Ooe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Toe(e){if(Array.isArray(e))return u1(e)}function u1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function hI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Va(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hI(Object(n),!0).forEach(function(r){jd(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jd(e,t,n){return t=D4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Roe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ioe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,D4(r.key),r)}}function Moe(e,t,n){return t&&Ioe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function D4(e){var t=$oe(e,"string");return qc(t)==="symbol"?t:String(t)}function $oe(e,t){if(qc(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(qc(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Doe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d1(e,t)}function d1(e,t){return d1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},d1(e,t)}function Loe(e){var t=Foe();return function(){var r=_m(e),s;if(t){var i=_m(this).constructor;s=Reflect.construct(r,arguments,i)}else s=r.apply(this,arguments);return f1(this,s)}}function f1(e,t){if(t&&(qc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return p1(e)}function p1(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Foe(){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 _m(e){return _m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_m(e)}var ks=(function(e){Doe(n,e);var t=Loe(n);function n(r,s){var i;Roe(this,n),i=t.call(this,r,s);var o=i.props,c=o.isActive,d=o.attributeName,f=o.from,h=o.to,p=o.steps,x=o.children,g=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind(p1(i)),i.changeStyle=i.changeStyle.bind(p1(i)),!c||g<=0)return i.state={style:{}},typeof x=="function"&&(i.state={style:h}),f1(i);if(p&&p.length)i.state={style:p[0].style};else if(f){if(typeof x=="function")return i.state={style:f},f1(i);i.state={style:d?jd({},d,f):f}}else i.state={style:{}};return i}return Moe(n,[{key:"componentDidMount",value:function(){var s=this.props,i=s.isActive,o=s.canBegin;this.mounted=!0,!(!i||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(s){var i=this.props,o=i.isActive,c=i.canBegin,d=i.attributeName,f=i.shouldReAnimate,h=i.to,p=i.from,x=this.state.style;if(c){if(!o){var g={style:d?jd({},d,h):h};this.state&&x&&(d&&x[d]!==h||!d&&x!==h)&&this.setState(g);return}if(!(Vie(s.to,h)&&s.canBegin&&s.isActive)){var j=!s.canBegin||!s.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var b=j||f?p:s.to;if(this.state&&x){var y={style:d?jd({},d,b):b};(d&&x[d]!==b||!d&&x!==b)&&this.setState(y)}this.runAnimation(Va(Va({},this.props),{},{from:b,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var s=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),s&&s()}},{key:"handleStyleChange",value:function(s){this.changeStyle(s)}},{key:"changeStyle",value:function(s){this.mounted&&this.setState({style:s})}},{key:"runJSAnimation",value:function(s){var i=this,o=s.from,c=s.to,d=s.duration,f=s.easing,h=s.begin,p=s.onAnimationEnd,x=s.onAnimationStart,g=Coe(o,c,hoe(f),d,this.changeStyle),j=function(){i.stopJSAnimation=g()};this.manager.start([x,h,j,d,p])}},{key:"runStepAnimation",value:function(s){var i=this,o=s.steps,c=s.begin,d=s.onAnimationStart,f=o[0],h=f.style,p=f.duration,x=p===void 0?0:p,g=function(b,y,S){if(S===0)return b;var C=y.duration,N=y.easing,E=N===void 0?"ease":N,A=y.style,P=y.properties,O=y.onAnimationEnd,T=S>0?o[S-1]:y,$=P||Object.keys(A);if(typeof E=="function"||E==="spring")return[].concat(uj(b),[i.runJSAnimation.bind(i,{from:T.style,to:A,duration:C,easing:E}),C]);var z=cI($,C,E),q=Va(Va(Va({},T.style),A),{},{transition:z});return[].concat(uj(b),[q,C,O]).filter(noe)};return this.manager.start([d].concat(uj(o.reduce(g,[h,Math.max(x,c)])),[s.onAnimationEnd]))}},{key:"runAnimation",value:function(s){this.manager||(this.manager=Jie());var i=s.begin,o=s.duration,c=s.attributeName,d=s.to,f=s.easing,h=s.onAnimationStart,p=s.onAnimationEnd,x=s.steps,g=s.children,j=this.manager;if(this.unSubscribe=j.subscribe(this.handleStyleChange),typeof f=="function"||typeof g=="function"||f==="spring"){this.runJSAnimation(s);return}if(x.length>1){this.runStepAnimation(s);return}var b=c?jd({},c,d):d,y=cI(Object.keys(b),o,f);j.start([h,i,Va(Va({},b),{},{transition:y}),o,p])}},{key:"render",value:function(){var s=this.props,i=s.children;s.begin;var o=s.duration;s.attributeName,s.easing;var c=s.isActive;s.steps,s.from,s.to,s.canBegin,s.onAnimationEnd,s.shouldReAnimate,s.onAnimationReStart;var d=Aoe(s,_oe),f=m.Children.count(i),h=this.state.style;if(typeof i=="function")return i(h);if(!c||f===0||o<=0)return i;var p=function(g){var j=g.props,b=j.style,y=b===void 0?{}:b,S=j.className,C=m.cloneElement(g,Va(Va({},d),{},{style:Va(Va({},y),h),className:S}));return C};return f===1?p(m.Children.only(i)):Y.createElement("div",null,m.Children.map(i,function(x){return p(x)}))}}]),n})(m.PureComponent);ks.displayName="Animate";ks.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};ks.propTypes={from:un.oneOfType([un.object,un.string]),to:un.oneOfType([un.object,un.string]),attributeName:un.string,duration:un.number,begin:un.number,easing:un.oneOfType([un.string,un.func]),steps:un.arrayOf(un.shape({duration:un.number.isRequired,style:un.object.isRequired,easing:un.oneOfType([un.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),un.func]),properties:un.arrayOf("string"),onAnimationEnd:un.func})),children:un.oneOfType([un.node,un.func]),isActive:un.bool,canBegin:un.bool,onAnimationEnd:un.func,shouldReAnimate:un.bool,onAnimationStart:un.func,onAnimationReStart:un.func};function uf(e){"@babel/helpers - typeof";return uf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uf(e)}function Am(){return Am=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Am.apply(this,arguments)}function Boe(e,t){return Woe(e)||Uoe(e,t)||qoe(e,t)||zoe()}function zoe(){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 qoe(e,t){if(e){if(typeof e=="string")return mI(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 mI(e,t)}}function mI(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,s,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,s=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw s}}return c}}function Woe(e){if(Array.isArray(e))return e}function vI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function gI(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){Voe(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 Voe(e,t,n){return t=Hoe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hoe(e){var t=Koe(e,"string");return uf(t)=="symbol"?t:t+""}function Koe(e,t){if(uf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(uf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var xI=function(t,n,r,s,i){var o=Math.min(Math.abs(r)/2,Math.abs(s)/2),c=s>=0?1:-1,d=r>=0?1:-1,f=s>=0&&r>=0||s<0&&r<0?1:0,h;if(o>0&&i instanceof Array){for(var p=[0,0,0,0],x=0,g=4;x<g;x++)p[x]=i[x]>o?o:i[x];h="M".concat(t,",").concat(n+c*p[0]),p[0]>0&&(h+="A ".concat(p[0],",").concat(p[0],",0,0,").concat(f,",").concat(t+d*p[0],",").concat(n)),h+="L ".concat(t+r-d*p[1],",").concat(n),p[1]>0&&(h+="A ".concat(p[1],",").concat(p[1],",0,0,").concat(f,`,
|
|
102
|
+
`).concat(t+r,",").concat(n+c*p[1])),h+="L ".concat(t+r,",").concat(n+s-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+s)),h+="L ".concat(t+d*p[3],",").concat(n+s),p[3]>0&&(h+="A ".concat(p[3],",").concat(p[3],",0,0,").concat(f,`,
|
|
104
|
+
`).concat(t,",").concat(n+s-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+s-c*j,`
|
|
109
|
+
A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+r-d*j,",").concat(n+s,`
|
|
110
|
+
L `).concat(t+d*j,",").concat(n+s,`
|
|
111
|
+
A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t,",").concat(n+s-c*j," Z")}else h="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(s," h ").concat(-r," Z");return h},Goe=function(t,n){if(!t||!n)return!1;var r=t.x,s=t.y,i=n.x,o=n.y,c=n.width,d=n.height;if(Math.abs(c)>0&&Math.abs(d)>0){var f=Math.min(i,i+c),h=Math.max(i,i+c),p=Math.min(o,o+d),x=Math.max(o,o+d);return r>=f&&r<=h&&s>=p&&s<=x}return!1},Yoe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},kC=function(t){var n=gI(gI({},Yoe),t),r=m.useRef(),s=m.useState(-1),i=Boe(s,2),o=i[0],c=i[1];m.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var E=r.current.getTotalLength();E&&c(E)}catch{}},[]);var d=n.x,f=n.y,h=n.width,p=n.height,x=n.radius,g=n.className,j=n.animationEasing,b=n.animationDuration,y=n.animationBegin,S=n.isAnimationActive,C=n.isUpdateAnimationActive;if(d!==+d||f!==+f||h!==+h||p!==+p||h===0||p===0)return null;var N=Dt("recharts-rectangle",g);return C?Y.createElement(ks,{canBegin:o>0,from:{width:h,height:p,x:d,y:f},to:{width:h,height:p,x:d,y:f},duration:b,animationEasing:j,isActive:C},function(E){var A=E.width,P=E.height,O=E.x,T=E.y;return Y.createElement(ks,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:b,isActive:S,easing:j},Y.createElement("path",Am({},Nt(n,!0),{className:N,d:xI(O,T,A,P,x),ref:r})))}):Y.createElement("path",Am({},Nt(n,!0),{className:N,d:xI(d,f,h,p,x)}))},Xoe=["points","className","baseLinePoints","connectNulls"];function hc(){return hc=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},hc.apply(this,arguments)}function Qoe(e,t){if(e==null)return{};var n=Joe(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Joe(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 yI(e){return nle(e)||tle(e)||ele(e)||Zoe()}function Zoe(){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 ele(e,t){if(e){if(typeof e=="string")return h1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return h1(e,t)}}function tle(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function nle(e){if(Array.isArray(e))return h1(e)}function h1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var bI=function(t){return t&&t.x===+t.x&&t.y===+t.y},rle=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){bI(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),bI(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},kd=function(t,n){var r=rle(t);n&&(r=[r.reduce(function(i,o){return[].concat(yI(i),yI(o))},[])]);var s=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(s,"Z"):s},ale=function(t,n,r){var s=kd(t,r);return"".concat(s.slice(-1)==="Z"?s.slice(0,-1):s,"L").concat(kd(n.reverse(),r).slice(1))},sle=function(t){var n=t.points,r=t.className,s=t.baseLinePoints,i=t.connectNulls,o=Qoe(t,Xoe);if(!n||!n.length)return null;var c=Dt("recharts-polygon",r);if(s&&s.length){var d=o.stroke&&o.stroke!=="none",f=ale(n,s,i);return Y.createElement("g",{className:c},Y.createElement("path",hc({},Nt(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:f})),d?Y.createElement("path",hc({},Nt(o,!0),{fill:"none",d:kd(n,i)})):null,d?Y.createElement("path",hc({},Nt(o,!0),{fill:"none",d:kd(s,i)})):null)}var h=kd(n,i);return Y.createElement("path",hc({},Nt(o,!0),{fill:h.slice(-1)==="Z"?o.fill:"none",className:c,d:h}))};function m1(){return m1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m1.apply(this,arguments)}var Zv=function(t){var n=t.cx,r=t.cy,s=t.r,i=t.className,o=Dt("recharts-dot",i);return n===+n&&r===+r&&s===+s?m.createElement("circle",m1({},Nt(t,!1),Kh(t),{className:o,cx:n,cy:r,r:s})):null};function df(e){"@babel/helpers - typeof";return df=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},df(e)}var ile=["x","y","top","left","width","height","className"];function v1(){return v1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v1.apply(this,arguments)}function wI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function ole(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){lle(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 lle(e,t,n){return t=cle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cle(e){var t=ule(e,"string");return df(t)=="symbol"?t:t+""}function ule(e,t){if(df(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(df(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dle(e,t){if(e==null)return{};var n=fle(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function fle(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var ple=function(t,n,r,s,i,o){return"M".concat(t,",").concat(i,"v").concat(s,"M").concat(o,",").concat(n,"h").concat(r)},hle=function(t){var n=t.x,r=n===void 0?0:n,s=t.y,i=s===void 0?0:s,o=t.top,c=o===void 0?0:o,d=t.left,f=d===void 0?0:d,h=t.width,p=h===void 0?0:h,x=t.height,g=x===void 0?0:x,j=t.className,b=dle(t,ile),y=ole({x:r,y:i,top:c,left:f,width:p,height:g},b);return!Ke(r)||!Ke(i)||!Ke(p)||!Ke(g)||!Ke(c)||!Ke(f)?null:Y.createElement("path",v1({},Nt(y,!0),{className:Dt("recharts-cross",j),d:ple(r,i,p,g,c,f)}))},dj,jI;function mle(){if(jI)return dj;jI=1;var e=Gv(),t=ZL(),n=$s();function r(s,i){return s&&s.length?e(s,n(i,2),t):void 0}return dj=r,dj}var vle=mle();const gle=fn(vle);var fj,SI;function xle(){if(SI)return fj;SI=1;var e=Gv(),t=$s(),n=e4();function r(s,i){return s&&s.length?e(s,t(i,2),n):void 0}return fj=r,fj}var yle=xle();const ble=fn(yle);var wle=["cx","cy","angle","ticks","axisLine"],jle=["ticks","tick","angle","tickFormatter","stroke"];function Uc(e){"@babel/helpers - typeof";return Uc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uc(e)}function Od(){return Od=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},Od.apply(this,arguments)}function NI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ro(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){eg(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 CI(e,t){if(e==null)return{};var n=Sle(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Sle(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 Nle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _I(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,F4(r.key),r)}}function Cle(e,t,n){return t&&_I(e.prototype,t),n&&_I(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _le(e,t,n){return t=Em(t),Ale(e,L4()?Reflect.construct(t,n||[],Em(e).constructor):t.apply(e,n))}function Ale(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 Ele(e)}function Ele(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function L4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(L4=function(){return!!e})()}function Em(e){return Em=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Em(e)}function Ple(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g1(e,t)}function g1(e,t){return g1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},g1(e,t)}function eg(e,t,n){return t=F4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F4(e){var t=kle(e,"string");return Uc(t)=="symbol"?t:t+""}function kle(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 tg=(function(e){function t(){return Nle(this,t),_le(this,t,arguments)}return Ple(t,e),Cle(t,[{key:"getTickValueCoord",value:function(r){var s=r.coordinate,i=this.props,o=i.angle,c=i.cx,d=i.cy;return Nn(c,d,s,o)}},{key:"getTickTextAnchor",value:function(){var r=this.props.orientation,s;switch(r){case"left":s="end";break;case"right":s="start";break;default:s="middle";break}return s}},{key:"getViewBox",value:function(){var r=this.props,s=r.cx,i=r.cy,o=r.angle,c=r.ticks,d=gle(c,function(h){return h.coordinate||0}),f=ble(c,function(h){return h.coordinate||0});return{cx:s,cy:i,startAngle:o,endAngle:o,innerRadius:f.coordinate||0,outerRadius:d.coordinate||0}}},{key:"renderAxisLine",value:function(){var r=this.props,s=r.cx,i=r.cy,o=r.angle,c=r.ticks,d=r.axisLine,f=CI(r,wle),h=c.reduce(function(j,b){return[Math.min(j[0],b.coordinate),Math.max(j[1],b.coordinate)]},[1/0,-1/0]),p=Nn(s,i,h[0],o),x=Nn(s,i,h[1],o),g=Ro(Ro(Ro({},Nt(f,!1)),{},{fill:"none"},Nt(d,!1)),{},{x1:p.x,y1:p.y,x2:x.x,y2:x.y});return Y.createElement("line",Od({className:"recharts-polar-radius-axis-line"},g))}},{key:"renderTicks",value:function(){var r=this,s=this.props,i=s.ticks,o=s.tick,c=s.angle,d=s.tickFormatter,f=s.stroke,h=CI(s,jle),p=this.getTickTextAnchor(),x=Nt(h,!1),g=Nt(o,!1),j=i.map(function(b,y){var S=r.getTickValueCoord(b),C=Ro(Ro(Ro(Ro({textAnchor:p,transform:"rotate(".concat(90-c,", ").concat(S.x,", ").concat(S.y,")")},x),{},{stroke:"none",fill:f},g),{},{index:y},S),{},{payload:b});return Y.createElement(nn,Od({className:Dt("recharts-polar-radius-axis-tick",A4(o)),key:"tick-".concat(b.coordinate)},nl(r.props,b,y)),t.renderTickItem(o,C,d?d(b.value,y):b.value))});return Y.createElement(nn,{className:"recharts-polar-radius-axis-ticks"},j)}},{key:"render",value:function(){var r=this.props,s=r.ticks,i=r.axisLine,o=r.tick;return!s||!s.length?null:Y.createElement(nn,{className:Dt("recharts-polar-radius-axis",this.props.className)},i&&this.renderAxisLine(),o&&this.renderTicks(),ur.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,s,i){var o;return Y.isValidElement(r)?o=Y.cloneElement(r,s):Mt(r)?o=r(s):o=Y.createElement(rl,Od({},s,{className:"recharts-polar-radius-axis-tick-value"}),i),o}}])})(m.PureComponent);eg(tg,"displayName","PolarRadiusAxis");eg(tg,"axisType","radiusAxis");eg(tg,"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 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 Bo(){return Bo=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},Bo.apply(this,arguments)}function AI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Io(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AI(Object(n),!0).forEach(function(r){ng(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ole(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function EI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,z4(r.key),r)}}function Tle(e,t,n){return t&&EI(e.prototype,t),n&&EI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Rle(e,t,n){return t=Pm(t),Ile(e,B4()?Reflect.construct(t,n||[],Pm(e).constructor):t.apply(e,n))}function Ile(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 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 B4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(B4=function(){return!!e})()}function Pm(e){return Pm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Pm(e)}function $le(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x1(e,t)}function x1(e,t){return x1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},x1(e,t)}function ng(e,t,n){return t=z4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z4(e){var t=Dle(e,"string");return Wc(t)=="symbol"?t:t+""}function Dle(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(t==="string"?String:Number)(e)}var Lle=Math.PI/180,PI=1e-5,rg=(function(e){function t(){return Ole(this,t),Rle(this,t,arguments)}return $le(t,e),Tle(t,[{key:"getTickLineCoord",value:function(r){var s=this.props,i=s.cx,o=s.cy,c=s.radius,d=s.orientation,f=s.tickSize,h=f||8,p=Nn(i,o,c,r.coordinate),x=Nn(i,o,c+(d==="inner"?-1:1)*h,r.coordinate);return{x1:p.x,y1:p.y,x2:x.x,y2:x.y}}},{key:"getTickTextAnchor",value:function(r){var s=this.props.orientation,i=Math.cos(-r.coordinate*Lle),o;return i>PI?o=s==="outer"?"start":"end":i<-PI?o=s==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var r=this.props,s=r.cx,i=r.cy,o=r.radius,c=r.axisLine,d=r.axisLineType,f=Io(Io({},Nt(this.props,!1)),{},{fill:"none"},Nt(c,!1));if(d==="circle")return Y.createElement(Zv,Bo({className:"recharts-polar-angle-axis-line"},f,{cx:s,cy:i,r:o}));var h=this.props.ticks,p=h.map(function(x){return Nn(s,i,o,x.coordinate)});return Y.createElement(sle,Bo({className:"recharts-polar-angle-axis-line"},f,{points:p}))}},{key:"renderTicks",value:function(){var r=this,s=this.props,i=s.ticks,o=s.tick,c=s.tickLine,d=s.tickFormatter,f=s.stroke,h=Nt(this.props,!1),p=Nt(o,!1),x=Io(Io({},h),{},{fill:"none"},Nt(c,!1)),g=i.map(function(j,b){var y=r.getTickLineCoord(j),S=r.getTickTextAnchor(j),C=Io(Io(Io({textAnchor:S},h),{},{stroke:"none",fill:f},p),{},{index:b,payload:j,x:y.x2,y:y.y2});return Y.createElement(nn,Bo({className:Dt("recharts-polar-angle-axis-tick",A4(o)),key:"tick-".concat(j.coordinate)},nl(r.props,j,b)),c&&Y.createElement("line",Bo({className:"recharts-polar-angle-axis-tick-line"},x,y)),o&&t.renderTickItem(o,C,d?d(j.value,b):j.value))});return Y.createElement(nn,{className:"recharts-polar-angle-axis-ticks"},g)}},{key:"render",value:function(){var r=this.props,s=r.ticks,i=r.radius,o=r.axisLine;return i<=0||!s||!s.length?null:Y.createElement(nn,{className:Dt("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,s,i){var o;return Y.isValidElement(r)?o=Y.cloneElement(r,s):Mt(r)?o=r(s):o=Y.createElement(rl,Bo({},s,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])})(m.PureComponent);ng(rg,"displayName","PolarAngleAxis");ng(rg,"axisType","angleAxis");ng(rg,"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 pj,kI;function Fle(){if(kI)return pj;kI=1;var e=Z3(),t=e(Object.getPrototypeOf,Object);return pj=t,pj}var hj,OI;function Ble(){if(OI)return hj;OI=1;var e=gi(),t=Fle(),n=xi(),r="[object Object]",s=Function.prototype,i=Object.prototype,o=s.toString,c=i.hasOwnProperty,d=o.call(Object);function f(h){if(!n(h)||e(h)!=r)return!1;var p=t(h);if(p===null)return!0;var x=c.call(p,"constructor")&&p.constructor;return typeof x=="function"&&x instanceof x&&o.call(x)==d}return hj=f,hj}var zle=Ble();const qle=fn(zle);var mj,TI;function Ule(){if(TI)return mj;TI=1;var e=gi(),t=xi(),n="[object Boolean]";function r(s){return s===!0||s===!1||t(s)&&e(s)==n}return mj=r,mj}var Wle=Ule();const Vle=fn(Wle);function ff(e){"@babel/helpers - typeof";return ff=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},ff(e)}function km(){return km=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},km.apply(this,arguments)}function Hle(e,t){return Xle(e)||Yle(e,t)||Gle(e,t)||Kle()}function Kle(){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 Gle(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 Yle(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,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,s=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw s}}return c}}function Xle(e){if(Array.isArray(e))return e}function II(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function MI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?II(Object(n),!0).forEach(function(r){Qle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):II(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qle(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=Zle(e,"string");return ff(t)=="symbol"?t:t+""}function Zle(e,t){if(ff(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ff(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $I=function(t,n,r,s,i){var o=r-s,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-s,",").concat(n+i),c+="L ".concat(t,",").concat(n," Z"),c},ece={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},tce=function(t){var n=MI(MI({},ece),t),r=m.useRef(),s=m.useState(-1),i=Hle(s,2),o=i[0],c=i[1];m.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var N=r.current.getTotalLength();N&&c(N)}catch{}},[]);var d=n.x,f=n.y,h=n.upperWidth,p=n.lowerWidth,x=n.height,g=n.className,j=n.animationEasing,b=n.animationDuration,y=n.animationBegin,S=n.isUpdateAnimationActive;if(d!==+d||f!==+f||h!==+h||p!==+p||x!==+x||h===0&&p===0||x===0)return null;var C=Dt("recharts-trapezoid",g);return S?Y.createElement(ks,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:x,x:d,y:f},to:{upperWidth:h,lowerWidth:p,height:x,x:d,y:f},duration:b,animationEasing:j,isActive:S},function(N){var E=N.upperWidth,A=N.lowerWidth,P=N.height,O=N.x,T=N.y;return Y.createElement(ks,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:b,easing:j},Y.createElement("path",km({},Nt(n,!0),{className:C,d:$I(O,T,E,A,P),ref:r})))}):Y.createElement("g",null,Y.createElement("path",km({},Nt(n,!0),{className:C,d:$I(d,f,h,p,x)})))},nce=["option","shapeType","propTransformer","activeClassName","isActive"];function pf(e){"@babel/helpers - typeof";return pf=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},pf(e)}function rce(e,t){if(e==null)return{};var n=ace(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ace(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 DI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Om(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DI(Object(n),!0).forEach(function(r){sce(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 sce(e,t,n){return t=ice(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ice(e){var t=oce(e,"string");return pf(t)=="symbol"?t:t+""}function oce(e,t){if(pf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(pf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lce(e,t){return Om(Om({},t),e)}function cce(e,t){return e==="symbols"}function LI(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return Y.createElement(kC,n);case"trapezoid":return Y.createElement(tce,n);case"sector":return Y.createElement(k4,n);case"symbols":if(cce(t))return Y.createElement(YN,n);break;default:return null}}function uce(e){return m.isValidElement(e)?e.props:e}function q4(e){var t=e.option,n=e.shapeType,r=e.propTransformer,s=r===void 0?lce:r,i=e.activeClassName,o=i===void 0?"recharts-active-shape":i,c=e.isActive,d=rce(e,nce),f;if(m.isValidElement(t))f=m.cloneElement(t,Om(Om({},d),uce(t)));else if(Mt(t))f=t(d);else if(qle(t)&&!Vle(t)){var h=s(t,d);f=Y.createElement(LI,{shapeType:n,elementProps:h})}else{var p=d;f=Y.createElement(LI,{shapeType:n,elementProps:p})}return c?Y.createElement(nn,{className:o},f):f}function ag(e,t){return t!=null&&"trapezoids"in e.props}function sg(e,t){return t!=null&&"sectors"in e.props}function hf(e,t){return t!=null&&"points"in e.props}function dce(e,t){var n,r,s=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 s&&i}function fce(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function pce(e,t){var n=e.x===t.x,r=e.y===t.y,s=e.z===t.z;return n&&r&&s}function hce(e,t){var n;return ag(e,t)?n=dce:sg(e,t)?n=fce:hf(e,t)&&(n=pce),n}function mce(e,t){var n;return ag(e,t)?n="trapezoids":sg(e,t)?n="sectors":hf(e,t)&&(n="points"),n}function vce(e,t){if(ag(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(sg(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 hf(e,t)?t.payload:{}}function gce(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,s=mce(n,t),i=vce(n,t),o=r.filter(function(d,f){var h=Uf(i,d),p=n.props[s].filter(function(j){var b=hce(n,t);return b(j,t)}),x=n.props[s].indexOf(p[p.length-1]),g=f===x;return h&&g}),c=r.indexOf(o[o.length-1]);return c}var Ih;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 mc(){return mc=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},mc.apply(this,arguments)}function FI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function bn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FI(Object(n),!0).forEach(function(r){Aa(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function BI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,W4(r.key),r)}}function yce(e,t,n){return t&&BI(e.prototype,t),n&&BI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function bce(e,t,n){return t=Tm(t),wce(e,U4()?Reflect.construct(t,n||[],Tm(e).constructor):t.apply(e,n))}function wce(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 jce(e)}function jce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function U4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(U4=function(){return!!e})()}function Tm(e){return Tm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Tm(e)}function Sce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&y1(e,t)}function y1(e,t){return y1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},y1(e,t)}function Aa(e,t,n){return t=W4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W4(e){var t=Nce(e,"string");return Vc(t)=="symbol"?t:t+""}function Nce(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 bi=(function(e){function t(n){var r;return xce(this,t),r=bce(this,t,[n]),Aa(r,"pieRef",null),Aa(r,"sectorRefs",[]),Aa(r,"id",xu("recharts-pie-")),Aa(r,"handleAnimationEnd",function(){var s=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),Mt(s)&&s()}),Aa(r,"handleAnimationStart",function(){var s=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),Mt(s)&&s()}),r.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},r}return Sce(t,e),yce(t,[{key:"isActiveIndex",value:function(r){var s=this.props.activeIndex;return Array.isArray(s)?s.indexOf(r)!==-1:r===s}},{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 s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.label,c=i.labelLine,d=i.dataKey,f=i.valueKey,h=Nt(this.props,!1),p=Nt(o,!1),x=Nt(c,!1),g=o&&o.offsetRadius||20,j=r.map(function(b,y){var S=(b.startAngle+b.endAngle)/2,C=Nn(b.cx,b.cy,b.outerRadius+g,S),N=bn(bn(bn(bn({},h),b),{},{stroke:"none"},p),{},{index:y,textAnchor:t.getTextAnchor(C.x,b.cx)},C),E=bn(bn(bn(bn({},h),b),{},{fill:"none",stroke:b.fill},x),{},{index:y,points:[Nn(b.cx,b.cy,b.outerRadius,S),C]}),A=d;return $t(d)&&$t(f)?A="value":$t(d)&&(A=f),Y.createElement(nn,{key:"label-".concat(b.startAngle,"-").concat(b.endAngle,"-").concat(b.midAngle,"-").concat(y)},c&&t.renderLabelLineItem(c,E,"line"),t.renderLabelItem(o,N,er(b,A)))});return Y.createElement(nn,{className:"recharts-pie-labels"},j)}},{key:"renderSectorsStatically",value:function(r){var s=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=s.isActiveIndex(h),x=d&&s.hasActiveIndex()?d:null,g=p?o:x,j=bn(bn({},f),{},{stroke:c?f.fill:f.stroke,tabIndex:-1});return Y.createElement(nn,mc({ref:function(y){y&&!s.sectorRefs.includes(y)&&s.sectorRefs.push(y)},tabIndex:-1,className:"recharts-pie-sector"},nl(s.props,f,h),{key:"sector-".concat(f?.startAngle,"-").concat(f?.endAngle,"-").concat(f.midAngle,"-").concat(h)}),Y.createElement(q4,mc({option:g,isActive:p,shapeType:"sector"},j)))})}},{key:"renderSectorsWithAnimation",value:function(){var r=this,s=this.props,i=s.sectors,o=s.isAnimationActive,c=s.animationBegin,d=s.animationDuration,f=s.animationEasing,h=s.animationId,p=this.state,x=p.prevSectors,g=p.prevIsAnimationActive;return Y.createElement(ks,{begin:c,duration:d,isActive:o,easing:f,from:{t:0},to:{t:1},key:"pie-".concat(h,"-").concat(g),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(j){var b=j.t,y=[],S=i&&i[0],C=S.startAngle;return i.forEach(function(N,E){var A=x&&x[E],P=E>0?fa(N,"paddingAngle",0):0;if(A){var O=la(A.endAngle-A.startAngle,N.endAngle-N.startAngle),T=bn(bn({},N),{},{startAngle:C+P,endAngle:C+O(b)+P});y.push(T),C=T.endAngle}else{var $=N.endAngle,z=N.startAngle,q=la(0,$-z),F=q(b),H=bn(bn({},N),{},{startAngle:C+P,endAngle:C+F+P});y.push(H),C=H.endAngle}}),Y.createElement(nn,null,r.renderSectorsStatically(y))})}},{key:"attachKeyboardHandlers",value:function(r){var s=this;r.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var o=++s.state.sectorToFocus%s.sectorRefs.length;s.sectorRefs[o].focus(),s.setState({sectorToFocus:o});break}case"ArrowRight":{var c=--s.state.sectorToFocus<0?s.sectorRefs.length-1:s.state.sectorToFocus%s.sectorRefs.length;s.sectorRefs[c].focus(),s.setState({sectorToFocus:c});break}case"Escape":{s.sectorRefs[s.state.sectorToFocus].blur(),s.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,s=r.sectors,i=r.isAnimationActive,o=this.state.prevSectors;return i&&s&&s.length&&(!o||!Uf(o,s))?this.renderSectorsWithAnimation():this.renderSectorsStatically(s)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,s=this.props,i=s.hide,o=s.sectors,c=s.className,d=s.label,f=s.cx,h=s.cy,p=s.innerRadius,x=s.outerRadius,g=s.isAnimationActive,j=this.state.isAnimationFinished;if(i||!o||!o.length||!Ke(f)||!Ke(h)||!Ke(p)||!Ke(x))return null;var b=Dt("recharts-pie",c);return Y.createElement(nn,{tabIndex:this.props.rootTabIndex,className:b,ref:function(S){r.pieRef=S}},this.renderSectors(),d&&this.renderLabels(o),ur.renderCallByParent(this.props,null,!1),(!g||j)&&si.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return s.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:s.curSectors,isAnimationFinished:!0}:r.sectors!==s.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,s){return r>s?"start":r<s?"end":"middle"}},{key:"renderLabelLineItem",value:function(r,s,i){if(Y.isValidElement(r))return Y.cloneElement(r,s);if(Mt(r))return r(s);var o=Dt("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return Y.createElement(jm,mc({},s,{key:i,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(r,s,i){if(Y.isValidElement(r))return Y.cloneElement(r,s);var o=i;if(Mt(r)&&(o=r(s),Y.isValidElement(o)))return o;var c=Dt("recharts-pie-label-text",typeof r!="boolean"&&!Mt(r)?r.className:"");return Y.createElement(rl,mc({},s,{alignmentBaseline:"middle",className:c}),o)}}])})(m.PureComponent);Ih=bi;Aa(bi,"displayName","Pie");Aa(bi,"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:!wl.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});Aa(bi,"parseDeltaAngle",function(e,t){var n=_r(t-e),r=Math.min(Math.abs(t-e),360);return n*r});Aa(bi,"getRealPieData",function(e){var t=e.data,n=e.children,r=Nt(e,!1),s=pa(n,zv);return t&&t.length?t.map(function(i,o){return bn(bn(bn({payload:i},r),i),s&&s[o]&&s[o].props)}):s&&s.length?s.map(function(i){return bn(bn({},r),i.props)}):[]});Aa(bi,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,s=t.width,i=t.height,o=_4(s,i),c=r+Ar(e.cx,s,s/2),d=n+Ar(e.cy,i,i/2),f=Ar(e.innerRadius,o,0),h=Ar(e.outerRadius,o,o*.8),p=e.maxRadius||Math.sqrt(s*s+i*i)/2;return{cx:c,cy:d,innerRadius:f,outerRadius:h,maxRadius:p}});Aa(bi,"getComposedData",function(e){var t=e.item,n=e.offset,r=t.type.defaultProps!==void 0?bn(bn({},t.type.defaultProps),t.props):t.props,s=Ih.getRealPieData(r);if(!s||!s.length)return null;var i=r.cornerRadius,o=r.startAngle,c=r.endAngle,d=r.paddingAngle,f=r.dataKey,h=r.nameKey,p=r.valueKey,x=r.tooltipType,g=Math.abs(r.minAngle),j=Ih.parseCoordinateOfPie(r,n),b=Ih.parseDeltaAngle(o,c),y=Math.abs(b),S=f;$t(f)&&$t(p)?(ri(!1,`Use "dataKey" to specify the value of pie,
|
|
114
|
+
the props "valueKey" will be deprecated in 1.1.0`),S="value"):$t(f)&&(ri(!1,`Use "dataKey" to specify the value of pie,
|
|
115
|
+
the props "valueKey" will be deprecated in 1.1.0`),S=p);var C=s.filter(function(T){return er(T,S,0)!==0}).length,N=(y>=360?C:C-1)*d,E=y-C*g-N,A=s.reduce(function(T,$){var z=er($,S,0);return T+(Ke(z)?z:0)},0),P;if(A>0){var O;P=s.map(function(T,$){var z=er(T,S,0),q=er(T,h,$),F=(Ke(z)?z:0)/A,H;$?H=O.endAngle+_r(b)*d*(z!==0?1:0):H=o;var U=H+_r(b)*((z!==0?g:0)+F*E),R=(H+U)/2,W=(j.innerRadius+j.outerRadius)/2,X=[{name:q,value:z,payload:T,dataKey:S,type:x}],G=Nn(j.cx,j.cy,W,R);return O=bn(bn(bn({percent:F,cornerRadius:i,name:q,tooltipPayload:X,midAngle:R,middleRadius:W,tooltipPosition:G},T),j),{},{value:er(T,S),startAngle:H,endAngle:U,payload:T,paddingAngle:_r(b)*d}),O})}return bn(bn({},j),{},{sectors:P,data:s})});var vj,zI;function Cce(){if(zI)return vj;zI=1;var e=Math.ceil,t=Math.max;function n(r,s,i,o){for(var c=-1,d=t(e((s-r)/(i||1)),0),f=Array(d);d--;)f[o?d:++c]=r,r+=i;return f}return vj=n,vj}var gj,qI;function V4(){if(qI)return gj;qI=1;var e=mL(),t=1/0,n=17976931348623157e292;function r(s){if(!s)return s===0?s:0;if(s=e(s),s===t||s===-t){var i=s<0?-1:1;return i*n}return s===s?s:0}return gj=r,gj}var xj,UI;function _ce(){if(UI)return xj;UI=1;var e=Cce(),t=Bv(),n=V4();function r(s){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,s)}}return xj=r,xj}var yj,WI;function Ace(){if(WI)return yj;WI=1;var e=_ce(),t=e();return yj=t,yj}var Ece=Ace();const Rm=fn(Ece);function mf(e){"@babel/helpers - typeof";return mf=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},mf(e)}function VI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function HI(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){H4(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 H4(e,t,n){return t=Pce(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pce(e){var t=kce(e,"string");return mf(t)=="symbol"?t:t+""}function kce(e,t){if(mf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(mf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Oce=["Webkit","Moz","O","ms"],Tce=function(t,n){var r=t.replace(/(\w)/,function(i){return i.toUpperCase()}),s=Oce.reduce(function(i,o){return HI(HI({},i),{},H4({},o+r,n))},{});return s[t]=n,s};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 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 KI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function bj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KI(Object(n),!0).forEach(function(r){sa(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function GI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,G4(r.key),r)}}function Ice(e,t,n){return t&&GI(e.prototype,t),n&&GI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Mce(e,t,n){return t=Mm(t),$ce(e,K4()?Reflect.construct(t,n||[],Mm(e).constructor):t.apply(e,n))}function $ce(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 Dce(e)}function Dce(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 Mm(e){return Mm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Mm(e)}function Lce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&b1(e,t)}function b1(e,t){return b1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},b1(e,t)}function sa(e,t,n){return t=G4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G4(e){var t=Fce(e,"string");return Hc(t)=="symbol"?t:t+""}function Fce(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 Bce=function(t){var n=t.data,r=t.startIndex,s=t.endIndex,i=t.x,o=t.width,c=t.travellerWidth;if(!n||!n.length)return{};var d=n.length,f=Ad().domain(Rm(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(s),scale:f,scaleValues:h}},YI=function(t){return t.changedTouches&&!!t.changedTouches.length},Kc=(function(e){function t(n){var r;return Rce(this,t),r=Mce(this,t,[n]),sa(r,"handleDrag",function(s){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(s):r.state.isSlideMoving&&r.handleSlideDrag(s)}),sa(r,"handleTouchMove",function(s){s.changedTouches!=null&&s.changedTouches.length>0&&r.handleDrag(s.changedTouches[0])}),sa(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var s=r.props,i=s.endIndex,o=s.onDragEnd,c=s.startIndex;o?.({endIndex:i,startIndex:c})}),r.detachDragEndListener()}),sa(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),sa(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),sa(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),sa(r,"handleSlideDragStart",function(s){var i=YI(s)?s.changedTouches[0]:s;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 Lce(t,e),Ice(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var s=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(s,i),x=Math.max(s,i),g=t.getIndexInRange(o,p),j=t.getIndexInRange(o,x);return{startIndex:g-g%d,endIndex:j===h?h:j-j%d}}},{key:"getTextOfTick",value:function(r){var s=this.props,i=s.data,o=s.tickFormatter,c=s.dataKey,d=er(i[r],c,r);return Mt(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 s=this.state,i=s.slideMoveStartX,o=s.startX,c=s.endX,d=this.props,f=d.x,h=d.width,p=d.travellerWidth,x=d.startIndex,g=d.endIndex,j=d.onChange,b=r.pageX-i;b>0?b=Math.min(b,f+h-p-c,f+h-p-o):b<0&&(b=Math.max(b,f-o,f-c));var y=this.getIndex({startX:o+b,endX:c+b});(y.startIndex!==x||y.endIndex!==g)&&j&&j(y),this.setState({startX:o+b,endX:c+b,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,s){var i=YI(s)?s.changedTouches[0]:s;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var s=this.state,i=s.brushMoveStartX,o=s.movingTravellerId,c=s.endX,d=s.startX,f=this.state[o],h=this.props,p=h.x,x=h.width,g=h.travellerWidth,j=h.onChange,b=h.gap,y=h.data,S={startX:this.state.startX,endX:this.state.endX},C=r.pageX-i;C>0?C=Math.min(C,p+x-g-f):C<0&&(C=Math.max(C,p-f)),S[o]=f+C;var N=this.getIndex(S),E=N.startIndex,A=N.endIndex,P=function(){var T=y.length-1;return o==="startX"&&(c>d?E%b===0:A%b===0)||c<d&&A===T||o==="endX"&&(c>d?A%b===0:E%b===0)||c>d&&A===T};this.setState(sa(sa({},o,f+C),"brushMoveStartX",r.pageX),function(){j&&P()&&j(N)})}},{key:"handleTravellerMoveKeyboard",value:function(r,s){var i=this,o=this.state,c=o.scaleValues,d=o.startX,f=o.endX,h=this.state[s],p=c.indexOf(h);if(p!==-1){var x=p+r;if(!(x===-1||x>=c.length)){var g=c[x];s==="startX"&&g>=f||s==="endX"&&g<=d||this.setState(sa({},s,g),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,s=r.x,i=r.y,o=r.width,c=r.height,d=r.fill,f=r.stroke;return Y.createElement("rect",{stroke:f,fill:d,x:s,y:i,width:o,height:c})}},{key:"renderPanorama",value:function(){var r=this.props,s=r.x,i=r.y,o=r.width,c=r.height,d=r.data,f=r.children,h=r.padding,p=m.Children.only(f);return p?Y.cloneElement(p,{x:s,y:i,width:o,height:c,margin:h,compact:!0,data:d}):null}},{key:"renderTravellerLayer",value:function(r,s){var i,o,c=this,d=this.props,f=d.y,h=d.travellerWidth,p=d.height,x=d.traveller,g=d.ariaLabel,j=d.data,b=d.startIndex,y=d.endIndex,S=Math.max(r,this.props.x),C=bj(bj({},Nt(this.props,!1)),{},{x:S,y:f,width:h,height:p}),N=g||"Min value: ".concat((i=j[b])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=j[y])===null||o===void 0?void 0:o.name);return Y.createElement(nn,{tabIndex:0,role:"slider","aria-label":N,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[s],onTouchStart:this.travellerDragStartHandlers[s],onKeyDown:function(A){["ArrowLeft","ArrowRight"].includes(A.key)&&(A.preventDefault(),A.stopPropagation(),c.handleTravellerMoveKeyboard(A.key==="ArrowRight"?1:-1,s))},onFocus:function(){c.setState({isTravellerFocused:!0})},onBlur:function(){c.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(x,C))}},{key:"renderSlide",value:function(r,s){var i=this.props,o=i.y,c=i.height,d=i.stroke,f=i.travellerWidth,h=Math.min(r,s)+f,p=Math.max(Math.abs(s-r)-f,0);return Y.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,s=r.startIndex,i=r.endIndex,o=r.y,c=r.height,d=r.travellerWidth,f=r.stroke,h=this.state,p=h.startX,x=h.endX,g=5,j={pointerEvents:"none",fill:f};return Y.createElement(nn,{className:"recharts-brush-texts"},Y.createElement(rl,Im({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,x)-g,y:o+c/2},j),this.getTextOfTick(s)),Y.createElement(rl,Im({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,x)+d+g,y:o+c/2},j),this.getTextOfTick(i)))}},{key:"render",value:function(){var r=this.props,s=r.data,i=r.className,o=r.children,c=r.x,d=r.y,f=r.width,h=r.height,p=r.alwaysShowText,x=this.state,g=x.startX,j=x.endX,b=x.isTextActive,y=x.isSlideMoving,S=x.isTravellerMoving,C=x.isTravellerFocused;if(!s||!s.length||!Ke(c)||!Ke(d)||!Ke(f)||!Ke(h)||f<=0||h<=0)return null;var N=Dt("recharts-brush",i),E=Y.Children.count(o)===1,A=Tce("userSelect","none");return Y.createElement(nn,{className:N,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:A},this.renderBackground(),E&&this.renderPanorama(),this.renderSlide(g,j),this.renderTravellerLayer(g,"startX"),this.renderTravellerLayer(j,"endX"),(b||y||S||C||p)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var s=r.x,i=r.y,o=r.width,c=r.height,d=r.stroke,f=Math.floor(i+c/2)-1;return Y.createElement(Y.Fragment,null,Y.createElement("rect",{x:s,y:i,width:o,height:c,fill:d,stroke:"none"}),Y.createElement("line",{x1:s+1,y1:f,x2:s+o-1,y2:f,fill:"none",stroke:"#fff"}),Y.createElement("line",{x1:s+1,y1:f+2,x2:s+o-1,y2:f+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,s){var i;return Y.isValidElement(r)?i=Y.cloneElement(r,s):Mt(r)?i=r(s):i=t.renderDefaultTraveller(s),i}},{key:"getDerivedStateFromProps",value:function(r,s){var i=r.data,o=r.width,c=r.x,d=r.travellerWidth,f=r.updateId,h=r.startIndex,p=r.endIndex;if(i!==s.prevData||f!==s.prevUpdateId)return bj({prevData:i,prevTravellerWidth:d,prevUpdateId:f,prevX:c,prevWidth:o},i&&i.length?Bce({data:i,width:o,x:c,travellerWidth:d,startIndex:h,endIndex:p}):{scale:null,scaleValues:null});if(s.scale&&(o!==s.prevWidth||c!==s.prevX||d!==s.prevTravellerWidth)){s.scale.range([c,c+o-d]);var x=s.scale.domain().map(function(g){return s.scale(g)});return{prevData:i,prevTravellerWidth:d,prevUpdateId:f,prevX:c,prevWidth:o,startX:s.scale(r.startIndex),endX:s.scale(r.endIndex),scaleValues:x}}return null}},{key:"getIndexInRange",value:function(r,s){for(var i=r.length,o=0,c=i-1;c-o>1;){var d=Math.floor((o+c)/2);r[d]>s?c=d:o=d}return s>=r[c]?c:o}}])})(m.PureComponent);sa(Kc,"displayName","Brush");sa(Kc,"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 wj,XI;function zce(){if(XI)return wj;XI=1;var e=nC();function t(n,r){var s;return e(n,function(i,o,c){return s=r(i,o,c),!s}),!!s}return wj=t,wj}var jj,QI;function qce(){if(QI)return jj;QI=1;var e=H3(),t=$s(),n=zce(),r=Xr(),s=Bv();function i(o,c,d){var f=r(o)?e:n;return d&&s(o,c,d)&&(c=void 0),f(o,t(c,3))}return jj=i,jj}var Uce=qce();const Wce=fn(Uce);var Ns=function(t,n){var r=t.alwaysShow,s=t.ifOverflow;return r&&(s="extendDomain"),s===n},Sj,JI;function Vce(){if(JI)return Sj;JI=1;var e=uL();function t(n,r,s){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:s,writable:!0}):n[r]=s}return Sj=t,Sj}var Nj,ZI;function Hce(){if(ZI)return Nj;ZI=1;var e=Vce(),t=lL(),n=$s();function r(s,i){var o={};return i=n(i,3),t(s,function(c,d,f){e(o,d,i(c,d,f))}),o}return Nj=r,Nj}var Kce=Hce();const Gce=fn(Kce);var Cj,eM;function Yce(){if(eM)return Cj;eM=1;function e(t,n){for(var r=-1,s=t==null?0:t.length;++r<s;)if(!n(t[r],r,t))return!1;return!0}return Cj=e,Cj}var _j,tM;function Xce(){if(tM)return _j;tM=1;var e=nC();function t(n,r){var s=!0;return e(n,function(i,o,c){return s=!!r(i,o,c),s}),s}return _j=t,_j}var Aj,nM;function Qce(){if(nM)return Aj;nM=1;var e=Yce(),t=Xce(),n=$s(),r=Xr(),s=Bv();function i(o,c,d){var f=r(o)?e:t;return d&&s(o,c,d)&&(c=void 0),f(o,n(c,3))}return Aj=i,Aj}var Jce=Qce();const Zce=fn(Jce);var eue=["x","y"];function vf(e){"@babel/helpers - typeof";return vf=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},vf(e)}function w1(){return w1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w1.apply(this,arguments)}function rM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function gd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rM(Object(n),!0).forEach(function(r){tue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tue(e,t,n){return t=nue(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nue(e){var t=rue(e,"string");return vf(t)=="symbol"?t:t+""}function rue(e,t){if(vf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(vf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function aue(e,t){if(e==null)return{};var n=sue(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function sue(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 iue(e,t){var n=e.x,r=e.y,s=aue(e,eue),i="".concat(n),o=parseInt(i,10),c="".concat(r),d=parseInt(c,10),f="".concat(t.height||s.height),h=parseInt(f,10),p="".concat(t.width||s.width),x=parseInt(p,10);return gd(gd(gd(gd(gd({},t),s),o?{x:o}:{}),d?{y:d}:{}),{},{height:h,width:x,name:t.name,radius:t.radius})}function aM(e){return Y.createElement(q4,w1({shapeType:"rectangle",propTransformer:iue,activeClassName:"recharts-active-bar"},e))}var oue=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,s){if(typeof t=="number")return t;var i=Ke(r)||_X(r);return i?t(r,s):(i||sl(),n)}},lue=["value","background"],Y4;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 cue(e,t){if(e==null)return{};var n=uue(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function uue(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function $m(){return $m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$m.apply(this,arguments)}function sM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Kn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sM(Object(n),!0).forEach(function(r){Xi(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function due(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iM(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Q4(r.key),r)}}function fue(e,t,n){return t&&iM(e.prototype,t),n&&iM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function pue(e,t,n){return t=Dm(t),hue(e,X4()?Reflect.construct(t,n||[],Dm(e).constructor):t.apply(e,n))}function hue(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 mue(e)}function mue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function 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 vue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&j1(e,t)}function j1(e,t){return j1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},j1(e,t)}function Xi(e,t,n){return t=Q4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Q4(e){var t=gue(e,"string");return Gc(t)=="symbol"?t:t+""}function gue(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 Cl=(function(e){function t(){var n;due(this,t);for(var r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return n=pue(this,t,[].concat(s)),Xi(n,"state",{isAnimationFinished:!1}),Xi(n,"id",xu("recharts-bar-")),Xi(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),Xi(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return vue(t,e),fue(t,[{key:"renderRectanglesStatically",value:function(r){var s=this,i=this.props,o=i.shape,c=i.dataKey,d=i.activeIndex,f=i.activeBar,h=Nt(this.props,!1);return r&&r.map(function(p,x){var g=x===d,j=g?f:o,b=Kn(Kn(Kn({},h),p),{},{isActive:g,option:j,index:x,dataKey:c,onAnimationStart:s.handleAnimationStart,onAnimationEnd:s.handleAnimationEnd});return Y.createElement(nn,$m({className:"recharts-bar-rectangle"},nl(s.props,p,x),{key:"rectangle-".concat(p?.x,"-").concat(p?.y,"-").concat(p?.value,"-").concat(x)}),Y.createElement(aM,b))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,s=this.props,i=s.data,o=s.layout,c=s.isAnimationActive,d=s.animationBegin,f=s.animationDuration,h=s.animationEasing,p=s.animationId,x=this.state.prevData;return Y.createElement(ks,{begin:d,duration:f,isActive:c,easing:h,from:{t:0},to:{t:1},key:"bar-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(g){var j=g.t,b=i.map(function(y,S){var C=x&&x[S];if(C){var N=la(C.x,y.x),E=la(C.y,y.y),A=la(C.width,y.width),P=la(C.height,y.height);return Kn(Kn({},y),{},{x:N(j),y:E(j),width:A(j),height:P(j)})}if(o==="horizontal"){var O=la(0,y.height),T=O(j);return Kn(Kn({},y),{},{y:y.y+y.height-T,height:T})}var $=la(0,y.width),z=$(j);return Kn(Kn({},y),{},{width:z})});return Y.createElement(nn,null,r.renderRectanglesStatically(b))})}},{key:"renderRectangles",value:function(){var r=this.props,s=r.data,i=r.isAnimationActive,o=this.state.prevData;return i&&s&&s.length&&(!o||!Uf(o,s))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(s)}},{key:"renderBackground",value:function(){var r=this,s=this.props,i=s.data,o=s.dataKey,c=s.activeIndex,d=Nt(this.props.background,!1);return i.map(function(f,h){f.value;var p=f.background,x=cue(f,lue);if(!p)return null;var g=Kn(Kn(Kn(Kn(Kn({},x),{},{fill:"#eee"},p),d),nl(r.props,f,h)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:h,className:"recharts-bar-background-rectangle"});return Y.createElement(aM,$m({key:"background-bar-".concat(h),option:r.props.background,isActive:h===c},g))})}},{key:"renderErrorBar",value:function(r,s){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=pa(h,Wf);if(!p)return null;var x=f==="vertical"?o[0].height/2:o[0].width/2,g=function(y,S){var C=Array.isArray(y.value)?y.value[1]:y.value;return{x:y.x,y:y.y,value:C,errorVal:er(y,S)}},j={clipPath:r?"url(#clipPath-".concat(s,")"):null};return Y.createElement(nn,j,p.map(function(b){return Y.cloneElement(b,{key:"error-bar-".concat(s,"-").concat(b.props.dataKey),data:o,xAxis:c,yAxis:d,layout:f,offset:x,dataPointFormatter:g})}))}},{key:"render",value:function(){var r=this.props,s=r.hide,i=r.data,o=r.className,c=r.xAxis,d=r.yAxis,f=r.left,h=r.top,p=r.width,x=r.height,g=r.isAnimationActive,j=r.background,b=r.id;if(s||!i||!i.length)return null;var y=this.state.isAnimationFinished,S=Dt("recharts-bar",o),C=c&&c.allowDataOverflow,N=d&&d.allowDataOverflow,E=C||N,A=$t(b)?this.id:b;return Y.createElement(nn,{className:S},C||N?Y.createElement("defs",null,Y.createElement("clipPath",{id:"clipPath-".concat(A)},Y.createElement("rect",{x:C?f:f-p/2,y:N?h:h-x/2,width:C?p:p*2,height:N?x:x*2}))):null,Y.createElement(nn,{className:"recharts-bar-rectangles",clipPath:E?"url(#clipPath-".concat(A,")"):null},j?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(E,A),(!g||y)&&si.renderCallByParent(this.props,i))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:s.curData}:r.data!==s.curData?{curData:r.data}:null}}])})(m.PureComponent);Y4=Cl;Xi(Cl,"displayName","Bar");Xi(Cl,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!wl.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Xi(Cl,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,s=e.bandSize,i=e.xAxis,o=e.yAxis,c=e.xAxisTicks,d=e.yAxisTicks,f=e.stackedData,h=e.dataStartIndex,p=e.displayedData,x=e.offset,g=zae(r,n);if(!g)return null;var j=t.layout,b=n.type.defaultProps,y=b!==void 0?Kn(Kn({},b),n.props):n.props,S=y.dataKey,C=y.children,N=y.minPointSize,E=j==="horizontal"?o:i,A=f?E.scale.domain():null,P=Gae({numericAxis:E}),O=pa(C,zv),T=p.map(function($,z){var q,F,H,U,R,W;f?q=qae(f[h+z],A):(q=er($,S),Array.isArray(q)||(q=[P,q]));var X=oue(N,Y4.defaultProps.minPointSize)(q[1],z);if(j==="horizontal"){var G,B=[o.scale(q[0]),o.scale(q[1])],J=B[0],D=B[1];F=I2({axis:i,ticks:c,bandSize:s,offset:g.offset,entry:$,index:z}),H=(G=D??J)!==null&&G!==void 0?G:void 0,U=g.size;var I=J-D;if(R=Number.isNaN(I)?0:I,W={x:F,y:o.y,width:U,height:o.height},Math.abs(X)>0&&Math.abs(R)<Math.abs(X)){var re=_r(R||X)*(Math.abs(X)-Math.abs(R));H-=re,R+=re}}else{var ne=[i.scale(q[0]),i.scale(q[1])],fe=ne[0],he=ne[1];if(F=fe,H=I2({axis:o,ticks:d,bandSize:s,offset:g.offset,entry:$,index:z}),U=he-fe,R=g.size,W={x:i.x,y:H,width:i.width,height:R},Math.abs(X)>0&&Math.abs(U)<Math.abs(X)){var V=_r(U||X)*(Math.abs(X)-Math.abs(U));U+=V}}return Kn(Kn(Kn({},$),{},{x:F,y:H,width:U,height:R,value:f?q:q[1],payload:$,background:W},O&&O[z]&&O[z].props),{},{tooltipPayload:[N4(n,$)],tooltipPosition:{x:F+U/2,y:H+R/2}})});return Kn({data:T,layout:j},x)});function gf(e){"@babel/helpers - typeof";return gf=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},gf(e)}function xue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oM(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,J4(r.key),r)}}function yue(e,t,n){return t&&oM(e.prototype,t),n&&oM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function lM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ga(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lM(Object(n),!0).forEach(function(r){ig(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ig(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=bue(e,"string");return gf(t)=="symbol"?t:t+""}function bue(e,t){if(gf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(gf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Z4=function(t,n,r,s,i){var o=t.width,c=t.height,d=t.layout,f=t.children,h=Object.keys(n),p={left:r.left,leftMirror:r.left,right:o-r.right,rightMirror:o-r.right,top:r.top,topMirror:r.top,bottom:c-r.bottom,bottomMirror:c-r.bottom},x=!!ia(f,Cl);return h.reduce(function(g,j){var b=n[j],y=b.orientation,S=b.domain,C=b.padding,N=C===void 0?{}:C,E=b.mirror,A=b.reversed,P="".concat(y).concat(E?"Mirror":""),O,T,$,z,q;if(b.type==="number"&&(b.padding==="gap"||b.padding==="no-gap")){var F=S[1]-S[0],H=1/0,U=b.categoricalDomain.sort(PX);if(U.forEach(function(ne,fe){fe>0&&(H=Math.min((ne||0)-(U[fe-1]||0),H))}),Number.isFinite(H)){var R=H/F,W=b.layout==="vertical"?r.height:r.width;if(b.padding==="gap"&&(O=R*W/2),b.padding==="no-gap"){var X=Ar(t.barCategoryGap,R*W),G=R*W/2;O=G-X-(G-X)/W*X}}}s==="xAxis"?T=[r.left+(N.left||0)+(O||0),r.left+r.width-(N.right||0)-(O||0)]:s==="yAxis"?T=d==="horizontal"?[r.top+r.height-(N.bottom||0),r.top+(N.top||0)]:[r.top+(N.top||0)+(O||0),r.top+r.height-(N.bottom||0)-(O||0)]:T=b.range,A&&(T=[T[1],T[0]]);var B=b4(b,i,x),J=B.scale,D=B.realScaleType;J.domain(S).range(T),w4(J);var I=j4(J,Ga(Ga({},b),{},{realScaleType:D}));s==="xAxis"?(q=y==="top"&&!E||y==="bottom"&&E,$=r.left,z=p[P]-q*b.height):s==="yAxis"&&(q=y==="left"&&!E||y==="right"&&E,$=p[P]-q*b.width,z=r.top);var re=Ga(Ga(Ga({},b),I),{},{realScaleType:D,x:$,y:z,scale:J,width:s==="xAxis"?r.width:b.width,height:s==="yAxis"?r.height:b.height});return re.bandSize=ym(re,I),!b.hide&&s==="xAxis"?p[P]+=(q?-1:1)*re.height:b.hide||(p[P]+=(q?-1:1)*re.width),Ga(Ga({},g),{},ig({},j,re))},{})},eF=function(t,n){var r=t.x,s=t.y,i=n.x,o=n.y;return{x:Math.min(r,i),y:Math.min(s,o),width:Math.abs(i-r),height:Math.abs(o-s)}},wue=function(t){var n=t.x1,r=t.y1,s=t.x2,i=t.y2;return eF({x:n,y:r},{x:s,y:i})},tF=(function(){function e(t){xue(this,e),this.scale=t}return yue(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]:{},s=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(s){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(),s=r[0],i=r[r.length-1];return s<=i?n>=s&&n<=i:n>=i&&n<=s}}],[{key:"create",value:function(n){return new e(n)}}])})();ig(tF,"EPS",1e-4);var OC=function(t){var n=Object.keys(t).reduce(function(r,s){return Ga(Ga({},r),{},ig({},s,tF.create(t[s])))},{});return Ga(Ga({},n),{},{apply:function(s){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,c=i.position;return Gce(s,function(d,f){return n[f].apply(d,{bandAware:o,position:c})})},isInRange:function(s){return Zce(s,function(i,o){return n[o].isInRange(i)})}})};function jue(e){return(e%180+180)%180}var Sue=function(t){var n=t.width,r=t.height,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=jue(s),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)},Ej,cM;function Nue(){if(cM)return Ej;cM=1;var e=$s(),t=Lf(),n=Lv();function r(s){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=s(i,o,c);return h>-1?d[f?i[h]:h]:void 0}}return Ej=r,Ej}var Pj,uM;function Cue(){if(uM)return Pj;uM=1;var e=V4();function t(n){var r=e(n),s=r%1;return r===r?s?r-s:r:0}return Pj=t,Pj}var kj,dM;function _ue(){if(dM)return kj;dM=1;var e=rL(),t=$s(),n=Cue(),r=Math.max;function s(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 kj=s,kj}var Oj,fM;function Aue(){if(fM)return Oj;fM=1;var e=Nue(),t=_ue(),n=e(t);return Oj=n,Oj}Aue();var Eue=y3();const Pue=fn(Eue);var kue=Pue(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("")}),nF=m.createContext(void 0),rF=m.createContext(void 0),aF=m.createContext(void 0),Oue=m.createContext({}),sF=m.createContext(void 0),iF=m.createContext(0),oF=m.createContext(0),pM=function(t){var n=t.state,r=n.xAxisMap,s=n.yAxisMap,i=n.offset,o=t.clipPathId,c=t.children,d=t.width,f=t.height,h=kue(i);return Y.createElement(nF.Provider,{value:r},Y.createElement(rF.Provider,{value:s},Y.createElement(Oue.Provider,{value:i},Y.createElement(aF.Provider,{value:h},Y.createElement(sF.Provider,{value:o},Y.createElement(iF.Provider,{value:f},Y.createElement(oF.Provider,{value:d},c)))))))},Tue=function(){return m.useContext(sF)},lF=function(t){var n=m.useContext(nF);n==null&&sl();var r=n[t];return r==null&&sl(),r},cF=function(t){var n=m.useContext(rF);n==null&&sl();var r=n[t];return r==null&&sl(),r},Rue=function(){var t=m.useContext(aF);return t},uF=function(){return m.useContext(oF)},dF=function(){return m.useContext(iF)};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 Iue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mue(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,pF(r.key),r)}}function $ue(e,t,n){return t&&Mue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Due(e,t,n){return t=Lm(t),Lue(e,fF()?Reflect.construct(t,n||[],Lm(e).constructor):t.apply(e,n))}function Lue(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 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 fF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(fF=function(){return!!e})()}function Lm(e){return Lm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Lm(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&&S1(e,t)}function S1(e,t){return S1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},S1(e,t)}function hM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function mM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hM(Object(n),!0).forEach(function(r){TC(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TC(e,t,n){return t=pF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pF(e){var t=zue(e,"string");return Yc(t)=="symbol"?t:t+""}function zue(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)}function que(e,t){return Hue(e)||Vue(e,t)||Wue(e,t)||Uue()}function Uue(){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 Wue(e,t){if(e){if(typeof e=="string")return vM(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 vM(e,t)}}function vM(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 Vue(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,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,s=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw s}}return c}}function Hue(e){if(Array.isArray(e))return e}function N1(){return N1=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},N1.apply(this,arguments)}var Kue=function(t,n){var r;return Y.isValidElement(t)?r=Y.cloneElement(t,n):Mt(t)?r=t(n):r=Y.createElement("line",N1({},n,{className:"recharts-reference-line-line"})),r},Gue=function(t,n,r,s,i,o,c,d,f){var h=i.x,p=i.y,x=i.width,g=i.height;if(r){var j=f.y,b=t.y.apply(j,{position:o});if(Ns(f,"discard")&&!t.y.isInRange(b))return null;var y=[{x:h+x,y:b},{x:h,y:b}];return d==="left"?y.reverse():y}if(n){var S=f.x,C=t.x.apply(S,{position:o});if(Ns(f,"discard")&&!t.x.isInRange(C))return null;var N=[{x:C,y:p+g},{x:C,y:p}];return c==="top"?N.reverse():N}if(s){var E=f.segment,A=E.map(function(P){return t.apply(P,{position:o})});return Ns(f,"discard")&&Wce(A,function(P){return!t.isInRange(P)})?null:A}return null};function Yue(e){var t=e.x,n=e.y,r=e.segment,s=e.xAxisId,i=e.yAxisId,o=e.shape,c=e.className,d=e.alwaysShow,f=Tue(),h=lF(s),p=cF(i),x=Rue();if(!f||!x)return null;ri(d===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var g=OC({x:h.scale,y:p.scale}),j=tr(t),b=tr(n),y=r&&r.length===2,S=Gue(g,j,b,y,x,e.position,h.orientation,p.orientation,e);if(!S)return null;var C=que(S,2),N=C[0],E=N.x,A=N.y,P=C[1],O=P.x,T=P.y,$=Ns(e,"hidden")?"url(#".concat(f,")"):void 0,z=mM(mM({clipPath:$},Nt(e,!0)),{},{x1:E,y1:A,x2:O,y2:T});return Y.createElement(nn,{className:Dt("recharts-reference-line",c)},Kue(o,z),ur.renderCallByParent(e,wue({x1:E,y1:A,x2:O,y2:T})))}var RC=(function(e){function t(){return Iue(this,t),Due(this,t,arguments)}return Bue(t,e),$ue(t,[{key:"render",value:function(){return Y.createElement(Yue,this.props)}}])})(Y.Component);TC(RC,"displayName","ReferenceLine");TC(RC,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function C1(){return C1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},C1.apply(this,arguments)}function 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 gM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function xM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gM(Object(n),!0).forEach(function(r){og(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Que(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,mF(r.key),r)}}function Jue(e,t,n){return t&&Que(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zue(e,t,n){return t=Fm(t),ede(e,hF()?Reflect.construct(t,n||[],Fm(e).constructor):t.apply(e,n))}function ede(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 tde(e)}function tde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(hF=function(){return!!e})()}function Fm(e){return Fm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Fm(e)}function nde(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_1(e,t)}function _1(e,t){return _1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},_1(e,t)}function og(e,t,n){return t=mF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mF(e){var t=rde(e,"string");return Xc(t)=="symbol"?t:t+""}function rde(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 ade=function(t){var n=t.x,r=t.y,s=t.xAxis,i=t.yAxis,o=OC({x:s.scale,y:i.scale}),c=o.apply({x:n,y:r},{bandAware:!0});return Ns(t,"discard")&&!o.isInRange(c)?null:c},lg=(function(e){function t(){return Xue(this,t),Zue(this,t,arguments)}return nde(t,e),Jue(t,[{key:"render",value:function(){var r=this.props,s=r.x,i=r.y,o=r.r,c=r.alwaysShow,d=r.clipPathId,f=tr(s),h=tr(i);if(ri(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!f||!h)return null;var p=ade(this.props);if(!p)return null;var x=p.x,g=p.y,j=this.props,b=j.shape,y=j.className,S=Ns(this.props,"hidden")?"url(#".concat(d,")"):void 0,C=xM(xM({clipPath:S},Nt(this.props,!0)),{},{cx:x,cy:g});return Y.createElement(nn,{className:Dt("recharts-reference-dot",y)},t.renderDot(b,C),ur.renderCallByParent(this.props,{x:x-o,y:g-o,width:2*o,height:2*o}))}}])})(Y.Component);og(lg,"displayName","ReferenceDot");og(lg,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});og(lg,"renderDot",function(e,t){var n;return Y.isValidElement(e)?n=Y.cloneElement(e,t):Mt(e)?n=e(t):n=Y.createElement(Zv,C1({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function A1(){return A1=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},A1.apply(this,arguments)}function Qc(e){"@babel/helpers - typeof";return Qc=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},Qc(e)}function yM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function bM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yM(Object(n),!0).forEach(function(r){cg(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ide(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,gF(r.key),r)}}function ode(e,t,n){return t&&ide(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function lde(e,t,n){return t=Bm(t),cde(e,vF()?Reflect.construct(t,n||[],Bm(e).constructor):t.apply(e,n))}function cde(e,t){if(t&&(Qc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ude(e)}function ude(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(vF=function(){return!!e})()}function Bm(e){return Bm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Bm(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&&E1(e,t)}function E1(e,t){return E1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},E1(e,t)}function cg(e,t,n){return t=gF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gF(e){var t=fde(e,"string");return Qc(t)=="symbol"?t:t+""}function fde(e,t){if(Qc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Qc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var pde=function(t,n,r,s,i){var o=i.x1,c=i.x2,d=i.y1,f=i.y2,h=i.xAxis,p=i.yAxis;if(!h||!p)return null;var x=OC({x:h.scale,y:p.scale}),g={x:t?x.x.apply(o,{position:"start"}):x.x.rangeMin,y:r?x.y.apply(d,{position:"start"}):x.y.rangeMin},j={x:n?x.x.apply(c,{position:"end"}):x.x.rangeMax,y:s?x.y.apply(f,{position:"end"}):x.y.rangeMax};return Ns(i,"discard")&&(!x.isInRange(g)||!x.isInRange(j))?null:eF(g,j)},ug=(function(e){function t(){return sde(this,t),lde(this,t,arguments)}return dde(t,e),ode(t,[{key:"render",value:function(){var r=this.props,s=r.x1,i=r.x2,o=r.y1,c=r.y2,d=r.className,f=r.alwaysShow,h=r.clipPathId;ri(f===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=tr(s),x=tr(i),g=tr(o),j=tr(c),b=this.props.shape;if(!p&&!x&&!g&&!j&&!b)return null;var y=pde(p,x,g,j,this.props);if(!y&&!b)return null;var S=Ns(this.props,"hidden")?"url(#".concat(h,")"):void 0;return Y.createElement(nn,{className:Dt("recharts-reference-area",d)},t.renderRect(b,bM(bM({clipPath:S},Nt(this.props,!0)),y)),ur.renderCallByParent(this.props,y))}}])})(Y.Component);cg(ug,"displayName","ReferenceArea");cg(ug,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});cg(ug,"renderRect",function(e,t){var n;return Y.isValidElement(e)?n=Y.cloneElement(e,t):Mt(e)?n=e(t):n=Y.createElement(kC,A1({},t,{className:"recharts-reference-area-rect"})),n});function xF(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],s=0;s<e.length;s+=t)r.push(e[s]);return r}function hde(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Sue(r,n)}function mde(e,t,n){var r=n==="width",s=e.x,i=e.y,o=e.width,c=e.height;return t===1?{start:r?s:i,end:r?s+o:i+c}:{start:r?s+o:i+c,end:r?s:i}}function zm(e,t,n,r,s){if(e*t<e*r||e*t>e*s)return!1;var i=n();return e*(t-e*i/2-r)>=0&&e*(t+e*i/2-s)<=0}function vde(e,t){return xF(e,t+1)}function gde(e,t,n,r,s){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:xF(r,f)};var b=d,y,S=function(){return y===void 0&&(y=n(j,b)),y},C=j.coordinate,N=d===0||zm(e,C,S,h,c);N||(d=0,h=o,f+=1),N&&(h=C+e*(S()/2+s),d+=f)},x;f<=i.length;)if(x=p(),x)return x.v;return[]}function xf(e){"@babel/helpers - typeof";return xf=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},xf(e)}function wM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function br(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wM(Object(n),!0).forEach(function(r){xde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xde(e,t,n){return t=yde(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yde(e){var t=bde(e,"string");return xf(t)=="symbol"?t:t+""}function bde(e,t){if(xf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(xf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wde(e,t,n,r,s){for(var i=(r||[]).slice(),o=i.length,c=t.start,d=t.end,f=function(x){var g=i[x],j,b=function(){return j===void 0&&(j=n(g,x)),j};if(x===o-1){var y=e*(g.coordinate+e*b()/2-d);i[x]=g=br(br({},g),{},{tickCoord:y>0?g.coordinate-y*e:g.coordinate})}else i[x]=g=br(br({},g),{},{tickCoord:g.coordinate});var S=zm(e,g.tickCoord,b,c,d);S&&(d=g.tickCoord-e*(b()/2+s),i[x]=br(br({},g),{},{isShow:!0}))},h=o-1;h>=0;h--)f(h);return i}function jde(e,t,n,r,s,i){var o=(r||[]).slice(),c=o.length,d=t.start,f=t.end;if(i){var h=r[c-1],p=n(h,c-1),x=e*(h.coordinate+e*p/2-f);o[c-1]=h=br(br({},h),{},{tickCoord:x>0?h.coordinate-x*e:h.coordinate});var g=zm(e,h.tickCoord,function(){return p},d,f);g&&(f=h.tickCoord-e*(p/2+s),o[c-1]=br(br({},h),{},{isShow:!0}))}for(var j=i?c-1:c,b=function(C){var N=o[C],E,A=function(){return E===void 0&&(E=n(N,C)),E};if(C===0){var P=e*(N.coordinate-e*A()/2-d);o[C]=N=br(br({},N),{},{tickCoord:P<0?N.coordinate-P*e:N.coordinate})}else o[C]=N=br(br({},N),{},{tickCoord:N.coordinate});var O=zm(e,N.tickCoord,A,d,f);O&&(d=N.tickCoord+e*(A()/2+s),o[C]=br(br({},N),{},{isShow:!0}))},y=0;y<j;y++)b(y);return o}function Sde(e,t,n){var r=e.tick,s=e.ticks,i=e.viewBox,o=e.minTickGap,c=e.orientation,d=e.interval,f=e.tickFormatter,h=e.unit,p=e.angle;if(!s||!s.length||!r)return[];if(Ke(d)||wl.isSsr)return vde(s,typeof d=="number"&&Ke(d)?d:0);var x=[],g=c==="top"||c==="bottom"?"width":"height",j=h&&g==="width"?_d(h,{fontSize:t,letterSpacing:n}):{width:0,height:0},b=function(N,E){var A=Mt(f)?f(N.value,E):N.value;return g==="width"?hde(_d(A,{fontSize:t,letterSpacing:n}),j,p):_d(A,{fontSize:t,letterSpacing:n})[g]},y=s.length>=2?_r(s[1].coordinate-s[0].coordinate):1,S=mde(i,y,g);return d==="equidistantPreserveStart"?gde(y,S,b,s,o):(d==="preserveStart"||d==="preserveStartEnd"?x=jde(y,S,b,s,o,d==="preserveStartEnd"):x=wde(y,S,b,s,o),x.filter(function(C){return C.isShow}))}var Nde=["viewBox"],Cde=["viewBox"],_de=["ticks"];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 vc(){return vc=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},vc.apply(this,arguments)}function jM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Jn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jM(Object(n),!0).forEach(function(r){IC(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tj(e,t){if(e==null)return{};var n=Ade(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ade(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 Ede(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function SM(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,bF(r.key),r)}}function Pde(e,t,n){return t&&SM(e.prototype,t),n&&SM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function kde(e,t,n){return t=qm(t),Ode(e,yF()?Reflect.construct(t,n||[],qm(e).constructor):t.apply(e,n))}function Ode(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 Tde(e)}function Tde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yF=function(){return!!e})()}function qm(e){return qm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},qm(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&&P1(e,t)}function P1(e,t){return P1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},P1(e,t)}function IC(e,t,n){return t=bF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bF(e){var t=Ide(e,"string");return Jc(t)=="symbol"?t:t+""}function Ide(e,t){if(Jc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Jc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var dg=(function(e){function t(n){var r;return Ede(this,t),r=kde(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return Rde(t,e),Pde(t,[{key:"shouldComponentUpdate",value:function(r,s){var i=r.viewBox,o=Tj(r,Nde),c=this.props,d=c.viewBox,f=Tj(c,Cde);return!Sc(i,d)||!Sc(o,f)||!Sc(s,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var s=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];s&&this.setState({fontSize:window.getComputedStyle(s).fontSize,letterSpacing:window.getComputedStyle(s).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var s=this.props,i=s.x,o=s.y,c=s.width,d=s.height,f=s.orientation,h=s.tickSize,p=s.mirror,x=s.tickMargin,g,j,b,y,S,C,N=p?-1:1,E=r.tickSize||h,A=Ke(r.tickCoord)?r.tickCoord:r.coordinate;switch(f){case"top":g=j=r.coordinate,y=o+ +!p*d,b=y-N*E,C=b-N*x,S=A;break;case"left":b=y=r.coordinate,j=i+ +!p*c,g=j-N*E,S=g-N*x,C=A;break;case"right":b=y=r.coordinate,j=i+ +p*c,g=j+N*E,S=g+N*x,C=A;break;default:g=j=r.coordinate,y=o+ +p*d,b=y+N*E,C=b+N*x,S=A;break}return{line:{x1:g,y1:b,x2:j,y2:y},tick:{x:S,y:C}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,s=r.orientation,i=r.mirror,o;switch(s){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,s=r.orientation,i=r.mirror,o="end";switch(s){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,s=r.x,i=r.y,o=r.width,c=r.height,d=r.orientation,f=r.mirror,h=r.axisLine,p=Jn(Jn(Jn({},Nt(this.props,!1)),Nt(h,!1)),{},{fill:"none"});if(d==="top"||d==="bottom"){var x=+(d==="top"&&!f||d==="bottom"&&f);p=Jn(Jn({},p),{},{x1:s,y1:i+x*c,x2:s+o,y2:i+x*c})}else{var g=+(d==="left"&&!f||d==="right"&&f);p=Jn(Jn({},p),{},{x1:s+g*o,y1:i,x2:s+g*o,y2:i+c})}return Y.createElement("line",vc({},p,{className:Dt("recharts-cartesian-axis-line",fa(h,"className"))}))}},{key:"renderTicks",value:function(r,s,i){var o=this,c=this.props,d=c.tickLine,f=c.stroke,h=c.tick,p=c.tickFormatter,x=c.unit,g=Sde(Jn(Jn({},this.props),{},{ticks:r}),s,i),j=this.getTickTextAnchor(),b=this.getTickVerticalAnchor(),y=Nt(this.props,!1),S=Nt(h,!1),C=Jn(Jn({},y),{},{fill:"none"},Nt(d,!1)),N=g.map(function(E,A){var P=o.getTickLineCoord(E),O=P.line,T=P.tick,$=Jn(Jn(Jn(Jn({textAnchor:j,verticalAnchor:b},y),{},{stroke:"none",fill:f},S),T),{},{index:A,payload:E,visibleTicksCount:g.length,tickFormatter:p});return Y.createElement(nn,vc({className:"recharts-cartesian-axis-tick",key:"tick-".concat(E.value,"-").concat(E.coordinate,"-").concat(E.tickCoord)},nl(o.props,E,A)),d&&Y.createElement("line",vc({},C,O,{className:Dt("recharts-cartesian-axis-tick-line",fa(d,"className"))})),h&&t.renderTickItem(h,$,"".concat(Mt(p)?p(E.value,A):E.value).concat(x||"")))});return Y.createElement("g",{className:"recharts-cartesian-axis-ticks"},N)}},{key:"render",value:function(){var r=this,s=this.props,i=s.axisLine,o=s.width,c=s.height,d=s.ticksGenerator,f=s.className,h=s.hide;if(h)return null;var p=this.props,x=p.ticks,g=Tj(p,_de),j=x;return Mt(d)&&(j=x&&x.length>0?d(this.props):d(g)),o<=0||c<=0||!j||!j.length?null:Y.createElement(nn,{className:Dt("recharts-cartesian-axis",f),ref:function(y){r.layerReference=y}},i&&this.renderAxisLine(),this.renderTicks(j,this.state.fontSize,this.state.letterSpacing),ur.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,s,i){var o,c=Dt(s.className,"recharts-cartesian-axis-tick-value");return Y.isValidElement(r)?o=Y.cloneElement(r,Jn(Jn({},s),{},{className:c})):Mt(r)?o=r(Jn(Jn({},s),{},{className:c})):o=Y.createElement(rl,vc({},s,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])})(m.Component);IC(dg,"displayName","CartesianAxis");IC(dg,"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 Mde=["type","layout","connectNulls","ref"],$de=["key"];function Zc(e){"@babel/helpers - typeof";return Zc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zc(e)}function NM(e,t){if(e==null)return{};var n=Dde(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Dde(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 Td(){return Td=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},Td.apply(this,arguments)}function CM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function ra(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CM(Object(n),!0).forEach(function(r){Ya(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sc(e){return zde(e)||Bde(e)||Fde(e)||Lde()}function Lde(){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 Fde(e,t){if(e){if(typeof e=="string")return k1(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 k1(e,t)}}function Bde(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function zde(e){if(Array.isArray(e))return k1(e)}function k1(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 qde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _M(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,jF(r.key),r)}}function Ude(e,t,n){return t&&_M(e.prototype,t),n&&_M(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Wde(e,t,n){return t=Um(t),Vde(e,wF()?Reflect.construct(t,n||[],Um(e).constructor):t.apply(e,n))}function Vde(e,t){if(t&&(Zc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Hde(e)}function Hde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(wF=function(){return!!e})()}function Um(e){return Um=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Um(e)}function Kde(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&&O1(e,t)}function O1(e,t){return O1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},O1(e,t)}function Ya(e,t,n){return t=jF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jF(e){var t=Gde(e,"string");return Zc(t)=="symbol"?t:t+""}function Gde(e,t){if(Zc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Zc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var il=(function(e){function t(){var n;qde(this,t);for(var r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return n=Wde(this,t,[].concat(s)),Ya(n,"state",{isAnimationFinished:!0,totalLength:0}),Ya(n,"generateSimpleStrokeDasharray",function(o,c){return"".concat(c,"px ").concat(o-c,"px")}),Ya(n,"getStrokeDasharray",function(o,c,d){var f=d.reduce(function(S,C){return S+C});if(!f)return n.generateSimpleStrokeDasharray(c,o);for(var h=Math.floor(o/f),p=o%f,x=c-o,g=[],j=0,b=0;j<d.length;b+=d[j],++j)if(b+d[j]>p){g=[].concat(sc(d.slice(0,j)),[p-b]);break}var y=g.length%2===0?[0,x]:[x];return[].concat(sc(t.repeat(d,h)),sc(g),y).map(function(S){return"".concat(S,"px")}).join(", ")}),Ya(n,"id",xu("recharts-line-")),Ya(n,"pathRef",function(o){n.mainCurve=o}),Ya(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Ya(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return Kde(t,e),Ude(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,s){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=pa(h,Wf);if(!p)return null;var x=function(b,y){return{x:b.x,y:b.y,value:b.value,errorVal:er(b.payload,y)}},g={clipPath:r?"url(#clipPath-".concat(s,")"):null};return Y.createElement(nn,g,p.map(function(j){return Y.cloneElement(j,{key:"bar-".concat(j.props.dataKey),data:o,xAxis:c,yAxis:d,layout:f,dataPointFormatter:x})}))}},{key:"renderDots",value:function(r,s,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=Nt(this.props,!1),x=Nt(d,!0),g=f.map(function(b,y){var S=ra(ra(ra({key:"dot-".concat(y),r:3},p),x),{},{index:y,cx:b.x,cy:b.y,value:b.value,dataKey:h,payload:b.payload,points:f});return t.renderDotItem(d,S)}),j={clipPath:r?"url(#clipPath-".concat(s?"":"dots-").concat(i,")"):null};return Y.createElement(nn,Td({className:"recharts-line-dots",key:"dots"},j),g)}},{key:"renderCurveStatically",value:function(r,s,i,o){var c=this.props,d=c.type,f=c.layout,h=c.connectNulls;c.ref;var p=NM(c,Mde),x=ra(ra(ra({},Nt(p,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:s?"url(#clipPath-".concat(i,")"):null,points:r},o),{},{type:d,layout:f,connectNulls:h});return Y.createElement(jm,Td({},x,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,s){var i=this,o=this.props,c=o.points,d=o.strokeDasharray,f=o.isAnimationActive,h=o.animationBegin,p=o.animationDuration,x=o.animationEasing,g=o.animationId,j=o.animateNewValues,b=o.width,y=o.height,S=this.state,C=S.prevPoints,N=S.totalLength;return Y.createElement(ks,{begin:h,duration:p,isActive:f,easing:x,from:{t:0},to:{t:1},key:"line-".concat(g),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(E){var A=E.t;if(C){var P=C.length/c.length,O=c.map(function(F,H){var U=Math.floor(H*P);if(C[U]){var R=C[U],W=la(R.x,F.x),X=la(R.y,F.y);return ra(ra({},F),{},{x:W(A),y:X(A)})}if(j){var G=la(b*2,F.x),B=la(y/2,F.y);return ra(ra({},F),{},{x:G(A),y:B(A)})}return ra(ra({},F),{},{x:F.x,y:F.y})});return i.renderCurveStatically(O,r,s)}var T=la(0,N),$=T(A),z;if(d){var q="".concat(d).split(/[,\s]+/gim).map(function(F){return parseFloat(F)});z=i.getStrokeDasharray($,N,q)}else z=i.generateSimpleStrokeDasharray(N,$);return i.renderCurveStatically(c,r,s,{strokeDasharray:z})})}},{key:"renderCurve",value:function(r,s){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||!Uf(f,o))?this.renderCurveWithAnimation(r,s):this.renderCurveStatically(o,r,s)}},{key:"render",value:function(){var r,s=this.props,i=s.hide,o=s.dot,c=s.points,d=s.className,f=s.xAxis,h=s.yAxis,p=s.top,x=s.left,g=s.width,j=s.height,b=s.isAnimationActive,y=s.id;if(i||!c||!c.length)return null;var S=this.state.isAnimationFinished,C=c.length===1,N=Dt("recharts-line",d),E=f&&f.allowDataOverflow,A=h&&h.allowDataOverflow,P=E||A,O=$t(y)?this.id:y,T=(r=Nt(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},$=T.r,z=$===void 0?3:$,q=T.strokeWidth,F=q===void 0?2:q,H=LX(o)?o:{},U=H.clipDot,R=U===void 0?!0:U,W=z*2+F;return Y.createElement(nn,{className:N},E||A?Y.createElement("defs",null,Y.createElement("clipPath",{id:"clipPath-".concat(O)},Y.createElement("rect",{x:E?x:x-g/2,y:A?p:p-j/2,width:E?g:g*2,height:A?j:j*2})),!R&&Y.createElement("clipPath",{id:"clipPath-dots-".concat(O)},Y.createElement("rect",{x:x-W/2,y:p-W/2,width:g+W,height:j+W}))):null,!C&&this.renderCurve(P,O),this.renderErrorBar(P,O),(C||o)&&this.renderDots(P,R,O),(!b||S)&&si.renderCallByParent(this.props,c))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:s.curPoints}:r.points!==s.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,s){for(var i=r.length%2!==0?[].concat(sc(r),[0]):r,o=[],c=0;c<s;++c)o=[].concat(sc(o),sc(i));return o}},{key:"renderDotItem",value:function(r,s){var i;if(Y.isValidElement(r))i=Y.cloneElement(r,s);else if(Mt(r))i=r(s);else{var o=s.key,c=NM(s,$de),d=Dt("recharts-line-dot",typeof r!="boolean"?r.className:"");i=Y.createElement(Zv,Td({key:o},c,{className:d}))}return i}}])})(m.PureComponent);Ya(il,"displayName","Line");Ya(il,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!wl.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Ya(il,"getComposedData",function(e){var t=e.props,n=e.xAxis,r=e.yAxis,s=e.xAxisTicks,i=e.yAxisTicks,o=e.dataKey,c=e.bandSize,d=e.displayedData,f=e.offset,h=t.layout,p=d.map(function(x,g){var j=er(x,o);return h==="horizontal"?{x:R2({axis:n,ticks:s,bandSize:c,entry:x,index:g}),y:$t(j)?null:r.scale(j),value:j,payload:x}:{x:$t(j)?null:n.scale(j),y:R2({axis:r,ticks:i,bandSize:c,entry:x,index:g}),value:j,payload:x}});return ra({points:p,layout:h},f)});function eu(e){"@babel/helpers - typeof";return eu=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},eu(e)}function Yde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xde(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,CF(r.key),r)}}function Qde(e,t,n){return t&&Xde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Jde(e,t,n){return t=Wm(t),Zde(e,SF()?Reflect.construct(t,n||[],Wm(e).constructor):t.apply(e,n))}function Zde(e,t){if(t&&(eu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return efe(e)}function efe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function SF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(SF=function(){return!!e})()}function Wm(e){return Wm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Wm(e)}function tfe(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&&T1(e,t)}function T1(e,t){return T1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},T1(e,t)}function NF(e,t,n){return t=CF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CF(e){var t=nfe(e,"string");return eu(t)=="symbol"?t:t+""}function nfe(e,t){if(eu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(eu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function R1(){return R1=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},R1.apply(this,arguments)}function rfe(e){var t=e.xAxisId,n=uF(),r=dF(),s=lF(t);return s==null?null:m.createElement(dg,R1({},s,{className:Dt("recharts-".concat(s.axisType," ").concat(s.axisType),s.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return Wo(o,!0)}}))}var io=(function(e){function t(){return Yde(this,t),Jde(this,t,arguments)}return tfe(t,e),Qde(t,[{key:"render",value:function(){return m.createElement(rfe,this.props)}}])})(m.Component);NF(io,"displayName","XAxis");NF(io,"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 tu(e){"@babel/helpers - typeof";return tu=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},tu(e)}function afe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sfe(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,EF(r.key),r)}}function ife(e,t,n){return t&&sfe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ofe(e,t,n){return t=Vm(t),lfe(e,_F()?Reflect.construct(t,n||[],Vm(e).constructor):t.apply(e,n))}function lfe(e,t){if(t&&(tu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cfe(e)}function cfe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _F(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_F=function(){return!!e})()}function Vm(e){return Vm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Vm(e)}function ufe(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&&I1(e,t)}function I1(e,t){return I1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},I1(e,t)}function AF(e,t,n){return t=EF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EF(e){var t=dfe(e,"string");return tu(t)=="symbol"?t:t+""}function dfe(e,t){if(tu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(tu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function M1(){return M1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},M1.apply(this,arguments)}var ffe=function(t){var n=t.yAxisId,r=uF(),s=dF(),i=cF(n);return i==null?null:m.createElement(dg,M1({},i,{className:Dt("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:s},ticksGenerator:function(c){return Wo(c,!0)}}))},oo=(function(e){function t(){return afe(this,t),ofe(this,t,arguments)}return ufe(t,e),ife(t,[{key:"render",value:function(){return m.createElement(ffe,this.props)}}])})(m.Component);AF(oo,"displayName","YAxis");AF(oo,"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 AM(e){return vfe(e)||mfe(e)||hfe(e)||pfe()}function pfe(){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 hfe(e,t){if(e){if(typeof e=="string")return $1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $1(e,t)}}function mfe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vfe(e){if(Array.isArray(e))return $1(e)}function $1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var D1=function(t,n,r,s,i){var o=pa(t,RC),c=pa(t,lg),d=[].concat(AM(o),AM(c)),f=pa(t,ug),h="".concat(s,"Id"),p=s[0],x=n;if(d.length&&(x=d.reduce(function(b,y){if(y.props[h]===r&&Ns(y.props,"extendDomain")&&Ke(y.props[p])){var S=y.props[p];return[Math.min(b[0],S),Math.max(b[1],S)]}return b},x)),f.length){var g="".concat(p,"1"),j="".concat(p,"2");x=f.reduce(function(b,y){if(y.props[h]===r&&Ns(y.props,"extendDomain")&&Ke(y.props[g])&&Ke(y.props[j])){var S=y.props[g],C=y.props[j];return[Math.min(b[0],S,C),Math.max(b[1],S,C)]}return b},x)}return i&&i.length&&(x=i.reduce(function(b,y){return Ke(y)?[Math.min(b[0],y),Math.max(b[1],y)]:b},x)),x},Rj={exports:{}},EM;function gfe(){return EM||(EM=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function s(d,f,h){this.fn=d,this.context=f,this.once=h||!1}function i(d,f,h,p,x){if(typeof h!="function")throw new TypeError("The listener must be a function");var g=new s(h,p||d,x),j=n?n+f:f;return d._events[j]?d._events[j].fn?d._events[j]=[d._events[j],g]:d._events[j].push(g):(d._events[j]=g,d._eventsCount++),d}function o(d,f){--d._eventsCount===0?d._events=new r:delete d._events[f]}function c(){this._events=new r,this._eventsCount=0}c.prototype.eventNames=function(){var f=[],h,p;if(this._eventsCount===0)return f;for(p in h=this._events)t.call(h,p)&&f.push(n?p.slice(1):p);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(h)):f},c.prototype.listeners=function(f){var h=n?n+f:f,p=this._events[h];if(!p)return[];if(p.fn)return[p.fn];for(var x=0,g=p.length,j=new Array(g);x<g;x++)j[x]=p[x].fn;return j},c.prototype.listenerCount=function(f){var h=n?n+f:f,p=this._events[h];return p?p.fn?1:p.length:0},c.prototype.emit=function(f,h,p,x,g,j){var b=n?n+f:f;if(!this._events[b])return!1;var y=this._events[b],S=arguments.length,C,N;if(y.fn){switch(y.once&&this.removeListener(f,y.fn,void 0,!0),S){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,h),!0;case 3:return y.fn.call(y.context,h,p),!0;case 4:return y.fn.call(y.context,h,p,x),!0;case 5:return y.fn.call(y.context,h,p,x,g),!0;case 6:return y.fn.call(y.context,h,p,x,g,j),!0}for(N=1,C=new Array(S-1);N<S;N++)C[N-1]=arguments[N];y.fn.apply(y.context,C)}else{var E=y.length,A;for(N=0;N<E;N++)switch(y[N].once&&this.removeListener(f,y[N].fn,void 0,!0),S){case 1:y[N].fn.call(y[N].context);break;case 2:y[N].fn.call(y[N].context,h);break;case 3:y[N].fn.call(y[N].context,h,p);break;case 4:y[N].fn.call(y[N].context,h,p,x);break;default:if(!C)for(A=1,C=new Array(S-1);A<S;A++)C[A-1]=arguments[A];y[N].fn.apply(y[N].context,C)}}return!0},c.prototype.on=function(f,h,p){return i(this,f,h,p,!1)},c.prototype.once=function(f,h,p){return i(this,f,h,p,!0)},c.prototype.removeListener=function(f,h,p,x){var g=n?n+f:f;if(!this._events[g])return this;if(!h)return o(this,g),this;var j=this._events[g];if(j.fn)j.fn===h&&(!x||j.once)&&(!p||j.context===p)&&o(this,g);else{for(var b=0,y=[],S=j.length;b<S;b++)(j[b].fn!==h||x&&!j[b].once||p&&j[b].context!==p)&&y.push(j[b]);y.length?this._events[g]=y.length===1?y[0]:y:o(this,g)}return this},c.prototype.removeAllListeners=function(f){var h;return f?(h=n?n+f:f,this._events[h]&&o(this,h)):(this._events=new r,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c})(Rj)),Rj.exports}var xfe=gfe();const yfe=fn(xfe);var Ij=new yfe,Mj="recharts.syncMouseEvents";function yf(e){"@babel/helpers - typeof";return yf=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},yf(e)}function bfe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wfe(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,PF(r.key),r)}}function jfe(e,t,n){return t&&wfe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function $j(e,t,n){return t=PF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PF(e){var t=Sfe(e,"string");return yf(t)=="symbol"?t:t+""}function Sfe(e,t){if(yf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(yf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Nfe=(function(){function e(){bfe(this,e),$j(this,"activeIndex",0),$j(this,"coordinateList",[]),$j(this,"layout","horizontal")}return jfe(e,[{key:"setDetails",value:function(n){var r,s=n.coordinateList,i=s===void 0?null:s,o=n.container,c=o===void 0?null:o,d=n.layout,f=d===void 0?null:d,h=n.offset,p=h===void 0?null:h,x=n.mouseHandlerCallback,g=x===void 0?null:x;this.coordinateList=(r=i??this.coordinateList)!==null&&r!==void 0?r:[],this.container=c??this.container,this.layout=f??this.layout,this.offset=p??this.offset,this.mouseHandlerCallback=g??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var s=this.container.getBoundingClientRect(),i=s.x,o=s.y,c=s.height,d=this.coordinateList[this.activeIndex].coordinate,f=((n=window)===null||n===void 0?void 0:n.scrollX)||0,h=((r=window)===null||r===void 0?void 0:r.scrollY)||0,p=i+d+f,x=o+this.offset.top+c/2+h;this.mouseHandlerCallback({pageX:p,pageY:x})}}}])})();function Cfe(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e?.[0],s=e?.[1];if(r&&s&&Ke(r)&&Ke(s))return!0}return!1}function _fe(e,t,n,r){var s=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-s:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-s,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function kF(e){var t=e.cx,n=e.cy,r=e.radius,s=e.startAngle,i=e.endAngle,o=Nn(t,n,r,s),c=Nn(t,n,r,i);return{points:[o,c],cx:t,cy:n,radius:r,startAngle:s,endAngle:i}}function Afe(e,t,n){var r,s,i,o;if(e==="horizontal")r=t.x,i=r,s=n.top,o=n.top+n.height;else if(e==="vertical")s=t.y,o=s,r=n.left,i=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var c=t.cx,d=t.cy,f=t.innerRadius,h=t.outerRadius,p=t.angle,x=Nn(c,d,f,p),g=Nn(c,d,h,p);r=x.x,s=x.y,i=g.x,o=g.y}else return kF(t);return[{x:r,y:s},{x:i,y:o}]}function bf(e){"@babel/helpers - typeof";return bf=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},bf(e)}function PM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Sh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PM(Object(n),!0).forEach(function(r){Efe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Efe(e,t,n){return t=Pfe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pfe(e){var t=kfe(e,"string");return bf(t)=="symbol"?t:t+""}function kfe(e,t){if(bf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(bf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ofe(e){var t,n,r=e.element,s=e.tooltipEventType,i=e.isActive,o=e.activeCoordinate,c=e.activePayload,d=e.offset,f=e.activeTooltipIndex,h=e.tooltipAxisBandSize,p=e.layout,x=e.chartName,g=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!g||!i||!o||x!=="ScatterChart"&&s!=="axis")return null;var j,b=jm;if(x==="ScatterChart")j=o,b=hle;else if(x==="BarChart")j=_fe(p,o,d,h),b=kC;else if(p==="radial"){var y=kF(o),S=y.cx,C=y.cy,N=y.radius,E=y.startAngle,A=y.endAngle;j={cx:S,cy:C,startAngle:E,endAngle:A,innerRadius:N,outerRadius:N},b=k4}else j={points:Afe(p,o,d)},b=jm;var P=Sh(Sh(Sh(Sh({stroke:"#ccc",pointerEvents:"none"},d),j),Nt(g,!1)),{},{payload:c,payloadIndex:f,className:Dt("recharts-tooltip-cursor",g.className)});return m.isValidElement(g)?m.cloneElement(g,P):m.createElement(b,P)}var Tfe=["item"],Rfe=["children","className","width","height","style","compact","title","desc"];function nu(e){"@babel/helpers - typeof";return nu=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},nu(e)}function gc(){return gc=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},gc.apply(this,arguments)}function kM(e,t){return $fe(e)||Mfe(e,t)||TF(e,t)||Ife()}function Ife(){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 Mfe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,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,s=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw s}}return c}}function $fe(e){if(Array.isArray(e))return e}function OM(e,t){if(e==null)return{};var n=Dfe(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Dfe(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 Lfe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ffe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,RF(r.key),r)}}function Bfe(e,t,n){return t&&Ffe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function zfe(e,t,n){return t=Hm(t),qfe(e,OF()?Reflect.construct(t,n||[],Hm(e).constructor):t.apply(e,n))}function qfe(e,t){if(t&&(nu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ufe(e)}function Ufe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function OF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(OF=function(){return!!e})()}function Hm(e){return Hm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Hm(e)}function Wfe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&L1(e,t)}function L1(e,t){return L1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},L1(e,t)}function ru(e){return Kfe(e)||Hfe(e)||TF(e)||Vfe()}function Vfe(){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 TF(e,t){if(e){if(typeof e=="string")return F1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return F1(e,t)}}function Hfe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Kfe(e){if(Array.isArray(e))return F1(e)}function F1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function TM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function je(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TM(Object(n),!0).forEach(function(r){_t(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _t(e,t,n){return t=RF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RF(e){var t=Gfe(e,"string");return nu(t)=="symbol"?t:t+""}function Gfe(e,t){if(nu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(nu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Yfe={xAxis:["bottom","top"],yAxis:["left","right"]},Xfe={width:"100%",height:"100%"},IF={x:0,y:0};function Nh(e){return e}var Qfe=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},Jfe=function(t,n,r,s){var i=n.find(function(h){return h&&h.index===r});if(i){if(t==="horizontal")return{x:i.coordinate,y:s.y};if(t==="vertical")return{x:s.x,y:i.coordinate};if(t==="centric"){var o=i.coordinate,c=s.radius;return je(je(je({},s),Nn(s.cx,s.cy,c,o)),{},{angle:o,radius:c})}var d=i.coordinate,f=s.angle;return je(je(je({},s),Nn(s.cx,s.cy,d,f)),{},{angle:f,radius:d})}return IF},fg=function(t,n){var r=n.graphicalItems,s=n.dataStartIndex,i=n.dataEndIndex,o=(r??[]).reduce(function(c,d){var f=d.props.data;return f&&f.length?[].concat(ru(c),ru(f)):c},[]);return o.length>0?o:t&&t.length&&Ke(s)&&Ke(i)?t.slice(s,i+1):[]};function MF(e){return e==="number"?[0,"auto"]:void 0}var B1=function(t,n,r,s){var i=t.graphicalItems,o=t.tooltipAxis,c=fg(n,t);return r<0||!i||!i.length||r>=c.length?null:i.reduce(function(d,f){var h,p=(h=f.props.data)!==null&&h!==void 0?h:n;p&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(p=p.slice(t.dataStartIndex,t.dataEndIndex+1));var x;if(o.dataKey&&!o.allowDuplicatedCategory){var g=p===void 0?c:p;x=Hh(g,o.dataKey,s)}else x=p&&p[r]||c[r];return x?[].concat(ru(d),[N4(f,x)]):d},[])},RM=function(t,n,r,s){var i=s||{x:t.chartX,y:t.chartY},o=Qfe(i,r),c=t.orderedTooltipTicks,d=t.tooltipAxis,f=t.tooltipTicks,h=Mae(o,c,f,d);if(h>=0&&f){var p=f[h]&&f[h].value,x=B1(t,n,h,p),g=Jfe(r,c,h,i);return{activeTooltipIndex:h,activeLabel:p,activePayload:x,activeCoordinate:g}}return null},Zfe=function(t,n){var r=n.axes,s=n.graphicalItems,i=n.axisType,o=n.axisIdKey,c=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,h=t.layout,p=t.children,x=t.stackOffset,g=y4(h,i);return r.reduce(function(j,b){var y,S=b.type.defaultProps!==void 0?je(je({},b.type.defaultProps),b.props):b.props,C=S.type,N=S.dataKey,E=S.allowDataOverflow,A=S.allowDuplicatedCategory,P=S.scale,O=S.ticks,T=S.includeHidden,$=S[o];if(j[$])return j;var z=fg(t.data,{graphicalItems:s.filter(function(I){var re,ne=o in I.props?I.props[o]:(re=I.type.defaultProps)===null||re===void 0?void 0:re[o];return ne===$}),dataStartIndex:d,dataEndIndex:f}),q=z.length,F,H,U;Cfe(S.domain,E,C)&&(F=e1(S.domain,null,E),g&&(C==="number"||P!=="auto")&&(U=Ed(z,N,"category")));var R=MF(C);if(!F||F.length===0){var W,X=(W=S.domain)!==null&&W!==void 0?W:R;if(N){if(F=Ed(z,N,C),C==="category"&&g){var G=EX(F);A&&G?(H=F,F=Rm(0,q)):A||(F=D2(X,F,b).reduce(function(I,re){return I.indexOf(re)>=0?I:[].concat(ru(I),[re])},[]))}else if(C==="category")A?F=F.filter(function(I){return I!==""&&!$t(I)}):F=D2(X,F,b).reduce(function(I,re){return I.indexOf(re)>=0||re===""||$t(re)?I:[].concat(ru(I),[re])},[]);else if(C==="number"){var B=Bae(z,s.filter(function(I){var re,ne,fe=o in I.props?I.props[o]:(re=I.type.defaultProps)===null||re===void 0?void 0:re[o],he="hide"in I.props?I.props.hide:(ne=I.type.defaultProps)===null||ne===void 0?void 0:ne.hide;return fe===$&&(T||!he)}),N,i,h);B&&(F=B)}g&&(C==="number"||P!=="auto")&&(U=Ed(z,N,"category"))}else g?F=Rm(0,q):c&&c[$]&&c[$].hasStack&&C==="number"?F=x==="expand"?[0,1]:S4(c[$].stackGroups,d,f):F=x4(z,s.filter(function(I){var re=o in I.props?I.props[o]:I.type.defaultProps[o],ne="hide"in I.props?I.props.hide:I.type.defaultProps.hide;return re===$&&(T||!ne)}),C,h,!0);if(C==="number")F=D1(p,F,$,i,O),X&&(F=e1(X,F,E));else if(C==="category"&&X){var J=X,D=F.every(function(I){return J.indexOf(I)>=0});D&&(F=J)}}return je(je({},j),{},_t({},$,je(je({},S),{},{axisType:i,domain:F,categoricalDomain:U,duplicateDomain:H,originalDomain:(y=S.domain)!==null&&y!==void 0?y:R,isCategorical:g,layout:h})))},{})},epe=function(t,n){var r=n.graphicalItems,s=n.Axis,i=n.axisType,o=n.axisIdKey,c=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,h=t.layout,p=t.children,x=fg(t.data,{graphicalItems:r,dataStartIndex:d,dataEndIndex:f}),g=x.length,j=y4(h,i),b=-1;return r.reduce(function(y,S){var C=S.type.defaultProps!==void 0?je(je({},S.type.defaultProps),S.props):S.props,N=C[o],E=MF("number");if(!y[N]){b++;var A;return j?A=Rm(0,g):c&&c[N]&&c[N].hasStack?(A=S4(c[N].stackGroups,d,f),A=D1(p,A,N,i)):(A=e1(E,x4(x,r.filter(function(P){var O,T,$=o in P.props?P.props[o]:(O=P.type.defaultProps)===null||O===void 0?void 0:O[o],z="hide"in P.props?P.props.hide:(T=P.type.defaultProps)===null||T===void 0?void 0:T.hide;return $===N&&!z}),"number",h),s.defaultProps.allowDataOverflow),A=D1(p,A,N,i)),je(je({},y),{},_t({},N,je(je({axisType:i},s.defaultProps),{},{hide:!0,orientation:fa(Yfe,"".concat(i,".").concat(b%2),null),domain:A,originalDomain:E,isCategorical:j,layout:h})))}return y},{})},tpe=function(t,n){var r=n.axisType,s=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(s,"Id"),x=pa(h,i),g={};return x&&x.length?g=Zfe(t,{axes:x,graphicalItems:o,axisType:s,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f}):o&&o.length&&(g=epe(t,{Axis:i,graphicalItems:o,axisType:s,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f})),g},npe=function(t){var n=cc(t),r=Wo(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:rC(r,function(s){return s.coordinate}),tooltipAxis:n,tooltipAxisBandSize:ym(n,r)}},IM=function(t){var n=t.children,r=t.defaultShowTooltip,s=ia(n,Kc),i=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),s&&s.props&&(s.props.startIndex>=0&&(i=s.props.startIndex),s.props.endIndex>=0&&(o=s.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!r}},rpe=function(t){return!t||!t.length?!1:t.some(function(n){var r=ni(n&&n.type);return r&&r.indexOf("Bar")>=0})},MM=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"}},ape=function(t,n){var r=t.props,s=t.graphicalItems,i=t.xAxisMap,o=i===void 0?{}:i,c=t.yAxisMap,d=c===void 0?{}:c,f=r.width,h=r.height,p=r.children,x=r.margin||{},g=ia(p,Kc),j=ia(p,Ho),b=Object.keys(d).reduce(function(A,P){var O=d[P],T=O.orientation;return!O.mirror&&!O.hide?je(je({},A),{},_t({},T,A[T]+O.width)):A},{left:x.left||0,right:x.right||0}),y=Object.keys(o).reduce(function(A,P){var O=o[P],T=O.orientation;return!O.mirror&&!O.hide?je(je({},A),{},_t({},T,fa(A,"".concat(T))+O.height)):A},{top:x.top||0,bottom:x.bottom||0}),S=je(je({},y),b),C=S.bottom;g&&(S.bottom+=g.props.height||Kc.defaultProps.height),j&&n&&(S=Lae(S,s,r,n));var N=f-S.left-S.right,E=h-S.top-S.bottom;return je(je({brushBottom:C},S),{},{width:Math.max(N,0),height:Math.max(E,0)})},spe=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},MC=function(t){var n=t.chartName,r=t.GraphicalChild,s=t.defaultTooltipEventType,i=s===void 0?"axis":s,o=t.validateTooltipEventTypes,c=o===void 0?["axis"]:o,d=t.axisComponents,f=t.legendContent,h=t.formatAxisMap,p=t.defaultProps,x=function(S,C){var N=C.graphicalItems,E=C.stackGroups,A=C.offset,P=C.updateId,O=C.dataStartIndex,T=C.dataEndIndex,$=S.barSize,z=S.layout,q=S.barGap,F=S.barCategoryGap,H=S.maxBarSize,U=MM(z),R=U.numericAxisName,W=U.cateAxisName,X=rpe(N),G=[];return N.forEach(function(B,J){var D=fg(S.data,{graphicalItems:[B],dataStartIndex:O,dataEndIndex:T}),I=B.type.defaultProps!==void 0?je(je({},B.type.defaultProps),B.props):B.props,re=I.dataKey,ne=I.maxBarSize,fe=I["".concat(R,"Id")],he=I["".concat(W,"Id")],V={},de=d.reduce(function(lt,pt){var vt=C["".concat(pt.axisType,"Map")],zt=I["".concat(pt.axisType,"Id")];vt&&vt[zt]||pt.axisType==="zAxis"||sl();var qt=vt[zt];return je(je({},lt),{},_t(_t({},pt.axisType,qt),"".concat(pt.axisType,"Ticks"),Wo(qt)))},V),Q=de[W],ee=de["".concat(W,"Ticks")],pe=E&&E[fe]&&E[fe].hasStack&&Yae(B,E[fe].stackGroups),ae=ni(B.type).indexOf("Bar")>=0,Re=ym(Q,ee),Ce=[],Me=X&&$ae({barSize:$,stackGroups:E,totalSize:spe(de,W)});if(ae){var L,oe,ve=$t(ne)?H:ne,Pe=(L=(oe=ym(Q,ee,!0))!==null&&oe!==void 0?oe:ve)!==null&&L!==void 0?L:0;Ce=Dae({barGap:q,barCategoryGap:F,bandSize:Pe!==Re?Pe:Re,sizeList:Me[he],maxBarSize:ve}),Pe!==Re&&(Ce=Ce.map(function(lt){return je(je({},lt),{},{position:je(je({},lt.position),{},{offset:lt.position.offset-Pe/2})})}))}var Ge=B&&B.type&&B.type.getComposedData;Ge&&G.push({props:je(je({},Ge(je(je({},de),{},{displayedData:D,props:S,dataKey:re,item:B,bandSize:Re,barPosition:Ce,offset:A,stackedData:pe,layout:z,dataStartIndex:O,dataEndIndex:T}))),{},_t(_t(_t({key:B.key||"item-".concat(J)},R,de[R]),W,de[W]),"animationId",P)),childIndex:zX(B,S.children),item:B})}),G},g=function(S,C){var N=S.props,E=S.dataStartIndex,A=S.dataEndIndex,P=S.updateId;if(!Qk({props:N}))return null;var O=N.children,T=N.layout,$=N.stackOffset,z=N.data,q=N.reverseStackOrder,F=MM(T),H=F.numericAxisName,U=F.cateAxisName,R=pa(O,r),W=Kae(z,R,"".concat(H,"Id"),"".concat(U,"Id"),$,q),X=d.reduce(function(I,re){var ne="".concat(re.axisType,"Map");return je(je({},I),{},_t({},ne,tpe(N,je(je({},re),{},{graphicalItems:R,stackGroups:re.axisType===H&&W,dataStartIndex:E,dataEndIndex:A}))))},{}),G=ape(je(je({},X),{},{props:N,graphicalItems:R}),C?.legendBBox);Object.keys(X).forEach(function(I){X[I]=h(N,X[I],G,I.replace("Map",""),n)});var B=X["".concat(U,"Map")],J=npe(B),D=x(N,je(je({},X),{},{dataStartIndex:E,dataEndIndex:A,updateId:P,graphicalItems:R,stackGroups:W,offset:G}));return je(je({formattedGraphicalItems:D,graphicalItems:R,offset:G,stackGroups:W},J),X)},j=(function(y){function S(C){var N,E,A;return Lfe(this,S),A=zfe(this,S,[C]),_t(A,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),_t(A,"accessibilityManager",new Nfe),_t(A,"handleLegendBBoxUpdate",function(P){if(P){var O=A.state,T=O.dataStartIndex,$=O.dataEndIndex,z=O.updateId;A.setState(je({legendBBox:P},g({props:A.props,dataStartIndex:T,dataEndIndex:$,updateId:z},je(je({},A.state),{},{legendBBox:P}))))}}),_t(A,"handleReceiveSyncEvent",function(P,O,T){if(A.props.syncId===P){if(T===A.eventEmitterSymbol&&typeof A.props.syncMethod!="function")return;A.applySyncEvent(O)}}),_t(A,"handleBrushChange",function(P){var O=P.startIndex,T=P.endIndex;if(O!==A.state.dataStartIndex||T!==A.state.dataEndIndex){var $=A.state.updateId;A.setState(function(){return je({dataStartIndex:O,dataEndIndex:T},g({props:A.props,dataStartIndex:O,dataEndIndex:T,updateId:$},A.state))}),A.triggerSyncEvent({dataStartIndex:O,dataEndIndex:T})}}),_t(A,"handleMouseEnter",function(P){var O=A.getMouseInfo(P);if(O){var T=je(je({},O),{},{isTooltipActive:!0});A.setState(T),A.triggerSyncEvent(T);var $=A.props.onMouseEnter;Mt($)&&$(T,P)}}),_t(A,"triggeredAfterMouseMove",function(P){var O=A.getMouseInfo(P),T=O?je(je({},O),{},{isTooltipActive:!0}):{isTooltipActive:!1};A.setState(T),A.triggerSyncEvent(T);var $=A.props.onMouseMove;Mt($)&&$(T,P)}),_t(A,"handleItemMouseEnter",function(P){A.setState(function(){return{isTooltipActive:!0,activeItem:P,activePayload:P.tooltipPayload,activeCoordinate:P.tooltipPosition||{x:P.cx,y:P.cy}}})}),_t(A,"handleItemMouseLeave",function(){A.setState(function(){return{isTooltipActive:!1}})}),_t(A,"handleMouseMove",function(P){P.persist(),A.throttleTriggeredAfterMouseMove(P)}),_t(A,"handleMouseLeave",function(P){A.throttleTriggeredAfterMouseMove.cancel();var O={isTooltipActive:!1};A.setState(O),A.triggerSyncEvent(O);var T=A.props.onMouseLeave;Mt(T)&&T(O,P)}),_t(A,"handleOuterEvent",function(P){var O=BX(P),T=fa(A.props,"".concat(O));if(O&&Mt(T)){var $,z;/.*touch.*/i.test(O)?z=A.getMouseInfo(P.changedTouches[0]):z=A.getMouseInfo(P),T(($=z)!==null&&$!==void 0?$:{},P)}}),_t(A,"handleClick",function(P){var O=A.getMouseInfo(P);if(O){var T=je(je({},O),{},{isTooltipActive:!0});A.setState(T),A.triggerSyncEvent(T);var $=A.props.onClick;Mt($)&&$(T,P)}}),_t(A,"handleMouseDown",function(P){var O=A.props.onMouseDown;if(Mt(O)){var T=A.getMouseInfo(P);O(T,P)}}),_t(A,"handleMouseUp",function(P){var O=A.props.onMouseUp;if(Mt(O)){var T=A.getMouseInfo(P);O(T,P)}}),_t(A,"handleTouchMove",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&A.throttleTriggeredAfterMouseMove(P.changedTouches[0])}),_t(A,"handleTouchStart",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&A.handleMouseDown(P.changedTouches[0])}),_t(A,"handleTouchEnd",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&A.handleMouseUp(P.changedTouches[0])}),_t(A,"handleDoubleClick",function(P){var O=A.props.onDoubleClick;if(Mt(O)){var T=A.getMouseInfo(P);O(T,P)}}),_t(A,"handleContextMenu",function(P){var O=A.props.onContextMenu;if(Mt(O)){var T=A.getMouseInfo(P);O(T,P)}}),_t(A,"triggerSyncEvent",function(P){A.props.syncId!==void 0&&Ij.emit(Mj,A.props.syncId,P,A.eventEmitterSymbol)}),_t(A,"applySyncEvent",function(P){var O=A.props,T=O.layout,$=O.syncMethod,z=A.state.updateId,q=P.dataStartIndex,F=P.dataEndIndex;if(P.dataStartIndex!==void 0||P.dataEndIndex!==void 0)A.setState(je({dataStartIndex:q,dataEndIndex:F},g({props:A.props,dataStartIndex:q,dataEndIndex:F,updateId:z},A.state)));else if(P.activeTooltipIndex!==void 0){var H=P.chartX,U=P.chartY,R=P.activeTooltipIndex,W=A.state,X=W.offset,G=W.tooltipTicks;if(!X)return;if(typeof $=="function")R=$(G,P);else if($==="value"){R=-1;for(var B=0;B<G.length;B++)if(G[B].value===P.activeLabel){R=B;break}}var J=je(je({},X),{},{x:X.left,y:X.top}),D=Math.min(H,J.x+J.width),I=Math.min(U,J.y+J.height),re=G[R]&&G[R].value,ne=B1(A.state,A.props.data,R),fe=G[R]?{x:T==="horizontal"?G[R].coordinate:D,y:T==="horizontal"?I:G[R].coordinate}:IF;A.setState(je(je({},P),{},{activeLabel:re,activeCoordinate:fe,activePayload:ne,activeTooltipIndex:R}))}else A.setState(P)}),_t(A,"renderCursor",function(P){var O,T=A.state,$=T.isTooltipActive,z=T.activeCoordinate,q=T.activePayload,F=T.offset,H=T.activeTooltipIndex,U=T.tooltipAxisBandSize,R=A.getTooltipEventType(),W=(O=P.props.active)!==null&&O!==void 0?O:$,X=A.props.layout,G=P.key||"_recharts-cursor";return Y.createElement(Ofe,{key:G,activeCoordinate:z,activePayload:q,activeTooltipIndex:H,chartName:n,element:P,isActive:W,layout:X,offset:F,tooltipAxisBandSize:U,tooltipEventType:R})}),_t(A,"renderPolarAxis",function(P,O,T){var $=fa(P,"type.axisType"),z=fa(A.state,"".concat($,"Map")),q=P.type.defaultProps,F=q!==void 0?je(je({},q),P.props):P.props,H=z&&z[F["".concat($,"Id")]];return m.cloneElement(P,je(je({},H),{},{className:Dt($,H.className),key:P.key||"".concat(O,"-").concat(T),ticks:Wo(H,!0)}))}),_t(A,"renderPolarGrid",function(P){var O=P.props,T=O.radialLines,$=O.polarAngles,z=O.polarRadius,q=A.state,F=q.radiusAxisMap,H=q.angleAxisMap,U=cc(F),R=cc(H),W=R.cx,X=R.cy,G=R.innerRadius,B=R.outerRadius;return m.cloneElement(P,{polarAngles:Array.isArray($)?$:Wo(R,!0).map(function(J){return J.coordinate}),polarRadius:Array.isArray(z)?z:Wo(U,!0).map(function(J){return J.coordinate}),cx:W,cy:X,innerRadius:G,outerRadius:B,key:P.key||"polar-grid",radialLines:T})}),_t(A,"renderLegend",function(){var P=A.state.formattedGraphicalItems,O=A.props,T=O.children,$=O.width,z=O.height,q=A.props.margin||{},F=$-(q.left||0)-(q.right||0),H=v4({children:T,formattedGraphicalItems:P,legendWidth:F,legendContent:f});if(!H)return null;var U=H.item,R=OM(H,Tfe);return m.cloneElement(U,je(je({},R),{},{chartWidth:$,chartHeight:z,margin:q,onBBoxUpdate:A.handleLegendBBoxUpdate}))}),_t(A,"renderTooltip",function(){var P,O=A.props,T=O.children,$=O.accessibilityLayer,z=ia(T,zr);if(!z)return null;var q=A.state,F=q.isTooltipActive,H=q.activeCoordinate,U=q.activePayload,R=q.activeLabel,W=q.offset,X=(P=z.props.active)!==null&&P!==void 0?P:F;return m.cloneElement(z,{viewBox:je(je({},W),{},{x:W.left,y:W.top}),active:X,label:R,payload:X?U:[],coordinate:H,accessibilityLayer:$})}),_t(A,"renderBrush",function(P){var O=A.props,T=O.margin,$=O.data,z=A.state,q=z.offset,F=z.dataStartIndex,H=z.dataEndIndex,U=z.updateId;return m.cloneElement(P,{key:P.key||"_recharts-brush",onChange:yh(A.handleBrushChange,P.props.onChange),data:$,x:Ke(P.props.x)?P.props.x:q.left,y:Ke(P.props.y)?P.props.y:q.top+q.height+q.brushBottom-(T.bottom||0),width:Ke(P.props.width)?P.props.width:q.width,startIndex:F,endIndex:H,updateId:"brush-".concat(U)})}),_t(A,"renderReferenceElement",function(P,O,T){if(!P)return null;var $=A,z=$.clipPathId,q=A.state,F=q.xAxisMap,H=q.yAxisMap,U=q.offset,R=P.type.defaultProps||{},W=P.props,X=W.xAxisId,G=X===void 0?R.xAxisId:X,B=W.yAxisId,J=B===void 0?R.yAxisId:B;return m.cloneElement(P,{key:P.key||"".concat(O,"-").concat(T),xAxis:F[G],yAxis:H[J],viewBox:{x:U.left,y:U.top,width:U.width,height:U.height},clipPathId:z})}),_t(A,"renderActivePoints",function(P){var O=P.item,T=P.activePoint,$=P.basePoint,z=P.childIndex,q=P.isRange,F=[],H=O.props.key,U=O.item.type.defaultProps!==void 0?je(je({},O.item.type.defaultProps),O.item.props):O.item.props,R=U.activeDot,W=U.dataKey,X=je(je({index:z,dataKey:W,cx:T.x,cy:T.y,r:4,fill:PC(O.item),strokeWidth:2,stroke:"#fff",payload:T.payload,value:T.value},Nt(R,!1)),Kh(R));return F.push(S.renderActiveDot(R,X,"".concat(H,"-activePoint-").concat(z))),$?F.push(S.renderActiveDot(R,je(je({},X),{},{cx:$.x,cy:$.y}),"".concat(H,"-basePoint-").concat(z))):q&&F.push(null),F}),_t(A,"renderGraphicChild",function(P,O,T){var $=A.filterFormatItem(P,O,T);if(!$)return null;var z=A.getTooltipEventType(),q=A.state,F=q.isTooltipActive,H=q.tooltipAxis,U=q.activeTooltipIndex,R=q.activeLabel,W=A.props.children,X=ia(W,zr),G=$.props,B=G.points,J=G.isRange,D=G.baseLine,I=$.item.type.defaultProps!==void 0?je(je({},$.item.type.defaultProps),$.item.props):$.item.props,re=I.activeDot,ne=I.hide,fe=I.activeBar,he=I.activeShape,V=!!(!ne&&F&&X&&(re||fe||he)),de={};z!=="axis"&&X&&X.props.trigger==="click"?de={onClick:yh(A.handleItemMouseEnter,P.props.onClick)}:z!=="axis"&&(de={onMouseLeave:yh(A.handleItemMouseLeave,P.props.onMouseLeave),onMouseEnter:yh(A.handleItemMouseEnter,P.props.onMouseEnter)});var Q=m.cloneElement(P,je(je({},$.props),de));function ee(pt){return typeof H.dataKey=="function"?H.dataKey(pt.payload):null}if(V)if(U>=0){var pe,ae;if(H.dataKey&&!H.allowDuplicatedCategory){var Re=typeof H.dataKey=="function"?ee:"payload.".concat(H.dataKey.toString());pe=Hh(B,Re,R),ae=J&&D&&Hh(D,Re,R)}else pe=B?.[U],ae=J&&D&&D[U];if(he||fe){var Ce=P.props.activeIndex!==void 0?P.props.activeIndex:U;return[m.cloneElement(P,je(je(je({},$.props),de),{},{activeIndex:Ce})),null,null]}if(!$t(pe))return[Q].concat(ru(A.renderActivePoints({item:$,activePoint:pe,basePoint:ae,childIndex:U,isRange:J})))}else{var Me,L=(Me=A.getItemByXY(A.state.activeCoordinate))!==null&&Me!==void 0?Me:{graphicalItem:Q},oe=L.graphicalItem,ve=oe.item,Pe=ve===void 0?P:ve,Ge=oe.childIndex,lt=je(je(je({},$.props),de),{},{activeIndex:Ge});return[m.cloneElement(Pe,lt),null,null]}return J?[Q,null,null]:[Q,null]}),_t(A,"renderCustomized",function(P,O,T){return m.cloneElement(P,je(je({key:"recharts-customized-".concat(T)},A.props),A.state))}),_t(A,"renderMap",{CartesianGrid:{handler:Nh,once:!0},ReferenceArea:{handler:A.renderReferenceElement},ReferenceLine:{handler:Nh},ReferenceDot:{handler:A.renderReferenceElement},XAxis:{handler:Nh},YAxis:{handler:Nh},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=C.id)!==null&&N!==void 0?N:xu("recharts"),"-clip"),A.throttleTriggeredAfterMouseMove=vL(A.triggeredAfterMouseMove,(E=C.throttleDelay)!==null&&E!==void 0?E:1e3/60),A.state={},A}return Wfe(S,y),Bfe(S,[{key:"componentDidMount",value:function(){var N,E;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(N=this.props.margin.left)!==null&&N!==void 0?N:0,top:(E=this.props.margin.top)!==null&&E!==void 0?E:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var N=this.props,E=N.children,A=N.data,P=N.height,O=N.layout,T=ia(E,zr);if(T){var $=T.props.defaultIndex;if(!(typeof $!="number"||$<0||$>this.state.tooltipTicks.length-1)){var z=this.state.tooltipTicks[$]&&this.state.tooltipTicks[$].value,q=B1(this.state,A,$,z),F=this.state.tooltipTicks[$].coordinate,H=(this.state.offset.top+P)/2,U=O==="horizontal",R=U?{x:F,y:H}:{y:F,x:H},W=this.state.formattedGraphicalItems.find(function(G){var B=G.item;return B.type.name==="Scatter"});W&&(R=je(je({},R),W.props.points[$].tooltipPosition),q=W.props.points[$].tooltipPayload);var X={activeTooltipIndex:$,isTooltipActive:!0,activeLabel:z,activePayload:q,activeCoordinate:R};this.setState(X),this.renderCursor(T),this.accessibilityManager.setIndex($)}}}},{key:"getSnapshotBeforeUpdate",value:function(N,E){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==E.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==N.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==N.margin){var A,P;this.accessibilityManager.setDetails({offset:{left:(A=this.props.margin.left)!==null&&A!==void 0?A:0,top:(P=this.props.margin.top)!==null&&P!==void 0?P:0}})}return null}},{key:"componentDidUpdate",value:function(N){jS([ia(N.children,zr)],[ia(this.props.children,zr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var N=ia(this.props.children,zr);if(N&&typeof N.props.shared=="boolean"){var E=N.props.shared?"axis":"item";return c.indexOf(E)>=0?E:i}return i}},{key:"getMouseInfo",value:function(N){if(!this.container)return null;var E=this.container,A=E.getBoundingClientRect(),P=Aee(A),O={chartX:Math.round(N.pageX-P.left),chartY:Math.round(N.pageY-P.top)},T=A.width/E.offsetWidth||1,$=this.inRange(O.chartX,O.chartY,T);if(!$)return null;var z=this.state,q=z.xAxisMap,F=z.yAxisMap,H=this.getTooltipEventType(),U=RM(this.state,this.props.data,this.props.layout,$);if(H!=="axis"&&q&&F){var R=cc(q).scale,W=cc(F).scale,X=R&&R.invert?R.invert(O.chartX):null,G=W&&W.invert?W.invert(O.chartY):null;return je(je({},O),{},{xValue:X,yValue:G},U)}return U?je(je({},O),U):null}},{key:"inRange",value:function(N,E){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,P=this.props.layout,O=N/A,T=E/A;if(P==="horizontal"||P==="vertical"){var $=this.state.offset,z=O>=$.left&&O<=$.left+$.width&&T>=$.top&&T<=$.top+$.height;return z?{x:O,y:T}:null}var q=this.state,F=q.angleAxisMap,H=q.radiusAxisMap;if(F&&H){var U=cc(F);return B2({x:O,y:T},U)}return null}},{key:"parseEventsOfWrapper",value:function(){var N=this.props.children,E=this.getTooltipEventType(),A=ia(N,zr),P={};A&&E==="axis"&&(A.props.trigger==="click"?P={onClick:this.handleClick}:P={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var O=Kh(this.props,this.handleOuterEvent);return je(je({},O),P)}},{key:"addListener",value:function(){Ij.on(Mj,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Ij.removeListener(Mj,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(N,E,A){for(var P=this.state.formattedGraphicalItems,O=0,T=P.length;O<T;O++){var $=P[O];if($.item===N||$.props.key===N.key||E===ni($.item.type)&&A===$.childIndex)return $}return null}},{key:"renderClipPath",value:function(){var N=this.clipPathId,E=this.state.offset,A=E.left,P=E.top,O=E.height,T=E.width;return Y.createElement("defs",null,Y.createElement("clipPath",{id:N},Y.createElement("rect",{x:A,y:P,height:O,width:T})))}},{key:"getXScales",value:function(){var N=this.state.xAxisMap;return N?Object.entries(N).reduce(function(E,A){var P=kM(A,2),O=P[0],T=P[1];return je(je({},E),{},_t({},O,T.scale))},{}):null}},{key:"getYScales",value:function(){var N=this.state.yAxisMap;return N?Object.entries(N).reduce(function(E,A){var P=kM(A,2),O=P[0],T=P[1];return je(je({},E),{},_t({},O,T.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(N){var E;return(E=this.state.xAxisMap)===null||E===void 0||(E=E[N])===null||E===void 0?void 0:E.scale}},{key:"getYScaleByAxisId",value:function(N){var E;return(E=this.state.yAxisMap)===null||E===void 0||(E=E[N])===null||E===void 0?void 0:E.scale}},{key:"getItemByXY",value:function(N){var E=this.state,A=E.formattedGraphicalItems,P=E.activeItem;if(A&&A.length)for(var O=0,T=A.length;O<T;O++){var $=A[O],z=$.props,q=$.item,F=q.type.defaultProps!==void 0?je(je({},q.type.defaultProps),q.props):q.props,H=ni(q.type);if(H==="Bar"){var U=(z.data||[]).find(function(G){return Goe(N,G)});if(U)return{graphicalItem:$,payload:U}}else if(H==="RadialBar"){var R=(z.data||[]).find(function(G){return B2(N,G)});if(R)return{graphicalItem:$,payload:R}}else if(ag($,P)||sg($,P)||hf($,P)){var W=gce({graphicalItem:$,activeTooltipItem:P,itemData:F.data}),X=F.activeIndex===void 0?W:F.activeIndex;return{graphicalItem:je(je({},$),{},{childIndex:X}),payload:hf($,P)?F.data[W]:$.props.data[W]}}}return null}},{key:"render",value:function(){var N=this;if(!Qk(this))return null;var E=this.props,A=E.children,P=E.className,O=E.width,T=E.height,$=E.style,z=E.compact,q=E.title,F=E.desc,H=OM(E,Rfe),U=Nt(H,!1);if(z)return Y.createElement(pM,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},Y.createElement(NS,gc({},U,{width:O,height:T,title:q,desc:F}),this.renderClipPath(),Zk(A,this.renderMap)));if(this.props.accessibilityLayer){var R,W;U.tabIndex=(R=this.props.tabIndex)!==null&&R!==void 0?R:0,U.role=(W=this.props.role)!==null&&W!==void 0?W:"application",U.onKeyDown=function(G){N.accessibilityManager.keyboardEvent(G)},U.onFocus=function(){N.accessibilityManager.focus()}}var X=this.parseEventsOfWrapper();return Y.createElement(pM,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},Y.createElement("div",gc({className:Dt("recharts-wrapper",P),style:je({position:"relative",cursor:"default",width:O,height:T},$)},X,{ref:function(B){N.container=B}}),Y.createElement(NS,gc({},U,{width:O,height:T,title:q,desc:F,style:Xfe}),this.renderClipPath(),Zk(A,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(m.Component);_t(j,"displayName",n),_t(j,"defaultProps",je({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},p)),_t(j,"getDerivedStateFromProps",function(y,S){var C=y.dataKey,N=y.data,E=y.children,A=y.width,P=y.height,O=y.layout,T=y.stackOffset,$=y.margin,z=S.dataStartIndex,q=S.dataEndIndex;if(S.updateId===void 0){var F=IM(y);return je(je(je({},F),{},{updateId:0},g(je(je({props:y},F),{},{updateId:0}),S)),{},{prevDataKey:C,prevData:N,prevWidth:A,prevHeight:P,prevLayout:O,prevStackOffset:T,prevMargin:$,prevChildren:E})}if(C!==S.prevDataKey||N!==S.prevData||A!==S.prevWidth||P!==S.prevHeight||O!==S.prevLayout||T!==S.prevStackOffset||!Sc($,S.prevMargin)){var H=IM(y),U={chartX:S.chartX,chartY:S.chartY,isTooltipActive:S.isTooltipActive},R=je(je({},RM(S,N,O)),{},{updateId:S.updateId+1}),W=je(je(je({},H),U),R);return je(je(je({},W),g(je({props:y},W),S)),{},{prevDataKey:C,prevData:N,prevWidth:A,prevHeight:P,prevLayout:O,prevStackOffset:T,prevMargin:$,prevChildren:E})}if(!jS(E,S.prevChildren)){var X,G,B,J,D=ia(E,Kc),I=D&&(X=(G=D.props)===null||G===void 0?void 0:G.startIndex)!==null&&X!==void 0?X:z,re=D&&(B=(J=D.props)===null||J===void 0?void 0:J.endIndex)!==null&&B!==void 0?B:q,ne=I!==z||re!==q,fe=!$t(N),he=fe&&!ne?S.updateId:S.updateId+1;return je(je({updateId:he},g(je(je({props:y},S),{},{updateId:he,dataStartIndex:I,dataEndIndex:re}),S)),{},{prevChildren:E,dataStartIndex:I,dataEndIndex:re})}return null}),_t(j,"renderActiveDot",function(y,S,C){var N;return m.isValidElement(y)?N=m.cloneElement(y,S):Mt(y)?N=y(S):N=Y.createElement(Zv,S),Y.createElement(nn,{className:"recharts-active-dot",key:C},N)});var b=m.forwardRef(function(S,C){return Y.createElement(j,gc({},S,{ref:C}))});return b.displayName=j.displayName,b},z1=MC({chartName:"LineChart",GraphicalChild:il,axisComponents:[{axisType:"xAxis",AxisComp:io},{axisType:"yAxis",AxisComp:oo}],formatAxisMap:Z4}),ipe=MC({chartName:"BarChart",GraphicalChild:Cl,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:io},{axisType:"yAxis",AxisComp:oo}],formatAxisMap:Z4}),ope=MC({chartName:"PieChart",GraphicalChild:bi,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:rg},{axisType:"radiusAxis",AxisComp:tg}],formatAxisMap:sse,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const lpe=()=>{const{configs:e}=Mf(),{source:t}=Ln(),[n,r]=m.useState([]),[s,i]=m.useState("timestamp"),[o,c]=m.useState("desc"),d=y=>{if(s===y){c(S=>S==="asc"?"desc":"asc");return}i(y),c("desc")};m.useEffect(()=>{let y=!0;return t.listResults().then(S=>{y&&r(S)}),()=>{y=!1}},[t]);const f=e.length,h=n.length,p=h===0?0:n.reduce((y,S)=>y+S.overallPassRate,0)/h,x=h===0?0:Math.round(n.reduce((y,S)=>y+S.avgLatency,0)/h),g=m.useMemo(()=>[...n].sort((S,C)=>{let N=0;return s==="timestamp"&&(N=new Date(S.timestamp).getTime()-new Date(C.timestamp).getTime()),s==="passRate"&&(N=S.overallPassRate-C.overallPassRate),s==="latency"&&(N=S.avgLatency-C.avgLatency),s==="scenarios"&&(N=S.totalScenarios-C.totalScenarios),o==="asc"?N:-N}),[n,s,o]),j=[...g].reverse().map(y=>({date:new Date(y.timestamp).toLocaleDateString("en-US",{month:"short",day:"numeric"}),passRate:Math.round(y.overallPassRate*100),latency:y.avgLatency})),b=y=>{const S=Array.from(new Set(y.scenarios.map(T=>T.scenarioId).filter(Boolean))),C=Array.from(new Set(y.scenarios.map(T=>T.agentName).filter(Boolean))),N=Array.from(new Set(y.scenarios.map(T=>T.model).filter(T=>!!T))),E=S.slice(0,2).join(", "),A=S.length>2?` +${S.length-2}`:"",P=N.slice(0,2).join(", "),O=N.length>2?` +${N.length-2}`:"";return{scenarioCount:S.length,agentCount:C.length,scenarioPreview:E?`${E}${A}`:"n/a",modelSummary:P?`${P}${O}`:""}};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[a.jsx(nD,{className:"h-6 w-6"}),"Dashboard"]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Overview of your MCP evaluation runs"})]}),a.jsxs("div",{className:"flex gap-3",children:[a.jsx(se,{asChild:!0,children:a.jsxs(At,{to:"/mcp-evaluations/new",children:[a.jsx(hN,{className:"mr-2 h-4 w-4"}),"New MCP Evaluation"]})}),a.jsx(se,{variant:"outline",asChild:!0,children:a.jsxs(At,{to:"/run",children:[a.jsx(ti,{className:"mr-2 h-4 w-4"}),"Run Evaluation"]})}),a.jsx(se,{variant:"outline",asChild:!0,children:a.jsxs(At,{to:"/results",children:[a.jsx(Ac,{className:"mr-2 h-4 w-4"}),"Browse Results"]})})]})]}),a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[a.jsx(vs,{title:"MCP Evaluations",value:f,icon:Zj,subtitle:`${f} active`}),a.jsx(vs,{title:"Total Runs",value:h,icon:Q$,subtitle:"Last 30 days"}),a.jsx(vs,{title:"Pass Rate",value:`${Math.round(p*100)}%`,icon:Ac,subtitle:"+5% from last week",trend:"up"}),a.jsx(vs,{title:"Avg Latency",value:`${x}ms`,icon:sD,subtitle:"-120ms from last week",trend:"up"})]}),a.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[a.jsxs(Ue,{children:[a.jsx(Pt,{className:"pb-3",children:a.jsx(kt,{className:"text-base",children:"Pass Rate Trend"})}),a.jsx(We,{children:a.jsx(rm,{width:"100%",height:200,children:a.jsxs(z1,{data:j,children:[a.jsx(io,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),a.jsx(oo,{domain:[0,100],tick:{fontSize:11},tickLine:!1,axisLine:!1,tickFormatter:y=>`${y}%`}),a.jsx(zr,{formatter:y=>[`${y}%`,"Pass Rate"]}),a.jsx(il,{type:"monotone",dataKey:"passRate",stroke:"hsl(38, 92%, 50%)",strokeWidth:2,dot:{r:3,fill:"hsl(38, 92%, 50%)"}})]})})})]}),a.jsxs(Ue,{children:[a.jsx(Pt,{className:"pb-3",children:a.jsx(kt,{className:"text-base",children:"Recent Tool Latency (ms)"})}),a.jsx(We,{children:a.jsx(rm,{width:"100%",height:200,children:a.jsxs(z1,{data:j,children:[a.jsx(io,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),a.jsx(oo,{tick:{fontSize:11},tickLine:!1,axisLine:!1}),a.jsx(zr,{formatter:y=>[`${y}ms`,"Latency"]}),a.jsx(il,{type:"monotone",dataKey:"latency",stroke:"hsl(200, 80%, 50%)",strokeWidth:2,dot:{r:3,fill:"hsl(200, 80%, 50%)"}})]})})})]})]}),a.jsx("div",{className:"grid gap-6",children:a.jsxs(Ue,{children:[a.jsx(Pt,{className:"pb-3",children:a.jsx(kt,{className:"text-base",children:"Recent Runs"})}),a.jsx(We,{className:"p-0",children:a.jsxs(Wr,{children:[a.jsx(Vr,{children:a.jsxs(Gt,{children:[a.jsx(rt,{children:"Run ID"}),a.jsx(rt,{children:"Evaluated"}),a.jsx(rt,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>d("timestamp"),children:["Timestamp",s==="timestamp"?o==="asc"?a.jsx(ws,{className:"h-3.5 w-3.5"}):a.jsx(Yt,{className:"h-3.5 w-3.5"}):a.jsx(xc,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),a.jsx(rt,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>d("passRate"),children:["Pass Rate",s==="passRate"?o==="asc"?a.jsx(ws,{className:"h-3.5 w-3.5"}):a.jsx(Yt,{className:"h-3.5 w-3.5"}):a.jsx(xc,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),a.jsx(rt,{className:"text-right",children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>d("scenarios"),children:["Scenarios",s==="scenarios"?o==="asc"?a.jsx(ws,{className:"h-3.5 w-3.5"}):a.jsx(Yt,{className:"h-3.5 w-3.5"}):a.jsx(xc,{className:"h-3.5 w-3.5 text-muted-foreground"})]})})]})}),a.jsx(Hr,{children:g.map(y=>a.jsxs(Gt,{className:"cursor-pointer",children:[a.jsx(ze,{children:a.jsx(At,{to:`/results/${y.id}`,className:"font-mono text-xs text-primary hover:underline",children:y.id})}),a.jsx(ze,{className:"text-[11px] text-muted-foreground",children:(()=>{const S=b(y);return a.jsxs("div",{className:"space-y-0.5",children:[a.jsxs("div",{children:["Evaluated: ",S.scenarioCount," scenario",S.scenarioCount===1?"":"s"," · ",S.agentCount," agent",S.agentCount===1?"":"s",S.modelSummary?` · ${S.modelSummary}`:""]}),a.jsx("div",{className:"font-mono text-xs text-foreground/80",children:S.scenarioPreview})]})})()}),a.jsx(ze,{className:"text-xs text-muted-foreground",children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(hi,{className:"h-3 w-3"}),new Date(y.timestamp).toLocaleString()]})}),a.jsx(ze,{children:a.jsx(Js,{rate:y.overallPassRate})}),a.jsx(ze,{className:"text-right font-mono text-sm",children:y.totalScenarios})]},y.id))})]})})]})})]})};function $C({value:e,onValueChange:t,placeholder:n="Search...",className:r,inputClassName:s,clearAriaLabel:i="Clear search"}){return a.jsxs("div",{className:Se("relative",r),children:[a.jsx(gt,{value:e,onChange:o=>t(o.target.value),placeholder:n,className:Se("h-9 w-[240px] pr-8",s)}),e&&a.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 h-7 w-7 -translate-y-1/2 border border-border/60",onClick:()=>t(""),"aria-label":i,children:a.jsx(As,{className:"h-4 w-4"})})]})}var cpe=m.createContext(void 0);function Su(e){const t=m.useContext(cpe);return e||t||"ltr"}var Dj="rovingFocusGroup.onEntryFocus",upe={bubbles:!1,cancelable:!0},Vf="RovingFocusGroup",[q1,$F,dpe]=Cf(Vf),[fpe,pg]=mr(Vf,[dpe]),[ppe,hpe]=fpe(Vf),DF=m.forwardRef((e,t)=>a.jsx(q1.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(q1.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(mpe,{...e,ref:t})})}));DF.displayName=Vf;var mpe=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:h=!1,...p}=e,x=m.useRef(null),g=St(t,x),j=Su(i),[b,y]=ha({prop:o,defaultProp:c??null,onChange:d,caller:Vf}),[S,C]=m.useState(!1),N=Vn(f),E=$F(n),A=m.useRef(!1),[P,O]=m.useState(0);return m.useEffect(()=>{const T=x.current;if(T)return T.addEventListener(Dj,N),()=>T.removeEventListener(Dj,N)},[N]),a.jsx(ppe,{scope:n,orientation:r,dir:j,loop:s,currentTabStopId:b,onItemFocus:m.useCallback(T=>y(T),[y]),onItemShiftTab:m.useCallback(()=>C(!0),[]),onFocusableItemAdd:m.useCallback(()=>O(T=>T+1),[]),onFocusableItemRemove:m.useCallback(()=>O(T=>T-1),[]),children:a.jsx(Ye.div,{tabIndex:S||P===0?-1:0,"data-orientation":r,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:Te(e.onMouseDown,()=>{A.current=!0}),onFocus:Te(e.onFocus,T=>{const $=!A.current;if(T.target===T.currentTarget&&$&&!S){const z=new CustomEvent(Dj,upe);if(T.currentTarget.dispatchEvent(z),!z.defaultPrevented){const q=E().filter(W=>W.focusable),F=q.find(W=>W.active),H=q.find(W=>W.id===b),R=[F,H,...q].filter(Boolean).map(W=>W.ref.current);BF(R,h)}}A.current=!1}),onBlur:Te(e.onBlur,()=>C(!1))})})}),LF="RovingFocusGroupItem",FF=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:o,...c}=e,d=nr(),f=i||d,h=hpe(LF,n),p=h.currentTabStopId===f,x=$F(n),{onFocusableItemAdd:g,onFocusableItemRemove:j,currentTabStopId:b}=h;return m.useEffect(()=>{if(r)return g(),()=>j()},[r,g,j]),a.jsx(q1.ItemSlot,{scope:n,id:f,focusable:r,active:s,children:a.jsx(Ye.span,{tabIndex:p?0:-1,"data-orientation":h.orientation,...c,ref:t,onMouseDown:Te(e.onMouseDown,y=>{r?h.onItemFocus(f):y.preventDefault()}),onFocus:Te(e.onFocus,()=>h.onItemFocus(f)),onKeyDown:Te(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){h.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const S=xpe(y,h.orientation,h.dir);if(S!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let N=x().filter(E=>E.focusable).map(E=>E.ref.current);if(S==="last")N.reverse();else if(S==="prev"||S==="next"){S==="prev"&&N.reverse();const E=N.indexOf(y.currentTarget);N=h.loop?ype(N,E+1):N.slice(E+1)}setTimeout(()=>BF(N))}}),children:typeof o=="function"?o({isCurrentTabStop:p,hasTabStop:b!=null}):o})})});FF.displayName=LF;var vpe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function gpe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function xpe(e,t,n){const r=gpe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return vpe[r]}function BF(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function ype(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var zF=DF,qF=FF;function bpe(e){const t=wpe(e),n=m.forwardRef((r,s)=>{const{children:i,...o}=r,c=m.Children.toArray(i),d=c.find(Spe);if(d){const f=d.props.children,h=c.map(p=>p===d?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:p);return a.jsx(t,{...o,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return a.jsx(t,{...o,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function wpe(e){const t=m.forwardRef((n,r)=>{const{children:s,...i}=n;if(m.isValidElement(s)){const o=Cpe(s),c=Npe(i,s.props);return s.type!==m.Fragment&&(c.ref=r?kr(r,o):o),m.cloneElement(s,c)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var jpe=Symbol("radix.slottable");function Spe(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===jpe}function Npe(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...c)=>{const d=i(...c);return s(...c),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function Cpe(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 U1=["Enter"," "],_pe=["ArrowDown","PageUp","Home"],UF=["ArrowUp","PageDown","End"],Ape=[..._pe,...UF],Epe={ltr:[...U1,"ArrowRight"],rtl:[...U1,"ArrowLeft"]},Ppe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Hf="Menu",[wf,kpe,Ope]=Cf(Hf),[_l,WF]=mr(Hf,[Ope,co,pg]),hg=co(),VF=pg(),[Tpe,Al]=_l(Hf),[Rpe,Kf]=_l(Hf),HF=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:i,modal:o=!0}=e,c=hg(t),[d,f]=m.useState(null),h=m.useRef(!1),p=Vn(i),x=Su(s);return m.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})}},[]),a.jsx(dv,{...c,children:a.jsx(Tpe,{scope:t,open:n,onOpenChange:p,content:d,onContentChange:f,children:a.jsx(Rpe,{scope:t,onClose:m.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:h,dir:x,modal:o,children:r})})})};HF.displayName=Hf;var Ipe="MenuAnchor",DC=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=hg(n);return a.jsx(Ef,{...s,...r,ref:t})});DC.displayName=Ipe;var LC="MenuPortal",[Mpe,KF]=_l(LC,{forceMount:void 0}),GF=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,i=Al(LC,t);return a.jsx(Mpe,{scope:t,forceMount:n,children:a.jsx(Yn,{present:n||i.open,children:a.jsx(gl,{asChild:!0,container:s,children:r})})})};GF.displayName=LC;var ka="MenuContent",[$pe,FC]=_l(ka),YF=m.forwardRef((e,t)=>{const n=KF(ka,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=Al(ka,e.__scopeMenu),o=Kf(ka,e.__scopeMenu);return a.jsx(wf.Provider,{scope:e.__scopeMenu,children:a.jsx(Yn,{present:r||i.open,children:a.jsx(wf.Slot,{scope:e.__scopeMenu,children:o.modal?a.jsx(Dpe,{...s,ref:t}):a.jsx(Lpe,{...s,ref:t})})})})}),Dpe=m.forwardRef((e,t)=>{const n=Al(ka,e.__scopeMenu),r=m.useRef(null),s=St(t,r);return m.useEffect(()=>{const i=r.current;if(i)return Nv(i)},[]),a.jsx(BC,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Te(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Lpe=m.forwardRef((e,t)=>{const n=Al(ka,e.__scopeMenu);return a.jsx(BC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Fpe=bpe("MenuContent.ScrollLock"),BC=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:x,onDismiss:g,disableOutsideScroll:j,...b}=e,y=Al(ka,n),S=Kf(ka,n),C=hg(n),N=VF(n),E=kpe(n),[A,P]=m.useState(null),O=m.useRef(null),T=St(t,O,y.onContentChange),$=m.useRef(0),z=m.useRef(""),q=m.useRef(0),F=m.useRef(null),H=m.useRef("right"),U=m.useRef(0),R=j?Of:m.Fragment,W=j?{as:Fpe,allowPinchZoom:!0}:void 0,X=B=>{const J=z.current+B,D=E().filter(V=>!V.disabled),I=document.activeElement,re=D.find(V=>V.ref.current===I)?.textValue,ne=D.map(V=>V.textValue),fe=Qpe(ne,J,re),he=D.find(V=>V.textValue===fe)?.ref.current;(function V(de){z.current=de,window.clearTimeout($.current),de!==""&&($.current=window.setTimeout(()=>V(""),1e3))})(J),he&&setTimeout(()=>he.focus())};m.useEffect(()=>()=>window.clearTimeout($.current),[]),jv();const G=m.useCallback(B=>H.current===F.current?.side&&Zpe(B,F.current?.area),[]);return a.jsx($pe,{scope:n,searchRef:z,onItemEnter:m.useCallback(B=>{G(B)&&B.preventDefault()},[G]),onItemLeave:m.useCallback(B=>{G(B)||(O.current?.focus(),P(null))},[G]),onTriggerLeave:m.useCallback(B=>{G(B)&&B.preventDefault()},[G]),pointerGraceTimerRef:q,onPointerGraceIntentChange:m.useCallback(B=>{F.current=B},[]),children:a.jsx(R,{...W,children:a.jsx(kf,{asChild:!0,trapped:s,onMountAutoFocus:Te(i,B=>{B.preventDefault(),O.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:a.jsx(vl,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:x,onDismiss:g,children:a.jsx(zF,{asChild:!0,...N,dir:S.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:P,onEntryFocus:Te(d,B=>{S.isUsingKeyboardRef.current||B.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(fv,{role:"menu","aria-orientation":"vertical","data-state":dB(y.open),"data-radix-menu-content":"",dir:S.dir,...C,...b,ref:T,style:{outline:"none",...b.style},onKeyDown:Te(b.onKeyDown,B=>{const D=B.target.closest("[data-radix-menu-content]")===B.currentTarget,I=B.ctrlKey||B.altKey||B.metaKey,re=B.key.length===1;D&&(B.key==="Tab"&&B.preventDefault(),!I&&re&&X(B.key));const ne=O.current;if(B.target!==ne||!Ape.includes(B.key))return;B.preventDefault();const he=E().filter(V=>!V.disabled).map(V=>V.ref.current);UF.includes(B.key)&&he.reverse(),Ype(he)}),onBlur:Te(e.onBlur,B=>{B.currentTarget.contains(B.target)||(window.clearTimeout($.current),z.current="")}),onPointerMove:Te(e.onPointerMove,jf(B=>{const J=B.target,D=U.current!==B.clientX;if(B.currentTarget.contains(J)&&D){const I=B.clientX>U.current?"right":"left";H.current=I,U.current=B.clientX}}))})})})})})})});YF.displayName=ka;var Bpe="MenuGroup",zC=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(Ye.div,{role:"group",...r,ref:t})});zC.displayName=Bpe;var zpe="MenuLabel",XF=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(Ye.div,{...r,ref:t})});XF.displayName=zpe;var Km="MenuItem",$M="menu.itemSelect",mg=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,i=m.useRef(null),o=Kf(Km,e.__scopeMenu),c=FC(Km,e.__scopeMenu),d=St(t,i),f=m.useRef(!1),h=()=>{const p=i.current;if(!n&&p){const x=new CustomEvent($M,{bubbles:!0,cancelable:!0});p.addEventListener($M,g=>r?.(g),{once:!0}),iN(p,x),x.defaultPrevented?f.current=!1:o.onClose()}};return a.jsx(QF,{...s,ref:d,disabled:n,onClick:Te(e.onClick,h),onPointerDown:p=>{e.onPointerDown?.(p),f.current=!0},onPointerUp:Te(e.onPointerUp,p=>{f.current||p.currentTarget?.click()}),onKeyDown:Te(e.onKeyDown,p=>{const x=c.searchRef.current!=="";n||x&&p.key===" "||U1.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});mg.displayName=Km;var QF=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=e,o=FC(Km,n),c=VF(n),d=m.useRef(null),f=St(t,d),[h,p]=m.useState(!1),[x,g]=m.useState("");return m.useEffect(()=>{const j=d.current;j&&g((j.textContent??"").trim())},[i.children]),a.jsx(wf.ItemSlot,{scope:n,disabled:r,textValue:s??x,children:a.jsx(qF,{asChild:!0,...c,focusable:!r,children:a.jsx(Ye.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:f,onPointerMove:Te(e.onPointerMove,jf(j=>{r?o.onItemLeave(j):(o.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Te(e.onPointerLeave,jf(j=>o.onItemLeave(j))),onFocus:Te(e.onFocus,()=>p(!0)),onBlur:Te(e.onBlur,()=>p(!1))})})})}),qpe="MenuCheckboxItem",JF=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return a.jsx(rB,{scope:e.__scopeMenu,checked:n,children:a.jsx(mg,{role:"menuitemcheckbox","aria-checked":Gm(n)?"mixed":n,...s,ref:t,"data-state":UC(n),onSelect:Te(s.onSelect,()=>r?.(Gm(n)?!0:!n),{checkForDefaultPrevented:!1})})})});JF.displayName=qpe;var ZF="MenuRadioGroup",[Upe,Wpe]=_l(ZF,{value:void 0,onValueChange:()=>{}}),eB=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,i=Vn(r);return a.jsx(Upe,{scope:e.__scopeMenu,value:n,onValueChange:i,children:a.jsx(zC,{...s,ref:t})})});eB.displayName=ZF;var tB="MenuRadioItem",nB=m.forwardRef((e,t)=>{const{value:n,...r}=e,s=Wpe(tB,e.__scopeMenu),i=n===s.value;return a.jsx(rB,{scope:e.__scopeMenu,checked:i,children:a.jsx(mg,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":UC(i),onSelect:Te(r.onSelect,()=>s.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});nB.displayName=tB;var qC="MenuItemIndicator",[rB,Vpe]=_l(qC,{checked:!1}),aB=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,i=Vpe(qC,n);return a.jsx(Yn,{present:r||Gm(i.checked)||i.checked===!0,children:a.jsx(Ye.span,{...s,ref:t,"data-state":UC(i.checked)})})});aB.displayName=qC;var Hpe="MenuSeparator",sB=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(Ye.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});sB.displayName=Hpe;var Kpe="MenuArrow",iB=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=hg(n);return a.jsx(pv,{...s,...r,ref:t})});iB.displayName=Kpe;var Gpe="MenuSub",[sye,oB]=_l(Gpe),Sd="MenuSubTrigger",lB=m.forwardRef((e,t)=>{const n=Al(Sd,e.__scopeMenu),r=Kf(Sd,e.__scopeMenu),s=oB(Sd,e.__scopeMenu),i=FC(Sd,e.__scopeMenu),o=m.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=i,f={__scopeMenu:e.__scopeMenu},h=m.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return m.useEffect(()=>h,[h]),m.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),d(null)}},[c,d]),a.jsx(DC,{asChild:!0,...f,children:a.jsx(QF,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":dB(n.open),...e,ref:kr(t,s.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Te(e.onPointerMove,jf(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:Te(e.onPointerLeave,jf(p=>{h();const x=n.content?.getBoundingClientRect();if(x){const g=n.content?.dataset.side,j=g==="right",b=j?-5:5,y=x[j?"left":"right"],S=x[j?"right":"left"];i.onPointerGraceIntentChange({area:[{x:p.clientX+b,y:p.clientY},{x:y,y:x.top},{x:S,y:x.top},{x:S,y:x.bottom},{x:y,y:x.bottom}],side:g}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(p),p.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Te(e.onKeyDown,p=>{const x=i.searchRef.current!=="";e.disabled||x&&p.key===" "||Epe[r.dir].includes(p.key)&&(n.onOpenChange(!0),n.content?.focus(),p.preventDefault())})})})});lB.displayName=Sd;var cB="MenuSubContent",uB=m.forwardRef((e,t)=>{const n=KF(ka,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=Al(ka,e.__scopeMenu),o=Kf(ka,e.__scopeMenu),c=oB(cB,e.__scopeMenu),d=m.useRef(null),f=St(t,d);return a.jsx(wf.Provider,{scope:e.__scopeMenu,children:a.jsx(Yn,{present:r||i.open,children:a.jsx(wf.Slot,{scope:e.__scopeMenu,children:a.jsx(BC,{id:c.contentId,"aria-labelledby":c.triggerId,...s,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:Te(e.onFocusOutside,h=>{h.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Te(e.onEscapeKeyDown,h=>{o.onClose(),h.preventDefault()}),onKeyDown:Te(e.onKeyDown,h=>{const p=h.currentTarget.contains(h.target),x=Ppe[o.dir].includes(h.key);p&&x&&(i.onOpenChange(!1),c.trigger?.focus(),h.preventDefault())})})})})})});uB.displayName=cB;function dB(e){return e?"open":"closed"}function Gm(e){return e==="indeterminate"}function UC(e){return Gm(e)?"indeterminate":e?"checked":"unchecked"}function Ype(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Xpe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Qpe(e,t,n){const s=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=Xpe(e,Math.max(i,0));s.length===1&&(o=o.filter(f=>f!==n));const d=o.find(f=>f.toLowerCase().startsWith(s.toLowerCase()));return d!==n?d:void 0}function Jpe(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const c=t[i],d=t[o],f=c.x,h=c.y,p=d.x,x=d.y;h>r!=x>r&&n<(p-f)*(r-h)/(x-h)+f&&(s=!s)}return s}function Zpe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Jpe(n,t)}function jf(e){return t=>t.pointerType==="mouse"?e(t):void 0}var ehe=HF,the=DC,nhe=GF,rhe=YF,ahe=zC,she=XF,ihe=mg,ohe=JF,lhe=eB,che=nB,uhe=aB,dhe=sB,fhe=iB,phe=lB,hhe=uB,vg="DropdownMenu",[mhe]=mr(vg,[WF]),Or=WF(),[vhe,fB]=mhe(vg),pB=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:i,onOpenChange:o,modal:c=!0}=e,d=Or(t),f=m.useRef(null),[h,p]=ha({prop:s,defaultProp:i??!1,onChange:o,caller:vg});return a.jsx(vhe,{scope:t,triggerId:nr(),triggerRef:f,contentId:nr(),open:h,onOpenChange:p,onOpenToggle:m.useCallback(()=>p(x=>!x),[p]),modal:c,children:a.jsx(ehe,{...d,open:h,onOpenChange:p,dir:r,modal:c,children:n})})};pB.displayName=vg;var hB="DropdownMenuTrigger",mB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,i=fB(hB,n),o=Or(n);return a.jsx(the,{asChild:!0,...o,children:a.jsx(Ye.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,...s,ref:kr(t,i.triggerRef),onPointerDown:Te(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(i.onOpenToggle(),i.open||c.preventDefault())}),onKeyDown:Te(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&i.onOpenToggle(),c.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});mB.displayName=hB;var ghe="DropdownMenuPortal",vB=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Or(t);return a.jsx(nhe,{...r,...n})};vB.displayName=ghe;var gB="DropdownMenuContent",xB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=fB(gB,n),i=Or(n),o=m.useRef(!1);return a.jsx(rhe,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...r,ref:t,onCloseAutoFocus:Te(e.onCloseAutoFocus,c=>{o.current||s.triggerRef.current?.focus(),o.current=!1,c.preventDefault()}),onInteractOutside:Te(e.onInteractOutside,c=>{const d=c.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0,h=d.button===2||f;(!s.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)"}})});xB.displayName=gB;var xhe="DropdownMenuGroup",yhe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(ahe,{...s,...r,ref:t})});yhe.displayName=xhe;var bhe="DropdownMenuLabel",yB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(she,{...s,...r,ref:t})});yB.displayName=bhe;var whe="DropdownMenuItem",bB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(ihe,{...s,...r,ref:t})});bB.displayName=whe;var jhe="DropdownMenuCheckboxItem",wB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(ohe,{...s,...r,ref:t})});wB.displayName=jhe;var She="DropdownMenuRadioGroup",Nhe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(lhe,{...s,...r,ref:t})});Nhe.displayName=She;var Che="DropdownMenuRadioItem",jB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(che,{...s,...r,ref:t})});jB.displayName=Che;var _he="DropdownMenuItemIndicator",SB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(uhe,{...s,...r,ref:t})});SB.displayName=_he;var Ahe="DropdownMenuSeparator",NB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(dhe,{...s,...r,ref:t})});NB.displayName=Ahe;var Ehe="DropdownMenuArrow",Phe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(fhe,{...s,...r,ref:t})});Phe.displayName=Ehe;var khe="DropdownMenuSubTrigger",CB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(phe,{...s,...r,ref:t})});CB.displayName=khe;var Ohe="DropdownMenuSubContent",_B=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Or(n);return a.jsx(hhe,{...s,...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)"}})});_B.displayName=Ohe;var The=pB,Rhe=mB,Ihe=vB,AB=xB,EB=yB,PB=bB,kB=wB,OB=jB,TB=SB,RB=NB,IB=CB,MB=_B;const Gf=The,Yf=Rhe,Mhe=m.forwardRef(({className:e,inset:t,children:n,...r},s)=>a.jsxs(IB,{ref:s,className:Se("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",t&&"pl-8",e),...r,children:[n,a.jsx(uN,{className:"ml-auto h-4 w-4"})]}));Mhe.displayName=IB.displayName;const $he=m.forwardRef(({className:e,...t},n)=>a.jsx(MB,{ref:n,className:Se("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));$he.displayName=MB.displayName;const Nu=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>a.jsx(Ihe,{children:a.jsx(AB,{ref:r,sideOffset:t,className:Se("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Nu.displayName=AB.displayName;const Gr=m.forwardRef(({className:e,inset:t,...n},r)=>a.jsx(PB,{ref:r,className:Se("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t&&"pl-8",e),...n}));Gr.displayName=PB.displayName;const Dhe=m.forwardRef(({className:e,children:t,checked:n,...r},s)=>a.jsxs(kB,{ref:s,className:Se("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),checked:n,...r,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(TB,{children:a.jsx(Ec,{className:"h-4 w-4"})})}),t]}));Dhe.displayName=kB.displayName;const Lhe=m.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(OB,{ref:r,className:Se("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(TB,{children:a.jsx(E7,{className:"h-2 w-2 fill-current"})})}),t]}));Lhe.displayName=OB.displayName;const $B=m.forwardRef(({className:e,inset:t,...n},r)=>a.jsx(EB,{ref:r,className:Se("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));$B.displayName=EB.displayName;const DB=m.forwardRef(({className:e,...t},n)=>a.jsx(RB,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",e),...t}));DB.displayName=RB.displayName;function Sf(e,[t,n]){return Math.min(n,Math.max(t,e))}function Fhe(e){const t=Bhe(e),n=m.forwardRef((r,s)=>{const{children:i,...o}=r,c=m.Children.toArray(i),d=c.find(qhe);if(d){const f=d.props.children,h=c.map(p=>p===d?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:p);return a.jsx(t,{...o,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return a.jsx(t,{...o,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function Bhe(e){const t=m.forwardRef((n,r)=>{const{children:s,...i}=n;if(m.isValidElement(s)){const o=Whe(s),c=Uhe(i,s.props);return s.type!==m.Fragment&&(c.ref=r?kr(r,o):o),m.cloneElement(s,c)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zhe=Symbol("radix.slottable");function qhe(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zhe}function Uhe(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...c)=>{const d=i(...c);return s(...c),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function Whe(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 gg(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Vhe=[" ","Enter","ArrowUp","ArrowDown"],Hhe=[" ","Enter"],ol="Select",[xg,yg,Khe]=Cf(ol),[Cu]=mr(ol,[Khe,co]),bg=co(),[Ghe,vo]=Cu(ol),[Yhe,Xhe]=Cu(ol),LB=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:i,value:o,defaultValue:c,onValueChange:d,dir:f,name:h,autoComplete:p,disabled:x,required:g,form:j}=e,b=bg(t),[y,S]=m.useState(null),[C,N]=m.useState(null),[E,A]=m.useState(!1),P=Su(f),[O,T]=ha({prop:r,defaultProp:s??!1,onChange:i,caller:ol}),[$,z]=ha({prop:o,defaultProp:c,onChange:d,caller:ol}),q=m.useRef(null),F=y?j||!!y.closest("form"):!0,[H,U]=m.useState(new Set),R=Array.from(H).map(W=>W.props.value).join(";");return a.jsx(dv,{...b,children:a.jsxs(Ghe,{required:g,scope:t,trigger:y,onTriggerChange:S,valueNode:C,onValueNodeChange:N,valueNodeHasChildren:E,onValueNodeHasChildrenChange:A,contentId:nr(),value:$,onValueChange:z,open:O,onOpenChange:T,dir:P,triggerPointerDownPosRef:q,disabled:x,children:[a.jsx(xg.Provider,{scope:t,children:a.jsx(Yhe,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(W=>{U(X=>new Set(X).add(W))},[]),onNativeOptionRemove:m.useCallback(W=>{U(X=>{const G=new Set(X);return G.delete(W),G})},[]),children:n})}),F?a.jsxs(lz,{"aria-hidden":!0,required:g,tabIndex:-1,name:h,autoComplete:p,value:$,onChange:W=>z(W.target.value),disabled:x,form:j,children:[$===void 0?a.jsx("option",{value:""}):null,Array.from(H)]},R):null]})})};LB.displayName=ol;var FB="SelectTrigger",BB=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,i=bg(n),o=vo(FB,n),c=o.disabled||r,d=St(t,o.onTriggerChange),f=yg(n),h=m.useRef("touch"),[p,x,g]=uz(b=>{const y=f().filter(N=>!N.disabled),S=y.find(N=>N.value===o.value),C=dz(y,b,S);C!==void 0&&o.onValueChange(C.value)}),j=b=>{c||(o.onOpenChange(!0),g()),b&&(o.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return a.jsx(Ef,{asChild:!0,...i,children:a.jsx(Ye.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":cz(o.value)?"":void 0,...s,ref:d,onClick:Te(s.onClick,b=>{b.currentTarget.focus(),h.current!=="mouse"&&j(b)}),onPointerDown:Te(s.onPointerDown,b=>{h.current=b.pointerType;const y=b.target;y.hasPointerCapture(b.pointerId)&&y.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(j(b),b.preventDefault())}),onKeyDown:Te(s.onKeyDown,b=>{const y=p.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&x(b.key),!(y&&b.key===" ")&&Vhe.includes(b.key)&&(j(),b.preventDefault())})})})});BB.displayName=FB;var zB="SelectValue",qB=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:o="",...c}=e,d=vo(zB,n),{onValueNodeHasChildrenChange:f}=d,h=i!==void 0,p=St(t,d.onValueNodeChange);return rr(()=>{f(h)},[f,h]),a.jsx(Ye.span,{...c,ref:p,style:{pointerEvents:"none"},children:cz(d.value)?a.jsx(a.Fragment,{children:o}):i})});qB.displayName=zB;var Qhe="SelectIcon",UB=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return a.jsx(Ye.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});UB.displayName=Qhe;var Jhe="SelectPortal",WB=e=>a.jsx(gl,{asChild:!0,...e});WB.displayName=Jhe;var ll="SelectContent",VB=m.forwardRef((e,t)=>{const n=vo(ll,e.__scopeSelect),[r,s]=m.useState();if(rr(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?lu.createPortal(a.jsx(HB,{scope:e.__scopeSelect,children:a.jsx(xg.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),i):null}return a.jsx(KB,{...e,ref:t})});VB.displayName=ll;var Ha=10,[HB,go]=Cu(ll),Zhe="SelectContentImpl",eme=Fhe("SelectContent.RemoveScroll"),KB=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:o,side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:x,collisionPadding:g,sticky:j,hideWhenDetached:b,avoidCollisions:y,...S}=e,C=vo(ll,n),[N,E]=m.useState(null),[A,P]=m.useState(null),O=St(t,V=>E(V)),[T,$]=m.useState(null),[z,q]=m.useState(null),F=yg(n),[H,U]=m.useState(!1),R=m.useRef(!1);m.useEffect(()=>{if(N)return Nv(N)},[N]),jv();const W=m.useCallback(V=>{const[de,...Q]=F().map(ae=>ae.ref.current),[ee]=Q.slice(-1),pe=document.activeElement;for(const ae of V)if(ae===pe||(ae?.scrollIntoView({block:"nearest"}),ae===de&&A&&(A.scrollTop=0),ae===ee&&A&&(A.scrollTop=A.scrollHeight),ae?.focus(),document.activeElement!==pe))return},[F,A]),X=m.useCallback(()=>W([T,N]),[W,T,N]);m.useEffect(()=>{H&&X()},[H,X]);const{onOpenChange:G,triggerPointerDownPosRef:B}=C;m.useEffect(()=>{if(N){let V={x:0,y:0};const de=ee=>{V={x:Math.abs(Math.round(ee.pageX)-(B.current?.x??0)),y:Math.abs(Math.round(ee.pageY)-(B.current?.y??0))}},Q=ee=>{V.x<=10&&V.y<=10?ee.preventDefault():N.contains(ee.target)||G(!1),document.removeEventListener("pointermove",de),B.current=null};return B.current!==null&&(document.addEventListener("pointermove",de),document.addEventListener("pointerup",Q,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",de),document.removeEventListener("pointerup",Q,{capture:!0})}}},[N,G,B]),m.useEffect(()=>{const V=()=>G(!1);return window.addEventListener("blur",V),window.addEventListener("resize",V),()=>{window.removeEventListener("blur",V),window.removeEventListener("resize",V)}},[G]);const[J,D]=uz(V=>{const de=F().filter(pe=>!pe.disabled),Q=de.find(pe=>pe.ref.current===document.activeElement),ee=dz(de,V,Q);ee&&setTimeout(()=>ee.ref.current.focus())}),I=m.useCallback((V,de,Q)=>{const ee=!R.current&&!Q;(C.value!==void 0&&C.value===de||ee)&&($(V),ee&&(R.current=!0))},[C.value]),re=m.useCallback(()=>N?.focus(),[N]),ne=m.useCallback((V,de,Q)=>{const ee=!R.current&&!Q;(C.value!==void 0&&C.value===de||ee)&&q(V)},[C.value]),fe=r==="popper"?W1:GB,he=fe===W1?{side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:x,collisionPadding:g,sticky:j,hideWhenDetached:b,avoidCollisions:y}:{};return a.jsx(HB,{scope:n,content:N,viewport:A,onViewportChange:P,itemRefCallback:I,selectedItem:T,onItemLeave:re,itemTextRefCallback:ne,focusSelectedItem:X,selectedItemText:z,position:r,isPositioned:H,searchRef:J,children:a.jsx(Of,{as:eme,allowPinchZoom:!0,children:a.jsx(kf,{asChild:!0,trapped:C.open,onMountAutoFocus:V=>{V.preventDefault()},onUnmountAutoFocus:Te(s,V=>{C.trigger?.focus({preventScroll:!0}),V.preventDefault()}),children:a.jsx(vl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:V=>V.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:a.jsx(fe,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:V=>V.preventDefault(),...S,...he,onPlaced:()=>U(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:Te(S.onKeyDown,V=>{const de=V.ctrlKey||V.altKey||V.metaKey;if(V.key==="Tab"&&V.preventDefault(),!de&&V.key.length===1&&D(V.key),["ArrowUp","ArrowDown","Home","End"].includes(V.key)){let ee=F().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);if(["ArrowUp","End"].includes(V.key)&&(ee=ee.slice().reverse()),["ArrowUp","ArrowDown"].includes(V.key)){const pe=V.target,ae=ee.indexOf(pe);ee=ee.slice(ae+1)}setTimeout(()=>W(ee)),V.preventDefault()}})})})})})})});KB.displayName=Zhe;var tme="SelectItemAlignedPosition",GB=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,i=vo(ll,n),o=go(ll,n),[c,d]=m.useState(null),[f,h]=m.useState(null),p=St(t,O=>h(O)),x=yg(n),g=m.useRef(!1),j=m.useRef(!0),{viewport:b,selectedItem:y,selectedItemText:S,focusSelectedItem:C}=o,N=m.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&f&&b&&y&&S){const O=i.trigger.getBoundingClientRect(),T=f.getBoundingClientRect(),$=i.valueNode.getBoundingClientRect(),z=S.getBoundingClientRect();if(i.dir!=="rtl"){const pe=z.left-T.left,ae=$.left-pe,Re=O.left-ae,Ce=O.width+Re,Me=Math.max(Ce,T.width),L=window.innerWidth-Ha,oe=Sf(ae,[Ha,Math.max(Ha,L-Me)]);c.style.minWidth=Ce+"px",c.style.left=oe+"px"}else{const pe=T.right-z.right,ae=window.innerWidth-$.right-pe,Re=window.innerWidth-O.right-ae,Ce=O.width+Re,Me=Math.max(Ce,T.width),L=window.innerWidth-Ha,oe=Sf(ae,[Ha,Math.max(Ha,L-Me)]);c.style.minWidth=Ce+"px",c.style.right=oe+"px"}const q=x(),F=window.innerHeight-Ha*2,H=b.scrollHeight,U=window.getComputedStyle(f),R=parseInt(U.borderTopWidth,10),W=parseInt(U.paddingTop,10),X=parseInt(U.borderBottomWidth,10),G=parseInt(U.paddingBottom,10),B=R+W+H+G+X,J=Math.min(y.offsetHeight*5,B),D=window.getComputedStyle(b),I=parseInt(D.paddingTop,10),re=parseInt(D.paddingBottom,10),ne=O.top+O.height/2-Ha,fe=F-ne,he=y.offsetHeight/2,V=y.offsetTop+he,de=R+W+V,Q=B-de;if(de<=ne){const pe=q.length>0&&y===q[q.length-1].ref.current;c.style.bottom="0px";const ae=f.clientHeight-b.offsetTop-b.offsetHeight,Re=Math.max(fe,he+(pe?re:0)+ae+X),Ce=de+Re;c.style.height=Ce+"px"}else{const pe=q.length>0&&y===q[0].ref.current;c.style.top="0px";const Re=Math.max(ne,R+b.offsetTop+(pe?I:0)+he)+Q;c.style.height=Re+"px",b.scrollTop=de-ne+b.offsetTop}c.style.margin=`${Ha}px 0`,c.style.minHeight=J+"px",c.style.maxHeight=F+"px",r?.(),requestAnimationFrame(()=>g.current=!0)}},[x,i.trigger,i.valueNode,c,f,b,y,S,i.dir,r]);rr(()=>N(),[N]);const[E,A]=m.useState();rr(()=>{f&&A(window.getComputedStyle(f).zIndex)},[f]);const P=m.useCallback(O=>{O&&j.current===!0&&(N(),C?.(),j.current=!1)},[N,C]);return a.jsx(rme,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:P,children:a.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:a.jsx(Ye.div,{...s,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});GB.displayName=tme;var nme="SelectPopperPosition",W1=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Ha,...i}=e,o=bg(n);return a.jsx(fv,{...o,...i,ref:t,align:r,collisionPadding:s,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)"}})});W1.displayName=nme;var[rme,WC]=Cu(ll,{}),V1="SelectViewport",YB=m.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,i=go(V1,n),o=WC(V1,n),c=St(t,i.onViewportChange),d=m.useRef(0);return a.jsxs(a.Fragment,{children:[a.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}),a.jsx(xg.Slot,{scope:n,children:a.jsx(Ye.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Te(s.onScroll,f=>{const h=f.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:x}=o;if(x?.current&&p){const g=Math.abs(d.current-h.scrollTop);if(g>0){const j=window.innerHeight-Ha*2,b=parseFloat(p.style.minHeight),y=parseFloat(p.style.height),S=Math.max(b,y);if(S<j){const C=S+g,N=Math.min(j,C),E=C-N;p.style.height=N+"px",p.style.bottom==="0px"&&(h.scrollTop=E>0?E:0,p.style.justifyContent="flex-end")}}}d.current=h.scrollTop})})})]})});YB.displayName=V1;var XB="SelectGroup",[ame,sme]=Cu(XB),ime=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=nr();return a.jsx(ame,{scope:n,id:s,children:a.jsx(Ye.div,{role:"group","aria-labelledby":s,...r,ref:t})})});ime.displayName=XB;var QB="SelectLabel",JB=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=sme(QB,n);return a.jsx(Ye.div,{id:s.id,...r,ref:t})});JB.displayName=QB;var Ym="SelectItem",[ome,ZB]=Cu(Ym),ez=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...o}=e,c=vo(Ym,n),d=go(Ym,n),f=c.value===r,[h,p]=m.useState(i??""),[x,g]=m.useState(!1),j=St(t,C=>d.itemRefCallback?.(C,r,s)),b=nr(),y=m.useRef("touch"),S=()=>{s||(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 a.jsx(ome,{scope:n,value:r,disabled:s,textId:b,isSelected:f,onItemTextChange:m.useCallback(C=>{p(N=>N||(C?.textContent??"").trim())},[]),children:a.jsx(xg.ItemSlot,{scope:n,value:r,disabled:s,textValue:h,children:a.jsx(Ye.div,{role:"option","aria-labelledby":b,"data-highlighted":x?"":void 0,"aria-selected":f&&x,"data-state":f?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...o,ref:j,onFocus:Te(o.onFocus,()=>g(!0)),onBlur:Te(o.onBlur,()=>g(!1)),onClick:Te(o.onClick,()=>{y.current!=="mouse"&&S()}),onPointerUp:Te(o.onPointerUp,()=>{y.current==="mouse"&&S()}),onPointerDown:Te(o.onPointerDown,C=>{y.current=C.pointerType}),onPointerMove:Te(o.onPointerMove,C=>{y.current=C.pointerType,s?d.onItemLeave?.():y.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Te(o.onPointerLeave,C=>{C.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Te(o.onKeyDown,C=>{d.searchRef?.current!==""&&C.key===" "||(Hhe.includes(C.key)&&S(),C.key===" "&&C.preventDefault())})})})})});ez.displayName=Ym;var Nd="SelectItemText",tz=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...i}=e,o=vo(Nd,n),c=go(Nd,n),d=ZB(Nd,n),f=Xhe(Nd,n),[h,p]=m.useState(null),x=St(t,S=>p(S),d.onItemTextChange,S=>c.itemTextRefCallback?.(S,d.value,d.disabled)),g=h?.textContent,j=m.useMemo(()=>a.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value),[d.disabled,d.value,g]),{onNativeOptionAdd:b,onNativeOptionRemove:y}=f;return rr(()=>(b(j),()=>y(j)),[b,y,j]),a.jsxs(a.Fragment,{children:[a.jsx(Ye.span,{id:d.textId,...i,ref:x}),d.isSelected&&o.valueNode&&!o.valueNodeHasChildren?lu.createPortal(i.children,o.valueNode):null]})});tz.displayName=Nd;var nz="SelectItemIndicator",rz=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return ZB(nz,n).isSelected?a.jsx(Ye.span,{"aria-hidden":!0,...r,ref:t}):null});rz.displayName=nz;var H1="SelectScrollUpButton",az=m.forwardRef((e,t)=>{const n=go(H1,e.__scopeSelect),r=WC(H1,e.__scopeSelect),[s,i]=m.useState(!1),o=St(t,r.onScrollButtonChange);return rr(()=>{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]),s?a.jsx(iz,{...e,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});az.displayName=H1;var K1="SelectScrollDownButton",sz=m.forwardRef((e,t)=>{const n=go(K1,e.__scopeSelect),r=WC(K1,e.__scopeSelect),[s,i]=m.useState(!1),o=St(t,r.onScrollButtonChange);return rr(()=>{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]),s?a.jsx(iz,{...e,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});sz.displayName=K1;var iz=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,i=go("SelectScrollButton",n),o=m.useRef(null),c=yg(n),d=m.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return m.useEffect(()=>()=>d(),[d]),rr(()=>{c().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),a.jsx(Ye.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Te(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Te(s.onPointerMove,()=>{i.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Te(s.onPointerLeave,()=>{d()})})}),lme="SelectSeparator",oz=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return a.jsx(Ye.div,{"aria-hidden":!0,...r,ref:t})});oz.displayName=lme;var G1="SelectArrow",cme=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=bg(n),i=vo(G1,n),o=go(G1,n);return i.open&&o.position==="popper"?a.jsx(pv,{...s,...r,ref:t}):null});cme.displayName=G1;var ume="SelectBubbleInput",lz=m.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=m.useRef(null),i=St(r,s),o=gg(t);return m.useEffect(()=>{const c=s.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]),a.jsx(Ye.select,{...n,style:{...P$,...n.style},ref:i,defaultValue:t})});lz.displayName=ume;function cz(e){return e===""||e===void 0}function uz(e){const t=Vn(e),n=m.useRef(""),r=m.useRef(0),s=m.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=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function dz(e,t,n){const s=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=dme(e,Math.max(i,0));s.length===1&&(o=o.filter(f=>f!==n));const d=o.find(f=>f.textValue.toLowerCase().startsWith(s.toLowerCase()));return d!==n?d:void 0}function dme(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var fme=LB,fz=BB,pme=qB,hme=UB,mme=WB,pz=VB,vme=YB,hz=JB,mz=ez,gme=tz,xme=rz,vz=az,gz=sz,xz=oz;const jn=fme,Sn=pme,mn=m.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(fz,{ref:r,className:Se("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,a.jsx(hme,{asChild:!0,children:a.jsx(Yt,{className:"h-4 w-4 opacity-50"})})]}));mn.displayName=fz.displayName;const yz=m.forwardRef(({className:e,...t},n)=>a.jsx(vz,{ref:n,className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(ws,{className:"h-4 w-4"})}));yz.displayName=vz.displayName;const bz=m.forwardRef(({className:e,...t},n)=>a.jsx(gz,{ref:n,className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Yt,{className:"h-4 w-4"})}));bz.displayName=gz.displayName;const vn=m.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>a.jsx(mme,{children:a.jsxs(pz,{ref:s,className:Se("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[a.jsx(yz,{}),a.jsx(vme,{className:Se("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),a.jsx(bz,{})]})}));vn.displayName=pz.displayName;const yme=m.forwardRef(({className:e,...t},n)=>a.jsx(hz,{ref:n,className:Se("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));yme.displayName=hz.displayName;const et=m.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(mz,{ref:r,className:Se("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(xme,{children:a.jsx(Ec,{className:"h-4 w-4"})})}),a.jsx(gme,{children:t})]}));et.displayName=mz.displayName;const bme=m.forwardRef(({className:e,...t},n)=>a.jsx(xz,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",e),...t}));bme.displayName=xz.displayName;const Hi=e=>e.configName?.trim()||e.name,wme="(root)",wz="__ROOT__",DM="mcplab.configurations.collapsedSuites",Lj=e=>e.suitePath&&e.suitePath.trim().length>0?e.suitePath.trim():null,Mo=e=>e??wme,Fj=e=>e===null?wz:`suite:${e}`,jme=e=>e===wz?null:e.startsWith("suite:")?e.slice(6):null,Sme=(e,t)=>t===null?e===null:e===null?!1:e===t||e.startsWith(`${t}/`),Nme=e=>{for(const t of e){const n=t.scenarioEntries??[];for(const s of n){if(s.kind==="inline"&&s.scenario?.id)return String(s.scenario.id);if(s.kind==="referenced"&&s.ref)return String(s.ref)}const r=t.scenarios??[];for(const s of r)if(s?.id)return String(s.id)}return null},Cme=e=>Nme([e]),_me=e=>{const t=Cme(e);return t?{href:`/results?scenario=${encodeURIComponent(t)}`,tooltipLabel:`Open results filtered by scenario ${t}`}:{href:"/results",tooltipLabel:"Open results"}},LM=["bg-red-400","bg-red-500","bg-orange-400","bg-orange-500","bg-amber-400","bg-amber-500","bg-yellow-400","bg-yellow-500","bg-lime-400","bg-lime-500","bg-green-400","bg-green-500","bg-emerald-400","bg-emerald-500","bg-teal-400","bg-teal-500","bg-cyan-400","bg-cyan-500","bg-sky-400","bg-sky-500","bg-blue-400","bg-blue-500","bg-indigo-400","bg-indigo-500","bg-violet-400","bg-violet-500","bg-purple-400","bg-purple-500","bg-fuchsia-400","bg-fuchsia-500","bg-pink-400","bg-pink-500","bg-rose-400","bg-rose-500"];function Ame(e){if(e===null)return"bg-slate-400";const t=e.split("").reduce((n,r)=>(n+r.charCodeAt(0))%LM.length,0);return LM[t]??"bg-slate-400"}const Eme=()=>{const{configs:e,deleteConfig:t,cloneConfig:n,loading:r,reload:s}=Mf(),{source:i}=Ln(),o=Ia(),[c,d]=m.useState("name"),[f,h]=m.useState("asc"),[p,x]=m.useState(""),[g,j]=m.useState("all"),[b,y]=m.useState(()=>{try{const D=window.localStorage.getItem(DM);if(!D)return new Set;const I=JSON.parse(D);return Array.isArray(I)?new Set(I.filter(re=>typeof re=="string")):new Set}catch(D){return console.warn("Failed to restore collapsed suites from localStorage",D),new Set}}),[S,C]=m.useState(new Set),[N,E]=m.useState(new Set),[A,P]=m.useState(new Set),O=p.trim().toLowerCase(),T=D=>{if(c===D){h(I=>I==="asc"?"desc":"asc");return}d(D),h(D==="updatedAt"?"desc":"asc")};m.useEffect(()=>{s();const D=()=>{s()};return window.addEventListener("focus",D),()=>{window.removeEventListener("focus",D)}},[s]);const $=async(D,I)=>{await t(D),_e({title:"Deleted",description:`"${I}" has been removed.`})},z=async D=>{const I=await n(D);_e({title:"Cloned",description:`Created "${Hi(I)}".`}),o(`/mcp-evaluations/${I.id}`)},q=D=>D.agentEntries?.length??D.agents?.length??0,F=D=>D.scenarioEntries?.length??D.scenarios?.length??0,H=m.useMemo(()=>{const D=new Set;for(const I of e){const re=Lj(I);if(D.add(re),!re)continue;const ne=re.split("/").filter(Boolean);for(let fe=1;fe<ne.length;fe+=1)D.add(ne.slice(0,fe).join("/"))}return Array.from(D).sort((I,re)=>Mo(I).localeCompare(Mo(re)))},[e]),U=m.useMemo(()=>e.filter(D=>{const I=Lj(D),re=g==="all"?void 0:jme(g),ne=Mo(I);return re!==void 0&&!Sme(I,re)?!1:O.length===0?!0:[Hi(D),D.id,D.description??"",D.loadError??"",ne,D.relativePath??""].join(" ").toLowerCase().includes(O)}),[e,O,g]),R=m.useMemo(()=>[...U].sort((I,re)=>{let ne=0;return c==="name"&&(ne=Hi(I).localeCompare(Hi(re))),c==="scenarios"&&(ne=F(I)-F(re)),c==="agents"&&(ne=q(I)-q(re)),c==="updatedAt"&&(ne=new Date(I.updatedAt).getTime()-new Date(re.updatedAt).getTime()),f==="asc"?ne:-ne}),[U,c,f]),W=D=>c!==D?a.jsx(xc,{className:"h-3.5 w-3.5 text-muted-foreground"}):f==="asc"?a.jsx(ws,{className:"h-3.5 w-3.5"}):a.jsx(Yt,{className:"h-3.5 w-3.5"}),X=D=>{y(I=>{const re=new Set(I);return re.has(D)?re.delete(D):re.add(D),re})},G=async(D,I,re)=>{if(!N.has(D)){E(ne=>new Set(ne).add(D));try{await i.startRun({configPath:I,runsPerScenario:1,applySnapshotEval:!0}),C(ne=>new Set(ne).add(D)),window.setTimeout(()=>{C(ne=>{const fe=new Set(ne);return fe.delete(D),fe})},2e3),_e({title:"Queued",description:`"${re}" added to run queue.`})}catch(ne){_e({title:"Could not queue evaluation",description:ne instanceof Error?ne.message:String(ne),variant:"destructive"})}finally{E(ne=>{const fe=new Set(ne);return fe.delete(D),fe})}}};m.useEffect(()=>{try{window.localStorage.setItem(DM,JSON.stringify(Array.from(b)))}catch(D){console.warn("Failed to persist collapsed suites to localStorage (quota/private mode?)",D)}},[b]);const B=async(D,I,re)=>{if(!A.has(D)){P(ne=>new Set(ne).add(D));try{const ne=re.filter(ee=>typeof ee.sourcePath=="string"&&ee.sourcePath.trim().length>0);if(ne.length===0){_e({title:"No runnable evaluations",description:`Suite "${I}" has no evaluation files with a source path.`,variant:"destructive"});return}const fe=await Promise.allSettled(ne.map(ee=>i.startRun({configPath:String(ee.sourcePath),runsPerScenario:1,applySnapshotEval:!0}))),he=fe.filter(ee=>ee.status==="fulfilled").length,V=fe.length-he,de=fe.find(ee=>ee.status==="rejected"),Q=de?de.reason instanceof Error?de.reason.message:String(de.reason):void 0;_e({title:V===0?"Suite queued":"Suite queued with errors",description:V===0?`Queued ${he} evaluation${he===1?"":"s"} for suite "${I}".`:`Queued ${he}/${ne.length} evaluations for suite "${I}" (${V} failed${Q?`: ${Q}`:""}).`,variant:V===0?"default":"destructive"})}catch(ne){_e({title:"Could not queue suite",description:ne instanceof Error?ne.message:String(ne),variant:"destructive"})}finally{P(ne=>{const fe=new Set(ne);return fe.delete(D),fe})}}},J=m.useMemo(()=>{const D=new Map;for(const I of R){const re=Lj(I),ne=D.get(re);ne?ne.push(I):D.set(re,[I])}return Array.from(D.entries()).sort((I,re)=>Mo(I[0]).localeCompare(Mo(re[0])))},[R]);return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[a.jsx(tD,{className:"h-6 w-6"}),"MCP Evaluations"]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage your MCP evaluation suites"})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx($C,{value:p,onValueChange:x,placeholder:"Search evaluations..."}),a.jsxs(jn,{value:g,onValueChange:j,children:[a.jsx(mn,{className:"h-9 w-[200px]",children:a.jsx(Sn,{placeholder:"All suites"})}),a.jsxs(vn,{children:[a.jsx(et,{value:"all",children:"All suites"}),H.map(D=>a.jsx(et,{value:Fj(D),children:Mo(D)},Fj(D)))]})]}),a.jsxs(se,{variant:"outline",size:"sm",onClick:()=>{s()},children:[a.jsx(ma,{className:"mr-2 h-4 w-4"}),"Refresh"]}),a.jsxs(se,{variant:"outline",size:"sm",children:[a.jsx(q7,{className:"mr-2 h-4 w-4"}),"Import YAML"]}),a.jsx(se,{size:"sm",asChild:!0,children:a.jsxs(At,{to:"/mcp-evaluations/new",children:[a.jsx(oi,{className:"mr-2 h-4 w-4"}),"Create New"]})})]})]}),a.jsx(Ue,{children:a.jsx(We,{className:"p-0",children:a.jsxs(Wr,{children:[a.jsx(Vr,{children:a.jsxs(Gt,{children:[a.jsx(rt,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>T("name"),children:["Name",W("name")]})}),a.jsx(rt,{className:"text-right",children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>T("scenarios"),children:["Scenarios",W("scenarios")]})}),a.jsx(rt,{className:"text-right",children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>T("agents"),children:["Agents",W("agents")]})}),a.jsx(rt,{className:"text-right",children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>T("updatedAt"),children:["Last Updated",W("updatedAt")]})}),a.jsx(rt,{className:"w-[220px] text-right"})]})}),a.jsxs(Hr,{children:[J.map(([D,I])=>{const re=Mo(D),ne=Fj(D),fe=b.has(ne),he=A.has(ne);return a.jsxs(m.Fragment,{children:[a.jsx(Gt,{className:"bg-muted/40 hover:bg-muted/40",children:a.jsx(ze,{colSpan:5,className:"py-2",children:a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("button",{type:"button",className:"inline-flex h-6 items-center gap-2 text-xs leading-none hover:text-foreground",onClick:()=>X(ne),"aria-expanded":!fe,"aria-label":`${fe?"Expand":"Collapse"} suite ${re}`,children:[a.jsx(uN,{className:`h-3.5 w-3.5 text-muted-foreground transition-transform ${fe?"":"rotate-90"}`,"aria-hidden":"true"}),a.jsx("span",{className:`h-2 w-2 rounded-full ${Ame(D)}`,"aria-hidden":"true"}),D===null?a.jsx(R7,{className:"h-3.5 w-3.5 text-muted-foreground","aria-hidden":"true"}):a.jsx(O7,{className:"h-3.5 w-3.5 text-muted-foreground","aria-hidden":"true"}),a.jsx("span",{className:"font-medium",children:re}),a.jsxs("span",{className:"text-muted-foreground",children:["(",I.length,")"]})]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:he,onClick:()=>{B(ne,re,I)},children:[a.jsx(ti,{className:"mr-1 h-3.5 w-3.5"}),he?"Queueing...":"Run Suite"]})]})})},`suite-${ne}`),!fe&&I.map(V=>{const de=_me(V);return a.jsxs(Gt,{children:[a.jsx(ze,{children:a.jsxs("div",{children:[a.jsx(At,{to:`/mcp-evaluations/${V.id}`,className:"font-medium text-sm hover:text-primary",children:Hi(V)}),V.loadError&&a.jsxs(qe,{variant:"destructive",className:"ml-2 align-middle text-[10px]",children:[a.jsx(kh,{className:"mr-1 h-3 w-3"}),"Broken"]}),V.relativePath&&a.jsx("div",{className:"mt-0.5",children:a.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:V.relativePath})}),V.loadError&&a.jsx("p",{className:"text-xs text-destructive mt-0.5 break-all",children:V.loadError})]})}),a.jsx(ze,{className:"text-right font-mono text-sm",children:F(V)}),a.jsx(ze,{className:"text-right font-mono text-sm",children:q(V)}),a.jsx(ze,{className:"text-right text-xs text-muted-foreground",children:a.jsxs("div",{className:"inline-flex items-center gap-1",children:[a.jsx(hi,{className:"h-3 w-3"}),new Date(V.updatedAt).toLocaleDateString()]})}),a.jsx(ze,{className:"w-[220px] whitespace-nowrap",children:a.jsxs("div",{className:"flex items-center justify-end gap-2",children:[a.jsxs(Gf,{children:[a.jsx(Yf,{asChild:!0,children:a.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:a.jsx(av,{className:"h-4 w-4"})})}),a.jsxs(Nu,{align:"end",children:[a.jsxs(Gr,{onClick:()=>o(`/mcp-evaluations/${V.id}`),children:[a.jsx(sv,{className:"mr-2 h-3.5 w-3.5"}),"Edit"]}),a.jsxs(Gr,{onClick:()=>{z(V.id)},children:[a.jsx(_s,{className:"mr-2 h-3.5 w-3.5"}),"Clone"]}),a.jsxs(Gr,{className:"text-destructive",onClick:()=>{$(V.id,Hi(V))},children:[a.jsx(Ta,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]}),a.jsx(ro,{children:a.jsxs(ao,{children:[a.jsx(so,{asChild:!0,children:a.jsx(se,{size:"icon",variant:"outline",className:"h-8 w-8",asChild:!0,"aria-label":de.tooltipLabel,children:a.jsxs(At,{to:de.href,children:[a.jsx(Ac,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"sr-only",children:de.tooltipLabel})]})})}),a.jsx(ui,{children:de.tooltipLabel})]})}),a.jsx(ro,{children:a.jsxs(ao,{children:[a.jsx(so,{asChild:!0,children:a.jsx(se,{size:"sm",variant:"outline",className:`h-8 px-2 text-xs ${S.has(V.id)?"border-green-600 bg-green-600 text-white hover:bg-green-700 hover:text-white":""}`,disabled:N.has(V.id)||!V.sourcePath,onClick:()=>V.sourcePath&&void G(V.id,V.sourcePath,Hi(V)),"aria-label":`Queue ${Hi(V)}`,children:S.has(V.id)?"Queued":N.has(V.id)?"Queueing...":a.jsxs(a.Fragment,{children:[a.jsx($7,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"sr-only",children:"Queue evaluation"})]})})}),a.jsx(ui,{children:"Queue evaluation run"})]})}),a.jsx(se,{size:"sm",variant:"outline",asChild:!0,children:a.jsxs(At,{to:`/run?configId=${encodeURIComponent(V.id)}`,children:[a.jsx(ti,{className:"h-3.5 w-3.5"}),"Run"]})})]})})]},V.id)})]},`suite-group-${ne}`)}),!r&&e.length===0&&a.jsx(Gt,{children:a.jsx(ze,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"No MCP evaluations yet. Create your first one to get started."})}),!r&&e.length>0&&R.length===0&&a.jsx(Gt,{children:a.jsx(ze,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"No MCP evaluations match this filter."})}),r&&a.jsx(Gt,{children:a.jsx(ze,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"Loading MCP evaluations..."})})]})]})})})]})};var Pme=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],kme=Pme.reduce((e,t)=>{const n=wv(`Primitive.${t}`),r=m.forwardRef((s,i)=>{const{asChild:o,...c}=s,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Ome="Label",jz=m.forwardRef((e,t)=>a.jsx(kme.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));jz.displayName=Ome;var Sz=jz;const Tme=xl("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),$e=m.forwardRef(({className:e,...t},n)=>a.jsx(Sz,{ref:n,className:Se(Tme(),e),...t}));$e.displayName=Sz.displayName;const Os=m.forwardRef(({className:e,...t},n)=>a.jsx("textarea",{className:Se("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Os.displayName="Textarea";var wg="Switch",[Rme]=mr(wg),[Ime,Mme]=Rme(wg),Nz=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:o,disabled:c,value:d="on",onCheckedChange:f,form:h,...p}=e,[x,g]=m.useState(null),j=St(t,N=>g(N)),b=m.useRef(!1),y=x?h||!!x.closest("form"):!0,[S,C]=ha({prop:s,defaultProp:i??!1,onChange:f,caller:wg});return a.jsxs(Ime,{scope:n,checked:S,disabled:c,children:[a.jsx(Ye.button,{type:"button",role:"switch","aria-checked":S,"aria-required":o,"data-state":Ez(S),"data-disabled":c?"":void 0,disabled:c,value:d,...p,ref:j,onClick:Te(e.onClick,N=>{C(E=>!E),y&&(b.current=N.isPropagationStopped(),b.current||N.stopPropagation())})}),y&&a.jsx(Az,{control:x,bubbles:!b.current,name:r,value:d,checked:S,required:o,disabled:c,form:h,style:{transform:"translateX(-100%)"}})]})});Nz.displayName=wg;var Cz="SwitchThumb",_z=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=Mme(Cz,n);return a.jsx(Ye.span,{"data-state":Ez(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});_z.displayName=Cz;var $me="SwitchBubbleInput",Az=m.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},i)=>{const o=m.useRef(null),c=St(o,i),d=gg(n),f=uv(t);return m.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]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:c,style:{...s.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Az.displayName=$me;function Ez(e){return e?"checked":"unchecked"}var Pz=Nz,Dme=_z;const Xm=m.forwardRef(({className:e,...t},n)=>a.jsx(Pz,{className:Se("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",e),...t,ref:n,children:a.jsx(Dme,{className:Se("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Xm.displayName=Pz.displayName;var jg="Tabs",[Lme]=mr(jg,[pg]),kz=pg(),[Fme,VC]=Lme(jg),Oz=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:o="horizontal",dir:c,activationMode:d="automatic",...f}=e,h=Su(c),[p,x]=ha({prop:r,onChange:s,defaultProp:i??"",caller:jg});return a.jsx(Fme,{scope:n,baseId:nr(),value:p,onValueChange:x,orientation:o,dir:h,activationMode:d,children:a.jsx(Ye.div,{dir:h,"data-orientation":o,...f,ref:t})})});Oz.displayName=jg;var Tz="TabsList",Rz=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,i=VC(Tz,n),o=kz(n);return a.jsx(zF,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:r,children:a.jsx(Ye.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:t})})});Rz.displayName=Tz;var Iz="TabsTrigger",Mz=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=e,o=VC(Iz,n),c=kz(n),d=Lz(o.baseId,r),f=Fz(o.baseId,r),h=r===o.value;return a.jsx(qF,{asChild:!0,...c,focusable:!s,active:h,children:a.jsx(Ye.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":f,"data-state":h?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:d,...i,ref:t,onMouseDown:Te(e.onMouseDown,p=>{!s&&p.button===0&&p.ctrlKey===!1?o.onValueChange(r):p.preventDefault()}),onKeyDown:Te(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&o.onValueChange(r)}),onFocus:Te(e.onFocus,()=>{const p=o.activationMode!=="manual";!h&&!s&&p&&o.onValueChange(r)})})})});Mz.displayName=Iz;var $z="TabsContent",Dz=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...o}=e,c=VC($z,n),d=Lz(c.baseId,r),f=Fz(c.baseId,r),h=r===c.value,p=m.useRef(h);return m.useEffect(()=>{const x=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(x)},[]),a.jsx(Yn,{present:s||h,children:({present:x})=>a.jsx(Ye.div,{"data-state":h?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!x,id:f,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:x&&i})})});Dz.displayName=$z;function Lz(e,t){return`${e}-trigger-${t}`}function Fz(e,t){return`${e}-content-${t}`}var Bme=Oz,Bz=Rz,zz=Mz,qz=Dz;const Sg=Bme,Xf=m.forwardRef(({className:e,...t},n)=>a.jsx(Bz,{ref:n,className:Se("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Xf.displayName=Bz.displayName;const Cs=m.forwardRef(({className:e,...t},n)=>a.jsx(zz,{ref:n,className:Se("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e),...t}));Cs.displayName=zz.displayName;const Nf=m.forwardRef(({className:e,...t},n)=>a.jsx(qz,{ref:n,className:Se("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Nf.displayName=qz.displayName;const zme={openai:"OpenAI",anthropic:"Anthropic",azure:"Azure OpenAI",azure_openai:"Azure OpenAI",google:"Google"};function Qm(e){return zme[e]??e}const FM={openai:"bg-emerald-100 text-emerald-800",anthropic:"bg-orange-100 text-orange-800",azure:"bg-blue-100 text-blue-800",azure_openai:"bg-blue-100 text-blue-800",google:"bg-yellow-100 text-yellow-800",custom:"bg-gray-100 text-gray-800"};function Uz({provider:e}){return a.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${FM[e]??FM.custom}`,children:Qm(e)})}var Ng="Collapsible",[qme]=mr(Ng),[Ume,HC]=qme(Ng),Wz=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:o,...c}=e,[d,f]=ha({prop:r,defaultProp:s??!1,onChange:o,caller:Ng});return a.jsx(Ume,{scope:n,disabled:i,contentId:nr(),open:d,onOpenToggle:m.useCallback(()=>f(h=>!h),[f]),children:a.jsx(Ye.div,{"data-state":GC(d),"data-disabled":i?"":void 0,...c,ref:t})})});Wz.displayName=Ng;var Vz="CollapsibleTrigger",Hz=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=HC(Vz,n);return a.jsx(Ye.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":GC(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:Te(e.onClick,s.onOpenToggle)})});Hz.displayName=Vz;var KC="CollapsibleContent",Kz=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=HC(KC,e.__scopeCollapsible);return a.jsx(Yn,{present:n||s.open,children:({present:i})=>a.jsx(Wme,{...r,ref:t,present:i})})});Kz.displayName=KC;var Wme=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=e,o=HC(KC,n),[c,d]=m.useState(r),f=m.useRef(null),h=St(t,f),p=m.useRef(0),x=p.current,g=m.useRef(0),j=g.current,b=o.open||c,y=m.useRef(b),S=m.useRef(void 0);return m.useEffect(()=>{const C=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(C)},[]),rr(()=>{const C=f.current;if(C){S.current=S.current||{transitionDuration:C.style.transitionDuration,animationName:C.style.animationName},C.style.transitionDuration="0s",C.style.animationName="none";const N=C.getBoundingClientRect();p.current=N.height,g.current=N.width,y.current||(C.style.transitionDuration=S.current.transitionDuration,C.style.animationName=S.current.animationName),d(r)}},[o.open,r]),a.jsx(Ye.div,{"data-state":GC(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!b,...i,ref:h,style:{"--radix-collapsible-content-height":x?`${x}px`:void 0,"--radix-collapsible-content-width":j?`${j}px`:void 0,...e.style},children:b&&s})});function GC(e){return e?"open":"closed"}var Vme=Wz;const Xa=Vme,_a=Hz,Qa=Kz;function Oa({text:e,variant:t="assistant",className:n}){const r=Hme(e);return a.jsx("div",{className:Se("space-y-2",t==="system"&&"text-xs",n),children:r.map((s,i)=>a.jsx(m.Fragment,{children:Kme(s,i,t)},`md-${i}`))})}function Hme(e){const t=e.replace(/\r\n/g,`
|
|
121
|
+
`).split(`
|
|
122
|
+
`),n=[];let r=0;const s=o=>o.trim()==="",i=o=>o.trimStart().startsWith("```");for(;r<t.length;){const o=t[r],c=o.trim();if(s(o)){r+=1;continue}if(i(o)){const x=c.replace(/^```/,"").trim()||void 0;r+=1;const g=[];for(;r<t.length&&!i(t[r]);)g.push(t[r]),r+=1;r<t.length&&i(t[r])&&(r+=1),n.push({type:"code",lang:x,code:g.join(`
|
|
123
|
+
`)});continue}if(/^---+$/.test(c)||/^\*\*\*+$/.test(c)){n.push({type:"hr"}),r+=1;continue}if(c.startsWith(">")){const x=[];for(;r<t.length&&t[r].trim().startsWith(">");)x.push(t[r].trim().replace(/^>\s?/,"")),r+=1;n.push({type:"blockquote",text:x.join(`
|
|
124
|
+
`)});continue}const d=c.match(/^(#{1,4})\s+(.+)$/);if(d){n.push({type:"heading",level:d[1].length,text:d[2].trim()}),r+=1;continue}if(BM(t,r)){const x=zM(t[r]);r+=2;const g=[];for(;r<t.length&&t[r].includes("|")&&!s(t[r]);)g.push(zM(t[r])),r+=1;n.push({type:"table",headers:x,rows:g});continue}const f=c.match(/^\d+\.\s+/),h=c.match(/^[-*+]\s+/);if(f||h){const x=!!f,g=[];for(;r<t.length;){const j=t[r].trim();if(x?/^\d+\.\s+/.test(j):/^[-*+]\s+/.test(j)){g.push(j.replace(x?/^\d+\.\s+/:/^[-*+]\s+/,"")),r+=1;continue}s(t[r])&&(r+=1);break}n.push({type:"list",ordered:x,items:g});continue}const p=[o];for(r+=1;r<t.length;){const x=t[r],g=x.trim();if(s(x)||i(x)||/^---+$/.test(g)||/^#{1,4}\s+/.test(g)||g.startsWith(">")||BM(t,r)||/^\d+\.\s+/.test(g)||/^[-*+]\s+/.test(g))break;p.push(x),r+=1}n.push({type:"paragraph",text:p.join(`
|
|
125
|
+
`)})}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 zM(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>t.trim())}function Kme(e,t,n){if(e.type==="hr")return a.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 a.jsx("h4",{className:r,children:ic(e.text,`${t}-h`)})}if(e.type==="paragraph")return a.jsx("p",{className:Se("whitespace-pre-wrap leading-relaxed",n==="system"&&"leading-normal"),children:ic(e.text,`${t}-p`)});if(e.type==="blockquote")return a.jsx("blockquote",{className:"border-l-2 border-muted-foreground/30 pl-3 text-muted-foreground italic",children:ic(e.text,`${t}-bq`)});if(e.type==="code")return a.jsxs("div",{className:"rounded-md border bg-muted/70",children:[e.lang&&a.jsx("div",{className:"border-b px-2 py-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:e.lang}),a.jsx("pre",{className:"max-h-72 overflow-auto p-2 text-xs",children:a.jsx("code",{children:e.code})})]});if(e.type==="list"){const r=e.ordered?"ol":"ul";return a.jsx(r,{className:Se("space-y-1 pl-5",e.ordered?"list-decimal":"list-disc"),children:e.items.map((s,i)=>a.jsx("li",{className:"leading-relaxed",children:ic(s,`${t}-li-${i}`)},`${t}-li-${i}`))})}return e.type==="table"?a.jsx("div",{className:"overflow-x-auto rounded-md border",children:a.jsxs("table",{className:"w-full min-w-[480px] border-collapse text-xs",children:[a.jsx("thead",{className:"bg-muted/40",children:a.jsx("tr",{children:e.headers.map((r,s)=>a.jsx("th",{className:"border-b px-2 py-1.5 text-left font-semibold align-top",children:ic(r,`${t}-thc-${s}`)},`${t}-th-${s}`))})}),a.jsx("tbody",{children:e.rows.map((r,s)=>a.jsx("tr",{className:"border-t",children:r.map((i,o)=>a.jsx("td",{className:"px-2 py-1.5 align-top",children:ic(i,`${t}-tdc-${s}-${o}`)},`${t}-td-${s}-${o}`))},`${t}-row-${s}`))})]})}):null}function ic(e,t){return e.split(/(`[^`]+`|\*\*[^*]+\*\*|\*[^*\n]+\*|_[^_\n]+_|~~[^~\n]+~~|\[[^\]]+\]\([^)]+\))/g).filter(Boolean).map((r,s)=>{if(r.startsWith("`")&&r.endsWith("`"))return a.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.92em]",children:r.slice(1,-1)},`${t}-${s}`);if(r.startsWith("**")&&r.endsWith("**"))return a.jsx("strong",{children:r.slice(2,-2)},`${t}-${s}`);if(r.startsWith("*")&&r.endsWith("*"))return a.jsx("em",{children:r.slice(1,-1)},`${t}-${s}`);if(r.startsWith("_")&&r.endsWith("_"))return a.jsx("em",{children:r.slice(1,-1)},`${t}-${s}`);if(r.startsWith("~~")&&r.endsWith("~~"))return a.jsx("s",{children:r.slice(2,-2)},`${t}-${s}`);const i=r.match(/^\[([^\]]+)\]\(([^)]+)\)$/);return i?a.jsx("a",{href:i[2],target:"_blank",rel:"noreferrer",className:"underline underline-offset-2",children:i[1]},`${t}-${s}`):a.jsx(m.Fragment,{children:r},`${t}-${s}`)})}function Gz({message:e,className:t,assistantLabel:n,renderActions:r}){const s=e.role;if(s==="tool"){const c=String(e.text??"").trim();return/^(Approved|Denied) tool call\b/i.test(c)?null:a.jsxs("div",{className:Se("rounded-md border border-sky-500/30 bg-sky-500/10 px-3 py-2 text-sm",t),children:[a.jsxs("div",{className:"mb-1 flex items-center gap-2 text-[11px] font-semibold uppercase tracking-wide text-sky-700",children:[a.jsx(Ja,{className:"h-3.5 w-3.5"}),"Tool",a.jsx("span",{className:"font-normal normal-case text-sky-700/80",children:new Date(e.createdAt).toLocaleTimeString()})]}),a.jsx("p",{className:"whitespace-pre-wrap text-sky-900",children:e.text})]})}if(s==="system")return a.jsxs("div",{className:Se("flex items-start gap-2 text-xs",t),children:[a.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:a.jsx(fN,{className:"h-3 w-3"})}),a.jsx("div",{className:"max-w-[92%] rounded-md border border-amber-400/30 bg-amber-50/70 p-3 text-sm",children:a.jsx(Oa,{text:e.text,variant:"assistant"})})]});const i=s==="user",o=i?Pc:Pr;return a.jsxs("div",{className:Se(`flex items-start gap-2 text-xs ${i?"justify-end":"justify-start"}`,t),children:[!i&&a.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:a.jsx(o,{className:"h-3 w-3"})}),a.jsxs("div",{className:"relative max-w-[92%]",children:[a.jsxs("div",{className:`max-w-full break-words rounded-md border px-3 py-2 text-sm ${i?"border-primary/20 bg-primary/10":"border-border/80 bg-background shadow-sm"}`,children:[!i&&n&&a.jsx("p",{className:"mb-2 text-[11px] font-semibold text-muted-foreground",children:n}),i?a.jsx("p",{className:"whitespace-pre-wrap",children:e.text}):a.jsx(Oa,{text:e.text,variant:"assistant",className:"text-sm"})]}),r]}),i&&a.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:a.jsx(Pc,{className:"h-3 w-3"})})]})}function Y1({call:e,loading:t=!1,onApprove:n,onDeny:r,defaultOpen:s,className:i,description:o}){const c=e.status==="pending",d=e.tool||e.publicToolName||"unknown_tool";return a.jsxs("details",{open:s??c,className:Se("group overflow-hidden rounded-md border border-border/60 bg-background",i),children:[a.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2",children:[a.jsx("div",{className:"min-w-0 flex-1",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ja,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),a.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:`Tool call ${d}`}),a.jsx("span",{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${c?"bg-amber-100 text-amber-900":e.status==="error"?"bg-red-100 text-red-900":e.status==="denied"?"bg-gray-100 text-gray-700":"bg-muted text-muted-foreground"}`,children:c?"Needs approval":e.status==="error"?"Error":e.status==="denied"?"Denied":"Approved"})]})}),a.jsx(Yt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),a.jsxs("div",{className:"space-y-2 border-t border-border/50 px-3 py-2",children:[o&&a.jsx(Oa,{text:o,variant:"assistant",className:"text-sm"}),a.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:a.jsx("code",{children:JSON.stringify(e.arguments??{},null,2)})}),e.error&&a.jsx("p",{className:"text-xs text-destructive",children:e.error}),c&&a.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[a.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:t,onClick:()=>r?.(e.id),children:"Deny"}),a.jsx(se,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:t,onClick:()=>n?.(e.id),children:"Approve"})]})]})]})}function Yz(){return a.jsxs("div",{className:"flex items-start gap-2",children:[a.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:a.jsx(Pr,{className:"h-3 w-3"})}),a.jsxs("div",{className:"inline-flex items-center gap-2 rounded-md border bg-background px-3 py-2 text-sm text-muted-foreground",children:[a.jsx(wr,{className:"h-4 w-4 animate-spin"}),"Thinking..."]})]})}function Gme({snippets:e,snippetsLabel:t,onSnippetSelect:n,disabled:r=!1,contentClassName:s="w-[360px]"}){return a.jsxs(Gf,{children:[a.jsx(Yf,{asChild:!0,children:a.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:r,children:[a.jsx(oi,{className:"h-3 w-3"}),"Snippets",a.jsx(Yt,{className:"h-3 w-3"})]})}),a.jsxs(Nu,{align:"start",className:s,children:[a.jsx($B,{children:t}),a.jsx(DB,{}),e.map(i=>a.jsx(Gr,{className:"items-start whitespace-normal px-2 py-2",onSelect:()=>n(i.prompt),children:a.jsxs("div",{className:"space-y-0.5",children:[a.jsx("div",{className:"text-xs font-medium leading-tight",children:i.label}),a.jsx("div",{className:"text-[11px] leading-snug text-muted-foreground",children:i.description})]})},i.label))]})]})}function Xz({input:e,onInputChange:t,onSend:n,inputPlaceholder:r,snippets:s,snippetsLabel:i,onSnippetSelect:o,loading:c=!1,disabled:d=!1,inputRef:f,snippetContentClassName:h}){const p=d||c;return a.jsxs("div",{className:"rounded-xl border bg-background p-2 shadow-sm",children:[a.jsx(Os,{ref:f,value:e,onChange:x=>t(x.target.value),placeholder:r,disabled:d,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:x=>{x.key==="Enter"&&!x.shiftKey&&(x.preventDefault(),p||n())}}),a.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 px-1 pt-1",children:[a.jsx(Gme,{snippets:s,snippetsLabel:i,onSnippetSelect:o,disabled:p,contentClassName:h}),a.jsx(se,{type:"button",size:"icon",className:"h-8 w-8 shrink-0 rounded-full",onClick:n,disabled:p||!e.trim(),"aria-label":"Send assistant message",title:"Send assistant message",children:c?a.jsx(wr,{className:"h-4 w-4 animate-spin"}):a.jsx(B7,{className:"h-4 w-4"})})]})]})}const Yme=_v,Xme=Av,Qz=m.forwardRef(({className:e,...t},n)=>a.jsx(hu,{ref:n,className:Se("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Qz.displayName=hu.displayName;const Jz=m.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(Xme,{children:[a.jsx(Qz,{}),a.jsxs(mu,{ref:r,className:Se("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,a.jsxs(Ev,{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:[a.jsx(As,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Jz.displayName=mu.displayName;const Zz=({className:e,...t})=>a.jsx("div",{className:Se("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Zz.displayName="DialogHeader";const e8=m.forwardRef(({className:e,...t},n)=>a.jsx(Tf,{ref:n,className:Se("text-lg font-semibold leading-none tracking-tight",e),...t}));e8.displayName=Tf.displayName;const t8=m.forwardRef(({className:e,...t},n)=>a.jsx(Rf,{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));t8.displayName=Rf.displayName;function Qme(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var YC="ScrollArea",[n8]=mr(YC),[Jme,$a]=n8(YC),r8=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:i=600,...o}=e,[c,d]=m.useState(null),[f,h]=m.useState(null),[p,x]=m.useState(null),[g,j]=m.useState(null),[b,y]=m.useState(null),[S,C]=m.useState(0),[N,E]=m.useState(0),[A,P]=m.useState(!1),[O,T]=m.useState(!1),$=St(t,q=>d(q)),z=Su(s);return a.jsx(Jme,{scope:n,type:r,dir:z,scrollHideDelay:i,scrollArea:c,viewport:f,onViewportChange:h,content:p,onContentChange:x,scrollbarX:g,onScrollbarXChange:j,scrollbarXEnabled:A,onScrollbarXEnabledChange:P,scrollbarY:b,onScrollbarYChange:y,scrollbarYEnabled:O,onScrollbarYEnabledChange:T,onCornerWidthChange:C,onCornerHeightChange:E,children:a.jsx(Ye.div,{dir:z,...o,ref:$,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":N+"px",...e.style}})})});r8.displayName=YC;var a8="ScrollAreaViewport",s8=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:s,...i}=e,o=$a(a8,n),c=m.useRef(null),d=St(t,c,o.onViewportChange);return a.jsxs(a.Fragment,{children:[a.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:s}),a.jsx(Ye.div,{"data-radix-scroll-area-viewport":"",...i,ref:d,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:a.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});s8.displayName=a8;var Ds="ScrollAreaScrollbar",XC=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=$a(Ds,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=s,c=e.orientation==="horizontal";return m.useEffect(()=>(c?i(!0):o(!0),()=>{c?i(!1):o(!1)}),[c,i,o]),s.type==="hover"?a.jsx(Zme,{...r,ref:t,forceMount:n}):s.type==="scroll"?a.jsx(eve,{...r,ref:t,forceMount:n}):s.type==="auto"?a.jsx(i8,{...r,ref:t,forceMount:n}):s.type==="always"?a.jsx(QC,{...r,ref:t}):null});XC.displayName=Ds;var Zme=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=$a(Ds,e.__scopeScrollArea),[i,o]=m.useState(!1);return m.useEffect(()=>{const c=s.scrollArea;let d=0;if(c){const f=()=>{window.clearTimeout(d),o(!0)},h=()=>{d=window.setTimeout(()=>o(!1),s.scrollHideDelay)};return c.addEventListener("pointerenter",f),c.addEventListener("pointerleave",h),()=>{window.clearTimeout(d),c.removeEventListener("pointerenter",f),c.removeEventListener("pointerleave",h)}}},[s.scrollArea,s.scrollHideDelay]),a.jsx(Yn,{present:n||i,children:a.jsx(i8,{"data-state":i?"visible":"hidden",...r,ref:t})})}),eve=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=$a(Ds,e.__scopeScrollArea),i=e.orientation==="horizontal",o=_g(()=>d("SCROLL_END"),100),[c,d]=Qme("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 m.useEffect(()=>{if(c==="idle"){const f=window.setTimeout(()=>d("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(f)}},[c,s.scrollHideDelay,d]),m.useEffect(()=>{const f=s.viewport,h=i?"scrollLeft":"scrollTop";if(f){let p=f[h];const x=()=>{const g=f[h];p!==g&&(d("SCROLL"),o()),p=g};return f.addEventListener("scroll",x),()=>f.removeEventListener("scroll",x)}},[s.viewport,i,d,o]),a.jsx(Yn,{present:n||c!=="hidden",children:a.jsx(QC,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Te(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Te(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),i8=m.forwardRef((e,t)=>{const n=$a(Ds,e.__scopeScrollArea),{forceMount:r,...s}=e,[i,o]=m.useState(!1),c=e.orientation==="horizontal",d=_g(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;o(c?f:h)}},10);return au(n.viewport,d),au(n.content,d),a.jsx(Yn,{present:r||i,children:a.jsx(QC,{"data-state":i?"visible":"hidden",...s,ref:t})})}),QC=m.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,s=$a(Ds,e.__scopeScrollArea),i=m.useRef(null),o=m.useRef(0),[c,d]=m.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=d8(c.viewport,c.content),h={...r,sizes:c,onSizesChange:d,hasThumb:f>0&&f<1,onThumbChange:x=>i.current=x,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:x=>o.current=x};function p(x,g){return ive(x,o.current,c,g)}return n==="horizontal"?a.jsx(tve,{...h,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const x=s.viewport.scrollLeft,g=qM(x,c,s.dir);i.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:x=>{s.viewport&&(s.viewport.scrollLeft=x)},onDragScroll:x=>{s.viewport&&(s.viewport.scrollLeft=p(x,s.dir))}}):n==="vertical"?a.jsx(nve,{...h,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const x=s.viewport.scrollTop,g=qM(x,c);i.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:x=>{s.viewport&&(s.viewport.scrollTop=x)},onDragScroll:x=>{s.viewport&&(s.viewport.scrollTop=p(x))}}):null}),tve=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,i=$a(Ds,e.__scopeScrollArea),[o,c]=m.useState(),d=m.useRef(null),f=St(t,d,i.onScrollbarXChange);return m.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),a.jsx(l8,{"data-orientation":"horizontal",...s,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":Cg(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,p)=>{if(i.viewport){const x=i.viewport.scrollLeft+h.deltaX;e.onWheelScroll(x),p8(x,p)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&o&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:Zm(o.paddingLeft),paddingEnd:Zm(o.paddingRight)}})}})}),nve=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,i=$a(Ds,e.__scopeScrollArea),[o,c]=m.useState(),d=m.useRef(null),f=St(t,d,i.onScrollbarYChange);return m.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),a.jsx(l8,{"data-orientation":"vertical",...s,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":Cg(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,p)=>{if(i.viewport){const x=i.viewport.scrollTop+h.deltaY;e.onWheelScroll(x),p8(x,p)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&o&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:Zm(o.paddingTop),paddingEnd:Zm(o.paddingBottom)}})}})}),[rve,o8]=n8(Ds),l8=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:h,onResize:p,...x}=e,g=$a(Ds,n),[j,b]=m.useState(null),y=St(t,$=>b($)),S=m.useRef(null),C=m.useRef(""),N=g.viewport,E=r.content-r.viewport,A=Vn(h),P=Vn(d),O=_g(p,10);function T($){if(S.current){const z=$.clientX-S.current.left,q=$.clientY-S.current.top;f({x:z,y:q})}}return m.useEffect(()=>{const $=z=>{const q=z.target;j?.contains(q)&&A(z,E)};return document.addEventListener("wheel",$,{passive:!1}),()=>document.removeEventListener("wheel",$,{passive:!1})},[N,j,E,A]),m.useEffect(P,[r,P]),au(j,O),au(g.content,O),a.jsx(rve,{scope:n,scrollbar:j,hasThumb:s,onThumbChange:Vn(i),onThumbPointerUp:Vn(o),onThumbPositionChange:P,onThumbPointerDown:Vn(c),children:a.jsx(Ye.div,{...x,ref:y,style:{position:"absolute",...x.style},onPointerDown:Te(e.onPointerDown,$=>{$.button===0&&($.target.setPointerCapture($.pointerId),S.current=j.getBoundingClientRect(),C.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),T($))}),onPointerMove:Te(e.onPointerMove,T),onPointerUp:Te(e.onPointerUp,$=>{const z=$.target;z.hasPointerCapture($.pointerId)&&z.releasePointerCapture($.pointerId),document.body.style.webkitUserSelect=C.current,g.viewport&&(g.viewport.style.scrollBehavior=""),S.current=null})})})}),Jm="ScrollAreaThumb",c8=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=o8(Jm,e.__scopeScrollArea);return a.jsx(Yn,{present:n||s.hasThumb,children:a.jsx(ave,{ref:t,...r})})}),ave=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...s}=e,i=$a(Jm,n),o=o8(Jm,n),{onThumbPositionChange:c}=o,d=St(t,p=>o.onThumbChange(p)),f=m.useRef(void 0),h=_g(()=>{f.current&&(f.current(),f.current=void 0)},100);return m.useEffect(()=>{const p=i.viewport;if(p){const x=()=>{if(h(),!f.current){const g=ove(p,c);f.current=g,c()}};return c(),p.addEventListener("scroll",x),()=>p.removeEventListener("scroll",x)}},[i.viewport,h,c]),a.jsx(Ye.div,{"data-state":o.hasThumb?"visible":"hidden",...s,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Te(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:Te(e.onPointerUp,o.onThumbPointerUp)})});c8.displayName=Jm;var JC="ScrollAreaCorner",u8=m.forwardRef((e,t)=>{const n=$a(JC,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?a.jsx(sve,{...e,ref:t}):null});u8.displayName=JC;var sve=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,s=$a(JC,n),[i,o]=m.useState(0),[c,d]=m.useState(0),f=!!(i&&c);return au(s.scrollbarX,()=>{const h=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(h),d(h)}),au(s.scrollbarY,()=>{const h=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(h),o(h)}),f?a.jsx(Ye.div,{...r,ref:t,style:{width:i,height:c,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Zm(e){return e?parseInt(e,10):0}function d8(e,t){const n=e/t;return isNaN(n)?0:n}function Cg(e){const t=d8(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function ive(e,t,n,r="ltr"){const s=Cg(n),i=s/2,o=t||i,c=s-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 f8([d,f],p)(e)}function qM(e,t,n="ltr"){const r=Cg(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-s,o=t.content-t.viewport,c=i-r,d=n==="ltr"?[0,o]:[o*-1,0],f=Sf(e,d);return f8([0,o],[0,c])(f)}function f8(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 p8(e,t){return e>0&&e<t}var ove=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function s(){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(s)})(),()=>window.cancelAnimationFrame(r)};function _g(e,t){const n=Vn(e),r=m.useRef(0);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),m.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function au(e,t){const n=Vn(t);rr(()=>{let r=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(e),()=>{window.cancelAnimationFrame(r),s.unobserve(e)}}},[e,n])}var h8=r8,lve=s8,cve=u8;const ZC=m.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(h8,{ref:r,className:Se("relative overflow-hidden",e),...n,children:[a.jsx(lve,{className:"h-full w-full rounded-[inherit]",children:t}),a.jsx(m8,{}),a.jsx(cve,{})]}));ZC.displayName=h8.displayName;const m8=m.forwardRef(({className:e,orientation:t="vertical",...n},r)=>a.jsx(XC,{ref:r,orientation:t,className:Se("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:a.jsx(c8,{className:"relative flex-1 rounded-full bg-border"})}));m8.displayName=XC.displayName;async function uve(e){const{sessionId:t,source:n,serverName:r,onLaunchUrl:s,timeoutMs:i=5*6e4}=e,o=Date.now()+i;let c=!1;for(;Date.now()<o;){const{session:d}=await n.getOAuthRuntimeSession(t),f=d.authorizeLaunchUrl||d.authorizationUrl||"";if(f&&s&&s(f),d.status==="completed"&&d.hasAccessToken){c=!0;break}if(d.status==="error"||d.status==="stopped")throw new Error(`OAuth login failed for '${r}' (${d.status}). ${d.lastError||""}`.trim());await new Promise(h=>setTimeout(h,1500))}if(!c)throw new Error(`OAuth login timed out for '${r}'. Authorization was not completed within 5 minutes.`)}const dve=250;async function ii(e){const{serverNames:t,source:n,onServerAuthStart:r,onServerStatus:s,timeoutMs:i=5*6e4}=e,o=Array.from(new Set(t.filter(Boolean)));if(o.length===0)return;const c=Date.now()+i,d=new Set,f=new Map;for(;Date.now()<c;){const h=await n.ensureOAuthServers({serverNames:o});for(const x of h.servers){const g=`${x.status}:${x.debugState??""}:${x.runtimeSessionId??""}`;f.get(x.serverName)!==g&&(f.set(x.serverName,g),s?.({serverName:x.serverName,status:x.status,debugState:x.debugState,tokenExpiresAt:x.tokenExpiresAt,tokenExpiresInSeconds:x.tokenExpiresInSeconds,message:x.message}))}const p=h.servers.filter(x=>x.status==="auth_required");if(p.length===0&&h.allReady)return;for(const x of p){const g=x.runtimeSessionId;if(!g)throw new Error(x.message||`OAuth login required for '${x.serverName}'.`);d.has(g)||(d.add(g),r?.(x.serverName));const j=(()=>{let b=!1;return y=>{if(b||!y)return;b=!0;const S=y.startsWith("http")?y:`${window.location.origin}${y}`;window.open(S,"_blank","noopener,noreferrer")}})();j(x.authorizeLaunchUrl||x.authorizationUrl||""),await uve({sessionId:g,source:n,serverName:x.serverName,onLaunchUrl:j,timeoutMs:Math.max(1e4,c-Date.now())})}await new Promise(x=>{window.setTimeout(x,dve)})}throw new Error("OAuth login timed out before all required servers were authorized.")}const fve=[{label:"Suggest Checks",description:"Propose stronger evaluation checks for this scenario.",prompt:"Review the current checks in this scenario and suggest stronger alternatives. For each suggestion, explain what failure mode it catches that the existing checks miss. Prioritize checks that are deterministic, not sensitive to minor phrasing changes, and that would reliably catch regressions."},{label:"Suggest Value Capture Rules",description:"Recommend extract/value capture rules for key outputs.",prompt:"Analyze the expected tool calls and outputs in this scenario and suggest value capture rules that extract the most meaningful structured data. For each rule, explain which field to capture, why it matters for evaluation, and what a good vs. bad captured value looks like."},{label:"Improve Prompt Determinism",description:"Reduce ambiguity and improve reproducibility.",prompt:"Identify parts of this scenario's prompt or context that are ambiguous, open-ended, or likely to produce different results across runs. Suggest specific rewrites that make the expected behavior more deterministic — without changing the intent of what is being tested."},{label:"Generate Scenario Draft",description:"Create a draft scenario from the current context.",prompt:"Based on the current tool configuration and context, generate a complete scenario draft. Include a clear prompt, realistic expected tool calls with arguments, meaningful checks that validate the core behavior, and at least one value capture rule. Explain your choices so I can adjust them."}];function pve({open:e,onOpenChange:t,configId:n,configPath:r,scenario:s,agents:i,servers:o,snapshotEval:c,defaultAssistantAgentName:d,initialUserMessage:f,onApplyPatch:h}){const{source:p}=Ln(),[x,g]=m.useState(null),[j,b]=m.useState(null),[y,S]=m.useState(""),[C,N]=m.useState(!1),[E,A]=m.useState(new Set),P=m.useRef(null),O=m.useRef(null),T=m.useRef(null),[$,z]=m.useState(!1),q=m.useRef(!1),F=d||i[0]?.id||"";m.useEffect(()=>{if(!e||!F||x)return;let V=!1;return N(!0),(async()=>{const Q=Array.from(new Set(s.serverIds.filter(pe=>o.find(Re=>Re.id===pe)?.authType==="oauth2")));await ii({serverNames:Q,source:p});const ee=await p.createScenarioAssistantSession({configId:n,configPath:r,scenarioId:s.id,selectedAssistantAgentName:F,context:{configSnapshotPolicy:c?{enabled:c.enabled,mode:c.mode,baselineSnapshotId:c.baselineSnapshotId}:void 0,scenario:{id:s.id,name:s.name,prompt:s.prompt,serverNames:s.serverIds,evalRules:s.evalRules,extractRules:s.extractRules,snapshotEval:s.snapshotEval?{enabled:s.snapshotEval.enabled,baselineSnapshotId:s.snapshotEval.baselineSnapshotId}:void 0},availableServers:o.map(pe=>({name:pe.name||pe.id,url:pe.url})),availableAgents:i.map(pe=>({name:pe.name||pe.id,provider:pe.provider,model:pe.model}))}});V||(g(ee.sessionId),U(ee.session))})().catch(Q=>{V||_e({title:"Could not start Scenario Assistant",description:Q instanceof Error?Q.message:String(Q),variant:"destructive"})}).finally(()=>{V||N(!1)}),()=>{V=!0}},[e,p,x,n,r,s,c,i,o,F]);const H=()=>{g(null),b(null),S(""),A(new Set),T.current=null},U=m.useCallback(V=>{b(de=>de&&de.messages.length>V.messages.length?de:V)},[]),R=V=>{H(),p.closeScenarioAssistantSession(V).catch(()=>{})};m.useEffect(()=>{e||x&&(q.current||$||R(x))},[e,x,p,$]),m.useEffect(()=>()=>{x&&p.closeScenarioAssistantSession(x).catch(()=>{})},[x,p]),m.useEffect(()=>{if(!e)return;$&&z(!1),q.current&&(q.current=!1);const V=window.setTimeout(()=>{P.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(V)},[e,C,j?.messages.length,j?.pendingToolCalls.length,j?.warnings.length]),m.useEffect(()=>{const V=O.current;if(!V)return;V.style.height="0px";const de=Math.min(V.scrollHeight,160);V.style.height=`${Math.max(40,de)}px`},[y,e]);const W=i.length>0&&s.serverIds.length>0&&!!F,X=async V=>{if(!x)return;const de=V.trim();if(!de)return;const Q=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,ee={id:Q,role:"user",text:de,createdAt:new Date().toISOString()};b(pe=>pe&&{...pe,messages:[...pe.messages,ee]}),S(""),N(!0);try{const pe=await p.sendScenarioAssistantMessage(x,de);U(pe.session)}catch(pe){b(ae=>ae&&{...ae,messages:ae.messages.filter(Re=>Re.id!==Q)}),S(ae=>ae.trim()?ae:de),_e({title:"Scenario Assistant error",description:pe instanceof Error?pe.message:String(pe),variant:"destructive"})}finally{N(!1)}},G=V=>{S(V),requestAnimationFrame(()=>O.current?.focus())};m.useEffect(()=>{if(!e||!x||!j||!W||C)return;const V=String(f??"").trim();V&&T.current!==V&&(T.current=V,X(V))},[e,x,j,W,C,f]),m.useEffect(()=>{if(!(!e||!x||!j))return p.subscribeScenarioAssistantSessionEvents(x,V=>{U(V.payload.session)})},[e,x,p,U]);const B=async V=>{if(x){N(!0);try{const de=await p.approveScenarioAssistantToolCall(x,V);U(de.session)}catch(de){_e({title:"Tool call failed",description:de instanceof Error?de.message:String(de),variant:"destructive"})}finally{N(!1)}}},J=async V=>{if(x){N(!0);try{const de=await p.denyScenarioAssistantToolCall(x,V);U(de.session)}catch(de){_e({title:"Could not deny tool call",description:de instanceof Error?de.message:String(de),variant:"destructive"})}finally{N(!1)}}},D=async()=>{if(x){N(!0);try{const V=await p.approveAllScenarioAssistantToolCalls(x);U(V.session)}catch(V){_e({title:"Could not approve all tool calls",description:V instanceof Error?V.message:String(V),variant:"destructive"})}finally{N(!1)}}},I=(V,de,Q)=>{if(!de)return;if(Q==="prompt"&&de.prompt&&h({prompt:de.prompt.replacement}),Q==="evalRules"&&de.evalRules&&h({evalRules:de.evalRules.replacement}),Q==="extractRules"&&de.extractRules&&h({extractRules:de.extractRules.replacement}),Q==="snapshotEval"&&de.snapshotEval&&h({snapshotEval:{enabled:de.snapshotEval.patch.enabled,baselineSnapshotId:de.snapshotEval.patch.baselineSnapshotId}}),V){const pe=`${V}:${Q}`;A(ae=>new Set([...ae,pe]))}_e({title:"Applied suggestion",description:`Updated ${{prompt:"Prompt",evalRules:"Checks",extractRules:"Value Capture Rules",snapshotEval:"Snapshot Settings"}[Q]}`})},re=()=>{const V=document.activeElement;V instanceof HTMLElement&&V.blur()},ne=V=>{V||(re(),z(!1),q.current=!1),t(V)},fe=()=>{re(),q.current=!0,z(!0),t(!1)},he=()=>{re(),q.current=!1,z(!1),x&&R(x)};return a.jsxs(a.Fragment,{children:[!e&&x&&a.jsxs("div",{className:"mt-3 flex items-center justify-between gap-2 rounded-md border bg-background px-3 py-2",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"text-sm font-medium",children:"Scenario Assistant (session active)"}),a.jsxs("p",{className:"truncate text-xs text-muted-foreground",children:["Resume conversation for ",a.jsx("span",{className:"font-mono",children:s.id}),j?` · ${j.messages.length} messages`:""]})]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>t(!0),children:[a.jsx(qr,{className:"mr-1.5 h-3.5 w-3.5"}),"Resume"]}),a.jsx(se,{type:"button",size:"sm",variant:"ghost",className:"h-8 px-2 text-muted-foreground",onClick:he,"aria-label":"Discard assistant session",title:"Discard assistant session",children:a.jsx(As,{className:"h-4 w-4"})})]})]}),a.jsx(Yme,{open:e,onOpenChange:ne,children:a.jsxs(Jz,{className:"max-w-6xl h-[85vh] flex flex-col",children:[x&&a.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:fe,"aria-label":"Minimize assistant",title:"Minimize assistant",children:[a.jsx(D7,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Minimize"})]}),a.jsx(Zz,{className:"pr-20",children:a.jsx("div",{className:"flex items-start justify-between gap-3",children:a.jsxs("div",{className:"min-w-0",children:[a.jsxs(e8,{className:"flex items-center gap-2",children:[a.jsx(qr,{className:"h-4 w-4"}),"Scenario Assistant"]}),a.jsx(t8,{children:"LLM-guided scenario authoring with MCP tool introspection and per-tool-call approval."})]})})}),W?a.jsxs("div",{className:"min-h-0 flex flex-1 flex-col gap-3",children:[a.jsx("div",{className:"grid gap-3 sm:grid-cols-1",children:a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"MCP Context"}),a.jsxs("div",{className:"h-8 rounded-md border px-2 text-xs flex items-center gap-2",children:[a.jsx(Ja,{className:"h-3.5 w-3.5"}),j?`Loaded ${j.toolsLoaded} tools`:"Preparing..."]})]})}),a.jsx(ZC,{className:"min-h-0 flex-1 rounded-md border p-3",children:a.jsxs("div",{className:"space-y-3",children:[j?.warnings?.map((V,de)=>a.jsx("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900",children:V},`${V}-${de}`)),j?.messages.map(V=>a.jsxs(m.Fragment,{children:[(()=>{const de=V.pendingToolCallIds??(V.pendingToolCallId?[V.pendingToolCallId]:[]),Q=de.map(Ce=>(j?.pendingToolCalls??[]).find(Me=>Me.id===Ce)).filter(Ce=>!!Ce),ee=de.map(Ce=>j.pendingToolCalls.find(Me=>Me.id===Ce)??j.pendingToolCalls.find(Me=>Me.id===Ce)).filter(Boolean);if(!(V.role==="assistant"&&de.length>0))return a.jsx("div",{className:"space-y-2",children:a.jsx(hve,{message:V})});const ae=Q.length,Re=ee.length-ae;return a.jsxs("div",{className:"flex items-start gap-2",children:[a.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:a.jsx(Pr,{className:"h-3 w-3"})}),a.jsxs("div",{className:"w-full max-w-[92%] space-y-2",children:[ee.length>1&&ae>0&&a.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:[a.jsxs("span",{className:"text-xs text-amber-900",children:[Re," of ",ee.length," tool calls resolved"]}),a.jsxs(se,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:ae===0,onClick:()=>{D()},children:["Approve All (",ae,")"]})]}),ee.map((Ce,Me)=>a.jsx(Y1,{call:Ce,loading:C,description:Me===0?V.text:void 0,onApprove:L=>{B(L)},onDeny:L=>{J(L)}},Ce.id))]})]})})(),V.suggestions&&a.jsxs("div",{className:"ml-0 space-y-3 rounded-md border border-dashed bg-muted/10 p-3",children:[a.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground",children:[a.jsx(qr,{className:"h-3.5 w-3.5"}),"Structured Suggestions"]}),V.suggestions.prompt&&a.jsx(Ch,{title:"Prompt",rationale:V.suggestions.prompt.rationale,preview:V.suggestions.prompt.replacement,applied:E.has(`${V.id}:prompt`),onApply:()=>I(V.id,V.suggestions,"prompt")}),V.suggestions.evalRules&&a.jsx(Ch,{title:"Checks",rationale:V.suggestions.evalRules.rationale,preview:JSON.stringify(V.suggestions.evalRules.replacement,null,2),applied:E.has(`${V.id}:evalRules`),onApply:()=>I(V.id,V.suggestions,"evalRules")}),V.suggestions.extractRules&&a.jsx(Ch,{title:"Value Capture Rules",rationale:V.suggestions.extractRules.rationale,preview:JSON.stringify(V.suggestions.extractRules.replacement,null,2),applied:E.has(`${V.id}:extractRules`),onApply:()=>I(V.id,V.suggestions,"extractRules")}),V.suggestions.snapshotEval&&a.jsx(Ch,{title:"Snapshot Settings",rationale:V.suggestions.snapshotEval.rationale,preview:JSON.stringify(V.suggestions.snapshotEval.patch,null,2),applied:E.has(`${V.id}:snapshotEval`),onApply:()=>I(V.id,V.suggestions,"snapshotEval")}),(()=>{const de=V.suggestions?.notes,Q=Array.isArray(de)?de:typeof de=="string"?[de]:[];return Q.length===0?null:a.jsxs("div",{className:"space-y-2 rounded-md border p-3",children:[a.jsx("h5",{className:"text-sm font-medium",children:"Notes"}),a.jsx("ul",{className:"space-y-1 text-xs text-muted-foreground list-disc pl-4",children:Q.map((ee,pe)=>a.jsx("li",{children:ee},`${V.id}-note-${pe}`))})]})})()]})]},V.id)),(j?.pendingToolCalls??[]).filter(V=>!(j?.messages??[]).some(de=>de.pendingToolCallId===V.id||de.pendingToolCallIds?.includes(V.id))).map(V=>a.jsx(Y1,{call:V,loading:C,onApprove:de=>{B(de)},onDeny:de=>{J(de)}},V.id)),!j&&C&&a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[a.jsx(wr,{className:"h-4 w-4 animate-spin"}),"Starting assistant session..."]}),j&&C&&a.jsx(Yz,{}),a.jsx("div",{ref:P})]})}),a.jsx(Xz,{input:y,onInputChange:S,onSend:()=>{X(y)},inputPlaceholder:"Get assistance with creating or refining this scenario ...",snippets:fve,snippetsLabel:"Scenario Assistant Snippets",onSnippetSelect:G,loading:C,disabled:!x,inputRef:O,snippetContentClassName:"w-[320px]"})]}):a.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 Ch({title:e,rationale:t,preview:n,applied:r=!1,onApply:s}){return a.jsxs("div",{className:`space-y-2 rounded-md border p-3 ${r?"border-emerald-300 bg-emerald-50/40":""}`,children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("h5",{className:"text-sm font-medium",children:e}),a.jsx(se,{type:"button",size:"sm",variant:r?"secondary":"outline",onClick:s,disabled:r,children:r?a.jsxs(a.Fragment,{children:[a.jsx(Qi,{className:"mr-1.5 h-3.5 w-3.5"}),"Applied"]}):"Apply"})]}),t&&a.jsx("p",{className:"text-xs text-muted-foreground",children:t}),a.jsx("pre",{className:"max-h-56 overflow-auto rounded bg-muted p-2 text-xs whitespace-pre-wrap",children:n})]})}function hve({message:e}){const t=async s=>{try{await navigator.clipboard.writeText(s),_e({title:"Copied"})}catch(i){_e({title:"Could not copy",description:i instanceof Error?i.message:String(i),variant:"destructive"})}},n=e.role==="user"||e.role==="assistant",r=e.role==="user";return a.jsx(Gz,{message:e,assistantLabel:e.role==="assistant"?"Assistant":void 0,renderActions:n?a.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:a.jsx(_s,{className:"h-3.5 w-3.5"})}):void 0})}function aa(e){return typeof e=="number"?e.toLocaleString():"n/a"}function X1(e,t){const n=t?.nonPositiveLabel??"0s";if(!Number.isFinite(e)||e<=0)return n;const r=Math.floor(e),s=Math.floor(r/3600),i=Math.floor(r%3600/60),o=r%60;return s>0?`${s}h ${i}m ${o}s`:i>0?`${i}m ${o}s`:`${o}s`}function mve({run:e,fallbackUserPrompt:t}){const[n,r]=m.useState(!0),[s,i]=m.useState(!1);return a.jsxs("div",{className:"space-y-2",children:[a.jsx(Xa,{open:n,onOpenChange:r,children:a.jsxs("div",{className:"rounded-md border border-muted-foreground/20 bg-card p-2",children:[a.jsx(_a,{asChild:!0,children:a.jsx("button",{type:"button",className:"mb-2 flex w-full items-center justify-between gap-2 text-left",children:a.jsxs("p",{className:"flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:[a.jsx(Yt,{className:`h-3.5 w-3.5 transition-transform ${n?"rotate-180":""}`}),a.jsx(Pr,{className:"h-3.5 w-3.5"}),"Final answer"]})})}),a.jsx(Qa,{children:a.jsx(Q1,{text:e.finalAnswer||"No final answer captured.",maxLength:1200,className:"text-xs text-foreground"})})]})}),a.jsx(Xa,{open:s,onOpenChange:i,children:a.jsxs("div",{className:"rounded-md border border-muted-foreground/20 bg-card p-2",children:[a.jsxs("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[a.jsx(_a,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex min-w-0 items-center gap-2 text-left",children:[a.jsx(Yt,{className:`h-3.5 w-3.5 transition-transform ${s?"rotate-180":""}`}),a.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Conversation trace"})]})}),a.jsxs(qe,{variant:"outline",className:"h-5 text-[10px]",children:[e.toolCalls.length," tool calls"]})]}),a.jsx(Qa,{children:a.jsx("div",{className:"space-y-2 rounded-md border bg-muted/20 p-2",children:e.conversation.length===0?a.jsx("p",{className:"text-xs text-muted-foreground",children:"No conversation trace captured."}):e.conversation.map(o=>a.jsx(vve,{item:o,fallbackUserPrompt:t},o.id))})})]})})]})}function vve({item:e,fallbackUserPrompt:t}){if(e.kind==="tool_call"){const d=UM(e,"input");return a.jsx(VM,{variant:"call",title:`Tool call · ${e.toolName||"unknown"}${d}`,text:e.text})}if(e.kind==="tool_result"){const d=UM(e,"output"),f=e.ok?a.jsx(Qi,{className:"h-3.5 w-3.5 text-emerald-700 dark:text-emerald-300"}):a.jsx(yc,{className:"h-3.5 w-3.5 text-rose-700 dark:text-rose-300"});return a.jsx(VM,{variant:e.ok?"result_ok":"result_error",title:`Tool result · ${e.toolName||"unknown"} · ${e.ok?"ok":"error"}${typeof e.durationMs=="number"?` · ${e.durationMs}ms`:""}${d}`,text:e.text,icon:f})}const n=e.kind==="user_prompt",r=WM(e.text,e.kind),s=t?WM(t,"user_prompt"):"",i=n&&!r&&s?s:r,o=n?"User prompt":e.kind==="assistant_final"?"Agent final":"Agent",c=n?Pc:Pr;return a.jsxs("div",{className:`flex items-start gap-2 text-xs ${n?"justify-end":"justify-start"}`,children:[!n&&a.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:a.jsx(c,{className:"h-3 w-3"})}),a.jsxs("div",{className:`max-w-[90%] rounded-md p-2 ${n?"bg-primary/10":"bg-muted/50"}`,children:[a.jsx("p",{className:`mb-1 text-[11px] font-semibold text-muted-foreground ${n?"text-right":""}`,children:o}),n?a.jsx(Q1,{text:i,maxLength:280,className:"text-xs"}):a.jsx(Q1,{text:i,maxLength:500,className:"text-xs"})]}),n&&a.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:a.jsx(c,{className:"h-3 w-3"})})]})}function UM(e,t){const n=t==="input"?e.estimatedTokens?.inputTokens:e.estimatedTokens?.outputTokens;return typeof n!="number"?"":` · estimated ${aa(n)} tokens`}function WM(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 VM({variant:e,title:t,text:n,icon:r}){const[s,i]=m.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 a.jsx(Xa,{open:s,onOpenChange:i,children:a.jsxs("div",{className:`rounded-md border p-2 text-xs ${o[e]}`,children:[a.jsx(_a,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex w-full items-center justify-between gap-2 text-left",children:[a.jsxs("div",{className:"flex items-center gap-1.5 font-mono text-[11px]",children:[r??a.jsx(Ja,{className:"h-3.5 w-3.5"}),a.jsx("span",{children:t})]}),a.jsx("span",{className:"text-[11px] font-semibold",children:s?"Hide content":"Show content"})]})}),a.jsx(Qa,{children:a.jsx("p",{className:"mt-2 font-mono whitespace-pre-wrap text-foreground",children:n})})]})})}function Q1({text:e,maxLength:t,className:n}){const[r,s]=m.useState(!1),i=e.length>t,o=r||!i?e:`${e.slice(0,t)}...`;return a.jsxs("div",{children:[a.jsx(Oa,{text:o,className:n}),i&&a.jsx("button",{type:"button",className:"mt-1 text-[11px] font-medium text-primary hover:underline",onClick:()=>s(c=>!c),children:r?"Show less":"Show all"})]})}const gve="mcplab.feature.";function Ag(e,t=!1){if(typeof window>"u")return t;try{const n=window.localStorage.getItem(`${gve}${e}`);return n==null?t:n==="1"||n==="true"}catch{return t}}const xve=()=>({id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]});function J1({scenarios:e,scenarioOrigins:t,scenarioOverrides:n,agents:r,servers:s,configId:i,configPath:o,defaultAssistantAgentName:c,assistantInitialPromptByScenarioId:d,assistantAutoOpenNonceByScenarioId:f,snapshotEval:h,onChange:p,readOnly:x,allowAdd:g=!x,allowStructureEdits:j=!x}){const b=(N,E)=>{const A=e.map((P,O)=>O===N?{...P,...E}:P);p(A)},y=N=>p(e.filter((E,A)=>A!==N)),S=()=>p([...e,xve()]),C=(N,E)=>{const A=N+E;if(A<0||A>=e.length)return;const P=[...e],[O]=P.splice(N,1);P.splice(A,0,O),p(P)};return a.jsxs("div",{className:x?"space-y-2":"space-y-4",children:[!x&&a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-sm font-semibold",children:"Scenarios"}),g&&j&&a.jsxs(se,{type:"button",variant:"outline",size:"sm",onClick:S,children:[a.jsx(oi,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Scenario"]})]}),e.map((N,E)=>a.jsx(yve,{scenario:N,scenarioOrigin:t?.[E],hasMcpServerOverride:n?.[E],index:E,total:e.length,agents:r,servers:s,configId:i,configPath:o,defaultAssistantAgentName:c,assistantInitialPrompt:d?.[N.id],assistantAutoOpenNonce:f?.[N.id],snapshotEval:h,onUpdate:A=>b(E,A),onMoveUp:()=>C(E,-1),onMoveDown:()=>C(E,1),onRemove:()=>y(E),readOnly:x,allowStructureEdits:j},N.id)),e.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No scenarios configured. Add one to get started."})]})}function yve({scenario:e,scenarioOrigin:t,hasMcpServerOverride:n,index:r,total:s,agents:i,servers:o,configId:c,configPath:d,defaultAssistantAgentName:f,assistantInitialPrompt:h,assistantAutoOpenNonce:p,snapshotEval:x,onUpdate:g,onMoveUp:j,onMoveDown:b,onRemove:y,readOnly:S,allowStructureEdits:C}){const{source:N}=Ln(),E=Ag("snapshots",!1),[A,P]=m.useState("required_tool"),[O,T]=m.useState(""),[$,z]=m.useState(""),[q,F]=m.useState(""),[H,U]=m.useState(""),[R,W]=m.useState(null),[X,G]=m.useState(!1),[B,J]=m.useState(null),[D,I]=m.useState(""),[re,ne]=m.useState(""),[fe,he]=m.useState(!1),[V,de]=m.useState(f||i[0]?.id||""),[Q,ee]=m.useState(!1),[pe,ae]=m.useState(null),[Re,Ce]=m.useState(""),[Me,L]=m.useState(null),[oe,ve]=m.useState(!S),Pe=()=>{if(A==="response_jsonpath"||A==="response_jsonpath_exists"||A==="response_jsonpath_not_exists"){const ue=$.trim();if(!ue)return;if(A==="response_jsonpath"){const Ze=q.trim();let ht;Ze.length>0&&(Ze==="true"?ht=!0:Ze==="false"?ht=!1:Number.isNaN(Number(Ze))?ht=Ze:ht=Number(Ze)),g({evalRules:[...e.evalRules,{type:A,path:ue,...ht!==void 0?{equals:ht}:{}}]})}else g({evalRules:[...e.evalRules,{type:A,path:ue}]});z(""),F("");return}O.trim()&&(g({evalRules:[...e.evalRules,{type:A,value:O.trim()}]}),T(""),U(""))},Ge=ue=>{g({evalRules:e.evalRules.filter((Ze,ht)=>ht!==ue)})},lt=()=>{!D.trim()||!re.trim()||(g({extractRules:[...e.extractRules,{name:D.trim(),pattern:re.trim()}]}),I(""),ne(""))},pt=ue=>{g({extractRules:e.extractRules.filter((Ze,ht)=>ht!==ue)})},vt=ue=>{const Ze=e.serverIds.includes(ue)?e.serverIds.filter(ht=>ht!==ue):[...e.serverIds,ue];g({serverIds:Ze})},zt={required_tool:"Required",forbidden_tool:"Forbidden",response_contains:"Contains",response_not_contains:"Not Contains",response_starts_with:"Starts With",response_ends_with:"Ends With",response_equals:"Equals",response_regex:"Regex",response_jsonpath:"JSONPath",response_jsonpath_exists:"JSONPath Exists",response_jsonpath_not_exists:"JSONPath Not Exists"},qt={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",response_starts_with:"border-cyan-300/60 bg-cyan-500/10 text-cyan-700",response_ends_with:"border-indigo-300/60 bg-indigo-500/10 text-indigo-700",response_equals:"border-lime-300/60 bg-lime-500/10 text-lime-700",response_regex:"border-fuchsia-300/60 bg-fuchsia-500/10 text-fuchsia-700",response_jsonpath:"border-emerald-300/60 bg-emerald-500/10 text-emerald-700",response_jsonpath_exists:"border-green-300/60 bg-green-500/10 text-green-700",response_jsonpath_not_exists:"border-orange-300/60 bg-orange-500/10 text-orange-700"},Wt=A==="required_tool"||A==="forbidden_tool",Qt=A==="response_jsonpath"||A==="response_jsonpath_exists"||A==="response_jsonpath_not_exists",Ne=e.serverIds.filter(ue=>o.some(Ze=>Ze.id===ue)),Xe=i.map(ue=>ue.id).filter(Boolean),Fe=Ne.length>0,Ft=e.snapshotEval?.baselineSnapshotId!==void 0,[on,Ut]=m.useState(""),[ye,Ve]=m.useState(0);m.useEffect(()=>{const ue=(h??"").trim();ue&&on!==ue&&(he(!0),Ut(ue))},[h,on]),m.useEffect(()=>{p&&p!==ye&&(he(!0),Ve(p))},[p,ye]),m.useEffect(()=>{W(null),J(null),U("")},[e.serverIds.join("|")]),m.useEffect(()=>{U(""),z(""),F("")},[A]),m.useEffect(()=>{V&&Xe.includes(V)||de(f||i[0]?.id||"")},[V,f,i,Xe]);const Be=async()=>{if(V){ee(!0),ae(null);try{const ue=e.serverIds.filter(ht=>o.find(Jt=>Jt.id===ht)?.authType==="oauth2");await ii({serverNames:ue,source:N});const Ze=await N.runScenarioPreview({selectedAgentName:V,scenario:{id:e.id,name:e.name,prompt:e.prompt,serverNames:e.serverIds,evalRules:e.evalRules,extractRules:e.extractRules}});L(Ze)}catch(ue){ae(ue instanceof Error?ue.message:String(ue))}finally{ee(!1)}}},xt=()=>{if(!Me)return;const ue=HM(e.evalRules,Me.run.failureReasons),Ze=ue.length?ue.map(Pn=>`${Pn.status.toUpperCase()} - ${bve(Pn.rule)}${Pn.failureReason?` (${Pn.failureReason})`:""}`).join(`
|
|
126
|
+
`):"No checks configured.",ht=Object.keys(Me.run.extractedValues).length>0?Object.entries(Me.run.extractedValues).map(([Pn,mt])=>`${Pn}: ${String(mt)}`).join(`
|
|
127
|
+
`):"No extracted values.",Ot=Me.run.toolCalls.length>0?Me.run.toolCalls.map((Pn,mt)=>`${mt+1}. ${Pn.name} (${Pn.duration}ms)`).join(`
|
|
128
|
+
`):"No tool calls.",Jt=[`I ran a prompt preview for scenario '${e.id}' and want you to suggest concrete updates.`,`Run ID: ${Me.runId}`,`Agent: ${Me.agentName}`,`Outcome: ${Me.run.passed?"passed":"failed"}`,`Duration: ${Me.run.duration}ms`,"","Current check outcomes:",Ze,"","Tool sequence:",Ot,"","Extracted values:",ht,"","Final answer:",Me.run.finalAnswer||"(empty)","","Please propose concrete updates to the Prompt, Checks, and/or Value Capture Rules based on this preview."].join(`
|
|
129
|
+
`);Ce(Jt),he(!0)},Ee=async()=>{if(!(!Fe||S)){G(!0),J(null);try{const ue=Ne.filter(ht=>o.find(Jt=>Jt.id===ht)?.authType==="oauth2");await ii({serverNames:ue,source:N});const Ze=new Set;for(const ht of Ne){const Ot=await N.discoverToolsForAnalysis({serverNames:[ht]});for(const Jt of Ot.servers)for(const Pn of Jt.tools)Ze.add(Pn.name)}W(Array.from(Ze).sort((ht,Ot)=>ht.localeCompare(Ot)))}catch(ue){J(ue instanceof Error?ue.message:"Failed to load tools")}finally{G(!1)}}};return a.jsx(Xa,{open:oe,onOpenChange:ve,children:a.jsxs(Ue,{className:S?"rounded-md border shadow-none":"border-dashed",children:[a.jsxs(Pt,{className:S?"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:[a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[!S&&a.jsx(_a,{asChild:!0,children:a.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",children:a.jsx(Yt,{className:`h-3.5 w-3.5 transition-transform ${oe?"rotate-0":"-rotate-90"}`})})}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[r+1,"."]}),a.jsx(kt,{className:"truncate text-sm font-medium",children:e.name||`Scenario ${r+1}`})]}),S?a.jsxs("div",{className:"flex items-center gap-2",children:[t&&a.jsx(qe,{variant:t==="inline"?"secondary":"outline",children:t==="referenced"?"Referenced":"Inline"}),n&&a.jsx(qe,{variant:"secondary",children:"Override"}),a.jsx(_a,{asChild:!0,children:a.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8","aria-label":oe?"Collapse scenario details":"Expand scenario details",children:a.jsx(Yt,{className:`h-4 w-4 transition-transform ${oe?"rotate-180":""}`})})})]}):C&&a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>he(!0),title:i.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:[a.jsx(qr,{className:"h-3.5 w-3.5 text-amber-500"}),"Ask Assistant"]}),a.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:j,disabled:r===0,"aria-label":"Move scenario up",children:a.jsx(ws,{className:"h-3.5 w-3.5"})}),a.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:b,disabled:r===s-1,"aria-label":"Move scenario down",children:a.jsx(Yt,{className:"h-3.5 w-3.5"})}),a.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:y,children:a.jsx(Ta,{className:"h-3.5 w-3.5 text-destructive"})})]})]}),a.jsx(Qa,{children:a.jsxs(We,{className:"space-y-3",children:[a.jsx(pve,{open:fe,onOpenChange:ue=>{he(ue),ue||Ce("")},configId:c,configPath:d,scenario:e,agents:i,servers:o,snapshotEval:x,defaultAssistantAgentName:f,initialUserMessage:Re||h,onApplyPatch:ue=>g({...ue.prompt!==void 0?{prompt:ue.prompt}:{},...ue.evalRules!==void 0?{evalRules:ue.evalRules}:{},...ue.extractRules!==void 0?{extractRules:ue.extractRules}:{},...ue.snapshotEval!==void 0?{snapshotEval:{...e.snapshotEval??{},...ue.snapshotEval}}:{}})}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Name"}),a.jsx(gt,{value:e.name,onChange:ue=>g({name:ue.target.value}),disabled:S,placeholder:"e.g. List directory"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Servers"}),a.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[o.map(ue=>a.jsx(qe,{variant:e.serverIds.includes(ue.id)?"default":"outline",className:`cursor-pointer text-xs ${e.serverIds.includes(ue.id)?"":"opacity-50"}`,onClick:()=>!S&&vt(ue.id),children:ue.name||ue.id},ue.id)),o.length===0&&a.jsx("span",{className:"text-xs text-muted-foreground",children:"Add servers above first"})]})]}),a.jsxs(Ue,{className:"border bg-card",children:[a.jsxs(Pt,{className:"pb-2",children:[a.jsx(kt,{className:"text-sm",children:"Prompt"}),a.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."})]}),a.jsx(We,{className:"pt-0",children:a.jsx(Os,{value:e.prompt,onChange:ue=>g({prompt:ue.target.value}),disabled:S,placeholder:"The prompt to send to the agent...",rows:4,className:"text-xs"})})]}),!S&&a.jsxs(Ue,{className:"border bg-muted/20",children:[a.jsxs(Pt,{className:"pb-2",children:[a.jsx(kt,{className:"text-sm",children:"Run Prompt Preview"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Execute the current draft prompt once and inspect final answer, conversation trace, tool calls, and check outcomes."})]}),a.jsxs(We,{className:"space-y-3",children:[a.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx($e,{className:"text-xs",children:"Agent"}),a.jsxs(jn,{value:V,onValueChange:de,children:[a.jsx(mn,{className:"h-8 text-xs",children:a.jsx(Sn,{placeholder:"Select agent"})}),a.jsx(vn,{children:i.map(ue=>a.jsx(et,{value:ue.id,children:ue.name||ue.id},ue.id))})]})]}),a.jsx("div",{className:"flex items-end",children:a.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5 px-2 text-xs",onClick:()=>{Be()},disabled:Q||!V||!e.prompt.trim()||e.serverIds.length===0,children:Q?a.jsxs(a.Fragment,{children:[a.jsx(wr,{className:"h-3.5 w-3.5 animate-spin"}),"Running..."]}):a.jsxs(a.Fragment,{children:[a.jsx(ti,{className:"h-3.5 w-3.5"}),"Run Prompt"]})})})]}),!e.prompt.trim()&&a.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Add a prompt to run preview."}),e.serverIds.length===0&&a.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Select at least one server to run preview."}),pe&&a.jsx("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:pe}),Me&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[a.jsx(qe,{variant:Me.run.passed?"default":"destructive",children:Me.run.passed?"Passed":"Failed"}),a.jsxs(qe,{variant:"outline",children:[Me.run.duration,"ms"]}),a.jsxs(qe,{variant:"outline",children:[Me.run.toolCalls.length," tool calls"]}),a.jsx(qe,{variant:"outline",className:"font-mono",children:Me.agentName}),a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-6 gap-1.5 px-2 text-[11px]",onClick:xt,children:[a.jsx(qr,{className:"h-3 w-3"}),"Send to Assistant"]})]}),e.evalRules.length===0?a.jsxs("div",{className:"rounded-md border bg-muted/20 p-2",children:[a.jsx("p",{className:"mb-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Check results"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"No checks configured for this scenario."})]}):(()=>{const ue=HM(e.evalRules,Me.run.failureReasons),Ze=ue.filter(Ot=>Ot.status==="passed"),ht=ue.filter(Ot=>Ot.status==="failed");return a.jsxs("div",{className:"rounded-md border bg-muted/20 p-2",children:[a.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[a.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Checks"}),a.jsxs(qe,{variant:"outline",className:"h-5 border-success/30 bg-success/10 text-success text-[10px]",children:[Ze.length," passed"]}),a.jsxs(qe,{variant:"outline",className:`h-5 text-[10px] ${ht.length>0?"border-destructive/30 bg-destructive/10 text-destructive":""}`,children:[ht.length," failed"]})]}),a.jsx("div",{className:"space-y-1",children:ue.map((Ot,Jt)=>a.jsxs("div",{className:`flex items-start justify-between gap-2 rounded-md border px-2 py-1.5 text-xs ${Ot.status==="failed"?"border-destructive/20 bg-destructive/5":"border-success/20 bg-success/5"}`,children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[Ot.status==="failed"?a.jsx(yc,{className:"h-3.5 w-3.5 shrink-0 text-destructive"}):a.jsx(Qi,{className:"h-3.5 w-3.5 shrink-0 text-success"}),a.jsx("span",{className:"font-medium",children:wve(Ot.rule)})]}),Ot.failureReason&&a.jsx("p",{className:"mt-1 pl-5 text-[11px] text-destructive",children:jve(Ot.failureReason)})]}),a.jsx(qe,{variant:"outline",className:`shrink-0 text-[10px] ${Ot.status==="failed"?"border-destructive/30 text-destructive":"border-success/30 text-success"}`,children:Ot.status})]},`${e.id}-preview-check-${Jt}`))})]})})(),Me.run.failureReasons.length>0&&a.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2",children:[a.jsx("p",{className:"mb-1 text-[11px] font-semibold uppercase tracking-wide text-destructive",children:"Check failures"}),a.jsx("ul",{className:"list-disc space-y-1 pl-4 text-xs text-destructive",children:Me.run.failureReasons.map((ue,Ze)=>a.jsx("li",{children:ue},`${Me.runId}-failure-${Ze}`))})]}),Object.keys(Me.run.extractedValues).length>0&&a.jsxs("div",{className:"rounded-md border bg-background p-2",children:[a.jsx("p",{className:"mb-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Extracted values"}),a.jsx("div",{className:"grid gap-1.5 sm:grid-cols-2",children:Object.entries(Me.run.extractedValues).map(([ue,Ze])=>a.jsxs("div",{className:"rounded border bg-muted/20 px-2 py-1 text-xs",children:[a.jsx("div",{className:"font-mono text-[11px] text-muted-foreground",children:ue}),a.jsx("div",{className:"break-all",children:String(Ze)})]},ue))})]}),a.jsx(mve,{run:Me.run,fallbackUserPrompt:e.prompt})]})]})]}),a.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[a.jsxs(Ue,{className:"border bg-muted/20",children:[a.jsx(Pt,{className:"pb-2",children:a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx(kt,{className:"text-sm",children:"Checks"}),a.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."})]}),!S&&a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>he(!0),title:"Ask for help improving checks",children:[a.jsx(qr,{className:"h-3.5 w-3.5 text-amber-500"}),"Ask Assistant"]})]})}),a.jsx(We,{className:"space-y-2",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx($e,{className:"text-xs",children:"Checks (pass / fail)"}),a.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."}),a.jsx("div",{className:"space-y-1.5",children:e.evalRules.length===0?a.jsx("p",{className:"rounded-md border border-dashed bg-background/60 px-2 py-2 text-xs text-muted-foreground",children:"No checks yet. Add tool checks or text pattern checks below."}):e.evalRules.map((ue,Ze)=>a.jsxs("div",{className:"flex items-start justify-between gap-2 rounded-md border bg-background px-2 py-2 text-xs",children:[a.jsx("div",{className:"min-w-0",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`rounded-full border px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${qt[ue.type]}`,children:zt[ue.type]}),a.jsx("span",{className:"font-mono break-all",children:ue.path?ue.equals!==void 0?`${ue.path} == ${String(ue.equals)}`:ue.path:ue.value})]})}),!S&&a.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>Ge(Ze),"aria-label":`Remove check ${Ze+1}`,children:a.jsx(As,{className:"h-3.5 w-3.5"})})]},Ze))}),!S&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex gap-2 items-end",children:[a.jsxs(jn,{value:A,onValueChange:ue=>P(ue),children:[a.jsx(mn,{className:"h-8 w-[14.5rem] shrink-0 text-xs",children:a.jsx(Sn,{})}),a.jsxs(vn,{children:[a.jsx(et,{value:"required_tool",children:"Required Tool"}),a.jsx(et,{value:"forbidden_tool",children:"Forbidden Tool"}),a.jsx(et,{value:"response_contains",children:"Text contains"}),a.jsx(et,{value:"response_not_contains",children:"Text does not contain"}),a.jsx(et,{value:"response_starts_with",children:"Text starts with"}),a.jsx(et,{value:"response_ends_with",children:"Text ends with"}),a.jsx(et,{value:"response_equals",children:"Text equals"}),a.jsx(et,{value:"response_regex",children:"Text matches regex"}),a.jsx(et,{value:"response_jsonpath",children:"JSONPath (optional equals)"}),a.jsx(et,{value:"response_jsonpath_exists",children:"JSONPath exists"}),a.jsx(et,{value:"response_jsonpath_not_exists",children:"JSONPath not exists"})]})]}),Qt?a.jsxs(a.Fragment,{children:[a.jsx(gt,{value:$,onChange:ue=>z(ue.target.value),placeholder:"JSONPath (e.g. $.status)",className:"h-8 text-xs font-mono",onKeyDown:ue=>ue.key==="Enter"&&(ue.preventDefault(),Pe())}),A==="response_jsonpath"&&a.jsx(gt,{value:q,onChange:ue=>F(ue.target.value),placeholder:"Equals (optional)",className:"h-8 w-[12rem] text-xs font-mono",onKeyDown:ue=>ue.key==="Enter"&&(ue.preventDefault(),Pe())})]}):a.jsx(gt,{value:O,onChange:ue=>T(ue.target.value),placeholder:"Value",className:"h-8 text-xs font-mono",onKeyDown:ue=>ue.key==="Enter"&&(ue.preventDefault(),Pe())}),a.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:Pe,children:"Add"})]}),Wt&&a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"flex items-end gap-2",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx($e,{className:"mb-1 block text-[11px] text-muted-foreground",children:"Pick from selected server tools (optional)"}),a.jsxs(jn,{value:H,onValueChange:ue=>{U(ue),T(ue)},disabled:X||!R||R.length===0,children:[a.jsx(mn,{className:"h-8 text-xs",children:a.jsx(Sn,{placeholder:X?"Loading tools...":R&&R.length>0?"Select tool to insert in value field":"Load tools first"})}),a.jsx(vn,{children:(R??[]).map(ue=>a.jsx(et,{value:ue,children:ue},ue))})]})]}),a.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:Ee,disabled:!Fe||X,children:X?"Loading...":R?"Refresh tools":"Load tools"})]}),!Fe&&a.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Select at least one server in this scenario to load tool names."}),B&&a.jsxs("p",{className:"text-[11px] text-destructive",children:["Could not load tools: ",B]})]})]})]})})]}),a.jsxs(Ue,{className:"border bg-muted/10",children:[a.jsx(Pt,{className:"pb-2",children:a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx(kt,{className:"text-sm",children:"Value Capture Rules"}),a.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."})]}),!S&&a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>he(!0),title:"Ask for help improving value capture rules",children:[a.jsx(qr,{className:"h-3.5 w-3.5 text-amber-500"}),"Ask Assistant"]})]})}),a.jsx(We,{className:"space-y-2",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx($e,{className:"text-xs",children:"Value Capture Rules"}),a.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."}),a.jsx("div",{className:"space-y-1.5",children:e.extractRules.length===0?a.jsx("p",{className:"w-full rounded-md border border-dashed bg-background/60 px-2 py-2 text-xs text-muted-foreground",children:"No value capture rules yet. Add one below to capture structured output from the final answer."}):e.extractRules.map((ue,Ze)=>a.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border bg-background px-2 py-2 text-xs",children:[a.jsx("div",{className:"min-w-0",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"rounded-full border border-violet-300/60 bg-violet-500/10 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-violet-700",children:ue.name}),a.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground",children:"regex:"}),a.jsx("code",{className:"font-mono break-all text-foreground",children:ue.pattern})]})}),!S&&a.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>pt(Ze),"aria-label":`Remove value capture rule ${Ze+1}`,children:a.jsx(As,{className:"h-3.5 w-3.5"})})]},Ze))}),!S&&a.jsxs("div",{className:"flex gap-2 items-end",children:[a.jsx(gt,{value:D,onChange:ue=>I(ue.target.value),placeholder:"Field name",className:"h-8 text-xs w-36"}),a.jsx(gt,{value:re,onChange:ue=>ne(ue.target.value),placeholder:"Regex pattern",className:"h-8 text-xs font-mono",onKeyDown:ue=>ue.key==="Enter"&&(ue.preventDefault(),lt())}),a.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:lt,children:"Add"})]})]})})]})]}),E&&a.jsxs(Ue,{className:"border bg-amber-50/40",children:[a.jsxs(Pt,{className:"pb-2",children:[a.jsx(kt,{className:"text-sm",children:"Snapshot Evaluation"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Per-scenario toggle for config baseline drift checks."})]}),a.jsxs(We,{className:"space-y-2 text-xs text-muted-foreground",children:[a.jsxs("div",{className:"flex items-center justify-between rounded-md border bg-white/60 px-2 py-1.5",children:[a.jsx("span",{children:"Enabled for this scenario"}),a.jsx(Xm,{checked:e.snapshotEval?.enabled!==!1,disabled:S,onCheckedChange:ue=>g({snapshotEval:{...e.snapshotEval??{},enabled:ue}})})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"flex items-center justify-between rounded-md border bg-white/60 px-2 py-1.5",children:[a.jsx("span",{children:"Use config baseline"}),a.jsx(Xm,{checked:!Ft,disabled:S,onCheckedChange:ue=>{if(ue){g({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:void 0}});return}g({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:e.snapshotEval?.baselineSnapshotId??""}})}})]}),Ft&&a.jsx(gt,{value:e.snapshotEval?.baselineSnapshotId??"",onChange:ue=>g({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:ue.target.value}}),disabled:S,placeholder:"Override baseline snapshot id",className:"h-8 text-xs font-mono"})]}),a.jsxs("p",{children:["Effective baseline snapshot:"," ",a.jsx("span",{className:"font-mono",children:e.snapshotEval?.baselineSnapshotId||x?.baselineSnapshotId||"Not configured"})]}),a.jsxs("p",{children:["Policy:"," ",a.jsx("span",{className:"font-mono",children:x?.mode??"warn"})," · config-level switch"," ",a.jsx("span",{className:"font-mono",children:x?.enabled?"on":"off"})]})]})]})]})})]})})}function HM(e,t){return e.map(n=>{const r=Sve(n,t);return{rule:n,status:r?"failed":"passed",failureReason:r}})}function bve(e){return e.path?e.equals!==void 0?`${e.type}: ${e.path} == ${String(e.equals)}`:`${e.type}: ${e.path}`:`${e.type}: ${e.value??""}`}function wve(e){return e.type==="required_tool"?`Required tool · ${e.value}`:e.type==="forbidden_tool"?`Forbidden tool · ${e.value}`:e.type==="response_contains"?`Text contains · ${e.value}`:e.type==="response_not_contains"?`Text does not contain · ${e.value}`:e.type==="response_starts_with"?`Text starts with · ${e.value}`:e.type==="response_ends_with"?`Text ends with · ${e.value}`:e.type==="response_equals"?`Text equals · ${e.value}`:e.type==="response_regex"?`Text matches regex · ${e.value}`:e.type==="response_jsonpath"?e.equals!==void 0?`JSONPath equals · ${e.path} == ${String(e.equals)}`:`JSONPath exists · ${e.path}`:e.type==="response_jsonpath_exists"?`JSONPath exists · ${e.path}`:e.type==="response_jsonpath_not_exists"?`JSONPath not exists · ${e.path}`:`${e.type} · ${e.value}`}function jve(e){const t=String(e??"").trim(),n=t.match(/^Regex assertion failed:\s*(.+)$/i);return n?`Text match failed: ${n[1]}`:t}function Sve(e,t){if(e.type==="response_jsonpath_exists"){const r=String(e.path??"").trim();return r?t.find(s=>s.startsWith(`JSONPath assertion failed: ${r}`)||s.startsWith(`JSONPath assertion failed: invalid JSON for path ${r}`)):void 0}const n=e.type==="required_tool"?`Required tool not used: ${e.value}`:e.type==="forbidden_tool"?`Forbidden tool used: ${e.value}`:e.type==="response_contains"?`Contains assertion failed: ${e.value}`:e.type==="response_not_contains"?`Not-contains assertion failed: ${e.value}`:e.type==="response_starts_with"?`Starts-with assertion failed: ${e.value}`:e.type==="response_ends_with"?`Ends-with assertion failed: ${e.value}`:e.type==="response_equals"?`Equals assertion failed: ${e.value}`:e.type==="response_regex"?`Regex assertion failed: ${e.value}`:e.type==="response_jsonpath"?e.equals!==void 0?`JSONPath equals assertion failed: ${e.path}`:`JSONPath assertion failed: ${e.path}`:e.type==="response_jsonpath_not_exists"?`JSONPath not-exists assertion failed: ${e.path}`:"";if(n)return t.find(r=>r.startsWith(n))}function v8(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 Nve=()=>({id:`cfg-${Date.now()}`,name:"",configName:"",description:"",servers:[],serverEntries:[],agents:[],agentEntries:[],scenarios:[],scenarioEntries:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),KM=()=>{const{id:e,tab:t}=yl(),n=Ia(),[r,s]=vi(),{getConfig:i,addConfig:o,updateConfig:c,loading:d}=Mf(),{source:f}=Ln(),h=Ag("snapshots",!1),{servers:p,agents:x,scenarios:g}=rs(),j=e==="new",b=!j&&!!e,y=b?i(e):void 0,[S,C]=m.useState(j||t==="edit"),[N,E]=m.useState(()=>y?structuredClone(y):Nve()),[A,P]=m.useState([]),[O,T]=m.useState(""),[$,z]=m.useState(""),[q,F]=m.useState(""),[H,U]=m.useState(null),[R,W]=m.useState(!1),[X,G]=m.useState(!1),[B,J]=m.useState(""),[D,I]=m.useState(""),[re,ne]=m.useState({}),[fe,he]=m.useState({}),[V,de]=m.useState({}),Q=m.useMemo(()=>{const K=t||r.get("tab");return K==="agents"||K==="scenarios"?K:"scenarios"},[t,r]);m.useEffect(()=>{y&&!S&&E(structuredClone(y))},[y,S]),m.useEffect(()=>{t==="edit"&&!j&&C(!0)},[t,j]),m.useEffect(()=>{let K=!0;return f.listSnapshots().then(ge=>{K&&P(ge)}).catch(()=>{K&&P([])}),()=>{K=!1}},[f]),m.useEffect(()=>{if(!O.trim()){U(null);return}let K=!0;return f.getResult(O.trim()).then(ge=>{if(!K)return;if(!ge){U(!1);return}const He=ge.overallPassRate===1&&ge.scenarios.every(ct=>ct.runs.every(Vt=>Vt.passed));U(He)}).catch(()=>{K&&U(!1)}),()=>{K=!1}},[O,f]);const ee=K=>E(ge=>({...ge,...K})),pe=m.useMemo(()=>N.serverEntries&&N.serverEntries.length>0?N.serverEntries:(N.servers??[]).map(K=>({kind:"inline",server:K})),[N.serverEntries,N.servers]),ae=m.useMemo(()=>N.scenarioEntries&&N.scenarioEntries.length>0?N.scenarioEntries:N.scenarios.map(K=>({kind:"inline",scenario:K})),[N.scenarioEntries,N.scenarios]),Re=K=>{ee({scenarioEntries:K,scenarios:K.filter(ge=>ge.kind==="inline").map(ge=>ge.scenario)})},Ce=m.useMemo(()=>N.agentEntries&&N.agentEntries.length>0?N.agentEntries:N.agents.map(K=>({kind:"inline",agent:K})),[N.agentEntries,N.agents]),Me=K=>{ee({agentEntries:K,agents:K.filter(ge=>ge.kind==="inline").map(ge=>ge.agent)})},L=!S,oe=N.runDefaults?.selectedAgentNames??[],ve=async K=>{if(!N.id||L===!1){ee({snapshotEval:{enabled:K.enabled,mode:K.mode,baselineSnapshotId:K.baselineSnapshotId,baselineSourceRunId:K.baselineSourceRunId,lastUpdatedAt:new Date().toISOString()}});return}W(!0);try{const ge=await f.updateSnapshotPolicy(N.id,K);E(ge),_e({title:"Snapshot policy updated"})}catch(ge){_e({title:"Could not update snapshot policy",description:ge instanceof Error?ge.message:String(ge),variant:"destructive"})}finally{W(!1)}},Pe=async()=>{if(!(!N.id||!O.trim())){G(!0);try{const K=await f.generateSnapshotEvalBaseline(O.trim(),N.id,$.trim()||void 0);E(K.config),F(K.snapshot.id),P(ge=>[K.snapshot,...ge.filter(He=>He.id!==K.snapshot.id)]),_e({title:"Snapshot baseline generated",description:`${K.snapshot.name} (${K.snapshot.id})`})}catch(K){_e({title:"Could not generate baseline",description:K instanceof Error?K.message:String(K),variant:"destructive"})}finally{G(!1)}}},Ge=async()=>{if(!N.name.trim()){_e({title:"Validation Error",description:"Config ID is required.",variant:"destructive"});return}const K=pe.map(Ae=>Ae.kind==="referenced"?{kind:"referenced",ref:p.find(Et=>Et.id===Ae.ref)?.id||Ae.ref}:Ae),ge=Ce.map(Ae=>Ae.kind==="referenced"?{kind:"referenced",ref:x.find(Et=>Et.id===Ae.ref)?.id||Ae.ref}:Ae),He=ae.map(Ae=>{if(Ae.kind==="referenced"){const On=g.find(Zt=>Zt.id===Ae.ref),Et=(Ae.mcpServers??[]).map(Zt=>Zt.kind==="referenced"?{kind:"referenced",ref:p.find(Ni=>Ni.id===Zt.ref)?.id||Zt.ref}:Zt);return{kind:"referenced",ref:On?.id||Ae.ref,...Ae.mcpServers!==void 0?{mcpServers:Et}:{}}}return Ae}),ct=K.filter(Ae=>Ae.kind==="inline").map(Ae=>({server:Ae.server,error:v8(Ae.server)})).find(Ae=>!!Ae.error);if(ct?.error){_e({title:"Validation Error",description:ct.error,variant:"destructive"});return}if(He.filter(Ae=>Ae.kind==="inline").some(Ae=>!Ae.scenario.name?.trim())){_e({title:"Validation Error",description:"Inline scenarios must have a name before saving.",variant:"destructive"});return}const yt=new Set(ge.map(Ae=>Ae.kind==="inline"?Ae.agent.id:Ae.ref)),Un=(N.runDefaults?.selectedAgentNames??[]).filter(Ae=>yt.has(Ae)),In={...N,serverEntries:K,servers:K.filter(Ae=>Ae.kind==="inline").map(Ae=>Ae.server),agentEntries:ge,agents:ge.filter(Ae=>Ae.kind==="inline").map(Ae=>Ae.agent),scenarioEntries:He,scenarios:He.filter(Ae=>Ae.kind==="inline").map(Ae=>Ae.scenario),runDefaults:Un.length>0?{...N.runDefaults??{},selectedAgentNames:Un}:void 0,updatedAt:new Date().toISOString()};if(j){const Ae=await o(In);E(Ae);const On=Ae.configName?.trim()||Ae.name;_e({title:"MCP Evaluation Created",description:`"${On}" has been saved.`}),n(`/mcp-evaluations/${Ae.id}`)}else{const Ae=await c(N.id,In);E(Ae);const On=Ae.configName?.trim()||Ae.name;_e({title:"MCP Evaluation Updated",description:`"${On}" has been updated.`}),C(!1),n(`/mcp-evaluations/${Ae.id}`,{replace:!0})}},lt=N.configName?.trim()||N.name,pt=j?"New MCP Evaluation":S?`Editing: ${lt}`:lt,vt=j?"/mcp-evaluations/new":`/mcp-evaluations/${encodeURIComponent(N.id||e||"")}`,zt=!!y?.loadError,qt=m.useMemo(()=>x.map(K=>({id:K.id,ref:K.id,label:K.name||K.id,model:K.model})).sort((K,ge)=>K.label.localeCompare(ge.label)),[x]),Wt=(K,ge)=>{const He=ge?Array.from(new Set([...oe,K])):oe.filter(ct=>ct!==K);ee({runDefaults:{...N.runDefaults??{},selectedAgentNames:He}})},Qt=K=>{const ge=new Set([...Ce.filter(yt=>yt.kind==="inline").map(yt=>yt.agent.name||yt.agent.id),...x.map(yt=>yt.name||yt.id)]),He=`${K}-custom`;let ct=He,Vt=2;for(;ge.has(ct);)ct=`${He}-${Vt}`,Vt+=1;return ct},Ne=()=>{const ge={id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096};Me([{kind:"inline",agent:ge},...Ce]),ne(He=>({...He,[ge.id]:!0}))},Xe=()=>{const K=x.find(ct=>ct.id===D);if(!K)return;const ge=K.id;new Set(Ce.filter(ct=>ct.kind==="referenced").map(ct=>ct.ref)).has(ge)||Me([...Ce,{kind:"referenced",ref:ge}]),I("")},Fe=()=>{const K=new Set(Ce.filter(He=>He.kind==="referenced").map(He=>He.ref)),ge=x.filter(He=>!K.has(He.id)).map(He=>({kind:"referenced",ref:He.id}));ge.length>0&&Me([...Ce,...ge])},Ft=()=>{const K=x.find(Vt=>Vt.id===D);if(!K)return;const ge=K.name||K.id,He=Qt(ge),ct={...structuredClone(K),id:`agt-${Date.now()}`,name:He};Me([...Ce,{kind:"inline",agent:ct}]),ne(Vt=>({...Vt,[ct.id]:!0})),I(""),_e({title:"Imported agent as inline",description:He})},on=K=>{const ge=Ce[K];if(!ge)return;const He=ge.kind==="inline"?ge.agent.id:ge.ref,ct=oe.filter(Vt=>Vt!==He);ee({runDefaults:{...N.runDefaults??{},selectedAgentNames:ct}}),ge.kind==="inline"&&ne(Vt=>{const yt={...Vt};return delete yt[ge.agent.id],yt}),Me(Ce.filter((Vt,yt)=>yt!==K))},Ut=(K,ge)=>{const He=K+ge;if(He<0||He>=Ce.length)return;const ct=[...Ce],[Vt]=ct.splice(K,1);ct.splice(He,0,Vt),Me(ct)},ye=K=>{const ge=Ce[K];if(!ge||ge.kind!=="referenced")return;const He=Ot(ge.ref);if(!He){_e({title:"Referenced agent not found",variant:"destructive"});return}const ct=He.name||He.id,Vt=Qt(ct),yt={...structuredClone(He),id:`agt-${Date.now()}`,name:Vt},Un=[...Ce];if(Un[K]={kind:"inline",agent:yt},Me(Un),oe.includes(ge.ref)){const In=oe.map(Ae=>Ae===ge.ref?yt.id:Ae);ee({runDefaults:{...N.runDefaults??{},selectedAgentNames:Array.from(new Set(In))}})}ne(In=>({...In,[yt.id]:!0})),_e({title:"Referenced agent converted to inline",description:Vt})},Ve=()=>{const K=g.find(He=>He.id===B);if(!K)return;const ge={...structuredClone(K),id:`scn-${Date.now()}`,serverIds:[...K.serverIds]};Re([...ae,{kind:"inline",scenario:ge}]),de(He=>({...He,[ge.id]:!0})),J("")},Be=()=>{const ge={id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};Re([{kind:"inline",scenario:ge},...ae]),de(He=>({...He,[ge.id]:!0}))},xt=()=>{const K=g.find(ct=>ct.id===B);if(!K)return;const ge=K.id;new Set(ae.filter(ct=>ct.kind==="referenced").map(ct=>ct.ref)).has(ge)||Re([...ae,{kind:"referenced",ref:ge}]),J("")},Ee=K=>{const ge=ae[K];ge?.kind==="inline"&&de(He=>{const ct={...He};return delete ct[ge.scenario.id],ct}),Re(ae.filter((He,ct)=>ct!==K))},ue=(K,ge)=>{const He=K+ge;if(He<0||He>=ae.length)return;const ct=[...ae],[Vt]=ct.splice(K,1);ct.splice(He,0,Vt),Re(ct)},Ze=K=>{const ge=ae[K];if(!ge||ge.kind!=="referenced")return;const He=Jt(ge.ref);if(!He){_e({title:"Referenced scenario not found",variant:"destructive"});return}const ct=new Set(ae.filter(Et=>Et.kind==="inline").map(Et=>Et.scenario.name?.trim().toLowerCase()).filter(Boolean)),Vt=`${(He.name||He.id).trim()}-custom`;let yt=Vt,Un=2;for(;ct.has(yt.toLowerCase());)yt=`${Vt}-${Un}`,Un+=1;const In=Date.now(),Ae={...structuredClone(He),id:`scn-${In}`,name:yt,serverIds:ge.mcpServers&&ge.mcpServers.length>0?ge.mcpServers.map(Et=>Et.kind==="referenced"?Et.ref:Et.server.id):[...He.serverIds]},On=[...ae];On[K]={kind:"inline",scenario:Ae},Re(On),de(Et=>({...Et,[Ae.id]:!0})),_e({title:"Referenced scenario converted to inline",description:yt})},ht=K=>p.find(ge=>ge.id===K),Ot=K=>x.find(ge=>ge.id===K),Jt=K=>g.find(ge=>ge.id===K),Pn=pe.filter(K=>K.kind==="referenced").map(K=>K.ref),mt=Pn.map(ht).filter(K=>!!K),It=Ce.filter(K=>K.kind==="referenced").map(K=>K.ref),Lt=It.map(Ot).filter(K=>!!K);Ce.filter(K=>K.kind==="inline");const Kt=Ce.flatMap(K=>{if(K.kind==="referenced"){const ge=Ot(K.ref);return ge?[{agent:ge,origin:"referenced",ref:K.ref}]:[]}return[{agent:K.agent,origin:"inline",ref:void 0}]}),qn=ae.filter(K=>K.kind==="referenced").map(K=>K.ref),le=ae.flatMap(K=>{if(K.kind==="referenced"){const ge=Jt(K.ref);if(!ge)return[];if(K.mcpServers===void 0)return[{scenario:ge,origin:"referenced",hasMcpServerOverride:!1}];const He=K.mcpServers.flatMap(ct=>ct.kind==="referenced"?[ct.ref]:[ct.server.id]);return[{scenario:{...ge,serverIds:He},origin:"referenced",hasMcpServerOverride:!0}]}return[{scenario:K.scenario,origin:"inline",hasMcpServerOverride:!1}]}),at=Array.from(new Map([...x,...N.agents,...Lt].map(K=>[K.id,K])).values()),Ct=Array.from(new Map([...p,...N.servers??[],...mt].map(K=>[K.id,K])).values()),an=ae.filter(K=>K.kind==="referenced").flatMap(K=>(K.mcpServers??[]).filter(ge=>ge.kind==="referenced").map(ge=>ge.ref)),bt=Array.from(new Set([...Pn,...an].filter(K=>!ht(K)))),kn=It.filter(K=>!Ot(K)),Fn=qn.filter(K=>!Jt(K));new Set(bt);const Tr=new Set(Fn),ji=Ce.length,Fs=ae.length,Si=[...p],Da=(K,ge)=>{const He=ae[K];if(!He||He.kind!=="referenced")return;const ct=[...ae];ct[K]={kind:"referenced",ref:He.ref,mcpServers:ge.map(Vt=>({kind:"referenced",ref:Vt}))},Re(ct)},Au=K=>{const ge=ae[K];if(!ge||ge.kind!=="referenced")return;const He=[...ae];He[K]={kind:"referenced",ref:ge.ref},Re(He)};return m.useEffect(()=>{if(!D)return;x.some(ge=>ge.id===D)||I("")},[x,D]),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(se,{variant:"ghost",size:"icon",asChild:!0,className:"h-8 w-8",children:a.jsx(At,{to:"/mcp-evaluations",children:a.jsx(Jo,{className:"h-4 w-4"})})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("h1",{className:"text-2xl font-bold truncate",children:pt}),a.jsx("p",{className:"text-sm text-muted-foreground",children:j?"Create a new MCP evaluation":d?"Loading configuration...":y?y.loadError?"MCP evaluation could not be fully loaded":`Last updated ${new Date(N.updatedAt).toLocaleDateString()}`:"MCP evaluation not found"})]}),a.jsxs("div",{className:"flex gap-2 shrink-0",children:[b&&!S&&a.jsx(se,{size:"sm",onClick:()=>{C(!0),n(`${vt}/edit`)},children:"Edit"}),b&&!S&&y&&!zt&&a.jsx(se,{size:"sm",variant:"outline",asChild:!0,children:a.jsxs(At,{to:`/run?configId=${encodeURIComponent(y.id)}`,children:[a.jsx(ti,{className:"mr-1.5 h-3.5 w-3.5"}),"Run MCP Evaluation"]})}),b&&!S&&zt&&a.jsxs(qe,{variant:"destructive",className:"py-1 px-3 text-xs",children:[a.jsx(kh,{className:"mr-1 h-3 w-3"}),"Broken config"]}),S&&a.jsxs(a.Fragment,{children:[!j&&a.jsx(se,{variant:"outline",size:"sm",onClick:()=>{E(structuredClone(y)),C(!1),n(vt)},children:"Cancel"}),a.jsxs(se,{size:"sm",onClick:()=>{Ge()},children:[a.jsx(F7,{className:"mr-1.5 h-3.5 w-3.5"}),"Save"]})]})]})]}),zt&&!S&&a.jsx(Ue,{className:"border-destructive/40",children:a.jsxs(We,{className:"pt-6 space-y-3",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(kh,{className:"mt-0.5 h-5 w-5 text-destructive"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"text-sm font-semibold",children:"This configuration is broken"}),a.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."})]})]}),a.jsxs("div",{className:"rounded-md border bg-muted/20 p-3",children:[a.jsx("p",{className:"text-xs font-medium mb-1",children:"File"}),a.jsx("p",{className:"text-xs font-mono break-all",children:y?.sourcePath||y?.description})]}),a.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3",children:[a.jsx("p",{className:"text-xs font-medium mb-1 text-destructive",children:"Load Error"}),a.jsx("p",{className:"text-xs break-all text-destructive",children:y?.loadError})]}),(bt.length>0||kn.length>0||Fn.length>0)&&a.jsxs("div",{className:"rounded-md border border-destructive/30 bg-background p-3 space-y-1.5",children:[a.jsx("p",{className:"text-xs font-medium",children:"Broken references"}),bt.length>0&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Servers: ",a.jsx("span",{className:"text-destructive",children:bt.join(", ")})]}),kn.length>0&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Agents: ",a.jsx("span",{className:"text-destructive",children:kn.join(", ")})]}),Fn.length>0&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Scenarios: ",a.jsx("span",{className:"text-destructive",children:Fn.join(", ")})]})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Valid items still render below. Only the missing references are marked as broken."})]})}),!zt&&(N.loadWarnings?.length??0)>0&&a.jsx(Ue,{className:"border-amber-500/30",children:a.jsxs(We,{className:"pt-4 space-y-1",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-amber-700 dark:text-amber-300",children:[a.jsx(kh,{className:"h-4 w-4"}),"Migration warnings"]}),N.loadWarnings?.map((K,ge)=>a.jsx("p",{className:"text-xs text-muted-foreground",children:K},`${K}-${ge}`))]})}),a.jsxs("div",{className:"flex gap-4",children:[a.jsx(qe,{variant:Q==="scenarios"?"default":"outline",className:"py-1 px-3 text-xs",children:a.jsxs(At,{to:`${vt}/scenarios`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[a.jsx(VE,{className:"h-3 w-3"}),Fs," scenario",Fs!==1?"s":""]})}),a.jsx(qe,{variant:Q==="agents"?"default":"outline",className:"py-1 px-3 text-xs",children:a.jsxs(At,{to:`${vt}/agents`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[a.jsx(Pr,{className:"h-3 w-3"}),ji," agent",ji!==1?"s":""]})})]}),a.jsx(Ue,{children:a.jsx(We,{className:"pt-6 space-y-3",children:a.jsxs("div",{className:`grid gap-4 ${L||!j?"sm:grid-cols-2":"sm:grid-cols-3"}`,children:[!L&&j&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Config ID"}),a.jsx(gt,{value:N.name,onChange:K=>ee({name:K.target.value}),disabled:L,placeholder:"e.g. check-weather"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Name (optional)"}),a.jsx(gt,{value:N.configName||"",onChange:K=>ee({configName:K.target.value}),disabled:L,placeholder:"e.g. Weather checks baseline"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Description"}),a.jsx(gt,{value:N.description||"",onChange:K=>ee({description:K.target.value}),disabled:L,placeholder:"Brief description..."})]})]})})}),h&&a.jsx(Ue,{children:a.jsxs(We,{className:"pt-6 space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-semibold",children:"Snapshot Evaluation"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Config baseline versioning. One active baseline is selected; scenarios can opt in/out below."})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx($e,{className:"text-xs",children:"Enable snapshot baseline"}),a.jsx(Xm,{checked:N.snapshotEval?.enabled??!1,disabled:R,onCheckedChange:K=>{const ge=N.snapshotEval;ve({enabled:K,mode:ge?.mode??"warn",baselineSnapshotId:ge?.baselineSnapshotId,baselineSourceRunId:ge?.baselineSourceRunId})}})]})]}),a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Drift mode"}),a.jsxs(jn,{value:N.snapshotEval?.mode??"warn",onValueChange:K=>{const ge=N.snapshotEval;ve({enabled:ge?.enabled??!1,mode:K,baselineSnapshotId:ge?.baselineSnapshotId,baselineSourceRunId:ge?.baselineSourceRunId})},children:[a.jsx(mn,{className:"h-8",children:a.jsx(Sn,{})}),a.jsxs(vn,{children:[a.jsx(et,{value:"warn",children:"Warn"}),a.jsx(et,{value:"fail_on_drift",children:"Fail on drift"})]})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Active baseline"}),a.jsx("p",{className:"rounded-md border bg-muted/20 px-2 py-2 text-xs font-mono",children:N.snapshotEval?.baselineSnapshotId??"No baseline linked"})]})]}),N.id&&a.jsxs("div",{className:"grid gap-2 rounded-md border bg-muted/20 p-3 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx($e,{className:"text-xs",children:"Generate baseline from passing run"}),a.jsx(gt,{value:O,onChange:K=>T(K.target.value),placeholder:"Run id (e.g. 20260208-140213)",className:"h-8 font-mono text-xs"}),H===!1&&a.jsx("p",{className:"text-[11px] text-destructive",children:"Run is missing or not fully passing."})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx($e,{className:"text-xs",children:"Snapshot name (optional)"}),a.jsx(gt,{value:$,onChange:K=>z(K.target.value),placeholder:"e.g. config-baseline-v1",className:"h-8 text-xs"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx($e,{className:"text-xs",children:"Switch baseline"}),a.jsxs(jn,{value:q||N.snapshotEval?.baselineSnapshotId||"",onValueChange:K=>{F(K),ve({enabled:N.snapshotEval?.enabled??!0,mode:N.snapshotEval?.mode??"warn",baselineSnapshotId:K||void 0,baselineSourceRunId:N.snapshotEval?.baselineSourceRunId})},children:[a.jsx(mn,{className:"h-8",children:a.jsx(Sn,{placeholder:"Select snapshot"})}),a.jsx(vn,{children:A.map(K=>a.jsx(et,{value:K.id,children:K.name},K.id))})]})]}),a.jsxs("div",{className:"flex items-end gap-2",children:[a.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:()=>{Pe()},disabled:X||!O.trim()||H!==!0,children:X?"Generating...":"Generate Baseline"}),a.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:()=>{ve({enabled:N.snapshotEval?.enabled??!1,mode:N.snapshotEval?.mode??"warn",baselineSnapshotId:void 0,baselineSourceRunId:void 0})},disabled:R,children:"Clear Baseline"})]})]})]})}),a.jsxs(Sg,{value:Q,onValueChange:K=>{if(K!=="servers"&&K!=="agents"&&K!=="scenarios")return;const ge=new URLSearchParams(r);if(ge.delete("tab"),s(ge,{replace:!0}),e&&e!=="new"){n(`/mcp-evaluations/${encodeURIComponent(e)}/${K}`,{replace:!0});return}n(`/mcp-evaluations/${e??"new"}/${K}`,{replace:!0})},className:"space-y-4",children:[a.jsxs(Xf,{children:[a.jsxs(Cs,{value:"scenarios",className:"gap-1.5",children:[a.jsx(VE,{className:"h-3.5 w-3.5"}),"Scenarios"]}),a.jsxs(Cs,{value:"agents",className:"gap-1.5",children:[a.jsx(Pr,{className:"h-3.5 w-3.5"}),"Agents"]})]}),a.jsxs(Nf,{value:"agents",children:[!L&&a.jsx(Ue,{className:"mb-4",children:a.jsxs(We,{className:"pt-4 space-y-3",children:[a.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[a.jsxs(jn,{value:D,onValueChange:I,children:[a.jsx(mn,{className:"h-8",children:a.jsx(Sn,{placeholder:"Select agent from library"})}),a.jsx(vn,{children:qt.map(K=>a.jsx(et,{value:K.id,children:K.label},K.id))})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!D,onClick:Xe,children:"Add Ref"}),a.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!D,onClick:Ft,children:"Import Inline"}),a.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:x.length===0||x.every(K=>Ce.some(ge=>ge.kind==="referenced"&&ge.ref===K.id)),onClick:Fe,children:"Add All Refs"}),a.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:Ne,children:"Add agent"})]})]}),a.jsxs("div",{className:"space-y-2",children:[Ce.map((K,ge)=>{const He=K.kind==="referenced"?Ot(K.ref):null,ct=K.kind==="inline"?K.agent.name?.trim()||K.agent.id:He?.name||K.ref,Vt=K.kind==="inline"?K.agent.model:He?.model||"unknown",yt=K.kind==="inline"?K.agent.id:K.ref,Un=K.kind==="referenced"&&!He,In=K.kind==="inline"?K.agent.id:K.ref,Ae=oe.includes(In),On=K.kind==="inline"&&!!re[K.agent.id];return a.jsxs("div",{className:"rounded-md border text-sm",children:[a.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Ut(ge,-1),disabled:ge===0,"aria-label":"Move agent up",children:a.jsx(ws,{className:"h-3 w-3"})}),a.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Ut(ge,1),disabled:ge===Ce.length-1,"aria-label":"Move agent down",children:a.jsx(Yt,{className:"h-3 w-3"})})]}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[ge+1,"."]}),a.jsx("span",{className:"truncate font-medium",children:ct}),a.jsx(qe,{variant:K.kind==="inline"?"secondary":"outline",children:K.kind==="inline"?"Inline":"Referenced"}),a.jsx(qe,{variant:"outline",className:"font-mono text-[10px]",children:Vt}),Ae&&a.jsx(qe,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),Un&&a.jsx(qe,{variant:"destructive",children:"Missing"})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsxs("label",{className:"mx-2 flex items-center gap-1.5 text-xs text-muted-foreground",children:[a.jsx("input",{type:"checkbox",checked:Ae,onChange:Et=>Wt(In,Et.target.checked)}),a.jsx("span",{children:"Default"})]}),K.kind==="inline"&&a.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>ne(Et=>({...Et,[K.agent.id]:!Et[K.agent.id]})),children:On?"Collapse":"Expand"}),K.kind==="referenced"&&a.jsx(a.Fragment,{children:a.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>ye(ge),disabled:Un,children:"Convert to inline"})}),a.jsx(se,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>on(ge),"aria-label":"Remove agent entry",children:a.jsx(Ta,{className:"h-3.5 w-3.5"})})]})]}),K.kind==="inline"&&On&&a.jsxs("div",{className:"border-t px-3 py-3 space-y-3",children:[a.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Name"}),a.jsx(gt,{value:K.agent.name,onChange:Et=>{const Zt=[...Ce];Zt[ge]={kind:"inline",agent:{...K.agent,name:Et.target.value}},Me(Zt)},placeholder:"e.g. GPT-5 Mini custom"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Provider"}),a.jsxs(jn,{value:K.agent.provider,onValueChange:Et=>{const Zt=[...Ce];Zt[ge]={kind:"inline",agent:{...K.agent,provider:Et}},Me(Zt)},children:[a.jsx(mn,{children:a.jsx(Sn,{})}),a.jsxs(vn,{children:[a.jsx(et,{value:"openai",children:"OpenAI"}),a.jsx(et,{value:"anthropic",children:"Anthropic"}),a.jsx(et,{value:"azure",children:"Azure OpenAI"}),a.jsx(et,{value:"google",children:"Google"}),a.jsx(et,{value:"custom",children:"Custom"})]})]})]})]}),a.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Model"}),a.jsx(gt,{value:K.agent.model,onChange:Et=>{const Zt=[...Ce];Zt[ge]={kind:"inline",agent:{...K.agent,model:Et.target.value}},Me(Zt)},className:"font-mono text-xs"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Max Tokens"}),a.jsx(gt,{type:"number",min:1,max:128e3,value:K.agent.maxTokens,onChange:Et=>{const Zt=[...Ce];Zt[ge]={kind:"inline",agent:{...K.agent,maxTokens:parseInt(Et.target.value)||0}},Me(Zt)},className:"font-mono text-xs"})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Temperature"}),a.jsx(gt,{type:"number",min:0,max:2,step:.01,value:K.agent.temperature,onChange:Et=>{const Zt=[...Ce];Zt[ge]={kind:"inline",agent:{...K.agent,temperature:Number(Et.target.value)||0}},Me(Zt)},className:"font-mono text-xs"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"System Prompt"}),a.jsx(Os,{value:K.agent.systemPrompt||"",onChange:Et=>{const Zt=[...Ce];Zt[ge]={kind:"inline",agent:{...K.agent,systemPrompt:Et.target.value}},Me(Zt)},rows:3,className:"text-xs"})]})]})]},`agent-entry-${ge}-${yt}`)}),Ce.length===0&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents configured yet. Add inline agents or references."})]}),kn.length>0&&a.jsxs("p",{className:"text-xs text-destructive",children:["Missing agent refs: ",kn.join(", ")]})]})}),L?a.jsx(Ue,{children:a.jsx(We,{className:"pt-4",children:a.jsxs("div",{className:"space-y-2",children:[Kt.map((K,ge)=>{const He=K.agent.name||K.agent.id,ct=oe.includes(K.origin==="inline"?K.agent.id:K.ref||K.agent.id),Vt=K.ref??K.agent.id,yt=!!fe[Vt];return a.jsxs("div",{className:"rounded-md border p-3",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a.jsxs("span",{className:"text-xs text-muted-foreground",children:[ge+1,"."]}),a.jsx("div",{className:"truncate font-medium text-sm",children:He})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[ct&&a.jsx(qe,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),a.jsx(qe,{variant:K.origin==="inline"?"secondary":"outline",children:K.origin==="inline"?"Inline":"Referenced"}),a.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8",onClick:()=>he(Un=>({...Un,[Vt]:!Un[Vt]})),"aria-label":yt?"Collapse agent details":"Expand agent details",children:a.jsx(Yt,{className:`h-4 w-4 transition-transform ${yt?"rotate-180":""}`})})]})]}),yt&&a.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 border-t pt-2",children:[a.jsx(Uz,{provider:K.agent.provider}),a.jsx(qe,{variant:"outline",className:"text-xs font-mono",children:K.agent.model}),a.jsxs(qe,{variant:"outline",className:"text-xs font-mono",children:["max_tokens: ",K.agent.maxTokens]}),a.jsxs(qe,{variant:"outline",className:"text-xs font-mono",children:["temperature: ",K.agent.temperature]})]})]},`agent-view-${ge}-${K.ref??K.agent.id}`)}),Kt.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No agents configured."})]})})}):null]}),a.jsxs(Nf,{value:"scenarios",children:[!L&&a.jsx(Ue,{className:"mb-4",children:a.jsxs(We,{className:"pt-4 space-y-3",children:[a.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[a.jsxs(jn,{value:B,onValueChange:J,children:[a.jsx(mn,{className:"h-8",children:a.jsx(Sn,{placeholder:"Select scenario from library"})}),a.jsx(vn,{children:[...g].sort((K,ge)=>(K.name||K.id).localeCompare(ge.name||ge.id)).map(K=>a.jsx(et,{value:K.id,children:K.name||K.id},K.id))})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!B,onClick:xt,children:"Add Ref"}),a.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!B,onClick:Ve,children:"Import Inline"}),a.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:Be,children:"Add scenario"})]})]}),a.jsxs("div",{className:"space-y-2",children:[ae.map((K,ge)=>{const He=K.kind==="referenced"?Jt(K.ref):null,ct=K.kind==="inline"?K.scenario.name?.trim()||K.scenario.id:He?.name||K.ref,Vt=K.kind==="inline"&&!K.scenario.name?.trim(),yt=K.kind==="referenced"&&Tr.has(K.ref),Un=K.kind==="referenced"&&Array.isArray(K.mcpServers),In=K.kind==="inline"&&!!V[K.scenario.id];return a.jsxs("div",{className:"rounded-md border text-sm",children:[a.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>ue(ge,-1),disabled:ge===0,"aria-label":"Move scenario up",children:a.jsx(ws,{className:"h-3 w-3"})}),a.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>ue(ge,1),disabled:ge===ae.length-1,"aria-label":"Move scenario down",children:a.jsx(Yt,{className:"h-3 w-3"})})]}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[ge+1,"."]}),a.jsx("span",{className:"truncate font-medium",children:ct}),a.jsx(qe,{variant:K.kind==="inline"?"secondary":"outline",children:K.kind==="inline"?"Inline":"Referenced"}),Un&&a.jsx(qe,{variant:"secondary",children:"Override"}),Vt&&a.jsx(qe,{variant:"destructive",children:"Name required"}),yt&&a.jsx(qe,{variant:"destructive",children:"Missing"})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[K.kind==="inline"&&a.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-7 w-7",onClick:()=>de(Ae=>({...Ae,[K.scenario.id]:!Ae[K.scenario.id]})),"aria-label":In?"Collapse scenario details":"Expand scenario details",children:a.jsx(Yt,{className:`h-3.5 w-3.5 transition-transform ${In?"rotate-180":""}`})}),K.kind==="referenced"&&a.jsx(a.Fragment,{children:a.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>Ze(ge),disabled:yt,children:"Convert to inline"})}),a.jsx(se,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>Ee(ge),"aria-label":"Remove scenario entry",children:a.jsx(Ta,{className:"h-3.5 w-3.5"})})]})]}),K.kind==="inline"&&In&&a.jsx("div",{className:"border-t px-3 py-3",children:a.jsx(J1,{scenarios:[K.scenario],scenarioOrigins:["inline"],agents:[...N.agents,...Lt],servers:[...N.servers??[],...mt],configId:N.id,configPath:N.sourcePath,defaultAssistantAgentName:N.runDefaults?.selectedAgentNames?.[0],snapshotEval:N.snapshotEval,onChange:Ae=>{const On=Ae[0];if(!On)return;const Et=[...ae];Et[ge]={kind:"inline",scenario:On},Re(Et)},readOnly:!1,allowAdd:!1,allowStructureEdits:!1})}),K.kind==="referenced"&&!yt&&a.jsxs("div",{className:"border-t px-3 py-3 space-y-2",children:[a.jsx("div",{className:"text-xs text-muted-foreground",children:"Optional MCP server override for this referenced scenario."}),a.jsx("div",{className:"flex flex-wrap gap-2",children:Si.map(Ae=>{const On=(K.mcpServers??[]).some(Et=>Et.kind==="referenced"&&Et.ref===Ae.id);return a.jsx(se,{type:"button",size:"sm",variant:On?"default":"outline",className:`h-7 text-xs ${On?"":"opacity-70"}`,onClick:()=>{const Et=(K.mcpServers??[]).filter(Jr=>Jr.kind==="referenced").map(Jr=>Jr.ref),Zt=Et.includes(Ae.id)?Et.filter(Jr=>Jr!==Ae.id):[...Et,Ae.id];Da(ge,Zt)},children:Ae.name||Ae.id},`${K.ref}-override-server-${Ae.id}`)})}),Un&&a.jsx(se,{type:"button",size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>Au(ge),children:"Reset override"})]})]},`scenario-entry-${ge}-${K.kind==="inline"?K.scenario.id:K.ref}`)}),ae.length===0&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"No scenarios configured yet. Add inline scenarios or references."})]}),Fn.length>0&&a.jsxs("p",{className:"text-xs text-destructive",children:["Missing scenario refs: ",Fn.join(", ")]})]})}),L?a.jsx(Ue,{children:a.jsx(We,{className:"pt-4",children:a.jsx(J1,{scenarios:le.map(K=>K.scenario),scenarioOrigins:le.map(K=>K.origin),scenarioOverrides:le.map(K=>K.hasMcpServerOverride),agents:at,servers:Ct,configId:N.id,configPath:N.sourcePath,defaultAssistantAgentName:N.runDefaults?.selectedAgentNames?.[0],snapshotEval:N.snapshotEval,onChange:()=>{},readOnly:!0})})}):null]})]})]})};var Cve=Symbol("radix.slottable");function _ve(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Cve,t}var g8="AlertDialog",[Ave]=mr(g8,[N5]),wi=N5(),x8=e=>{const{__scopeAlertDialog:t,...n}=e,r=wi(t);return a.jsx(_v,{...r,...n,modal:!0})};x8.displayName=g8;var Eve="AlertDialogTrigger",Pve=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=wi(n);return a.jsx(YG,{...s,...r,ref:t})});Pve.displayName=Eve;var kve="AlertDialogPortal",y8=e=>{const{__scopeAlertDialog:t,...n}=e,r=wi(t);return a.jsx(Av,{...r,...n})};y8.displayName=kve;var Ove="AlertDialogOverlay",b8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=wi(n);return a.jsx(hu,{...s,...r,ref:t})});b8.displayName=Ove;var _c="AlertDialogContent",[Tve,Rve]=Ave(_c),Ive=_ve("AlertDialogContent"),w8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,i=wi(n),o=m.useRef(null),c=St(t,o),d=m.useRef(null);return a.jsx(VG,{contentName:_c,titleName:j8,docsSlug:"alert-dialog",children:a.jsx(Tve,{scope:n,cancelRef:d,children:a.jsxs(mu,{role:"alertdialog",...i,...s,ref:c,onOpenAutoFocus:Te(s.onOpenAutoFocus,f=>{f.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[a.jsx(Ive,{children:r}),a.jsx($ve,{contentRef:o})]})})})});w8.displayName=_c;var j8="AlertDialogTitle",S8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=wi(n);return a.jsx(Tf,{...s,...r,ref:t})});S8.displayName=j8;var N8="AlertDialogDescription",C8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=wi(n);return a.jsx(Rf,{...s,...r,ref:t})});C8.displayName=N8;var Mve="AlertDialogAction",_8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=wi(n);return a.jsx(Ev,{...s,...r,ref:t})});_8.displayName=Mve;var A8="AlertDialogCancel",E8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=Rve(A8,n),i=wi(n),o=St(t,s);return a.jsx(Ev,{...i,...r,ref:o})});E8.displayName=A8;var $ve=({contentRef:e})=>{const t=`\`${_c}\` requires a description for the component to be accessible for screen reader users.
|
|
130
|
+
|
|
131
|
+
You can add a description to the \`${_c}\` by passing a \`${N8}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
132
|
+
|
|
133
|
+
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 \`${_c}\`. 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.
|
|
134
|
+
|
|
135
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return m.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Dve=x8,Lve=y8,P8=b8,k8=w8,O8=_8,T8=E8,R8=S8,I8=C8;const Ls=Dve,Fve=Lve,M8=m.forwardRef(({className:e,...t},n)=>a.jsx(P8,{className:Se("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));M8.displayName=P8.displayName;const ss=m.forwardRef(({className:e,...t},n)=>a.jsxs(Fve,{children:[a.jsx(M8,{}),a.jsx(k8,{ref:n,className:Se("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));ss.displayName=k8.displayName;const is=({className:e,...t})=>a.jsx("div",{className:Se("flex flex-col space-y-2 text-center sm:text-left",e),...t});is.displayName="AlertDialogHeader";const os=({className:e,...t})=>a.jsx("div",{className:Se("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});os.displayName="AlertDialogFooter";const ls=m.forwardRef(({className:e,...t},n)=>a.jsx(R8,{ref:n,className:Se("text-lg font-semibold",e),...t}));ls.displayName=R8.displayName;const cs=m.forwardRef(({className:e,...t},n)=>a.jsx(I8,{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));cs.displayName=I8.displayName;const us=m.forwardRef(({className:e,...t},n)=>a.jsx(O8,{ref:n,className:Se(ON(),e),...t}));us.displayName=O8.displayName;const ds=m.forwardRef(({className:e,...t},n)=>a.jsx(T8,{ref:n,className:Se(ON({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));ds.displayName=T8.displayName;const Bve=()=>{const{servers:e,setServers:t,reload:n,loading:r}=rs(),s=Ia(),[i,o]=m.useState(null),[c,d]=m.useState(""),f=c.trim().toLowerCase(),h=b=>b.name?.trim()||b.id,p=async b=>{const y=`${h(b)}-copy`;let S=y,C=1;for(;e.some(E=>(E.name?.trim()||E.id)===S);)S=`${y}-${C}`,C+=1;const N={...structuredClone(b),id:`srv-${Date.now()}`,name:S};await t([...e,N]),_e({title:"Server duplicated",description:`Created ${S}.`})},x=async b=>{await t(e.filter(y=>y.id!==b.id)),_e({title:"Server deleted",description:`${h(b)} was removed.`}),o(null)},g=b=>b.transport==="stdio"?[b.command,...b.args||[]].filter(Boolean).join(" "):b.url||"",j=m.useMemo(()=>[...f.length===0?e:e.filter(y=>[h(y),y.id,y.transport,g(y),y.authType??""].join(" ").toLowerCase().includes(f))].sort((y,S)=>h(y).localeCompare(h(S),void 0,{sensitivity:"base"})),[e,f]);return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[a.jsx(Z$,{className:"h-6 w-6"}),"MCP Servers"]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Reusable MCP server definitions shared across configurations."})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx($C,{value:c,onValueChange:d,placeholder:"Search MCP servers..."}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[a.jsx(ma,{className:"mr-2 h-4 w-4"}),"Refresh"]}),a.jsxs(se,{type:"button",size:"sm",onClick:()=>s("/libraries/servers/new"),children:[a.jsx(oi,{className:"mr-2 h-4 w-4"}),"Add Server"]})]})]}),e.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed py-16 text-center",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"No servers configured. Add one to get started."}),a.jsxs(se,{type:"button",size:"sm",className:"mt-4",onClick:()=>s("/libraries/servers/new"),children:[a.jsx(oi,{className:"mr-2 h-4 w-4"}),"Add Server"]})]}):j.length===0?a.jsx("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed py-12 text-center",children:a.jsx("p",{className:"text-sm text-muted-foreground",children:"No servers match this filter."})}):a.jsx(Ue,{children:a.jsx(We,{className:"p-0",children:a.jsxs(Wr,{children:[a.jsx(Vr,{children:a.jsxs(Gt,{children:[a.jsx(rt,{children:"Name"}),a.jsx(rt,{children:"Transport"}),a.jsx(rt,{children:"Endpoint"}),a.jsx(rt,{children:"Auth"}),a.jsx(rt,{className:"text-right",children:"Actions"})]})}),a.jsx(Hr,{children:j.map(b=>a.jsxs(Gt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>s(`/libraries/servers/${encodeURIComponent(b.id)}`),children:[a.jsx(ze,{className:"font-medium",children:h(b)}),a.jsx(ze,{children:a.jsx(qe,{variant:"secondary",className:"font-mono text-xs",children:b.transport})}),a.jsx(ze,{children:a.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:g(b)})}),a.jsx(ze,{children:!b.authType||b.authType==="none"?a.jsx("span",{className:"text-xs text-muted-foreground",children:"—"}):a.jsx(qe,{variant:"outline",className:"text-xs",children:b.authType})}),a.jsx(ze,{className:"text-right",onClick:y=>y.stopPropagation(),children:a.jsxs("div",{className:"flex items-center justify-end gap-2",children:[a.jsxs(se,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>o(b),children:[a.jsx(Ta,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{p(b)},children:[a.jsx(_s,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>s(`/libraries/servers/${encodeURIComponent(b.id)}`),children:[a.jsx(sv,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},b.id))})]})})}),a.jsx(Ls,{open:!!i,onOpenChange:b=>!b&&o(null),children:a.jsxs(ss,{children:[a.jsxs(is,{children:[a.jsx(ls,{children:"Delete server?"}),a.jsxs(cs,{children:["This will permanently remove"," ",a.jsx("span",{className:"font-mono",children:i?h(i):""})," from the library. This action cannot be undone."]})]}),a.jsxs(os,{children:[a.jsx(ds,{children:"Cancel"}),a.jsx(us,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{i&&x(i)},children:"Delete Server"})]})]})})]})},GM={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"},YM=()=>({id:`srv-${Date.now()}`,name:"",transport:"stdio",authType:"none"}),zve=()=>{const{serverId:e}=yl(),t=Ia(),{servers:n,setServers:r}=rs(),{source:s}=Ln(),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]=m.useState(()=>c??YM()),[p,x]=m.useState(!1),[g,j]=m.useState(!1),[b,y]=m.useState({status:"idle"}),[S,C]=m.useState(!1),[N,E]=m.useState(!1),[A,P]=m.useState([]),[O,T]=m.useState(!1),$=m.useRef(null);m.useEffect(()=>{const R=i?`new:${o||"new"}`:`srv:${o}`;if($.current!==R){if(i){h(YM()),T(!1),$.current=R;return}c&&(h(c),T(!1),$.current=R)}},[i,o,c]);const z=R=>{T(!1),h(W=>({...W,authType:R,...R!=="bearer"&&R!=="api-key"?{authValue:void 0}:{},...R!=="api-key"?{apiKeyHeaderName:void 0}:{apiKeyHeaderName:W.apiKeyHeaderName||"X-API-Key"},...R!=="oauth2"?{oauthClientId:void 0,oauthClientSecret:void 0,oauthRedirectUrl:void 0,oauthScope:void 0,oauthMode:void 0,oauthAuthorizationUrl:void 0,oauthTokenEndpoint:void 0}:{oauthRedirectUrl:W.oauthRedirectUrl||void 0}}))},q=async()=>{if(C(!0),y({status:"loading"}),P([]),f.authType==="oauth2")try{E(!0),await ii({serverNames:[f.id],source:s,onServerStatus:R=>{const W=new Date().toLocaleTimeString(),X=typeof R.tokenExpiresInSeconds=="number"?` (valid ${X1(R.tokenExpiresInSeconds,{nonPositiveLabel:"expired"})}; until ${new Date(R.tokenExpiresAt||Date.now()).toLocaleTimeString()})`:"";if(R.status==="auth_required"){P(G=>[...G,`[${W}] OAuth debug: callback required for '${R.serverName}'`]);return}R.status==="ready"&&(R.debugState==="refreshed"?P(G=>[...G,`[${W}] OAuth debug: token refreshed (no callback)${X}`]):R.debugState==="reused"?P(G=>[...G,`[${W}] OAuth debug: session/token reused${X}`]):P(G=>[...G,`[${W}] OAuth debug: authorized${X}`]))}})}catch(R){y({status:"error",message:`OAuth login failed: ${R instanceof Error?R.message:String(R)}`,testedAt:new Date().toISOString()}),E(!1);return}finally{E(!1)}try{const W=(await s.discoverToolsForAnalysis({serverNames:[f.id]})).servers[0];W&&W.warnings.length===0?y({status:"success",toolNames:W.tools.map(X=>X.name),toolCount:W.tools.length,mcpServerVersion:W.mcpServerVersion,mcpServerImplementation:W.mcpServerImplementation,testedAt:new Date().toISOString()}):y({status:"error",message:W?.warnings[0]??"Connection failed",testedAt:new Date().toISOString()})}catch(R){y({status:"error",message:R instanceof Error?R.message:String(R),testedAt:new Date().toISOString()})}},F=async()=>{if(!f.name.trim()){_e({title:"Name is required",variant:"destructive"});return}const R=v8(f);if(R){_e({title:"Validation Error",description:R,variant:"destructive"});return}const W={...f,authValue:f.authValue?.trim(),apiKeyHeaderName:f.apiKeyHeaderName?.trim()||void 0};j(!0);try{if(i)await r([...n,W]),_e({title:"Server created"}),t(`/libraries/servers/${encodeURIComponent(W.id)}`);else{const X=n.map(G=>G.id===c?.id?W:G);await r(X),_e({title:"Server saved"}),W.id!==o&&t(`/libraries/servers/${encodeURIComponent(W.id)}`,{replace:!0})}}finally{j(!1)}},H=async()=>{const R=n.filter(W=>W.id!==c?.id);await r(R),_e({title:"Server deleted"}),t("/libraries/servers")},U=()=>f.transport==="stdio"?[f.command,...f.args||[]].filter(Boolean).join(" "):f.url||"";return!i&&!c?a.jsxs("div",{className:"space-y-4",children:[a.jsxs(At,{to:"/libraries/servers",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[a.jsx(Jo,{className:"h-4 w-4"})," Servers"]}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:['Server "',o,'" not found.']})]}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsxs(At,{to:"/libraries/servers",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[a.jsx(Jo,{className:"h-4 w-4"})," Servers"]}),a.jsx("h1",{className:"text-2xl font-bold",children:i?"New Server":d(f)})]}),!i&&a.jsxs(se,{type:"button",onClick:()=>{q()},disabled:b.status==="loading"||N,children:[a.jsx(iD,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),S&&a.jsxs(Ue,{children:[a.jsxs(Pt,{className:"flex-row items-center justify-between space-y-0",children:[a.jsx(kt,{className:"text-base",children:"Connection Test"}),a.jsx("button",{type:"button",onClick:()=>C(!1),className:"rounded-sm opacity-70 hover:opacity-100",children:a.jsx(As,{className:"h-4 w-4"})})]}),a.jsxs(We,{className:"space-y-3",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground",children:[a.jsx("span",{children:"Server:"}),a.jsx("span",{className:"font-medium text-foreground",children:d(f)}),a.jsx("span",{className:"mx-1",children:"·"}),a.jsx("span",{children:"Transport:"}),a.jsx("span",{className:"font-medium text-foreground",children:f.transport}),U()&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"mx-1",children:"·"}),a.jsx("span",{children:"Endpoint:"}),a.jsx("code",{className:"font-mono text-xs",children:U()})]})]}),b.status==="loading"&&a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[a.jsx(wr,{className:"h-4 w-4 animate-spin"}),N?"Waiting for OAuth login in browser…":"Connecting to MCP server…"]}),A.length>0&&a.jsx("div",{className:"space-y-0.5",children:A.map((R,W)=>a.jsx("p",{className:"text-xs text-muted-foreground",children:R},W))})]}),b.status==="success"&&a.jsxs("div",{className:"space-y-3",children:[a.jsxs("p",{className:"flex items-center gap-2 text-sm text-emerald-700",children:[a.jsx(Ec,{className:"h-4 w-4 shrink-0"}),"Connected — discovered ",b.toolCount," tool",b.toolCount!==1?"s":""]}),b.toolNames.length>0&&a.jsxs("div",{className:"rounded-md bg-muted p-3",children:[a.jsx("p",{className:"mb-1 text-xs font-medium text-muted-foreground",children:"First 5 tools:"}),a.jsx("ul",{className:"space-y-0.5",children:b.toolNames.slice(0,5).map(R=>a.jsx("li",{className:"font-mono text-xs",children:R},R))})]}),(b.mcpServerImplementation||b.mcpServerVersion)&&a.jsx("div",{className:"rounded-md border bg-muted/40 p-3",children:a.jsxs("div",{className:"flex items-start gap-2",children:[b.mcpServerImplementation?.icons?.[0]?.src?a.jsx("img",{src:b.mcpServerImplementation.icons[0].src,alt:b.mcpServerImplementation.title||b.mcpServerImplementation.name,className:"h-7 w-7 rounded-sm border bg-background object-contain"}):null,a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"MCP server"}),a.jsx("p",{className:"truncate text-sm",children:b.mcpServerImplementation?b.mcpServerImplementation.title||b.mcpServerImplementation.name:"Unknown MCP server"}),b.mcpServerVersion?a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Version: ",a.jsx("code",{className:"font-mono",children:b.mcpServerVersion})]}):null,b.mcpServerImplementation?.description?a.jsx("p",{className:"text-xs text-muted-foreground",children:b.mcpServerImplementation.description}):null]})]})}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(b.testedAt).toLocaleString()]}),A.length>0&&a.jsx("div",{className:"space-y-0.5",children:A.map((R,W)=>a.jsx("p",{className:"text-xs text-muted-foreground",children:R},W))})]}),b.status==="error"&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("p",{className:"text-sm text-destructive",children:[a.jsx("span",{className:"font-medium",children:"✗ Connection failed"})," — ",b.message]}),GM[f.transport]&&a.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",GM[f.transport]]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(b.testedAt).toLocaleString()]})]})]})]}),a.jsxs(Ue,{children:[a.jsx(Pt,{children:a.jsx(kt,{className:"text-base",children:"Configuration"})}),a.jsxs(We,{className:"space-y-4",children:[a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{children:"Name"}),a.jsx(gt,{value:f.name,onChange:R=>h(W=>({...W,name:R.target.value})),placeholder:"e.g. Filesystem MCP"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{children:"Transport"}),a.jsxs(jn,{value:f.transport,onValueChange:R=>h(W=>({...W,transport:R})),children:[a.jsx(mn,{children:a.jsx(Sn,{})}),a.jsxs(vn,{children:[a.jsx(et,{value:"stdio",children:"stdio"}),a.jsx(et,{value:"sse",children:"SSE"}),a.jsx(et,{value:"streamable-http",children:"Streamable HTTP"})]})]})]})]}),f.transport==="stdio"?a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{children:"Command"}),a.jsx(gt,{value:f.command||"",onChange:R=>h(W=>({...W,command:R.target.value})),placeholder:"npx",className:"font-mono text-xs"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{children:"Args (comma-separated)"}),a.jsx(gt,{value:(f.args||[]).join(", "),onChange:R=>h(W=>({...W,args:R.target.value.split(",").map(X=>X.trim()).filter(Boolean)})),placeholder:"-y, @mcp/server",className:"font-mono text-xs"})]})]}):a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{children:"URL"}),a.jsx(gt,{value:f.url||"",onChange:R=>h(W=>({...W,url:R.target.value})),placeholder:"http://localhost:3001/sse",className:"font-mono text-xs"})]}),a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{children:"Auth Type"}),a.jsxs(jn,{value:f.authType||"none",onValueChange:R=>z(R),children:[a.jsx(mn,{children:a.jsx(Sn,{})}),a.jsxs(vn,{children:[a.jsx(et,{value:"none",children:"None"}),a.jsx(et,{value:"bearer",children:"Bearer Token"}),a.jsx(et,{value:"api-key",children:"API Key"}),a.jsx(et,{value:"oauth2",children:"OAuth 2.0"})]})]})]}),f.authType==="bearer"&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{children:"Token"}),a.jsx(gt,{value:f.authValue||"",onChange:R=>h(W=>({...W,authValue:R.target.value})),placeholder:"${DATABRICKS_TOKEN}",className:"font-mono text-xs"})]})]}),f.authType==="bearer"&&a.jsxs("p",{className:"text-xs text-muted-foreground -mt-1",children:["Use ",a.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"&&a.jsxs("div",{className:"space-y-3 rounded-md border p-3",children:[a.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"API Key"}),a.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Header Name"}),a.jsx(gt,{value:f.apiKeyHeaderName||"X-API-Key",onChange:R=>h(W=>({...W,apiKeyHeaderName:R.target.value})),placeholder:"X-API-Key",className:"font-mono text-xs"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Value"}),a.jsx(gt,{value:f.authValue||"",onChange:R=>h(W=>({...W,authValue:R.target.value})),placeholder:"${MY_API_KEY}",className:"font-mono text-xs"})]})]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Use ",a.jsx("code",{className:"rounded bg-muted px-1",children:"${VAR_NAME}"})," to reference an environment variable, or enter a value directly."]})]}),f.authType==="oauth2"&&a.jsxs("div",{className:"space-y-3 rounded-md border p-3",children:[a.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"OAuth 2.0 Flow"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(se,{type:"button",variant:!f.oauthMode||f.oauthMode==="pre_registered"?"default":"outline",size:"sm",onClick:()=>h(R=>({...R,oauthMode:"pre_registered"})),children:"Pre-registered"}),a.jsx(se,{type:"button",variant:f.oauthMode==="dcr"?"default":"outline",size:"sm",onClick:()=>h(R=>({...R,oauthMode:"dcr",oauthClientId:void 0,oauthClientSecret:void 0})),children:"DCR (Dynamic)"})]}),(!f.oauthMode||f.oauthMode==="pre_registered")&&a.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Client ID"}),a.jsx(gt,{value:f.oauthClientId||"",onChange:R=>h(W=>({...W,oauthClientId:R.target.value})),placeholder:"your-client-id",className:"font-mono text-xs"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Client Secret (optional)"}),a.jsx(gt,{type:"password",value:f.oauthClientSecret||"",onChange:R=>h(W=>({...W,oauthClientSecret:R.target.value})),placeholder:"••••••••",className:"font-mono text-xs"})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Scope (optional, space-separated)"}),a.jsx(gt,{value:f.oauthScope||"",onChange:R=>h(W=>({...W,oauthScope:R.target.value})),placeholder:"openid profile mcp",className:"font-mono text-xs"})]}),a.jsxs("div",{children:[a.jsxs("button",{type:"button",className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",onClick:()=>T(R=>!R),children:[a.jsx("span",{children:O?"▾":"▸"}),"Advanced — manual endpoint overrides"]}),O&&a.jsxs("div",{className:"mt-2 grid gap-3 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Authorization URL"}),a.jsx(gt,{value:f.oauthAuthorizationUrl||"",onChange:R=>h(W=>({...W,oauthAuthorizationUrl:R.target.value||void 0})),placeholder:"leave blank to use .well-known discovery",className:"font-mono text-xs"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Token URL"}),a.jsx(gt,{value:f.oauthTokenEndpoint||"",onChange:R=>h(W=>({...W,oauthTokenEndpoint:R.target.value||void 0})),placeholder:"leave blank to use .well-known discovery",className:"font-mono text-xs"})]})]})]})]}),a.jsxs("div",{className:"flex items-center justify-between pt-2",children:[a.jsx("div",{children:!i&&a.jsx(se,{type:"button",variant:"destructive",size:"sm",onClick:()=>x(!0),children:"Delete"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(se,{type:"button",variant:"outline",size:"sm",onClick:()=>t("/libraries/servers"),children:"Cancel"}),a.jsxs(se,{type:"button",size:"sm",onClick:()=>{F()},disabled:g,children:[g&&a.jsx(wr,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Create Server":"Save"]})]})]})]})]}),a.jsx(Ls,{open:p,onOpenChange:x,children:a.jsxs(ss,{children:[a.jsxs(is,{children:[a.jsx(ls,{children:"Delete server?"}),a.jsxs(cs,{children:["This will permanently remove the server"," ",a.jsx("span",{className:"font-mono",children:f.name}),". This action cannot be undone."]})]}),a.jsxs(os,{children:[a.jsx(ds,{children:"Cancel"}),a.jsx(us,{onClick:()=>{H()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},qve=()=>{const{agents:e,setAgents:t,reload:n,loading:r}=rs(),s=Ia(),[i,o]=m.useState(null),[c,d]=m.useState(""),f=c.trim().toLowerCase(),h=m.useMemo(()=>f.length===0?e:e.filter(g=>{const j=g.name.toLowerCase(),b=g.model.toLowerCase();return j.includes(f)||b.includes(f)}),[e,f]),p=async g=>{const j=`${g.name}-copy`;let b=j,y=1;for(;e.some(C=>C.name===b);)b=`${j}-${y}`,y+=1;const S={...structuredClone(g),id:`agt-${Date.now()}`,name:b};await t([...e,S]),_e({title:"Agent duplicated",description:`Created ${b}.`})},x=async g=>{await t(e.filter(j=>j.id!==g.id)),_e({title:"Agent deleted",description:`${g.name} was removed.`}),o(null)};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[a.jsx(Pr,{className:"h-6 w-6"}),"Agents"]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Reusable agent profiles shared across configurations."})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx($C,{value:c,onValueChange:d,placeholder:"Search agents..."}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[a.jsx(ma,{className:"mr-2 h-4 w-4"}),"Refresh"]}),a.jsxs(se,{type:"button",size:"sm",onClick:()=>s("/libraries/agents/new"),children:[a.jsx(oi,{className:"mr-2 h-4 w-4"}),"Add Agent"]})]})]}),e.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed py-16 text-center",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents configured. Add one to get started."}),a.jsxs(se,{type:"button",size:"sm",className:"mt-4",onClick:()=>s("/libraries/agents/new"),children:[a.jsx(oi,{className:"mr-2 h-4 w-4"}),"Add Agent"]})]}):h.length===0?a.jsx("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed py-12 text-center",children:a.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents match this filter."})}):a.jsx(Ue,{children:a.jsx(We,{className:"p-0",children:a.jsxs(Wr,{children:[a.jsx(Vr,{children:a.jsxs(Gt,{children:[a.jsx(rt,{children:"Name"}),a.jsx(rt,{children:"Provider"}),a.jsx(rt,{children:"Model"}),a.jsx(rt,{children:"Max Tokens"}),a.jsx(rt,{children:"Temperature"}),a.jsx(rt,{className:"text-right",children:"Actions"})]})}),a.jsx(Hr,{children:h.map(g=>a.jsxs(Gt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>s(`/libraries/agents/${encodeURIComponent(g.id)}`),children:[a.jsx(ze,{className:"font-medium",children:g.name}),a.jsx(ze,{children:a.jsx(Uz,{provider:g.provider})}),a.jsx(ze,{children:a.jsx("span",{className:"font-mono text-xs",children:g.model})}),a.jsx(ze,{className:"font-mono text-xs",children:g.maxTokens}),a.jsx(ze,{className:"font-mono text-xs",children:g.temperature.toFixed(2)}),a.jsx(ze,{className:"text-right",onClick:j=>j.stopPropagation(),children:a.jsxs("div",{className:"flex items-center justify-end gap-2",children:[a.jsxs(se,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>o(g),children:[a.jsx(Ta,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{p(g)},children:[a.jsx(_s,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>s(`/libraries/agents/${encodeURIComponent(g.id)}`),children:[a.jsx(sv,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},g.id))})]})})}),a.jsx(Ls,{open:!!i,onOpenChange:g=>!g&&o(null),children:a.jsxs(ss,{children:[a.jsxs(is,{children:[a.jsx(ls,{children:"Delete agent?"}),a.jsxs(cs,{children:["This will permanently remove"," ",a.jsx("span",{className:"font-mono",children:i?.name})," from the library. This action cannot be undone."]})]}),a.jsxs(os,{children:[a.jsx(ds,{children:"Cancel"}),a.jsx(us,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{i&&x(i)},children:"Delete Agent"})]})]})})]})};var $8=["PageUp","PageDown"],D8=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],L8={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},_u="Slider",[Z1,Uve,Wve]=Cf(_u),[F8]=mr(_u,[Wve]),[Vve,Eg]=F8(_u),B8=m.forwardRef((e,t)=>{const{name:n,min:r=0,max:s=100,step:i=1,orientation:o="horizontal",disabled:c=!1,minStepsBetweenThumbs:d=0,defaultValue:f=[r],value:h,onValueChange:p=()=>{},onValueCommit:x=()=>{},inverted:g=!1,form:j,...b}=e,y=m.useRef(new Set),S=m.useRef(0),N=o==="horizontal"?Hve:Kve,[E=[],A]=ha({prop:h,defaultProp:f,onChange:q=>{[...y.current][S.current]?.focus(),p(q)}}),P=m.useRef(E);function O(q){const F=Jve(E,q);z(q,F)}function T(q){z(q,S.current)}function $(){const q=P.current[S.current];E[S.current]!==q&&x(E)}function z(q,F,{commit:H}={commit:!1}){const U=nge(i),R=rge(Math.round((q-r)/i)*i+r,U),W=Sf(R,[r,s]);A((X=[])=>{const G=Xve(X,W,F);if(tge(G,d*i)){S.current=G.indexOf(W);const B=String(G)!==String(X);return B&&H&&x(G),B?G:X}else return X})}return a.jsx(Vve,{scope:e.__scopeSlider,name:n,disabled:c,min:r,max:s,valueIndexToChangeRef:S,thumbs:y.current,values:E,orientation:o,form:j,children:a.jsx(Z1.Provider,{scope:e.__scopeSlider,children:a.jsx(Z1.Slot,{scope:e.__scopeSlider,children:a.jsx(N,{"aria-disabled":c,"data-disabled":c?"":void 0,...b,ref:t,onPointerDown:Te(b.onPointerDown,()=>{c||(P.current=E)}),min:r,max:s,inverted:g,onSlideStart:c?void 0:O,onSlideMove:c?void 0:T,onSlideEnd:c?void 0:$,onHomeKeyDown:()=>!c&&z(r,0,{commit:!0}),onEndKeyDown:()=>!c&&z(s,E.length-1,{commit:!0}),onStepKeyDown:({event:q,direction:F})=>{if(!c){const R=$8.includes(q.key)||q.shiftKey&&D8.includes(q.key)?10:1,W=S.current,X=E[W],G=i*R*F;z(X+G,W,{commit:!0})}}})})})})});B8.displayName=_u;var[z8,q8]=F8(_u,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Hve=m.forwardRef((e,t)=>{const{min:n,max:r,dir:s,inverted:i,onSlideStart:o,onSlideMove:c,onSlideEnd:d,onStepKeyDown:f,...h}=e,[p,x]=m.useState(null),g=St(t,N=>x(N)),j=m.useRef(void 0),b=Su(s),y=b==="ltr",S=y&&!i||!y&&i;function C(N){const E=j.current||p.getBoundingClientRect(),A=[0,E.width],O=e_(A,S?[n,r]:[r,n]);return j.current=E,O(N-E.left)}return a.jsx(z8,{scope:e.__scopeSlider,startEdge:S?"left":"right",endEdge:S?"right":"left",direction:S?1:-1,size:"width",children:a.jsx(U8,{dir:b,"data-orientation":"horizontal",...h,ref:g,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:N=>{const E=C(N.clientX);o?.(E)},onSlideMove:N=>{const E=C(N.clientX);c?.(E)},onSlideEnd:()=>{j.current=void 0,d?.()},onStepKeyDown:N=>{const A=L8[S?"from-left":"from-right"].includes(N.key);f?.({event:N,direction:A?-1:1})}})})}),Kve=m.forwardRef((e,t)=>{const{min:n,max:r,inverted:s,onSlideStart:i,onSlideMove:o,onSlideEnd:c,onStepKeyDown:d,...f}=e,h=m.useRef(null),p=St(t,h),x=m.useRef(void 0),g=!s;function j(b){const y=x.current||h.current.getBoundingClientRect(),S=[0,y.height],N=e_(S,g?[r,n]:[n,r]);return x.current=y,N(b-y.top)}return a.jsx(z8,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:a.jsx(U8,{"data-orientation":"vertical",...f,ref:p,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:b=>{const y=j(b.clientY);i?.(y)},onSlideMove:b=>{const y=j(b.clientY);o?.(y)},onSlideEnd:()=>{x.current=void 0,c?.()},onStepKeyDown:b=>{const S=L8[g?"from-bottom":"from-top"].includes(b.key);d?.({event:b,direction:S?-1:1})}})})}),U8=m.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:o,onEndKeyDown:c,onStepKeyDown:d,...f}=e,h=Eg(_u,n);return a.jsx(Ye.span,{...f,ref:t,onKeyDown:Te(e.onKeyDown,p=>{p.key==="Home"?(o(p),p.preventDefault()):p.key==="End"?(c(p),p.preventDefault()):$8.concat(D8).includes(p.key)&&(d(p),p.preventDefault())}),onPointerDown:Te(e.onPointerDown,p=>{const x=p.target;x.setPointerCapture(p.pointerId),p.preventDefault(),h.thumbs.has(x)?x.focus():r(p)}),onPointerMove:Te(e.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&s(p)}),onPointerUp:Te(e.onPointerUp,p=>{const x=p.target;x.hasPointerCapture(p.pointerId)&&(x.releasePointerCapture(p.pointerId),i(p))})})}),W8="SliderTrack",V8=m.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=Eg(W8,n);return a.jsx(Ye.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:t})});V8.displayName=W8;var eN="SliderRange",H8=m.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=Eg(eN,n),i=q8(eN,n),o=m.useRef(null),c=St(t,o),d=s.values.length,f=s.values.map(x=>Y8(x,s.min,s.max)),h=d>1?Math.min(...f):0,p=100-Math.max(...f);return a.jsx(Ye.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:c,style:{...e.style,[i.startEdge]:h+"%",[i.endEdge]:p+"%"}})});H8.displayName=eN;var tN="SliderThumb",K8=m.forwardRef((e,t)=>{const n=Uve(e.__scopeSlider),[r,s]=m.useState(null),i=St(t,c=>s(c)),o=m.useMemo(()=>r?n().findIndex(c=>c.ref.current===r):-1,[n,r]);return a.jsx(Gve,{...e,ref:i,index:o})}),Gve=m.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:s,...i}=e,o=Eg(tN,n),c=q8(tN,n),[d,f]=m.useState(null),h=St(t,C=>f(C)),p=d?o.form||!!d.closest("form"):!0,x=uv(d),g=o.values[r],j=g===void 0?0:Y8(g,o.min,o.max),b=Qve(r,o.values.length),y=x?.[c.size],S=y?Zve(y,j,c.direction):0;return m.useEffect(()=>{if(d)return o.thumbs.add(d),()=>{o.thumbs.delete(d)}},[d,o.thumbs]),a.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${j}% + ${S}px)`},children:[a.jsx(Z1.ItemSlot,{scope:e.__scopeSlider,children:a.jsx(Ye.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:Te(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),p&&a.jsx(G8,{name:s??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:g},r)]})});K8.displayName=tN;var Yve="RadioBubbleInput",G8=m.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const s=m.useRef(null),i=St(s,r),o=gg(t);return m.useEffect(()=>{const c=s.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]),a.jsx(Ye.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});G8.displayName=Yve;function Xve(e=[],t,n){const r=[...e];return r[n]=t,r.sort((s,i)=>s-i)}function Y8(e,t,n){const i=100/(n-t)*(e-t);return Sf(i,[0,100])}function Qve(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Jve(e,t){if(e.length===1)return 0;const n=e.map(s=>Math.abs(s-t)),r=Math.min(...n);return n.indexOf(r)}function Zve(e,t,n){const r=e/2,i=e_([0,50],[0,r]);return(r-i(t)*n)*n}function ege(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function tge(e,t){if(t>0){const n=ege(e);return Math.min(...n)>=t}return!0}function e_(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 nge(e){return(String(e).split(".")[1]||"").length}function rge(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var X8=B8,age=V8,sge=H8,ige=K8;const Q8=m.forwardRef(({className:e,...t},n)=>a.jsxs(X8,{ref:n,className:Se("relative flex w-full touch-none select-none items-center",e),...t,children:[a.jsx(age,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:a.jsx(sge,{className:"absolute h-full bg-primary"})}),a.jsx(ige,{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"})]}));Q8.displayName=X8.displayName;function oge(e){const t=lge(e),n=m.forwardRef((r,s)=>{const{children:i,...o}=r,c=m.Children.toArray(i),d=c.find(uge);if(d){const f=d.props.children,h=c.map(p=>p===d?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:p);return a.jsx(t,{...o,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return a.jsx(t,{...o,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function lge(e){const t=m.forwardRef((n,r)=>{const{children:s,...i}=n;if(m.isValidElement(s)){const o=fge(s),c=dge(i,s.props);return s.type!==m.Fragment&&(c.ref=r?kr(r,o):o),m.cloneElement(s,c)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var cge=Symbol("radix.slottable");function uge(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cge}function dge(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...c)=>{const d=i(...c);return s(...c),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function fge(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 Pg="Popover",[J8]=mr(Pg,[co]),Qf=co(),[pge,xo]=J8(Pg),Z8=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!1}=e,c=Qf(t),d=m.useRef(null),[f,h]=m.useState(!1),[p,x]=ha({prop:r,defaultProp:s??!1,onChange:i,caller:Pg});return a.jsx(dv,{...c,children:a.jsx(pge,{scope:t,contentId:nr(),triggerRef:d,open:p,onOpenChange:x,onOpenToggle:m.useCallback(()=>x(g=>!g),[x]),hasCustomAnchor:f,onCustomAnchorAdd:m.useCallback(()=>h(!0),[]),onCustomAnchorRemove:m.useCallback(()=>h(!1),[]),modal:o,children:n})})};Z8.displayName=Pg;var e6="PopoverAnchor",hge=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=xo(e6,n),i=Qf(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:c}=s;return m.useEffect(()=>(o(),()=>c()),[o,c]),a.jsx(Ef,{...i,...r,ref:t})});hge.displayName=e6;var t6="PopoverTrigger",n6=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=xo(t6,n),i=Qf(n),o=St(t,s.triggerRef),c=a.jsx(Ye.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":o6(s.open),...r,ref:o,onClick:Te(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:a.jsx(Ef,{asChild:!0,...i,children:c})});n6.displayName=t6;var t_="PopoverPortal",[mge,vge]=J8(t_,{forceMount:void 0}),r6=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,i=xo(t_,t);return a.jsx(mge,{scope:t,forceMount:n,children:a.jsx(Yn,{present:n||i.open,children:a.jsx(gl,{asChild:!0,container:s,children:r})})})};r6.displayName=t_;var su="PopoverContent",a6=m.forwardRef((e,t)=>{const n=vge(su,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,i=xo(su,e.__scopePopover);return a.jsx(Yn,{present:r||i.open,children:i.modal?a.jsx(xge,{...s,ref:t}):a.jsx(yge,{...s,ref:t})})});a6.displayName=su;var gge=oge("PopoverContent.RemoveScroll"),xge=m.forwardRef((e,t)=>{const n=xo(su,e.__scopePopover),r=m.useRef(null),s=St(t,r),i=m.useRef(!1);return m.useEffect(()=>{const o=r.current;if(o)return Nv(o)},[]),a.jsx(Of,{as:gge,allowPinchZoom:!0,children:a.jsx(s6,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Te(e.onCloseAutoFocus,o=>{o.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Te(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:Te(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),yge=m.forwardRef((e,t)=>{const n=xo(su,e.__scopePopover),r=m.useRef(!1),s=m.useRef(!1);return a.jsx(s6,{...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,s.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;n.triggerRef.current?.contains(o)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),s6=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,...p}=e,x=xo(su,n),g=Qf(n);return jv(),a.jsx(kf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(vl,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>x.onOpenChange(!1),children:a.jsx(fv,{"data-state":o6(x.open),role:"dialog",id:x.contentId,...g,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),i6="PopoverClose",bge=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=xo(i6,n);return a.jsx(Ye.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,()=>s.onOpenChange(!1))})});bge.displayName=i6;var wge="PopoverArrow",jge=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Qf(n);return a.jsx(pv,{...s,...r,ref:t})});jge.displayName=wge;function o6(e){return e?"open":"closed"}var Sge=Z8,Nge=n6,Cge=r6,l6=a6;const iu=Sge,ou=Nge,cl=m.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>a.jsx(Cge,{children:a.jsx(l6,{ref:s,align:t,sideOffset:n,className:Se("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));cl.displayName=l6.displayName;var XM=1,_ge=.9,Age=.8,Ege=.17,Bj=.1,zj=.999,Pge=.9999,kge=.99,Oge=/[\\\/_+.#"@\[\(\{&]/,Tge=/[\\\/_+.#"@\[\(\{&]/g,Rge=/[\s-]/,c6=/[\s-]/g;function nN(e,t,n,r,s,i,o){if(i===t.length)return s===e.length?XM:kge;var c=`${s},${i}`;if(o[c]!==void 0)return o[c];for(var d=r.charAt(i),f=n.indexOf(d,s),h=0,p,x,g,j;f>=0;)p=nN(e,t,n,r,f+1,i+1,o),p>h&&(f===s?p*=XM:Oge.test(e.charAt(f-1))?(p*=Age,g=e.slice(s,f-1).match(Tge),g&&s>0&&(p*=Math.pow(zj,g.length))):Rge.test(e.charAt(f-1))?(p*=_ge,j=e.slice(s,f-1).match(c6),j&&s>0&&(p*=Math.pow(zj,j.length))):(p*=Ege,s>0&&(p*=Math.pow(zj,f-s))),e.charAt(f)!==t.charAt(i)&&(p*=Pge)),(p<Bj&&n.charAt(f-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(f-1)!==r.charAt(i))&&(x=nN(e,t,n,r,f+1,i+2,o),x*Bj>p&&(p=x*Bj)),p>h&&(h=p),f=n.indexOf(d,f+1);return o[c]=h,h}function QM(e){return e.toLowerCase().replace(c6," ")}function Ige(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,nN(e,t,QM(e),QM(t),0,0,{})}var xd='[cmdk-group=""]',qj='[cmdk-group-items=""]',Mge='[cmdk-group-heading=""]',u6='[cmdk-item=""]',JM=`${u6}:not([aria-disabled="true"])`,rN="cmdk-item-select",uc="data-value",$ge=(e,t,n)=>Ige(e,t,n),d6=m.createContext(void 0),Jf=()=>m.useContext(d6),f6=m.createContext(void 0),n_=()=>m.useContext(f6),p6=m.createContext(void 0),h6=m.forwardRef((e,t)=>{let n=dc(()=>{var I,re;return{search:"",value:(re=(I=e.value)!=null?I:e.defaultValue)!=null?re:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=dc(()=>new Set),s=dc(()=>new Map),i=dc(()=>new Map),o=dc(()=>new Set),c=m6(e),{label:d,children:f,value:h,onValueChange:p,filter:x,shouldFilter:g,loop:j,disablePointerSelection:b=!1,vimBindings:y=!0,...S}=e,C=nr(),N=nr(),E=nr(),A=m.useRef(null),P=Kge();ul(()=>{if(h!==void 0){let I=h.trim();n.current.value=I,O.emit()}},[h]),ul(()=>{P(6,H)},[]);let O=m.useMemo(()=>({subscribe:I=>(o.current.add(I),()=>o.current.delete(I)),snapshot:()=>n.current,setState:(I,re,ne)=>{var fe,he,V,de;if(!Object.is(n.current[I],re)){if(n.current[I]=re,I==="search")F(),z(),P(1,q);else if(I==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Q=document.getElementById(E);Q?Q.focus():(fe=document.getElementById(C))==null||fe.focus()}if(P(7,()=>{var Q;n.current.selectedItemId=(Q=U())==null?void 0:Q.id,O.emit()}),ne||P(5,H),((he=c.current)==null?void 0:he.value)!==void 0){let Q=re??"";(de=(V=c.current).onValueChange)==null||de.call(V,Q);return}}O.emit()}},emit:()=>{o.current.forEach(I=>I())}}),[]),T=m.useMemo(()=>({value:(I,re,ne)=>{var fe;re!==((fe=i.current.get(I))==null?void 0:fe.value)&&(i.current.set(I,{value:re,keywords:ne}),n.current.filtered.items.set(I,$(re,ne)),P(2,()=>{z(),O.emit()}))},item:(I,re)=>(r.current.add(I),re&&(s.current.has(re)?s.current.get(re).add(I):s.current.set(re,new Set([I]))),P(3,()=>{F(),z(),n.current.value||q(),O.emit()}),()=>{i.current.delete(I),r.current.delete(I),n.current.filtered.items.delete(I);let ne=U();P(4,()=>{F(),ne?.getAttribute("id")===I&&q(),O.emit()})}),group:I=>(s.current.has(I)||s.current.set(I,new Set),()=>{i.current.delete(I),s.current.delete(I)}),filter:()=>c.current.shouldFilter,label:d||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:C,inputId:E,labelId:N,listInnerRef:A}),[]);function $(I,re){var ne,fe;let he=(fe=(ne=c.current)==null?void 0:ne.filter)!=null?fe:$ge;return I?he(I,n.current.search,re):0}function z(){if(!n.current.search||c.current.shouldFilter===!1)return;let I=n.current.filtered.items,re=[];n.current.filtered.groups.forEach(fe=>{let he=s.current.get(fe),V=0;he.forEach(de=>{let Q=I.get(de);V=Math.max(Q,V)}),re.push([fe,V])});let ne=A.current;R().sort((fe,he)=>{var V,de;let Q=fe.getAttribute("id"),ee=he.getAttribute("id");return((V=I.get(ee))!=null?V:0)-((de=I.get(Q))!=null?de:0)}).forEach(fe=>{let he=fe.closest(qj);he?he.appendChild(fe.parentElement===he?fe:fe.closest(`${qj} > *`)):ne.appendChild(fe.parentElement===ne?fe:fe.closest(`${qj} > *`))}),re.sort((fe,he)=>he[1]-fe[1]).forEach(fe=>{var he;let V=(he=A.current)==null?void 0:he.querySelector(`${xd}[${uc}="${encodeURIComponent(fe[0])}"]`);V?.parentElement.appendChild(V)})}function q(){let I=R().find(ne=>ne.getAttribute("aria-disabled")!=="true"),re=I?.getAttribute(uc);O.setState("value",re||void 0)}function F(){var I,re,ne,fe;if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let he=0;for(let V of r.current){let de=(re=(I=i.current.get(V))==null?void 0:I.value)!=null?re:"",Q=(fe=(ne=i.current.get(V))==null?void 0:ne.keywords)!=null?fe:[],ee=$(de,Q);n.current.filtered.items.set(V,ee),ee>0&&he++}for(let[V,de]of s.current)for(let Q of de)if(n.current.filtered.items.get(Q)>0){n.current.filtered.groups.add(V);break}n.current.filtered.count=he}function H(){var I,re,ne;let fe=U();fe&&(((I=fe.parentElement)==null?void 0:I.firstChild)===fe&&((ne=(re=fe.closest(xd))==null?void 0:re.querySelector(Mge))==null||ne.scrollIntoView({block:"nearest"})),fe.scrollIntoView({block:"nearest"}))}function U(){var I;return(I=A.current)==null?void 0:I.querySelector(`${u6}[aria-selected="true"]`)}function R(){var I;return Array.from(((I=A.current)==null?void 0:I.querySelectorAll(JM))||[])}function W(I){let re=R()[I];re&&O.setState("value",re.getAttribute(uc))}function X(I){var re;let ne=U(),fe=R(),he=fe.findIndex(de=>de===ne),V=fe[he+I];(re=c.current)!=null&&re.loop&&(V=he+I<0?fe[fe.length-1]:he+I===fe.length?fe[0]:fe[he+I]),V&&O.setState("value",V.getAttribute(uc))}function G(I){let re=U(),ne=re?.closest(xd),fe;for(;ne&&!fe;)ne=I>0?Vge(ne,xd):Hge(ne,xd),fe=ne?.querySelector(JM);fe?O.setState("value",fe.getAttribute(uc)):X(I)}let B=()=>W(R().length-1),J=I=>{I.preventDefault(),I.metaKey?B():I.altKey?G(1):X(1)},D=I=>{I.preventDefault(),I.metaKey?W(0):I.altKey?G(-1):X(-1)};return m.createElement(Ye.div,{ref:t,tabIndex:-1,...S,"cmdk-root":"",onKeyDown:I=>{var re;(re=S.onKeyDown)==null||re.call(S,I);let ne=I.nativeEvent.isComposing||I.keyCode===229;if(!(I.defaultPrevented||ne))switch(I.key){case"n":case"j":{y&&I.ctrlKey&&J(I);break}case"ArrowDown":{J(I);break}case"p":case"k":{y&&I.ctrlKey&&D(I);break}case"ArrowUp":{D(I);break}case"Home":{I.preventDefault(),W(0);break}case"End":{I.preventDefault(),B();break}case"Enter":{I.preventDefault();let fe=U();if(fe){let he=new Event(rN);fe.dispatchEvent(he)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:Yge},d),kg(e,I=>m.createElement(f6.Provider,{value:O},m.createElement(d6.Provider,{value:T},I))))}),Dge=m.forwardRef((e,t)=>{var n,r;let s=nr(),i=m.useRef(null),o=m.useContext(p6),c=Jf(),d=m6(e),f=(r=(n=d.current)==null?void 0:n.forceMount)!=null?r:o?.forceMount;ul(()=>{if(!f)return c.item(s,o?.id)},[f]);let h=v6(s,i,[e.value,e.children,i],e.keywords),p=n_(),x=lo(P=>P.value&&P.value===h.current),g=lo(P=>f||c.filter()===!1?!0:P.search?P.filtered.items.get(s)>0:!0);m.useEffect(()=>{let P=i.current;if(!(!P||e.disabled))return P.addEventListener(rN,j),()=>P.removeEventListener(rN,j)},[g,e.onSelect,e.disabled]);function j(){var P,O;b(),(O=(P=d.current).onSelect)==null||O.call(P,h.current)}function b(){p.setState("value",h.current,!0)}if(!g)return null;let{disabled:y,value:S,onSelect:C,forceMount:N,keywords:E,...A}=e;return m.createElement(Ye.div,{ref:kr(i,t),...A,id:s,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!x,"data-disabled":!!y,"data-selected":!!x,onPointerMove:y||c.getDisablePointerSelection()?void 0:b,onClick:y?void 0:j},e.children)}),Lge=m.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...i}=e,o=nr(),c=m.useRef(null),d=m.useRef(null),f=nr(),h=Jf(),p=lo(g=>s||h.filter()===!1?!0:g.search?g.filtered.groups.has(o):!0);ul(()=>h.group(o),[]),v6(o,c,[e.value,e.heading,d]);let x=m.useMemo(()=>({id:o,forceMount:s}),[s]);return m.createElement(Ye.div,{ref:kr(c,t),...i,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},n&&m.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),kg(e,g=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},m.createElement(p6.Provider,{value:x},g))))}),Fge=m.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=m.useRef(null),i=lo(o=>!o.search);return!n&&!i?null:m.createElement(Ye.div,{ref:kr(s,t),...r,"cmdk-separator":"",role:"separator"})}),Bge=m.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,i=n_(),o=lo(f=>f.search),c=lo(f=>f.selectedItemId),d=Jf();return m.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),m.createElement(Ye.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:s?e.value:o,onChange:f=>{s||i.setState("search",f.target.value),n?.(f.target.value)}})}),zge=m.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,i=m.useRef(null),o=m.useRef(null),c=lo(f=>f.selectedItemId),d=Jf();return m.useEffect(()=>{if(o.current&&i.current){let f=o.current,h=i.current,p,x=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let g=f.offsetHeight;h.style.setProperty("--cmdk-list-height",g.toFixed(1)+"px")})});return x.observe(f),()=>{cancelAnimationFrame(p),x.unobserve(f)}}},[]),m.createElement(Ye.div,{ref:kr(i,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:d.listId},kg(e,f=>m.createElement("div",{ref:kr(o,d.listInnerRef),"cmdk-list-sizer":""},f)))}),qge=m.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:o,...c}=e;return m.createElement(_v,{open:n,onOpenChange:r},m.createElement(Av,{container:o},m.createElement(hu,{"cmdk-overlay":"",className:s}),m.createElement(mu,{"aria-label":e.label,"cmdk-dialog":"",className:i},m.createElement(h6,{ref:t,...c}))))}),Uge=m.forwardRef((e,t)=>lo(n=>n.filtered.count===0)?m.createElement(Ye.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Wge=m.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...i}=e;return m.createElement(Ye.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},kg(e,o=>m.createElement("div",{"aria-hidden":!0},o)))}),Qr=Object.assign(h6,{List:zge,Item:Dge,Input:Bge,Group:Lge,Separator:Fge,Dialog:qge,Empty:Uge,Loading:Wge});function Vge(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Hge(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function m6(e){let t=m.useRef(e);return ul(()=>{t.current=e}),t}var ul=typeof window>"u"?m.useEffect:m.useLayoutEffect;function dc(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function lo(e){let t=n_(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function v6(e,t,n,r=[]){let s=m.useRef(),i=Jf();return ul(()=>{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():s.current}})(),d=r.map(f=>f.trim());i.value(e,c,d),(o=t.current)==null||o.setAttribute(uc,c),s.current=c}),s}var Kge=()=>{let[e,t]=m.useState(),n=dc(()=>new Map);return ul(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function Gge(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function kg({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(Gge(t),{ref:t.ref},n(t.props.children)):n(t)}var Yge={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const dl=m.forwardRef(({className:e,...t},n)=>a.jsx(Qr,{ref:n,className:Se("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));dl.displayName=Qr.displayName;const fl=m.forwardRef(({className:e,...t},n)=>a.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[a.jsx(pN,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),a.jsx(Qr.Input,{ref:n,className:Se("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));fl.displayName=Qr.Input.displayName;const pl=m.forwardRef(({className:e,...t},n)=>a.jsx(Qr.List,{ref:n,className:Se("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));pl.displayName=Qr.List.displayName;const hl=m.forwardRef((e,t)=>a.jsx(Qr.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));hl.displayName=Qr.Empty.displayName;const ml=m.forwardRef(({className:e,...t},n)=>a.jsx(Qr.Group,{ref:n,className:Se("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));ml.displayName=Qr.Group.displayName;const Xge=m.forwardRef(({className:e,...t},n)=>a.jsx(Qr.Separator,{ref:n,className:Se("-mx-1 h-px bg-border",e),...t}));Xge.displayName=Qr.Separator.displayName;const ua=m.forwardRef(({className:e,...t},n)=>a.jsx(Qr.Item,{ref:n,className:Se("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...t}));ua.displayName=Qr.Item.displayName;const ZM={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:[]},e$={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"},t$=()=>({id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096}),Qge=()=>{const{agentName:e}=yl(),t=Ia(),{agents:n,setAgents:r}=rs(),{source:s}=Ln(),i=e==="new",o=e?decodeURIComponent(e):"",c=i?null:n.find(B=>B.id===o)??n.find(B=>B.name===o),[d,f]=m.useState(()=>c??t$()),[h,p]=m.useState(!1),[x,g]=m.useState(!1),[j,b]=m.useState({status:"idle"}),[y,S]=m.useState(!1),[C,N]=m.useState([]),[E,A]=m.useState(!1),[P,O]=m.useState(!1),[T,$]=m.useState(!1),z=m.useRef(null);m.useEffect(()=>{const B=i?`new:${o||"new"}`:`agt:${o}`;if(z.current!==B){if(i){f(t$()),z.current=B;return}c&&(f(c),z.current=B)}},[i,o,c]);const q=d.provider==="anthropic"||d.provider==="openai"||d.provider==="azure",F=Array.from(new Set([...ZM[d.provider]||[],...C])),H=F.includes(d.model),U=T||!!d.model&&!H,R=async()=>{if(S(!0),d.provider==="google"||d.provider==="custom"){b({status:"unsupported"});return}b({status:"loading"});try{const B=await s.listProviderModels(d.provider);b({status:"success",items:B.items,source:B.source,kind:B.kind,testedAt:new Date().toISOString()})}catch(B){b({status:"error",message:B instanceof Error?B.message:String(B),testedAt:new Date().toISOString()})}},W=async()=>{if(!q){_e({title:"Provider discovery not supported",description:"Model discovery is available for Anthropic, OpenAI, and Azure OpenAI."});return}A(!0);try{const B=await s.listProviderModels(d.provider);N(B.items),_e({title:B.kind==="deployments"?"Deployments loaded":"Models loaded",description:`${B.items.length} ${B.kind} from ${B.source}`})}catch(B){_e({title:"Could not load provider models",description:String(B instanceof Error?B.message:B),variant:"destructive"})}finally{A(!1)}},X=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 B=n.map(J=>J.id===c?.id?d:J);await r(B),_e({title:"Agent saved"}),d.id!==o&&t(`/libraries/agents/${encodeURIComponent(d.id)}`,{replace:!0})}}finally{g(!1)}},G=async()=>{const B=n.filter(J=>J.id!==c?.id);await r(B),_e({title:"Agent deleted"}),t("/libraries/agents")};return!i&&!c?a.jsxs("div",{className:"space-y-4",children:[a.jsxs(At,{to:"/libraries/agents",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[a.jsx(Jo,{className:"h-4 w-4"})," Agents"]}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:['Agent "',o,'" not found.']})]}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsxs(At,{to:"/libraries/agents",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[a.jsx(Jo,{className:"h-4 w-4"})," Agents"]}),a.jsx("h1",{className:"text-2xl font-bold",children:i?"New Agent":d.name})]}),!i&&a.jsxs(se,{type:"button",onClick:()=>{R()},children:[a.jsx(iD,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),y&&a.jsxs(Ue,{children:[a.jsxs(Pt,{className:"flex-row items-center justify-between space-y-0",children:[a.jsx(kt,{className:"text-base",children:"Connection Test"}),a.jsx("button",{type:"button",onClick:()=>S(!1),className:"rounded-sm opacity-70 hover:opacity-100",children:a.jsx(As,{className:"h-4 w-4"})})]}),a.jsxs(We,{className:"space-y-3",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground",children:[a.jsx("span",{children:"Provider:"}),a.jsx("span",{className:"font-medium text-foreground",children:d.provider}),a.jsx("span",{className:"mx-1",children:"·"}),a.jsx("span",{children:"Endpoint:"}),a.jsxs("code",{className:"font-mono text-xs",children:["/api/providers/models?provider=",d.provider]})]}),j.status==="loading"&&a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[a.jsx(wr,{className:"h-4 w-4 animate-spin"}),"Testing connection..."]}),j.status==="success"&&a.jsxs("div",{className:"space-y-3",children:[a.jsxs("p",{className:"flex items-center gap-2 text-sm text-emerald-700",children:[a.jsx(Ec,{className:"h-4 w-4 shrink-0"}),"Connected — discovered ",j.items.length," ",j.kind," from"," ",j.source]}),a.jsxs("div",{className:"rounded-md bg-muted p-3",children:[a.jsxs("p",{className:"mb-1 text-xs font-medium text-muted-foreground",children:["First 5 ",j.kind,":"]}),a.jsx("ul",{className:"space-y-0.5",children:j.items.slice(0,5).map(B=>a.jsx("li",{className:"font-mono text-xs",children:B},B))})]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(j.testedAt).toLocaleString()]})]}),j.status==="error"&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("p",{className:"text-sm text-destructive",children:[a.jsx("span",{className:"font-medium",children:"✗ Connection failed"})," —"," ",j.message]}),e$[d.provider]&&a.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",e$[d.provider]]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(j.testedAt).toLocaleString()]})]}),j.status==="unsupported"&&a.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-sm text-muted-foreground",children:["Connection testing is not supported for the"," ",a.jsx("span",{className:"font-medium",children:d.provider})," provider. Supported providers: Anthropic, OpenAI, Azure OpenAI."]})]})]}),a.jsxs(Ue,{children:[a.jsx(Pt,{children:a.jsx(kt,{className:"text-base",children:"Configuration"})}),a.jsxs(We,{className:"space-y-4",children:[a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{children:"Name"}),a.jsx(gt,{value:d.name,onChange:B=>f(J=>({...J,name:B.target.value})),placeholder:"e.g. GPT-4o"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{children:"Provider"}),a.jsxs(jn,{value:d.provider,onValueChange:B=>f(J=>({...J,provider:B,model:ZM[B]?.[0]||""})),children:[a.jsx(mn,{children:a.jsx(Sn,{})}),a.jsxs(vn,{children:[a.jsx(et,{value:"openai",children:"OpenAI"}),a.jsx(et,{value:"anthropic",children:"Anthropic"}),a.jsx(et,{value:"azure",children:"Azure OpenAI"}),a.jsx(et,{value:"google",children:"Google"}),a.jsx(et,{value:"custom",children:"Custom"})]})]})]})]}),a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{children:d.provider==="azure"?"Deployment":"Model"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(iu,{open:P,onOpenChange:O,children:[a.jsx(ou,{asChild:!0,children:a.jsxs(se,{type:"button",variant:"outline",role:"combobox","aria-expanded":P,className:"h-9 flex-1 justify-between font-mono text-xs",children:[a.jsx("span",{className:"truncate text-left",children:d.model||"Select model..."}),a.jsx(Yt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsx(cl,{className:"w-[420px] p-0",align:"start",children:a.jsxs(dl,{children:[a.jsx(fl,{placeholder:`Search ${d.provider==="azure"?"deployments":"models"}...`}),a.jsxs(pl,{children:[a.jsxs(hl,{children:["No ",d.provider==="azure"?"deployments":"models"," found."]}),a.jsxs(ml,{heading:d.provider==="azure"?"Deployments":"Models",children:[F.map(B=>a.jsxs(ua,{value:B,onSelect:J=>{f(D=>({...D,model:J})),$(!1),O(!1)},children:[a.jsx(Ec,{className:Se("mr-2 h-4 w-4",d.model===B?"opacity-100":"opacity-0")}),a.jsx("span",{className:"font-mono text-xs",children:B})]},B)),a.jsx(ua,{value:"__custom_model_id__",onSelect:()=>{$(!0),O(!1)},children:a.jsx("span",{className:"font-medium",children:d.provider==="azure"?"Custom deployment ID...":"Custom model ID..."})})]})]})]})})]}),q&&a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-9 shrink-0 text-xs",onClick:()=>{W()},disabled:E,title:d.provider==="azure"?"Fetch Azure OpenAI deployments":`Fetch ${d.provider} models`,children:[E?a.jsx(wr,{className:"mr-1 h-3 w-3 animate-spin"}):a.jsx(ma,{className:"mr-1 h-3 w-3"}),d.provider==="azure"?"Fetch Deployments":"Fetch Models"]})]}),U&&a.jsx(gt,{value:d.model,onChange:B=>f(J=>({...J,model:B.target.value})),placeholder:d.provider==="azure"?"Type deployment name manually":"Type model name manually",className:"font-mono text-xs"}),C.length>0&&a.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Loaded ",C.length," ",d.provider==="azure"?"deployment names":"models"," from provider discovery."]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{children:"Max Tokens"}),a.jsx(gt,{type:"number",min:1,max:128e3,value:d.maxTokens,onChange:B=>f(J=>({...J,maxTokens:parseInt(B.target.value)||0})),className:"font-mono text-xs"})]})]}),a.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{children:"Max Turns"}),a.jsx(gt,{type:"number",min:1,max:50,value:d.maxTurns??"",onChange:B=>{const J=B.target.value.trim();f(D=>({...D,maxTurns:J&&parseInt(J)||void 0}))},placeholder:"30 (default)",className:"font-mono text-xs"}),a.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Maximum number of LLM round-trips (tool calls + final answer) per eval run."})]})}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx($e,{children:"Temperature"}),a.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:d.temperature.toFixed(2)})]}),a.jsx(Q8,{value:[d.temperature],onValueChange:([B])=>f(J=>({...J,temperature:B})),min:0,max:2,step:.01})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{children:"System Prompt"}),a.jsx(Os,{value:d.systemPrompt||"",onChange:B=>f(J=>({...J,systemPrompt:B.target.value})),placeholder:"Optional system prompt...",rows:3,className:"text-xs"})]}),a.jsxs("div",{className:"flex items-center justify-between pt-2",children:[a.jsx("div",{children:!i&&a.jsx(se,{type:"button",variant:"destructive",size:"sm",onClick:()=>p(!0),children:"Delete"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(se,{type:"button",variant:"outline",size:"sm",onClick:()=>t("/libraries/agents"),children:"Cancel"}),a.jsxs(se,{type:"button",size:"sm",onClick:()=>{X()},disabled:x,children:[x&&a.jsx(wr,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Create Agent":"Save"]})]})]})]})]}),a.jsx(Ls,{open:h,onOpenChange:p,children:a.jsxs(ss,{children:[a.jsxs(is,{children:[a.jsx(ls,{children:"Delete agent?"}),a.jsxs(cs,{children:["This will permanently remove the agent"," ",a.jsx("span",{className:"font-mono",children:d.name}),". This action cannot be undone."]})]}),a.jsxs(os,{children:[a.jsx(ds,{children:"Cancel"}),a.jsx(us,{onClick:()=>{G()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},n$="mcplab.resultAssistantScenarioHandoff",r$=()=>{const{testCaseId:e}=yl(),[t,n]=vi(),r=Ia(),{source:s}=Ln(),{scenarios:i,setScenarios:o,agents:c,servers:d,reload:f,loading:h}=rs(),[p,x]=m.useState(""),[g,j]=m.useState("all"),[b,y]=m.useState("name"),[S,C]=m.useState("asc"),[N,E]=m.useState(""),[A,P]=m.useState(null),[O,T]=m.useState("idle"),[$,z]=m.useState(""),[q,F]=m.useState(""),[H,U]=m.useState(0),[R,W]=m.useState(null),X=m.useRef(null),G=m.useRef(!1),B=m.useRef(!1),J=m.useRef(null),D=m.useRef(0),I=e?decodeURIComponent(e):void 0,re=I?i.findIndex(L=>L.id===I):-1,ne=re>=0?i[re]:void 0,fe=async L=>{if(!ne||re<0||!L)return;const oe=[...i];oe[re]=L,await o(oe)},he=async()=>{const L=J.current;if(!L||!ne)return;if(G.current){B.current=!0;return}G.current=!0,B.current=!1;const oe=++D.current;T("saving"),z("");try{await fe(L),oe===D.current&&T("saved")}catch(ve){const Pe=ve instanceof Error?ve.message:String(ve);oe===D.current&&(T("error"),z(Pe)),_e({title:"Could not save scenario",description:Pe,variant:"destructive"})}finally{G.current=!1,B.current&&(B.current=!1,he())}},V=L=>{J.current=L,T("dirty"),z(""),X.current&&window.clearTimeout(X.current),X.current=window.setTimeout(()=>{X.current=null,he()},700)},de=async()=>{const L=`scn-${Date.now()}`;let oe=L,ve=1;for(;i.some(Ge=>Ge.id===oe);)oe=`${L}-${ve}`,ve+=1;const Pe={id:oe,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};await o([...i,Pe]),r(`/libraries/test-cases/${encodeURIComponent(oe)}`),_e({title:"Test case created",description:`Opened ${oe} for editing.`})},Q=L=>{const oe=(L||`scn-${Date.now()}`).trim().replace(/\s+/g,"-").replace(/[^a-zA-Z0-9_-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")||`scn-${Date.now()}`;let ve=oe,Pe=1;for(;i.some(Ge=>Ge.id===ve);)ve=`${oe}-${Pe}`,Pe+=1;return ve},ee=async(L,oe=!1)=>{const ve=Q(`${L.id}-copy`),Pe={...structuredClone(L),id:ve,name:L.name?`${L.name} (Copy)`:""};await o([...i,Pe]),_e({title:"Test case duplicated",description:`Created ${Pe.id}.`}),oe&&r(`/libraries/test-cases/${encodeURIComponent(Pe.id)}`)},pe=async L=>{X.current&&(window.clearTimeout(X.current),X.current=null);const oe=i.filter(ve=>ve.id!==L.id);await o(oe),_e({title:"Test case deleted",description:`${L.id} was removed.`}),ne?.id===L.id&&(P(null),J.current=null,T("idle"),z(""),r("/libraries/test-cases"))},ae=L=>L.map(oe=>d.find(ve=>ve.id===oe)).filter(Boolean).map(oe=>oe?.name||oe?.id).filter(Boolean),Re=m.useMemo(()=>{const L=new Set;for(const oe of i)for(const ve of ae(oe.serverIds))L.add(ve);return Array.from(L).sort((oe,ve)=>oe.localeCompare(ve))},[i,d]),Ce=m.useMemo(()=>{const L=p.trim().toLowerCase(),oe=i.filter(ve=>{const Pe=(ve.name||"").toLowerCase(),Ge=ve.id.toLowerCase(),lt=(ve.prompt||"").toLowerCase(),pt=ae(ve.serverIds);return g!=="all"&&!pt.includes(g)?!1:L?Pe.includes(L)||Ge.includes(L)||lt.includes(L)||pt.some(vt=>vt.toLowerCase().includes(L)):!0});return oe.sort((ve,Pe)=>{const Ge=ae(ve.serverIds),lt=ae(Pe.serverIds);let pt=0;switch(b){case"id":pt=ve.id.localeCompare(Pe.id);break;case"servers":pt=Ge.length-lt.length;break;case"evalRules":pt=ve.evalRules.length-Pe.evalRules.length;break;case"extractRules":pt=ve.extractRules.length-Pe.extractRules.length;break;default:pt=(ve.name||ve.id).localeCompare(Pe.name||Pe.id);break}return pt===0&&(pt=ve.id.localeCompare(Pe.id)),S==="asc"?pt:-pt}),oe},[i,p,g,b,S,d]);m.useEffect(()=>{let L=!0;return s.getWorkspaceSettings().then(oe=>{!L||!oe||E(oe.scenarioAssistantAgentName??"")}).catch(()=>{L&&E("")}),()=>{L=!1}},[s]),m.useEffect(()=>{if(I&&t.get("assistantHandoff")==="1")try{const L=window.sessionStorage.getItem(n$);if(!L)return;const oe=JSON.parse(L);if(!oe||oe.scenarioId!==I||!oe.prompt)return;F(String(oe.prompt)),U(Date.now()),window.sessionStorage.removeItem(n$);const ve=new URLSearchParams(t);ve.delete("assistantHandoff"),n(ve,{replace:!0}),_e({title:"Suggestion sent to Scenario Assistant",description:"Review the suggestion and apply changes in the scenario editor."})}catch{}},[I,t,n]),m.useEffect(()=>{ne?(P(structuredClone(ne)),J.current=structuredClone(ne),T("idle"),z("")):(P(null),J.current=null,T("idle"),z("")),X.current&&(window.clearTimeout(X.current),X.current=null),G.current=!1,B.current=!1},[ne]),m.useEffect(()=>()=>{X.current&&window.clearTimeout(X.current)},[]);const Me=N||c[0]?.name||"";return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[a.jsx(eD,{className:"h-6 w-6"}),"Manage Test Cases"]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Reusable test case templates shared across configurations."})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[ne&&a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>r("/libraries/test-cases"),children:[a.jsx(Jo,{className:"mr-2 h-4 w-4"}),"Back to Overview"]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{f()},disabled:h,children:[a.jsx(ma,{className:"mr-2 h-4 w-4"}),"Refresh"]}),!ne&&a.jsxs(se,{type:"button",size:"sm",onClick:()=>{de()},children:[a.jsx(oi,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Test Case"]})]})]}),!ne&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid gap-3 rounded-md border bg-muted/30 p-3 md:grid-cols-[1.6fr_1fr_1fr_auto]",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Search"}),a.jsxs("div",{className:"relative",children:[a.jsx(pN,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),a.jsx(gt,{value:p,onChange:L=>x(L.target.value),placeholder:"Search by name, id, prompt, server...",className:"h-8 pl-8 text-xs"})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Server Filter"}),a.jsxs(jn,{value:g,onValueChange:j,children:[a.jsx(mn,{className:"h-8 text-xs",children:a.jsx(Sn,{})}),a.jsxs(vn,{children:[a.jsx(et,{value:"all",children:"All servers"}),Re.map(L=>a.jsx(et,{value:L,children:L},L))]})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Sort By"}),a.jsxs(jn,{value:b,onValueChange:L=>y(L),children:[a.jsx(mn,{className:"h-8 text-xs",children:a.jsx(Sn,{})}),a.jsxs(vn,{children:[a.jsx(et,{value:"name",children:"Name"}),a.jsx(et,{value:"id",children:"ID"}),a.jsx(et,{value:"servers",children:"# Servers"}),a.jsx(et,{value:"evalRules",children:"# Eval Rules"}),a.jsx(et,{value:"extractRules",children:"# Extract Rules"})]})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Direction"}),a.jsxs(jn,{value:S,onValueChange:L=>C(L),children:[a.jsx(mn,{className:"h-8 w-28 text-xs",children:a.jsx(Sn,{})}),a.jsxs(vn,{children:[a.jsx(et,{value:"asc",children:"Ascending"}),a.jsx(et,{value:"desc",children:"Descending"})]})]})]})]}),a.jsx(Ue,{children:a.jsxs(We,{className:"space-y-3 pt-6",children:[a.jsxs("div",{className:"text-xs text-muted-foreground",children:["Showing ",Ce.length," of ",i.length," test case",i.length!==1?"s":"","."]}),I&&!ne&&a.jsxs("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900",children:["Test case ",a.jsx("code",{className:"font-mono",children:I})," was not found."]}),i.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No library test cases yet."}):Ce.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No test cases match the current filters."}):a.jsx("div",{className:"grid gap-3",children:Ce.map(L=>{const oe=I===L.id,ve=`/libraries/test-cases/${encodeURIComponent(L.id)}`,Pe=ae(L.serverIds);return a.jsx("div",{className:`rounded-lg border p-3 ${oe?"border-primary bg-primary/5":""}`,children:a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"space-y-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx(At,{to:ve,className:"font-medium truncate hover:underline",children:L.name||L.id}),a.jsx(qe,{variant:"outline",className:"font-mono text-[10px]",children:L.id}),oe&&a.jsx(qe,{children:"Selected"})]}),a.jsxs("div",{className:"text-xs text-muted-foreground flex flex-wrap gap-x-3 gap-y-1",children:[a.jsxs("span",{children:[Pe.length," server",Pe.length!==1?"s":""]}),a.jsxs("span",{children:[L.evalRules.length," eval rule",L.evalRules.length!==1?"s":""]}),a.jsxs("span",{children:[L.extractRules.length," extract rule",L.extractRules.length!==1?"s":""]})]}),Pe.length>0&&a.jsx("div",{className:"flex flex-wrap gap-1",children:Pe.map(Ge=>a.jsx(qe,{variant:"secondary",className:"text-[10px]",children:Ge},`${L.id}-${Ge}`))})]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a.jsxs(se,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>W(L),children:[a.jsx(Ta,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{ee(L)},children:[a.jsx(_s,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),a.jsx(se,{type:"button",size:"sm",variant:oe?"default":"outline",asChild:!0,children:a.jsxs(At,{to:ve,children:[a.jsx(sv,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})})]})]})},L.id)})})]})})]}),ne&&A?a.jsxs(Ue,{children:[a.jsx(Pt,{className:"pb-3",children:a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs(kt,{className:"text-base",children:["Edit Test Case ·"," ",a.jsx("code",{className:"font-mono text-muted-foreground",children:ne.id})]}),a.jsx(qe,{variant:"outline",className:`text-[10px] ${O==="saving"?"border-amber-300 text-amber-700":O==="saved"?"border-emerald-300 text-emerald-700":O==="error"?"border-destructive/40 text-destructive":O==="dirty"?"border-sky-300 text-sky-700":""}`,children:O==="saving"?"Saving...":O==="saved"?"Saved":O==="error"?"Save failed":O==="dirty"?"Unsaved changes":"Ready"})]}),O==="error"&&$&&a.jsx("div",{className:"text-[11px] text-destructive",children:$})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{ee(A,!0)},children:[a.jsx(_s,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>W(A),children:[a.jsx(Ta,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]})]})]})}),a.jsx(We,{className:"pt-3",children:a.jsx(J1,{scenarios:[A],agents:c,servers:d,defaultAssistantAgentName:Me,assistantInitialPromptByScenarioId:q&&A?.id?{[A.id]:q}:void 0,assistantAutoOpenNonceByScenarioId:A?.id&&H?{[A.id]:H}:void 0,onChange:L=>{const oe=L[0];oe&&(P(oe),V(oe))},allowAdd:!1})})]}):null,a.jsx(Ls,{open:!!R,onOpenChange:L=>!L&&W(null),children:a.jsxs(ss,{children:[a.jsxs(is,{children:[a.jsx(ls,{children:"Delete test case?"}),a.jsxs(cs,{children:["This will permanently remove"," ",a.jsx("span",{className:"font-medium",children:R?.name||R?.id})," ","from the library. This action cannot be undone."]})]}),a.jsxs(os,{children:[a.jsx(ds,{children:"Cancel"}),a.jsx(us,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{R&&(pe(R),W(null))},children:"Delete Test Case"})]})]})})]})},Jge=()=>{const{source:e}=Ln(),{agents:t,reload:n,loading:r}=rs(),[s,i]=m.useState(!1),[o,c]=m.useState(!1),[d,f]=m.useState(""),h=m.useMemo(()=>d||t[0]?.name||"",[d,t]),p=m.useCallback(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)}},[e]);m.useEffect(()=>{p()},[p]);const x=async j=>{f(j),c(!0);try{await e.updateWorkspaceSettings({scenarioAssistantAgentName:j||void 0}),_e({title:"Settings updated",description:j?`Default assistant agent set to ${j}.`:"Default 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 a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[a.jsx(hN,{className:"h-6 w-6"}),"Settings"]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Workspace-level MCP Lab settings and defaults."})]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{g()},disabled:r||s,children:[a.jsx(ma,{className:"mr-2 h-4 w-4"}),"Refresh"]})]}),a.jsxs(Ue,{children:[a.jsxs(Pt,{className:"pb-3",children:[a.jsx(kt,{className:"text-base",children:"Assistant Defaults"}),a.jsx(Ur,{children:"Default assistant agent used across assistant flows. If unset, MCP Lab uses the first available agent automatically."})]}),a.jsxs(We,{className:"grid gap-3 md:grid-cols-[1.3fr_auto] md:items-end",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx($e,{className:"text-xs",children:"Default Assistant Agent"}),a.jsxs(jn,{value:h||"__none__",onValueChange:j=>{x(j==="__none__"?"":j)},disabled:o,children:[a.jsx(mn,{className:"h-9 text-sm",children:a.jsx(Sn,{placeholder:"Select assistant agent"})}),a.jsxs(vn,{children:[a.jsx(et,{value:"__none__",children:"None (use first agent)"}),t.map(j=>a.jsxs(et,{value:j.id,children:[j.name||j.id," · ",j.model]},j.id))]})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Applies to the assistant flows that use the workspace default. MCP Evaluation editors can still override the assistant agent from their evaluation context."})]}),a.jsx("div",{className:"text-xs text-muted-foreground",children:"Saved in workspace settings"})]})]})]})},Zge=xl("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"}}),Yo=m.forwardRef(({className:e,variant:t,...n},r)=>a.jsx("div",{ref:r,role:"alert",className:Se(Zge({variant:t}),e),...n}));Yo.displayName="Alert";const Xo=m.forwardRef(({className:e,...t},n)=>a.jsx("h5",{ref:n,className:Se("mb-1 font-medium leading-none tracking-tight",e),...t}));Xo.displayName="AlertTitle";const Qo=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Se("text-sm [&_p]:leading-relaxed",e),...t}));Qo.displayName="AlertDescription";const exe="127.0.0.1",txe=3011,nxe="/mcp",rxe=`http://${exe}:${txe}${nxe}`;function axe(e){return navigator.clipboard.writeText(e)}function g6({text:e,label:t}){const[n,r]=m.useState(!1),s=async()=>{try{await axe(e),r(!0),_e({title:"Copied",description:`${t} copied to clipboard.`}),window.setTimeout(()=>r(!1),1500)}catch(i){_e({title:"Copy failed",description:i instanceof Error?i.message:String(i),variant:"destructive"})}};return a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{s()},children:[a.jsx(_s,{className:"mr-2 h-3.5 w-3.5"}),n?"Copied":"Copy"]})}function Uj({label:e,value:t,copyText:n,valueClassName:r=""}){return a.jsx("div",{className:"rounded-lg border bg-muted/20 p-3",children:a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground",children:e}),a.jsx("div",{className:`mt-1 break-all text-sm font-medium ${r}`,children:t})]}),n&&a.jsx(g6,{text:n,label:e})]})})}function a$({title:e,description:t,code:n,iconSrc:r}){return a.jsxs(Ue,{children:[a.jsxs(Pt,{className:"pb-3",children:[a.jsxs(kt,{className:"flex items-center gap-2 text-base",children:[a.jsx("img",{src:r,alt:"","aria-hidden":"true",className:"h-4 w-4"}),e]}),a.jsx(Ur,{children:t})]}),a.jsxs(We,{className:"space-y-3",children:[a.jsx("pre",{className:"max-h-80 overflow-auto rounded-lg border bg-muted/30 p-3 text-xs whitespace-pre-wrap break-all",children:n}),a.jsx("div",{className:"flex justify-end",children:a.jsx(g6,{text:n,label:e})})]})]})}const sxe=()=>{const{source:e}=Ln(),[t,n]=m.useState(!0),[r,s]=m.useState(null),i=m.useCallback(async()=>{n(!0);try{const p=await e.health();s(p)}catch(p){s(null),_e({title:"Could not load MCP connection info",description:p instanceof Error?p.message:String(p),variant:"destructive"})}finally{n(!1)}},[e]);m.useEffect(()=>{i()},[i]);const o=r?.mcp?.enabled?r.mcp:null,c=o?.directUrl??rxe,d=o?.transport??"streamable-http",f=m.useMemo(()=>JSON.stringify({mcpServers:{mcplab:{command:"npx",args:["mcp-remote",c]}}},null,2),[c]),h=m.useMemo(()=>JSON.stringify({name:"mcplab",transport:d,url:c},null,2),[c,d]);return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[a.jsx(eS,{className:"h-6 w-6"}),"MCP Connection Info"]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Copy the local MCPLab MCP server details into Claude Desktop or any MCP-capable client."})]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{i()},disabled:t,children:[a.jsx(ma,{className:"mr-2 h-4 w-4"}),"Refresh"]})]}),!o&&a.jsxs(Yo,{children:[a.jsx(eS,{className:"h-4 w-4"}),a.jsx(Xo,{children:"MCP server not reported"}),a.jsx(Qo,{children:"The page is showing the default local connection details. Start MCP Lab in dev mode to see the live runtime endpoint and package version."})]}),a.jsxs("div",{className:"grid gap-6 xl:grid-cols-[1.1fr_0.9fr]",children:[a.jsxs(Ue,{children:[a.jsxs(Pt,{className:"pb-3",children:[a.jsx(kt,{className:"text-base",children:"Connection Details"}),a.jsx(Ur,{children:"The local server is exposed over streamable HTTP."})]}),a.jsx(We,{className:"space-y-3",children:a.jsxs("div",{className:"grid gap-3",children:[a.jsx(Uj,{label:"Direct MCP URL",value:c,copyText:c}),a.jsx(Uj,{label:"Transport",value:d}),a.jsx(Uj,{label:"Authentication",value:"none"})]})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsx(a$,{title:"Claude Desktop",description:"Use mcp-remote to bridge Claude Desktop to the local streamable HTTP MCP server.",code:f,iconSrc:"/icons/claude-color.svg"}),a.jsx(a$,{title:"OpenAI / MCP-capable client",description:"Use this endpoint block in any client or adapter that accepts a single MCP-over-HTTP server.",code:h,iconSrc:"/icons/openai.svg"})]})]})]})};var Og="Checkbox",[ixe]=mr(Og),[oxe,r_]=ixe(Og);function lxe(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:i,form:o,name:c,onCheckedChange:d,required:f,value:h="on",internal_do_not_use_render:p}=e,[x,g]=ha({prop:n,defaultProp:s??!1,onChange:d,caller:Og}),[j,b]=m.useState(null),[y,S]=m.useState(null),C=m.useRef(!1),N=j?!!o||!!j.closest("form"):!0,E={checked:x,disabled:i,setChecked:g,control:j,setControl:b,name:c,form:o,value:h,hasConsumerStoppedPropagationRef:C,required:f,defaultChecked:eo(s)?!1:s,isFormControl:N,bubbleInput:y,setBubbleInput:S};return a.jsx(oxe,{scope:t,...E,children:cxe(p)?p(E):r})}var x6="CheckboxTrigger",y6=m.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:i,value:o,disabled:c,checked:d,required:f,setControl:h,setChecked:p,hasConsumerStoppedPropagationRef:x,isFormControl:g,bubbleInput:j}=r_(x6,e),b=St(s,h),y=m.useRef(d);return m.useEffect(()=>{const S=i?.form;if(S){const C=()=>p(y.current);return S.addEventListener("reset",C),()=>S.removeEventListener("reset",C)}},[i,p]),a.jsx(Ye.button,{type:"button",role:"checkbox","aria-checked":eo(d)?"mixed":d,"aria-required":f,"data-state":N6(d),"data-disabled":c?"":void 0,disabled:c,value:o,...r,ref:b,onKeyDown:Te(t,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:Te(n,S=>{p(C=>eo(C)?!0:!C),j&&g&&(x.current=S.isPropagationStopped(),x.current||S.stopPropagation())})})});y6.displayName=x6;var a_=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:i,required:o,disabled:c,value:d,onCheckedChange:f,form:h,...p}=e;return a.jsx(lxe,{__scopeCheckbox:n,checked:s,defaultChecked:i,disabled:c,required:o,onCheckedChange:f,name:r,form:h,value:d,internal_do_not_use_render:({isFormControl:x})=>a.jsxs(a.Fragment,{children:[a.jsx(y6,{...p,ref:t,__scopeCheckbox:n}),x&&a.jsx(S6,{__scopeCheckbox:n})]})})});a_.displayName=Og;var b6="CheckboxIndicator",w6=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,i=r_(b6,n);return a.jsx(Yn,{present:r||eo(i.checked)||i.checked===!0,children:a.jsx(Ye.span,{"data-state":N6(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});w6.displayName=b6;var j6="CheckboxBubbleInput",S6=m.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:i,defaultChecked:o,required:c,disabled:d,name:f,value:h,form:p,bubbleInput:x,setBubbleInput:g}=r_(j6,e),j=St(n,g),b=gg(i),y=uv(r);m.useEffect(()=>{const C=x;if(!C)return;const N=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(N,"checked").set,P=!s.current;if(b!==i&&A){const O=new Event("click",{bubbles:P});C.indeterminate=eo(i),A.call(C,eo(i)?!1:i),C.dispatchEvent(O)}},[x,b,i,s]);const S=m.useRef(eo(i)?!1:i);return a.jsx(Ye.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??S.current,required:c,disabled:d,name:f,value:h,form:p,...t,tabIndex:-1,ref:j,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});S6.displayName=j6;function cxe(e){return typeof e=="function"}function eo(e){return e==="indeterminate"}function N6(e){return eo(e)?"indeterminate":e?"checked":"unchecked"}const Yr=m.forwardRef(({className:e,...t},n)=>a.jsx(a_,{ref:n,className:Se("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:a.jsx(w6,{className:Se("flex items-center justify-center text-current"),children:a.jsx(Ec,{className:"h-4 w-4"})})}));Yr.displayName=a_.displayName;function uxe(e,t=[]){let n=[];function r(i,o){const c=m.createContext(o);c.displayName=i+"Context";const d=n.length;n=[...n,o];const f=p=>{const{scope:x,children:g,...j}=p,b=x?.[e]?.[d]||c,y=m.useMemo(()=>j,Object.values(j));return a.jsx(b.Provider,{value:y,children:g})};f.displayName=i+"Provider";function h(p,x){const g=x?.[e]?.[d]||c,j=m.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 s=()=>{const i=n.map(o=>m.createContext(o));return function(c){const d=c?.[e]||i;return m.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return s.scopeName=e,[r,dxe(s,...t)]}function dxe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((c,{useScope:d,scopeName:f})=>{const p=d(i)[`__scope${f}`];return{...c,...p}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var fxe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],C6=fxe.reduce((e,t)=>{const n=wv(`Primitive.${t}`),r=m.forwardRef((s,i)=>{const{asChild:o,...c}=s,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),s_="Progress",i_=100,[pxe]=uxe(s_),[hxe,mxe]=pxe(s_),_6=m.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:i=vxe,...o}=e;(s||s===0)&&!s$(s)&&console.error(gxe(`${s}`,"Progress"));const c=s$(s)?s:i_;r!==null&&!i$(r,c)&&console.error(xxe(`${r}`,"Progress"));const d=i$(r,c)?r:null,f=ev(d)?i(d,c):void 0;return a.jsx(hxe,{scope:n,value:d,max:c,children:a.jsx(C6.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":ev(d)?d:void 0,"aria-valuetext":f,role:"progressbar","data-state":P6(d,c),"data-value":d??void 0,"data-max":c,...o,ref:t})})});_6.displayName=s_;var A6="ProgressIndicator",E6=m.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,s=mxe(A6,n);return a.jsx(C6.div,{"data-state":P6(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:t})});E6.displayName=A6;function vxe(e,t){return`${Math.round(e/t*100)}%`}function P6(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function ev(e){return typeof e=="number"}function s$(e){return ev(e)&&!isNaN(e)&&e>0}function i$(e,t){return ev(e)&&!isNaN(e)&&e<=t&&e>=0}function gxe(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${i_}\`.`}function xxe(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
136
|
+
- a positive number
|
|
137
|
+
- less than the value passed to \`max\` (or ${i_} if no \`max\` prop is set)
|
|
138
|
+
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
139
|
+
|
|
140
|
+
Defaulting to \`null\`.`}var k6=_6,yxe=E6;const Tg=m.forwardRef(({className:e,value:t,...n},r)=>a.jsx(k6,{ref:r,className:Se("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:a.jsx(yxe,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Tg.displayName=k6.displayName;function O6(e){const t=e.toLowerCase();return t.includes("side-effectful prefix")||t.includes("destructive behavior")||t.includes("destructivehint")}function o$(e){try{return JSON.stringify(e,null,2)}catch{return"[schema not serializable]"}}const $o=["critical","high","medium","low","info"];function _h(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 bxe(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 l$(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"tool"}function Wj({text:e}){return a.jsxs("div",{className:"mt-2 rounded-md border px-2.5 py-2 text-[11px] text-slate-800",children:[a.jsxs("div",{className:"mb-1 inline-flex items-center gap-1 font-medium text-slate-700",children:[a.jsx(M7,{className:"h-3.5 w-3.5"}),"Suggested improvement"]}),a.jsx("p",{children:e})]})}function wxe({label:e,reason:t,variantClassName:n}){return a.jsx(ro,{delayDuration:0,children:a.jsxs(ao,{children:[a.jsx(so,{asChild:!0,children:a.jsx(qe,{variant:"outline",className:n,children:e})}),a.jsx(ui,{className:"max-w-sm text-xs",children:a.jsx("p",{children:t})})]})})}function o_(e){const t=[],n=(r,s)=>{t.push(`#### ${r}`),t.push("```json");try{t.push(JSON.stringify(s,null,2))}catch{t.push('"[schema not serializable]"')}t.push("```")};if(t.push("# MCP Tool Analysis Report",""),t.push(`- Created: ${e.createdAt}`),t.push(`- Assistant Agent: ${e.assistantAgentName}`),t.push(`- Assistant Model: ${e.assistantAgentModel}`),e.mcpServerVersions&&Object.keys(e.mcpServerVersions).length>0){const r=Object.entries(e.mcpServerVersions).map(([s,i])=>`${s}: ${i??"unknown"}`).join(", ");t.push(`- MCP Server Versions: ${r}`)}t.push(`- Modes: ${[e.modes.metadataReview?"metadata review":null,e.modes.deeperAnalysis?"deeper analysis":null].filter(Boolean).join(" + ")}`),t.push("","## Summary"),t.push(`- Servers analyzed: ${e.summary.serversAnalyzed}`),t.push(`- Tools analyzed: ${e.summary.toolsAnalyzed}`),t.push(`- Tools skipped: ${e.summary.toolsSkipped}`,"");for(const r of e.servers){t.push(`## Server: ${r.serverName}`),r.warnings.length>0&&t.push(...r.warnings.map(s=>`- Warning: ${s}`),"");for(const s of r.tools){if(t.push(`### ${s.publicToolName}`),s.title&&t.push(`- Title: ${s.title}`),t.push(`- Safety: ${s.safetyClassification} (${s.classificationReason})`),s.inputSchema!==void 0&&n("Input schema",s.inputSchema),s.outputSchema!==void 0&&n("Output schema",s.outputSchema),s.metadataReview?.issues.length){t.push("#### Metadata issues");for(const i of s.metadataReview.issues)t.push(` - [${i.severity}] ${i.title}: ${i.detail}`)}if(s.deeperAnalysis)if(!s.deeperAnalysis.attempted)t.push(`- Deeper analysis: skipped (${s.deeperAnalysis.skippedReason??"unknown"})`);else{t.push(`- Deeper analysis sample calls: ${s.deeperAnalysis.sampleCalls.length}`);for(const i of s.deeperAnalysis.sampleCalls){t.push(` - Call ${i.callIndex}: ${i.ok?"ok":"error"}${i.durationMs?` (${i.durationMs}ms)`:""}`),i.error&&t.push(` - Error: ${i.error}`);for(const o of i.observations)t.push(` - ${o}`)}}if(s.overallRecommendations.length>0){t.push("#### Recommendations");for(const i of s.overallRecommendations)t.push(` - ${i}`)}if(s.metadataReview?.evalReadinessNotes.length){t.push("#### Agent/Eval readiness notes");for(const i of s.metadataReview.evalReadinessNotes)t.push(` - ${i}`)}t.push("")}}return`${t.join(`
|
|
141
|
+
`)}
|
|
142
|
+
`}function T6({report:e}){const[t,n]=vi(),[r,s]=m.useState([...$o]),[i,o]=m.useState(new Set),[c,d]=m.useState(""),[f,h]=m.useState(!1),p=t.get("groupBy")==="severity"?"severity":"tool",x=m.useRef(null),g=c.trim().toLowerCase(),j=m.useMemo(()=>new Set(r),[r]),b=T=>{s($=>{const z=$.includes(T)?$.filter(q=>q!==T):[...$,T];return z.length===0?[...$o]:z})},y=T=>{const $=new URLSearchParams(t);T==="severity"?$.set("groupBy","severity"):$.delete("groupBy"),n($,{replace:!0})},S=m.useMemo(()=>{const T={critical:[],high:[],medium:[],low:[],info:[]};for(const $ of e.servers)for(const z of $.tools){const q=`tool-${l$(`${$.serverName}-${z.publicToolName}`)}`,F=`${$.serverName}::${z.publicToolName}`,H=z.publicToolName.split("::").pop()??z.publicToolName;for(const U of z.metadataReview?.issues??[]){const R=U.severity;T[R].push({key:`${F}-metadata-${U.id}`,toolAnchorId:q,toolLabel:F,toolDisplayName:H,sourceLabel:"Metadata review",issue:{id:U.id,title:U.title,detail:U.detail,severity:R,suggestion:U.suggestion}})}for(const U of z.deeperAnalysis?.sampleCalls??[])for(const R of U.issues){const W=R.severity;T[W].push({key:`${F}-call-${U.callIndex}-${R.id}`,toolAnchorId:q,toolLabel:F,toolDisplayName:H,sourceLabel:`Sample call ${U.callIndex}`,issue:{id:R.id,title:R.title,detail:R.detail,severity:W,suggestion:R.suggestion}})}}return T},[e.servers]),C=m.useMemo(()=>Array.from(new Set(e.servers.flatMap(T=>T.tools.map($=>$.publicToolName)).map(T=>T.split("::").pop()??T))).sort((T,$)=>T.localeCompare($)),[e.servers]),N=T=>g.length===0?!0:(T.toLowerCase().split("::").pop()??T.toLowerCase()).includes(g),E=T=>{if(!x.current)return;x.current.querySelectorAll("details").forEach(z=>{z.open=T})},A=()=>o(new Set($o)),P=()=>o(new Set),O=T=>{o($=>{const z=new Set($);return z.has(T)?z.delete(T):z.add(T),z})};return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[a.jsx(Ue,{children:a.jsxs(We,{className:"pt-6",children:[a.jsx("div",{className:"text-xs text-muted-foreground",children:"Tools analyzed"}),a.jsx("div",{className:"text-2xl font-semibold",children:e.summary.toolsAnalyzed})]})}),a.jsx(Ue,{children:a.jsxs(We,{className:"pt-6",children:[a.jsx("div",{className:"text-xs text-muted-foreground",children:"Tools skipped"}),a.jsx("div",{className:"text-2xl font-semibold",children:e.summary.toolsSkipped})]})}),a.jsx(Ue,{children:a.jsxs(We,{className:"pt-6",children:[a.jsx("div",{className:"text-xs text-muted-foreground",children:"Findings"}),a.jsx("div",{className:"text-2xl font-semibold",children:e.findings.length})]})})]}),a.jsxs(Ue,{children:[a.jsxs(Pt,{className:"pb-3",children:[a.jsx(kt,{className:"text-base",children:"Analysis Overview"}),a.jsx(Ur,{children:"Visual breakdown of findings by severity. Click badges to filter the report."})]}),a.jsx(We,{children:a.jsxs("div",{className:"flex flex-wrap gap-2",children:[$o.filter(T=>e.summary.issueCounts[T]>0).map(T=>{const $=j.has(T);return a.jsx("button",{type:"button",onClick:()=>b(T),className:"rounded-full","aria-pressed":$,children:a.jsxs(qe,{variant:"outline",className:`capitalize font-normal ${$?_h(T):bxe(T)} ${$?"ring-1 ring-current":"opacity-70"}`,children:[T,": ",e.summary.issueCounts[T]]})},T)}),a.jsx(se,{type:"button",size:"sm",variant:"ghost",onClick:()=>s([...$o]),className:"h-7 px-2 text-xs",children:"Reset"})]})})]}),a.jsxs("div",{className:"space-y-0",children:[a.jsx(Sg,{value:p,onValueChange:T=>{(T==="tool"||T==="severity")&&y(T)},className:"min-w-0 px-3 pt-1",children:a.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-2 border-b",children:[a.jsxs(Xf,{className:"h-auto justify-start rounded-none bg-transparent p-0",children:[a.jsx(Cs,{value:"tool",className:"-mb-px h-10 rounded-none rounded-t border border-border border-b-border bg-muted/20 px-6 text-sm font-semibold text-muted-foreground data-[state=active]:z-10 data-[state=active]:bg-card data-[state=active]:text-foreground data-[state=active]:border-border data-[state=active]:border-b-card data-[state=active]:shadow-none",children:"Report by Tool"}),a.jsx(Cs,{value:"severity",className:"-mb-px h-10 rounded-none rounded-t border border-border border-b-border bg-muted/20 px-6 text-sm font-semibold text-muted-foreground data-[state=active]:z-10 data-[state=active]:bg-card data-[state=active]:text-foreground data-[state=active]:border-border data-[state=active]:border-b-card data-[state=active]:shadow-none",children:"By Severity"})]}),a.jsxs("div",{className:"mb-2 flex min-w-0 items-center gap-2",children:[a.jsx("span",{className:"whitespace-nowrap text-xs text-muted-foreground",children:"Filter tools"}),a.jsxs(iu,{open:f,onOpenChange:h,children:[a.jsx(ou,{asChild:!0,children:a.jsxs(se,{type:"button",variant:"outline",role:"combobox","aria-expanded":f,className:"h-8 w-[320px] max-w-full justify-between text-xs font-normal",children:[a.jsx("span",{className:"truncate text-left",children:c||"All tools"}),a.jsx(Yt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsx(cl,{className:"w-[320px] p-0",align:"end",children:a.jsxs(dl,{children:[a.jsx(fl,{placeholder:"Search tools..."}),a.jsxs(pl,{children:[a.jsx(hl,{children:"No tools found."}),a.jsxs(ml,{children:[a.jsx(ua,{value:"all tools",onSelect:()=>{d(""),h(!1)},children:"All tools"}),C.map(T=>a.jsx(ua,{value:T,onSelect:()=>{d(T),h(!1)},children:T},T))]})]})]})})]}),p==="severity"&&a.jsxs(a.Fragment,{children:[a.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:P,children:"Expand all"}),a.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:A,children:"Collapse all"})]}),p==="tool"&&a.jsxs(a.Fragment,{children:[a.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>E(!0),children:"Expand all"}),a.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>E(!1),children:"Collapse all"})]})]})]})}),p==="severity"?a.jsx("div",{className:"space-y-4",children:$o.filter(T=>j.has(T)).map(T=>{const $=S[T].filter(q=>N(q.toolLabel));if($.length===0)return null;const z=i.has(T);return a.jsxs(Ue,{children:[a.jsx(Pt,{className:"pb-3",children:a.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx(kt,{className:"text-base capitalize",children:T}),a.jsxs(Ur,{children:[$.length," finding(s)"]})]}),a.jsx("div",{className:"flex gap-2",children:a.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>O(T),children:z?"Expand":"Collapse"})})]})}),!z&&a.jsx(We,{className:"space-y-2",children:$.map((q,F)=>a.jsxs("div",{className:"rounded border p-2 text-xs",children:[a.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a.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}),a.jsx("span",{className:"min-w-0 font-bold leading-tight",children:q.issue.title})]}),a.jsx(qe,{variant:"outline",className:`shrink-0 text-[10px] ${_h(q.issue.severity)}`,children:q.issue.severity})]}),a.jsxs("p",{children:[a.jsx("span",{className:"font-bold",children:"Finding:"})," ",q.issue.detail]}),a.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-[11px]",children:[a.jsx(qe,{variant:"secondary",className:"font-normal",children:q.sourceLabel}),a.jsx(se,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 font-mono text-[11px]",title:q.toolLabel,onClick:()=>{y("tool"),requestAnimationFrame(()=>{document.getElementById(q.toolAnchorId)?.scrollIntoView({behavior:"smooth",block:"start"})})},children:q.toolDisplayName})]}),q.issue.suggestion&&a.jsx(Wj,{text:q.issue.suggestion})]},q.key))})]},T)})}):a.jsx("div",{ref:x,className:"space-y-4",children:e.servers.map(T=>{const $=T.tools.filter(z=>{const q=`${T.serverName}::${z.publicToolName}`;if(!N(q))return!1;const F=[...z.metadataReview?.issues??[],...z.deeperAnalysis?.sampleCalls.flatMap(H=>H.issues)??[]];return F.length===0?r.length===$o.length:F.some(H=>j.has(H.severity))});return $.length===0?null:a.jsxs(Ue,{children:[a.jsxs(Pt,{className:"pb-3",children:[a.jsx(kt,{className:"text-base",children:T.serverName}),a.jsxs(Ur,{children:["Discovered ",T.toolCountDiscovered," · Showing ",$.length," of ",T.toolCountAnalyzed," analyzed · Skipped ",T.toolCountSkipped]})]}),a.jsxs(We,{className:"space-y-3",children:[T.warnings.length>0&&a.jsxs(Yo,{children:[a.jsx(Xo,{children:"Warnings"}),a.jsx(Qo,{children:a.jsx("ul",{className:"ml-4 list-disc space-y-1",children:T.warnings.map(z=>a.jsx("li",{children:z},`${T.serverName}-${z}`))})})]}),$.map(z=>{const q=z.publicToolName.split("::").pop()??z.publicToolName,F=O6(z.classificationReason),H=z.safetyClassification==="read_like"?"read-like":F?"write/delete":"unsafe/unknown",U=z.safetyClassification==="read_like"?"border-emerald-200 bg-emerald-50 text-emerald-700":F?"border-amber-300 bg-amber-50 text-amber-800":"border-slate-300 bg-slate-100 text-slate-700";return a.jsxs("details",{id:`tool-${l$(`${T.serverName}-${z.publicToolName}`)}`,className:"group rounded-md border p-3",children:[a.jsx("summary",{className:"cursor-pointer list-none",children:a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a.jsx("div",{className:"min-w-0 truncate font-mono text-sm",title:z.publicToolName,children:q}),a.jsx(wxe,{label:H,reason:z.classificationReason,variantClassName:U})]}),a.jsx(Yt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),z.title&&a.jsx("p",{className:"text-sm text-foreground/85",children:z.title}),z.description&&a.jsx("p",{className:"text-xs text-muted-foreground",children:z.description})]})}),a.jsxs("div",{className:"mt-3 space-y-2",children:[(z.inputSchema!==void 0||z.outputSchema!==void 0)&&a.jsxs("details",{className:"group/schema rounded border bg-muted/10 p-2",children:[a.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-2 text-xs font-medium",children:[a.jsx("span",{children:"Schemas"}),a.jsx(Yt,{className:"h-4 w-4 text-muted-foreground transition-transform group-open/schema:rotate-180"})]}),a.jsxs("div",{className:"mt-2 space-y-2",children:[z.inputSchema!==void 0&&a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-[11px] font-medium text-muted-foreground",children:"Input schema"}),a.jsx("pre",{className:"max-h-52 overflow-auto rounded border bg-muted/20 p-2 text-[11px]",children:o$(z.inputSchema)})]}),z.outputSchema!==void 0&&a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-[11px] font-medium text-muted-foreground",children:"Output schema"}),a.jsx("pre",{className:"max-h-52 overflow-auto rounded border bg-muted/20 p-2 text-[11px]",children:o$(z.outputSchema)})]})]})]}),z.metadataReview&&a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-xs font-medium",children:"Metadata review"}),z.metadataReview.issues.filter(R=>j.has(R.severity)).length===0?a.jsx("p",{className:"text-xs text-muted-foreground",children:"No metadata issues reported."}):a.jsx("div",{className:"space-y-1",children:z.metadataReview.issues.filter(R=>j.has(R.severity)).map((R,W)=>a.jsxs("div",{className:"rounded border p-2 text-xs",children:[a.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a.jsx("span",{className:"inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full border bg-muted px-1 text-[10px] font-semibold text-muted-foreground",children:W+1}),a.jsx("span",{className:"min-w-0 font-bold leading-tight",children:R.title})]}),a.jsx(qe,{variant:"outline",className:`shrink-0 text-[10px] ${_h(R.severity)}`,children:R.severity})]}),a.jsxs("p",{children:[a.jsx("span",{className:"font-bold",children:"Finding:"})," ",R.detail]}),R.suggestion&&a.jsx(Wj,{text:R.suggestion})]},R.id))})]}),z.deeperAnalysis&&a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-xs font-medium",children:"Deeper analysis"}),z.deeperAnalysis.attempted?a.jsx("div",{className:"space-y-2",children:z.deeperAnalysis.sampleCalls.map(R=>a.jsxs("div",{className:"rounded border p-2 text-xs",children:[a.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[a.jsx(qe,{variant:R.ok?"secondary":"destructive",className:"text-[10px]",children:R.ok?"ok":"error"}),a.jsxs("span",{children:["Call ",R.callIndex]}),R.durationMs!==void 0&&a.jsxs("span",{className:"text-muted-foreground",children:[R.durationMs,"ms"]})]}),R.error&&a.jsx("p",{className:"text-destructive",children:R.error}),R.observations.length>0&&a.jsxs("div",{className:"mt-2",children:[a.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"}),a.jsx("ul",{className:"ml-4 list-disc space-y-1",children:R.observations.map((W,X)=>a.jsx("li",{children:W},`${z.publicToolName}-obs-${R.callIndex}-${X}`))})]}),R.issues.filter(W=>j.has(W.severity)).length>0&&a.jsx("div",{className:"mt-2 space-y-1",children:R.issues.filter(W=>j.has(W.severity)).map((W,X)=>a.jsxs("div",{className:"rounded border p-2",children:[a.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a.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:X+1}),a.jsx("span",{className:"min-w-0 font-bold leading-tight",children:W.title})]}),a.jsx(qe,{variant:"outline",className:`shrink-0 text-[10px] ${_h(W.severity)}`,children:W.severity})]}),a.jsxs("p",{children:[a.jsx("span",{className:"font-bold",children:"Finding:"})," ",W.detail]}),W.suggestion&&a.jsx(Wj,{text:W.suggestion})]},`${R.callIndex}-${W.id}`))})]},`${z.publicToolName}-call-${R.callIndex}`))}):a.jsx("p",{className:"text-xs text-muted-foreground",children:z.deeperAnalysis.skippedReason??"Skipped"})]})]})]},z.publicToolName)})]})]},T.serverName)})})]})]})}function jxe(e){let t=0;const n=new Set,r=new Set;for(const i of e){const o=typeof i.payload?.message=="string"?i.payload.message:"";if(!o)continue;const c=o.match(/\((\d+)\s+selected\s+of\s+\d+\s+discovered\)/i);c&&(t=Math.max(t,Number(c[1])||0));const d=o.match(/^Started\s+(.+)$/);d&&n.add(d[1]);const f=o.match(/^Finished\s+(.+)$/);f&&r.add(f[1])}const s=t>0?Math.max(0,Math.min(100,Math.round(r.size/t*100))):0;return{totalTools:t,startedTools:n.size,finishedTools:r.size,percent:s}}const Vj="mcplab.toolAnalysis.activeJobId";function c$(e,t,n){const r=new Blob([t],{type:n}),s=URL.createObjectURL(r),i=document.createElement("a");i.href=s,i.download=e,i.click(),URL.revokeObjectURL(s)}function u$({text:e}){return a.jsxs(ao,{children:[a.jsx(so,{asChild:!0,children:a.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:a.jsx(A7,{className:"h-3.5 w-3.5"})})}),a.jsx(ui,{className:"max-w-xs text-xs",children:a.jsx("p",{children:e})})]})}function Sxe(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}function Nxe({label:e,reason:t,variantClassName:n}){return a.jsx(ro,{delayDuration:0,children:a.jsxs(ao,{children:[a.jsx(so,{asChild:!0,children:a.jsx(qe,{variant:"outline",className:n,children:e})}),a.jsx(ui,{className:"max-w-sm text-xs",children:a.jsx("p",{children:t})})]})})}const Cxe=()=>{const{source:e}=Ln(),{servers:t,agents:n,loading:r,reload:s}=rs(),[i,o]=m.useState(""),[c,d]=m.useState([]),[f,h]=m.useState(!1),[p,x]=m.useState([]),[g,j]=m.useState({}),[b,y]=m.useState(""),[S,C]=m.useState(!0),[N,E]=m.useState(!1),[A,P]=m.useState(2),[O,T]=m.useState(1),[$,z]=m.useState(1e4),[q,F]=m.useState(null),[H,U]=m.useState([]),[R,W]=m.useState(null),[X,G]=m.useState(null),[B,J]=m.useState(!1),[D,I]=m.useState("configure"),[re,ne]=m.useState("idle"),[fe,he]=m.useState(!1),V=m.useRef(null),de=m.useRef(null),Q=i||n[0]?.name||"",ee=m.useMemo(()=>jxe(H),[H]);m.useEffect(()=>{let Ne=!0;return e.getWorkspaceSettings().then(Xe=>{!Ne||!Xe||o(Xe.scenarioAssistantAgentName??"")}).catch(()=>{Ne&&o("")}),()=>{Ne=!1}},[e]),m.useEffect(()=>()=>{V.current?.()},[]),m.useEffect(()=>{const Ne=de.current;Ne&&requestAnimationFrame(()=>{Ne.scrollTop=Ne.scrollHeight})},[H.length]);const pe=()=>{try{sessionStorage.removeItem(Vj)}catch{}},ae=Ne=>{try{sessionStorage.setItem(Vj,Ne)}catch{}},Re=Ne=>{V.current?.(),V.current=e.subscribeToolAnalysisJob(Ne,Xe=>{if(U(Fe=>[...Fe,Xe]),Xe.type==="completed")e.getToolAnalysisResult(Ne).then(Fe=>{W(Fe.report),G(Fe.savedReportId??null)}).catch(Fe=>_e({title:"Could not load analysis report",description:Fe instanceof Error?Fe.message:String(Fe),variant:"destructive"})).finally(()=>{pe(),F(null),J(!1),ne("idle"),I("run")});else if(Xe.type==="error"){const Fe=String(Xe.payload?.message??"");pe(),ne(Fe.toLowerCase().includes("abort")?"stopped":"error"),F(null),J(!1)}})};m.useEffect(()=>{if(q||R)return;let Ne="";try{Ne=sessionStorage.getItem(Vj)??""}catch{Ne=""}if(Ne)return I("run"),ne("running"),J(!0),F(Ne),U([]),Re(Ne),()=>{}},[e,q,R]);const Ce=async()=>{if(c.length===0){x([]),j({});return}const Ne=c.filter(Xe=>t.find(Ft=>Ft.id===Xe)?.authType==="oauth2");try{Ne.length>0&&(he(!0),await ii({serverNames:Ne,source:e,onServerAuthStart:Xe=>{_e({title:`OAuth login required for ${Xe}`,description:"Complete login in the opened browser tab. Discovery will continue automatically."})}}))}catch(Xe){_e({title:"OAuth login failed",description:Xe instanceof Error?Xe.message:String(Xe),variant:"destructive"}),he(!1);return}finally{he(!1)}h(!0);try{const Xe=await e.discoverToolsForAnalysis({serverNames:c});x(Xe.servers),j(Fe=>{const Ft={};for(const on of Xe.servers){const Ut=Fe[on.serverName]??[],ye=on.tools.map(Be=>Be.name),Ve=Ut.filter(Be=>ye.includes(Be));Ft[on.serverName]=Ve.length>0?Ve:ye}return Ft})}catch(Xe){_e({title:"Could not discover MCP tools",description:Xe instanceof Error?Xe.message:String(Xe),variant:"destructive"})}finally{h(!1)}};m.useEffect(()=>{Ce()},[c.join("|")]);const Me=m.useMemo(()=>{const Ne=b.trim().toLowerCase();return Ne?p.map(Xe=>({...Xe,tools:Xe.tools.filter(Fe=>Fe.name.toLowerCase().includes(Ne)||(Fe.description||"").toLowerCase().includes(Ne))})).filter(Xe=>Xe.tools.length>0):p},[p,b]),L=m.useMemo(()=>Object.values(g).reduce((Ne,Xe)=>Ne+Xe.length,0),[g]),oe=c[0]??"",ve=async()=>{if(!S&&!N){_e({title:"Select at least one mode",variant:"destructive"});return}if(c.length!==1){_e({title:"Select exactly one server",variant:"destructive"});return}if(L===0){_e({title:"Select at least one tool",variant:"destructive"});return}J(!0),U([]),W(null),G(null),I("run"),ne("running");try{const Ne=c[0];t.find(Ft=>Ft.id===Ne)?.authType==="oauth2"&&(he(!0),await ii({serverNames:[Ne],source:e,onServerAuthStart:Ft=>{_e({title:`OAuth login required for ${Ft}`,description:"Complete login in the opened browser tab. Analysis will continue automatically."})}}));const{jobId:Fe}=await e.startToolAnalysis({serverNames:c,selectedToolsByServer:g,maxParallelTools:A,modes:{metadataReview:S,deeperAnalysis:N},deeperAnalysisOptions:{autoRunPolicy:"read_only_allowlist",sampleCallsPerTool:O,toolCallTimeoutMs:$}});F(Fe),ae(Fe),Re(Fe)}catch(Ne){J(!1),ne("error"),I("run"),_e({title:"Could not start tool analysis",description:Ne instanceof Error?Ne.message:String(Ne),variant:"destructive"})}finally{he(!1)}},Pe=async()=>{if(!q)return;const Ne=q;try{const Xe=await e.stopToolAnalysis(Ne);if(Xe.status==="completed"){V.current?.(),V.current=null;const Fe=await e.getToolAnalysisResult(Ne);W(Fe.report),G(Fe.savedReportId??null),pe(),F(null),J(!1),ne("idle"),I("run"),_e({title:"Analysis already finished",description:"Showing the result overview."});return}if(Xe.status==="stopped"){V.current?.(),V.current=null,pe(),F(null),J(!1),ne("stopped"),_e({title:"Analysis stopped"});return}if(Xe.status==="error"){V.current?.(),V.current=null,pe(),F(null),J(!1),ne("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(Xe){_e({title:"Could not stop analysis",description:Xe instanceof Error?Xe.message:String(Xe),variant:"destructive"})}},Ge=()=>{I("configure"),ne("idle"),F(null)},lt=(Ne,Xe)=>{d(Fe=>Xe?[Ne]:Fe.filter(Ft=>Ft!==Ne))},pt=(Ne,Xe,Fe)=>{j(Ft=>{const on=new Set(Ft[Ne]??[]);return Fe?on.add(Xe):on.delete(Xe),{...Ft,[Ne]:Array.from(on)}})},vt=(Ne,Xe)=>{j(Fe=>({...Fe,[Ne]:Xe}))},zt=!0,qt=q!==null||H.length>0||re==="stopped"||re==="error",Wt=!!R,Qt=Ne=>{if(Ne==="configure"&&zt){I("configure");return}if(Ne==="run"&&qt){I("run");return}Ne==="report"&&Wt&&I("report")};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[a.jsx(rD,{className:"h-6 w-6"}),"Analyze MCP Tools"]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Review MCP tools for schema quality, ergonomics, and agent/eval readiness."})]}),a.jsxs("div",{className:"hidden flex-wrap items-center gap-2 md:flex",children:[a.jsx("button",{type:"button",onClick:()=>Qt("configure"),className:"rounded-full","aria-label":"Open Configure Analysis",children:a.jsx(qe,{variant:D==="configure"?"default":"outline",className:"cursor-pointer",children:"Configure Analysis"})}),a.jsx("button",{type:"button",onClick:()=>Qt("run"),disabled:!qt,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Run Analysis",children:a.jsx(qe,{variant:D==="run"?"default":"outline",className:qt?"cursor-pointer":"cursor-not-allowed",children:"Run Analysis"})}),a.jsx("button",{type:"button",onClick:()=>Qt("report"),disabled:!Wt,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Report",children:a.jsx(qe,{variant:D==="report"?"default":"outline",className:Wt?"cursor-pointer":"cursor-not-allowed",children:"Report"})})]})]}),D==="configure"&&a.jsxs(Ue,{children:[a.jsxs(Pt,{children:[a.jsx(kt,{className:"text-base",children:"Run MCP analysis"}),a.jsx(Ur,{children:"Select servers and tools, choose metadata review and/or deeper sample-call analysis, then run the report."})]}),a.jsxs(We,{className:"space-y-5",children:[!Q&&a.jsxs(Yo,{children:[a.jsx(Xo,{children:"No assistant agent available"}),a.jsxs(Qo,{children:["Add a library agent in"," ",a.jsx(At,{to:"/libraries/agents",className:"underline",children:"Agents"})," ","and optionally set the default Scenario Assistant Agent in"," ",a.jsx(At,{to:"/settings",className:"underline",children:"Settings"}),"."]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx($e,{className:"text-xs",children:"Servers"}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{s()},disabled:r||fe,children:[a.jsx(ma,{className:"mr-2 h-4 w-4"}),"Refresh Servers"]})]}),a.jsx("div",{className:"grid gap-2 rounded-md border p-3 md:grid-cols-2",children:t.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No library servers configured."}):t.map(Ne=>{const Xe=c.includes(Ne.id);return a.jsxs("label",{className:"flex items-start gap-2 rounded-md border p-2 text-sm",children:[a.jsx(Yr,{checked:Xe,onCheckedChange:Fe=>lt(Ne.id,!!Fe)}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"font-medium",children:Ne.name||Ne.id}),Ne.url&&a.jsx("div",{className:"truncate text-xs text-muted-foreground",children:Ne.url})]})]},Ne.id)})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Select exactly one MCP server for analysis."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx($e,{className:"text-xs",children:"Filter visible tools"}),a.jsxs("div",{className:"relative",children:[a.jsx(pN,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),a.jsx(gt,{className:"h-9 pl-8",placeholder:"Filter tools by name or description...",value:b,onChange:Ne=>y(Ne.target.value)})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Filtering only changes what is shown; selected tools remain selected."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx($e,{className:"text-xs",children:oe?`Tools for ${oe}`:"Tools"}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Ce()},disabled:f||fe||c.length===0,children:[f&&a.jsx(wr,{className:"mr-2 h-4 w-4 animate-spin"}),"Discover Tools"]})]}),a.jsx("div",{className:"space-y-3 rounded-md border p-3",children:c.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"Select a server to discover tools."}):f&&p.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading tools..."}):Me.length===0&&!f?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No discovered tools match the current filters."}):Me.map(Ne=>{const Xe=new Set(g[Ne.serverName]??[]);return a.jsxs("div",{className:"rounded-md border p-3",children:[a.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[a.jsx("div",{className:"font-medium",children:Ne.serverName}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(se,{type:"button",size:"sm",variant:"ghost",onClick:()=>vt(Ne.serverName,Ne.tools.map(Fe=>Fe.name)),children:"Select all"}),a.jsx(se,{type:"button",size:"sm",variant:"ghost",onClick:()=>vt(Ne.serverName,[]),children:"Clear"})]})]}),Ne.warnings.length>0&&a.jsx("div",{className:"mb-2 space-y-1",children:Ne.warnings.map(Fe=>a.jsx("div",{className:"text-xs text-amber-700",children:Sxe(Ne.serverName,Fe)},`${Ne.serverName}-${Fe}`))}),a.jsx("div",{className:"grid gap-2",children:Ne.tools.map(Fe=>{const Ft=O6(Fe.classificationReason),on=Fe.safetyClassification==="read_like"?"read-like":Ft?"write/delete":"unsafe/unknown",Ut=Fe.safetyClassification==="read_like"?"border-emerald-200 bg-emerald-50 text-emerald-700":Ft?"border-amber-300 bg-amber-50 text-amber-800":"border-slate-300 bg-slate-100 text-slate-700";return a.jsxs("label",{className:"flex items-start gap-2 rounded border p-2",children:[a.jsx(Yr,{checked:Xe.has(Fe.name),onCheckedChange:ye=>pt(Ne.serverName,Fe.name,!!ye)}),a.jsxs("div",{className:"min-w-0 space-y-1",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("span",{className:"font-mono text-xs",children:Fe.name}),Fe.title&&a.jsx("span",{className:"text-xs text-muted-foreground",children:Fe.title}),a.jsx(Nxe,{label:on,reason:Fe.classificationReason,variantClassName:Ut}),Fe.inputSchema&&a.jsx(qe,{variant:"outline",className:"border-border text-[10px] text-muted-foreground",children:"schema: input"}),Fe.outputSchema&&a.jsx(qe,{variant:"outline",className:"border-border text-[10px] text-muted-foreground",children:"schema: output"})]}),Fe.description&&a.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:Fe.description})]})]},`${Ne.serverName}-${Fe.name}`)})})]},Ne.serverName)})}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Selected tools: ",L]})]}),a.jsxs("div",{className:"space-y-3 rounded-md border p-3",children:[a.jsx("div",{className:"text-sm font-medium",children:"Analysis Modes"}),a.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[a.jsx(Yr,{checked:S,onCheckedChange:Ne=>C(!!Ne)}),a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Metadata / schema review",a.jsx(u$,{text:"No tool execution. Reviews tool names, descriptions, and schemas only."})]})]}),a.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[a.jsx(Yr,{checked:N,onCheckedChange:Ne=>E(!!Ne)}),a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Deeper analysis",a.jsx(u$,{text:"Runs sample MCP tool calls automatically for read-like tools only (based on the safety allowlist)."})]})]}),a.jsxs("div",{className:"grid gap-3 rounded-md border bg-muted/20 p-3 md:grid-cols-3",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx($e,{className:"text-xs",children:"Max parallel tools"}),a.jsx(gt,{type:"number",min:1,max:8,value:A,onChange:Ne=>P(Math.max(1,Math.min(8,Number(Ne.target.value)||2))),className:"h-8"})]}),N?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx($e,{className:"text-xs",children:"Safety profile"}),a.jsx("div",{className:"text-sm",children:"Read-only allowlist only"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx($e,{className:"text-xs",children:"Sample calls per tool"}),a.jsx(gt,{type:"number",min:1,max:5,value:O,onChange:Ne=>T(Math.max(1,Math.min(5,Number(Ne.target.value)||1))),className:"h-8"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx($e,{className:"text-xs",children:"Tool call timeout (ms)"}),a.jsx(gt,{type:"number",min:1e3,max:6e4,step:500,value:$,onChange:Ne=>z(Math.max(1e3,Math.min(6e4,Number(Ne.target.value)||1e4))),className:"h-8"})]}),a.jsx("div",{className:"md:col-span-3 text-xs text-amber-700",children:"Deeper analysis may execute read-only MCP tools automatically."})]}):a.jsx("div",{className:"md:col-span-2 text-xs text-muted-foreground",children:"Deeper analysis is disabled. Only metadata/schema review will run."})]})]}),a.jsx("div",{className:"flex flex-wrap items-center gap-2",children:a.jsxs(se,{type:"button",onClick:()=>{ve()},disabled:B||fe||!!q,children:[(B||!!q)&&a.jsx(wr,{className:"mr-2 h-4 w-4 animate-spin"}),"Analyze Tools"]})})]})]}),D==="run"&&a.jsxs(Ue,{children:[a.jsx(Pt,{className:"pb-3",children:a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx(kt,{className:"flex items-center gap-2 text-base",children:a.jsx("span",{children:"Progress"})}),a.jsx(Ur,{children:q?"Live tool-analysis job events:":R?"Analysis finished. Review the summary below or open the saved report details.":re==="stopped"?"Analysis was stopped. You can return to Configure Analysis.":re==="error"?"Analysis ended with an error. Review the log and go back to Configure Analysis.":"Analysis finished."})]}),q?a.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Pe()},children:"Stop Analysis"}):a.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:Ge,children:"Back to Configure Analysis"})]})}),a.jsxs(We,{className:"space-y-2",children:[q&&a.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:[a.jsx(wr,{className:"h-3.5 w-3.5 animate-spin"}),"Analysis is still running..."]}),(ee.totalTools>0||q)&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[a.jsx("span",{children:ee.totalTools>0?`${ee.finishedTools}/${ee.totalTools} tools finished`:"Preparing analysis..."}),a.jsx("span",{children:ee.totalTools>0?`${ee.percent}%`:"0%"})]}),a.jsx(Tg,{value:ee.totalTools>0?ee.percent:0,className:"h-2"})]}),H.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:q?"Starting analysis...":"No progress events captured."}):a.jsx("div",{ref:de,className:"max-h-64 space-y-1 overflow-auto rounded border bg-muted/20 p-2",children:H.map((Ne,Xe)=>a.jsxs("div",{className:"text-xs",children:[a.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(Ne.ts).toLocaleTimeString()}),a.jsx(qe,{variant:"outline",className:"mr-2 text-[10px]",children:Ne.type}),a.jsx("span",{className:"break-all",children:typeof Ne.payload.message=="string"?Ne.payload.message:JSON.stringify(Ne.payload)})]},`${Ne.ts}-${Xe}`))}),!q&&R&&a.jsx(Ue,{className:"mt-2 border-green-200 bg-green-50/40 dark:border-green-900/40 dark:bg-green-950/10",children:a.jsxs(We,{className:"pt-4 space-y-3",children:[a.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-semibold",children:"Result overview"}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[R.summary.toolsAnalyzed," tools analyzed, ",R.summary.toolsSkipped," skipped, across"," ",R.summary.serversAnalyzed," server",R.summary.serversAnalyzed!==1?"s":"","."]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[X&&a.jsx(se,{asChild:!0,size:"sm",children:a.jsx(At,{to:`/tool-analysis-results/${X}`,children:"Open result details"})}),a.jsx(se,{asChild:!0,size:"sm",variant:"outline",children:a.jsx(At,{to:"/tool-analysis-results",children:"View all results"})}),a.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>Qt("report"),children:"View inline report"})]})]}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[R.summary.issueCounts.critical>0&&a.jsxs(qe,{className:"bg-red-600 text-white hover:bg-red-600",children:["Critical: ",R.summary.issueCounts.critical]}),R.summary.issueCounts.high>0&&a.jsxs(qe,{className:"bg-orange-500 text-white hover:bg-orange-500",children:["High: ",R.summary.issueCounts.high]}),R.summary.issueCounts.medium>0&&a.jsxs(qe,{className:"bg-amber-500 text-white hover:bg-amber-500",children:["Medium: ",R.summary.issueCounts.medium]}),R.summary.issueCounts.low>0&&a.jsxs(qe,{className:"bg-blue-500 text-white hover:bg-blue-500",children:["Low: ",R.summary.issueCounts.low]}),R.summary.issueCounts.info>0&&a.jsxs(qe,{variant:"outline",children:["Info: ",R.summary.issueCounts.info]}),Object.values(R.summary.issueCounts).every(Ne=>Ne===0)&&a.jsx(qe,{className:"bg-green-600 text-white hover:bg-green-600",children:"No findings"})]})]})})]})]}),D==="report"&&R&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl font-semibold",children:"Report"}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:[R.summary.toolsAnalyzed," tools analyzed across ",R.summary.serversAnalyzed," server",R.summary.serversAnalyzed!==1?"s":"","."]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:Ge,children:"Back to Configure Analysis"}),X&&a.jsxs(a.Fragment,{children:[a.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:a.jsx(At,{to:`/tool-analysis-results/${X}`,children:"Open saved report"})}),a.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:a.jsx(At,{to:"/tool-analysis-results",children:"View all reports"})})]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>c$(`tool-analysis-${Date.now()}.json`,`${JSON.stringify(R,null,2)}
|
|
143
|
+
`,"application/json"),children:[a.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>c$(`tool-analysis-${Date.now()}.md`,o_(R),"text/markdown"),children:[a.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Export Markdown"]})]})]}),a.jsx(T6,{report:R})]})]})};function d$(e,t,n){const r=new Blob([t],{type:n}),s=URL.createObjectURL(r),i=document.createElement("a");i.href=s,i.download=e,i.click(),URL.revokeObjectURL(s)}function _xe(){const{source:e}=Ln(),[t,n]=m.useState([]),[r,s]=m.useState(!0),[i,o]=m.useState(null),[c,d]=m.useState(!1),[f,h]=m.useState("all"),[p,x]=m.useState(!1),g=async()=>{s(!0);try{n(await e.listToolAnalysisResults())}catch(N){_e({title:"Could not load tool analysis results",description:N instanceof Error?N.message:String(N),variant:"destructive"})}finally{s(!1)}};m.useEffect(()=>{g()},[]);const j=m.useMemo(()=>Array.from(new Set(t.flatMap(N=>N.serverNames))).sort((N,E)=>N.localeCompare(E)),[t]),b=m.useMemo(()=>f==="all"?t:t.filter(N=>N.serverNames.includes(f)),[t,f]),y=m.useMemo(()=>t.find(N=>N.reportId===i)??null,[t,i]),S=async()=>{if(i){d(!0);try{await e.deleteToolAnalysisSavedResult(i),n(N=>N.filter(E=>E.reportId!==i)),_e({title:"Tool analysis report deleted"}),o(null)}catch(N){_e({title:"Could not delete report",description:N instanceof Error?N.message:String(N),variant:"destructive"})}finally{d(!1)}}},C=async(N,E)=>{try{const A=await e.getToolAnalysisSavedResult(N);E==="json"?d$(`${N}.json`,`${JSON.stringify(A,null,2)}
|
|
144
|
+
`,"application/json"):d$(`${N}.md`,o_(A.report),"text/markdown")}catch(A){_e({title:"Could not export saved report",description:A instanceof Error?A.message:String(A),variant:"destructive"})}};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[a.jsx(aD,{className:"h-6 w-6"}),"Tool Analysis Results"]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Browse persisted Analyze MCP Tools reports."})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs text-muted-foreground",children:"MCP server"}),a.jsxs(iu,{open:p,onOpenChange:x,children:[a.jsx(ou,{asChild:!0,children:a.jsxs(se,{type:"button",variant:"outline",role:"combobox","aria-expanded":p,className:"h-9 w-[240px] justify-between font-normal",children:[a.jsx("span",{className:"truncate text-left",children:f==="all"?"All servers":f}),a.jsx(Yt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsx(cl,{className:"w-[240px] p-0",align:"start",children:a.jsxs(dl,{children:[a.jsx(fl,{placeholder:"Search MCP servers..."}),a.jsxs(pl,{children:[a.jsx(hl,{children:"No servers found."}),a.jsxs(ml,{children:[a.jsx(ua,{value:"all servers",onSelect:()=>{h("all"),x(!1)},children:"All servers"}),j.map(N=>a.jsx(ua,{value:N,onSelect:()=>{h(N),x(!1)},children:N},N))]})]})]})})]})]}),a.jsx(se,{variant:"outline",onClick:()=>{g()},disabled:r,children:r?"Refreshing...":"Refresh"}),a.jsx(se,{asChild:!0,variant:"outline",children:a.jsx(At,{to:"/tool-analysis",children:"Analyze MCP Tools"})})]})]}),a.jsx(Ue,{children:a.jsx(We,{className:"p-0",children:r?a.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Loading tool analysis results..."}):t.length===0?a.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"No saved tool analysis reports yet."}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"border-b px-4 py-3",children:a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Showing ",a.jsx("span",{className:"font-medium text-foreground",children:b.length})," of"," ",a.jsx("span",{className:"font-medium text-foreground",children:t.length})," reports"]})}),b.length===0?a.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"No reports for the selected MCP server."}):a.jsxs(Wr,{children:[a.jsx(Vr,{children:a.jsxs(Gt,{children:[a.jsx(rt,{children:"Report ID"}),a.jsx(rt,{children:"Evaluated"}),a.jsx(rt,{children:"Timestamp"}),a.jsx(rt,{children:"Issues"}),a.jsx(rt,{children:"Modes"}),a.jsx(rt,{className:"w-10"})]})}),a.jsx(Hr,{children:b.map(N=>a.jsxs(Gt,{children:[a.jsx(ze,{children:a.jsxs("div",{className:"space-y-1",children:[a.jsx(At,{to:`/tool-analysis-results/${N.reportId}`,className:"font-mono text-xs text-primary hover:underline",children:N.reportId}),a.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[N.assistantAgentName," · ",N.assistantAgentModel]})]})}),a.jsx(ze,{className:"text-[11px] text-muted-foreground",children:a.jsxs("div",{className:"space-y-0.5",children:[a.jsxs("div",{children:["Servers: ",a.jsx("span",{className:"font-medium text-foreground",children:N.serverNames.length})," · Tools:"," ",a.jsx("span",{className:"font-medium text-foreground",children:N.summary.toolsAnalyzed})," · ","Skipped: ",a.jsx("span",{className:"font-medium text-foreground",children:N.summary.toolsSkipped})]}),a.jsxs("div",{className:"font-mono text-xs text-foreground/80",children:[N.serverNames.slice(0,2).join(", "),N.serverNames.length>2?` +${N.serverNames.length-2}`:""]})]})}),a.jsx(ze,{className:"text-xs text-muted-foreground",children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(hi,{className:"h-3 w-3"}),new Date(N.createdAt).toLocaleString()]})}),a.jsx(ze,{children:a.jsxs("div",{className:"flex flex-wrap gap-1",children:[["critical","high","medium","low","info"].map(E=>N.summary.issueCounts[E]>0?a.jsxs(qe,{variant:"outline",className:"capitalize",children:[E,": ",N.summary.issueCounts[E]]},`${N.reportId}-${E}`):null),Object.values(N.summary.issueCounts).every(E=>E===0)&&a.jsx(qe,{variant:"outline",children:"No issues"})]})}),a.jsx(ze,{children:a.jsxs("div",{className:"flex flex-wrap gap-1",children:[N.modes.metadataReview&&a.jsx(qe,{variant:"outline",children:"metadata"}),N.modes.deeperAnalysis&&a.jsx(qe,{variant:"outline",children:"deeper"})]})}),a.jsx(ze,{children:a.jsxs(Gf,{children:[a.jsx(Yf,{asChild:!0,children:a.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:a.jsx(av,{className:"h-4 w-4"})})}),a.jsxs(Nu,{align:"end",children:[a.jsx(Gr,{asChild:!0,children:a.jsx(At,{to:`/tool-analysis-results/${N.reportId}`,children:"View"})}),a.jsxs(Gr,{onSelect:()=>{C(N.reportId,"json")},children:[a.jsx(Ea,{className:"mr-2 h-3.5 w-3.5"})," Export JSON"]}),a.jsxs(Gr,{onSelect:()=>{C(N.reportId,"markdown")},children:[a.jsx(Ea,{className:"mr-2 h-3.5 w-3.5"})," Export Markdown"]}),a.jsxs(Gr,{className:"text-destructive",onSelect:E=>{E.preventDefault(),o(N.reportId)},children:[a.jsx(Ta,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},N.reportId))})]})]})})}),a.jsx(Ls,{open:!!i,onOpenChange:N=>!N&&o(null),children:a.jsxs(ss,{children:[a.jsxs(is,{children:[a.jsx(ls,{children:"Delete tool analysis report?"}),a.jsx(cs,{children:y?`Delete saved report '${y.reportId}' from disk? This cannot be undone.`:"Delete this saved report from disk? This cannot be undone."})]}),a.jsxs(os,{children:[a.jsx(ds,{disabled:c,children:"Cancel"}),a.jsx(us,{onClick:N=>{N.preventDefault(),S()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}function f$(e,t,n){const r=new Blob([t],{type:n}),s=URL.createObjectURL(r),i=document.createElement("a");i.href=s,i.download=e,i.click(),URL.revokeObjectURL(s)}function Axe(){const{id:e=""}=yl(),t=Ia(),{source:n}=Ln(),[r,s]=m.useState(null),[i,o]=m.useState(!0),[c,d]=m.useState(!1),[f,h]=m.useState(!1),[p,x]=m.useState(!1);m.useEffect(()=>{let j=!0;return o(!0),d(!1),n.getToolAnalysisSavedResult(e).then(b=>{j&&s(b)}).catch(b=>{if(!j)return;const y=b instanceof Error?b.message:String(b);if(y.includes("(404)")){d(!0),s(null);return}_e({title:"Could not load saved tool analysis report",description:y,variant:"destructive"})}).finally(()=>{j&&o(!1)}),()=>{j=!1}},[e,n]);const g=async()=>{x(!0);try{await n.deleteToolAnalysisSavedResult(e),_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{x(!1),h(!1)}};return i?a.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading saved tool analysis report..."}):c||!r?a.jsxs("div",{className:"space-y-4",children:[a.jsx("h1",{className:"text-2xl font-bold",children:"Tool Analysis Result"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Saved report not found."}),a.jsx(se,{asChild:!0,variant:"outline",children:a.jsx(At,{to:"/tool-analysis-results",children:"Back to Tool Analysis Results"})})]}):a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"font-mono text-xl font-semibold",children:r.reportId}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[a.jsxs("span",{className:"inline-flex items-center gap-1 align-middle",children:[a.jsx(hi,{className:"h-3 w-3 shrink-0"}),new Date(r.createdAt).toLocaleString()]})," ","· ",r.serverNames.join(", ")||"—"]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.report.mcpServerVersions&&Object.keys(r.report.mcpServerVersions).length>0&&a.jsxs("span",{className:"inline-flex items-center align-middle rounded-sm border border-border/60 bg-muted/30 px-1.5 py-1 text-[11px] leading-none text-muted-foreground",children:[a.jsx("span",{className:"font-medium",children:"MCP:"}),a.jsx("span",{className:"ml-1 font-mono",children:Object.entries(r.report.mcpServerVersions).map(([j,b])=>`${j}: ${b??"unknown"}`).join(", ")})]}),a.jsx(se,{asChild:!0,size:"sm",variant:"outline",children:a.jsx(At,{to:"/tool-analysis-results",children:"Back to results"})}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>f$(`${r.reportId}.json`,`${JSON.stringify(r,null,2)}
|
|
145
|
+
`,"application/json"),children:[a.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>f$(`${r.reportId}.md`,o_(r.report),"text/markdown"),children:[a.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>h(!0),children:[a.jsx(Ta,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]}),a.jsx(T6,{report:r.report}),a.jsx(Ls,{open:f,onOpenChange:h,children:a.jsxs(ss,{children:[a.jsxs(is,{children:[a.jsx(ls,{children:"Delete tool analysis report?"}),a.jsxs(cs,{children:["Delete saved report '",r.reportId,"' from disk? This cannot be undone."]})]}),a.jsxs(os,{children:[a.jsx(ds,{disabled:p,children:"Cancel"}),a.jsx(us,{onClick:j=>{j.preventDefault(),g()},disabled:p,children:p?"Deleting...":"Delete"})]})]})})]})}const Exe=[{id:"configure",label:"Configure Debug Session"},{id:"run",label:"Run / Inspect Flow"},{id:"report",label:"Report / Export"}];function Nr({text:e}){return a.jsx(ro,{delayDuration:200,children:a.jsxs(ao,{children:[a.jsx(so,{type:"button",className:"inline-flex shrink-0 items-center",onClick:t=>t.preventDefault(),children:a.jsx(I7,{className:"h-3.5 w-3.5 text-muted-foreground/50 hover:text-muted-foreground"})}),a.jsx(ui,{className:"max-w-xs text-xs leading-relaxed",children:e})]})})}function p$(e){return navigator.clipboard.writeText(e)}function Hj(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}function Pxe(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 s=typeof r.payload.message=="string"?r.payload.message:JSON.stringify(r.payload);n.push(`- ${new Date(r.ts).toLocaleTimeString()} [${r.type}] ${s}`)}return`${n.join(`
|
|
146
|
+
`)}
|
|
147
|
+
`}function kxe(){const{source:e}=Ln(),{servers:t,reload:n,loading:r}=rs(),[s,i]=m.useState("configure"),[o,c]=m.useState(""),[d,f]=m.useState("pre_registered"),[h,p]=m.useState("local_callback"),[x,g]=m.useState(!0),[j,b]=m.useState(!0),[y,S]=m.useState(!0),[C,N]=m.useState(""),[E,A]=m.useState(""),[P,O]=m.useState(""),[T,$]=m.useState(""),[z,q]=m.useState("__default__"),[F,H]=m.useState("{}"),[U,R]=m.useState(""),[W,X]=m.useState(""),[G,B]=m.useState(""),[J,D]=m.useState(""),[I,re]=m.useState(""),[ne,fe]=m.useState(""),[he,V]=m.useState(""),[de,Q]=m.useState(""),[ee,pe]=m.useState(null),[ae,Re]=m.useState(null),[Ce,Me]=m.useState([]),[L,oe]=m.useState(!1),[ve,Pe]=m.useState(!1),[Ge,lt]=m.useState(!1),[pt,vt]=m.useState("all"),[zt,qt]=m.useState("all"),[Wt,Qt]=m.useState("inspector"),Ne=m.useRef(null),Xe=m.useRef(null),Fe=m.useRef(!1),Ft=m.useRef(j);m.useEffect(()=>{Ft.current=j},[j]),m.useEffect(()=>()=>{Ne.current?.(),Ne.current=null},[]),m.useEffect(()=>{Xe.current?.scrollIntoView({behavior:"smooth",block:"end"})},[Ce.length]);const on=m.useMemo(()=>t.filter(le=>le.authType==="oauth2").slice().sort((le,at)=>(le.name||le.id).localeCompare(at.name||at.id,void 0,{sensitivity:"base"})),[t]),Ut=on.find(le=>le.id===o);m.useEffect(()=>{o&&(on.some(le=>le.id===o)||c(""))},[on,o]),m.useEffect(()=>{Ut&&(Ut.oauthMode==="dcr"?(f("dcr"),O(""),$("")):(f("pre_registered"),O(Ut.oauthClientId??""),$(Ut.oauthClientSecret??"")),N(Ut.oauthScope??""),D(Ut.oauthAuthorizationUrl??""),re(Ut.oauthTokenEndpoint??""))},[Ut?.id]);const ye=m.useMemo(()=>{const le=ee?.stepStates.length??0,at=ee?.stepStates.filter(bt=>bt.status==="completed"||bt.status==="skipped").length??0,Ct=ee?.stepStates.filter(bt=>bt.status==="failed").length??0,an=le>0?Math.round((at+Ct)/le*100):0;return{total:le,completed:at,failed:Ct,percent:an}},[ee]),Ve=m.useMemo(()=>{const le=ee?.network??[],at=new Map,Ct=[],an=bt=>`${bt.stepId}::${bt.label}::${bt.url}`;for(const bt of le){if(bt.phase==="request"){const ji=Ct.length;Ct.push({key:bt.id,stepId:bt.stepId,label:bt.label,method:bt.method,url:bt.url,request:bt});const Fs=an(bt),Si=at.get(Fs)??[];Si.push(ji),at.set(Fs,Si);continue}const kn=an(bt),Fn=at.get(kn),Tr=Fn?.shift();if(typeof Tr=="number"){Ct[Tr]={...Ct[Tr],response:bt},Fn&&Fn.length>0?at.set(kn,Fn):at.delete(kn);continue}Ct.push({key:bt.id,stepId:bt.stepId,label:bt.label,method:bt.method,url:bt.url,response:bt})}return Ct.filter(bt=>pt!=="all"&&bt.stepId!==pt?!1:zt==="error"?typeof bt.response?.status=="number"&&bt.response.status>=400:zt==="ok"?typeof bt.response?.status=="number"&&bt.response.status<400:!0)},[ee?.network,pt,zt]),Be=!!ae,xt=!!(ee&&(ee.status==="completed"||ee.status==="error"||ee.status==="stopped")),Ee=m.useMemo(()=>{const le=new Map;return(ee?.stepStates??[]).forEach((at,Ct)=>{le.set(at.id,Ct+1)}),le},[ee?.stepStates]),ue=le=>{if(le==="configure"||le==="run"&&Be||le==="report"&&xt)return i(le)},Ze=()=>{let le;if(d==="dcr"&&F.trim())try{le=JSON.parse(F)}catch{throw new Error("DCR metadata JSON is invalid")}if(!Ut)throw new Error("Select an MCP server");return{profile:"latest",target:{serverName:Ut.id,overrides:{authorizationServerMetadataUrl:G||void 0,authorizationEndpoint:J||void 0,tokenEndpoint:I||void 0,registrationEndpoint:ne||void 0,cimdUrl:U||void 0,resourceBaseUrl:he||void 0}},registrationMethod:d,clientConfig:{preRegistered:d==="pre_registered"?{clientId:P.trim(),clientSecret:T.trim()||void 0,tokenEndpointAuthMethod:z==="__default__"?void 0:z||void 0}:void 0,dcr:d==="dcr"?{metadata:le,tokenEndpointAuthMethod:z==="__default__"?void 0:z||void 0}:void 0,cimd:d==="cimd"?{cimdUrl:U||void 0,expectedClientId:W||void 0}:void 0},runtime:{redirectMode:h,scopes:C.split(/[,\s]+/).map(at=>at.trim()).filter(Boolean),resource:E.trim()||void 0,usePkce:y,codeChallengeMethod:"S256"},display:{showSensitiveValues:x}}},ht=le=>{Ne.current?.(),Ne.current=e.subscribeOAuthDebuggerSession(le,at=>{Me(an=>[...an,at]),(at.type==="completed"||at.type==="error"||at.type==="stopped")&&oe(!1),e.getOAuthDebuggerSession(le).then(an=>{pe(an.session),an.session.uiHints.authorizationUrl&&Ot(`${Hj()}/api/oauth-debugger/sessions/${le}/authorize`),an.session.status==="completed"&&i("report")}).catch(()=>{})})},Ot=le=>{!Ft.current||Fe.current||!le||(Fe.current=!0,window.open(le,"_blank","noopener,noreferrer"))},Jt=async()=>{Pe(!0),Fe.current=!1;try{const le=Ze(),at=await e.createOAuthDebuggerSession(le);Re(at.sessionId),pe(at.session),Me([]),i("run"),ht(at.sessionId);const Ct=await e.startOAuthDebuggerSession(at.sessionId);pe(Ct.session),oe(!0),(Ct.session.status==="waiting_for_user"||Ct.session.status==="waiting_for_browser_callback")&&(oe(!1),Ct.session.uiHints.authorizationUrl&&Ot(`${Hj()}/api/oauth-debugger/sessions/${at.sessionId}/authorize`))}catch(le){_e({title:"Could not start OAuth Debugger session",description:le instanceof Error?le.message:String(le),variant:"destructive"})}finally{Pe(!1)}},Pn=async()=>{if(ae)try{Pe(!0);const le=await e.submitOAuthDebuggerManualCallback(ae,{redirectUrl:de.trim()||void 0});pe(le.session),Q(""),oe(!0)}catch(le){_e({title:"Could not submit callback",description:le instanceof Error?le.message:String(le),variant:"destructive"})}finally{Pe(!1)}},mt=async()=>{if(ae){lt(!0);try{const le=await e.stopOAuthDebuggerSession(ae);if(oe(!1),le.status!=="running"){const at=await e.getOAuthDebuggerSession(ae);pe(at.session),at.session.status==="completed"?i("report"):i("run")}}catch(le){_e({title:"Could not stop session",description:le instanceof Error?le.message:String(le),variant:"destructive"})}finally{lt(!1)}}},It=async()=>{Ne.current?.(),Ne.current=null,pe(null),Re(null),Me([]),oe(!1),lt(!1),Pe(!1),Q(""),vt("all"),qt("all"),Qt("inspector"),i("run"),await Jt()},Lt=async le=>{if(!(!ae||!ee))try{const at=await e.exportOAuthDebuggerSession(ae,le);let Ct="";const an=le==="json"?"json":le==="raw"?"txt":"md";typeof at=="string"?Ct=at:Ct=`${JSON.stringify(at,null,2)}
|
|
148
|
+
`;const bt=new Blob([Ct],{type:"text/plain;charset=utf-8"}),kn=URL.createObjectURL(bt),Fn=document.createElement("a");Fn.href=kn,Fn.download=`oauth-debugger-${ae}.${an}`,Fn.click(),URL.revokeObjectURL(kn)}catch(at){if(le==="markdown"){const Ct=Pxe(ee,Ce),an=new Blob([Ct],{type:"text/markdown;charset=utf-8"}),bt=URL.createObjectURL(an),kn=document.createElement("a");kn.href=bt,kn.download=`oauth-debugger-${ee.id}.md`,kn.click(),URL.revokeObjectURL(bt);return}_e({title:"Export failed",description:at instanceof Error?at.message:String(at),variant:"destructive"})}},Kt=ae?`${Hj()}/api/oauth-debugger/sessions/${ae}/authorize`:void 0,qn=le=>le==="error"?"destructive":le==="warning"?"outline":"secondary";return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold",children:"OAuth Debugger"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Step-by-step OAuth flow debugging for MCP servers (latest MCP authorization draft profile)."})]}),a.jsx("div",{className:"flex flex-wrap items-center gap-2",children:Exe.map(le=>{const at=s===le.id,Ct=le.id==="configure"||le.id==="run"&&Be||le.id==="report"&&xt;return a.jsx("button",{type:"button",onClick:()=>Ct&&ue(le.id),disabled:!Ct,className:"rounded-full",children:a.jsx(qe,{variant:at?"default":"outline",className:Ct?"":"opacity-50",children:le.label})},le.id)})})]}),s==="configure"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs(Ue,{children:[a.jsx(Pt,{className:"pb-3",children:a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx(kt,{className:"text-base",children:"Target MCP Server"}),a.jsx(Ur,{children:"Select one MCP server from Libraries and optionally override endpoints."})]}),a.jsxs(se,{type:"button",variant:"outline",size:"sm",onClick:()=>{n()},disabled:r,children:[a.jsx(ma,{className:`mr-2 h-4 w-4 ${r?"animate-spin":""}`}),"Refresh Servers"]})]})}),a.jsx(We,{className:"space-y-3",children:a.jsxs("div",{className:"max-w-xl space-y-2",children:[a.jsx($e,{children:"MCP Server"}),a.jsxs(jn,{value:o,onValueChange:c,children:[a.jsx(mn,{children:a.jsx(Sn,{placeholder:"Select an MCP server"})}),a.jsx(vn,{children:on.map(le=>a.jsx(et,{value:le.id,children:le.name||le.id},le.id))})]}),on.length===0&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["No MCP servers with OAuth configured found. Add OAuth 2.0 auth in"," ",a.jsx("a",{href:"/libraries/servers",className:"underline text-primary",children:"Manage Servers"}),"."]}),Ut&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:[Ut.transport," · ",Ut.url||Ut.command||"No URL/command"," · ",a.jsxs("span",{className:"text-primary",children:[Ut.oauthMode==="dcr"?"DCR":"pre-registered"," fields pre-filled"]})]})]})})]}),a.jsxs(Ue,{children:[a.jsxs(Pt,{className:"pb-3",children:[a.jsx(kt,{className:"text-base",children:"Client Registration Method"}),a.jsx(Ur,{children:"How your OAuth client is identified with the authorization server."})]}),a.jsxs(We,{className:"space-y-3",children:[a.jsx("div",{className:"grid gap-2 md:grid-cols-3",children:[{id:"pre_registered",label:"Pre-registered client",hint:"You already have a client_id issued by the authorization server."},{id:"dcr",label:"Dynamic Client Registration",hint:"The server issues a client_id automatically at the start of the flow (RFC 7591)."},{id:"cimd",label:"Client ID Metadata Document",hint:"The client identifies itself via a hosted JSON metadata document at a public URL (RFC 9728)."}].map(le=>a.jsxs("button",{type:"button",onClick:()=>f(le.id),className:"rounded-md border p-3 text-left",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:`h-2.5 w-2.5 shrink-0 rounded-full ${d===le.id?"bg-primary":"bg-muted-foreground/30"}`}),a.jsx("span",{className:"text-sm font-medium",children:le.label})]}),a.jsx("p",{className:"mt-1 pl-5 text-xs text-muted-foreground",children:le.hint})]},le.id))}),a.jsx("div",{className:"grid gap-3 md:grid-cols-1",children:a.jsxs("div",{className:"max-w-md space-y-1",children:[a.jsxs($e,{className:"text-xs flex items-center gap-1",children:["Redirect mode",a.jsx(Nr,{text:"Local callback (recommended): MCP Lab automatically captures the redirect after you log in — no copy-pasting needed. Manual: you complete the browser login and then paste the final redirect URL back here."})]}),a.jsxs(jn,{value:h,onValueChange:le=>p(le),children:[a.jsx(mn,{children:a.jsx(Sn,{})}),a.jsxs(vn,{children:[a.jsx(et,{value:"local_callback",children:"Local callback (recommended)"}),a.jsx(et,{value:"manual",children:"Manual paste redirect URL"})]})]})]})}),d==="pre_registered"&&a.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsxs($e,{className:"text-xs flex items-center gap-1",children:["client_id",a.jsx(Nr,{text:"The unique identifier for your application, issued by the authorization server when you registered the client."})]}),a.jsx(gt,{value:P,onChange:le=>O(le.target.value)})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs($e,{className:"text-xs flex items-center gap-1",children:["client_secret",a.jsx(Nr,{text:"Leave empty for public clients (e.g. SPAs or mobile apps). Required for confidential clients that authenticate with the token endpoint."})]}),a.jsx(gt,{value:T,onChange:le=>$(le.target.value),type:"password",placeholder:"optional"})]})]}),d==="cimd"&&a.jsxs("div",{className:"space-y-1",children:[a.jsxs($e,{className:"text-xs flex items-center gap-1",children:["CIMD URL",a.jsx(Nr,{text:"A publicly reachable URL hosting a JSON document that describes this client. The authorization server fetches it to identify the client."})]}),a.jsx(gt,{value:U,onChange:le=>R(le.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),a.jsxs(Ue,{children:[a.jsxs(Pt,{className:"pb-3",children:[a.jsx(kt,{className:"text-base",children:"Runtime OAuth Inputs"}),a.jsx(Ur,{children:"Parameters sent in the authorization request."})]}),a.jsxs(We,{className:"grid gap-3 md:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx($e,{className:"text-xs",children:"Scopes"}),a.jsx(gt,{value:C,onChange:le=>N(le.target.value),placeholder:"openid profile email"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Space or comma separated. Leave empty to use scopes auto-discovered from the server metadata."})]}),a.jsxs("div",{className:"flex items-center gap-2 md:col-span-2",children:[a.jsx(Yr,{checked:y,onCheckedChange:le=>S(!!le)}),a.jsxs($e,{className:"flex items-center gap-1",children:["Use PKCE (S256)",a.jsx(Nr,{text:"Proof Key for Code Exchange — generates a one-time code verifier so the authorization code can't be hijacked. Recommended for all clients; required for public clients."})]})]}),a.jsxs("div",{className:"flex items-center gap-2 md:col-span-2",children:[a.jsx(Yr,{checked:j,onCheckedChange:le=>b(!!le)}),a.jsx($e,{children:"Auto-open browser when authorization URL is ready"})]})]})]}),a.jsxs("details",{className:"rounded-md border bg-card p-3 shadow-sm",children:[a.jsx("summary",{className:"cursor-pointer text-sm font-medium",children:"Advanced"}),a.jsxs("div",{className:"mt-3 space-y-4",children:[a.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsxs($e,{className:"text-xs flex items-center gap-1",children:["Token endpoint auth method",a.jsx(Nr,{text:"How your client authenticates when exchanging the authorization code for a token. Choose 'none' for public clients (no secret). Leave as server default if unsure."})]}),a.jsxs(jn,{value:z,onValueChange:q,children:[a.jsx(mn,{children:a.jsx(Sn,{placeholder:"Server default (recommended)"})}),a.jsxs(vn,{children:[a.jsx(et,{value:"__default__",children:"Server default (let the server decide)"}),a.jsx(et,{value:"client_secret_basic",children:"client_secret_basic — credentials in Authorization header"}),a.jsx(et,{value:"client_secret_post",children:"client_secret_post — credentials in request body"}),a.jsx(et,{value:"none",children:"none — public client, no secret"}),a.jsx(et,{value:"private_key_jwt",children:"private_key_jwt — signed JWT assertion"})]})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:'Use "server default" unless the server requires a specific method.'})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs($e,{className:"text-xs flex items-center gap-1",children:["Resource / audience",a.jsx(Nr,{text:"Some servers (RFC 8707) require the target API's URI in the token request to scope the token. Only set this if your server explicitly requires it."})]}),a.jsx(gt,{value:E,onChange:le=>A(le.target.value),placeholder:"https://api.example.com"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional. Only needed for servers that use resource indicators."})]})]}),d==="dcr"&&a.jsxs("div",{className:"space-y-1",children:[a.jsxs($e,{className:"text-xs flex items-center gap-1",children:["DCR metadata JSON",a.jsx(Nr,{text:'Extra fields for the dynamic client registration request (RFC 7591), e.g. {"client_name": "My App"}. redirect_uris and grant_types are always added automatically.'})]}),a.jsx(Os,{value:F,onChange:le=>H(le.target.value),className:"min-h-32 font-mono text-xs"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional extra fields for the registration request body."})]}),d==="cimd"&&a.jsxs("div",{className:"space-y-1",children:[a.jsxs($e,{className:"text-xs flex items-center gap-1",children:["Expected client_id",a.jsx(Nr,{text:"If you know what client_id the server should assign from the metadata document, enter it here for verification. Leave blank to accept whatever the server returns."})]}),a.jsx(gt,{value:W,onChange:le=>X(le.target.value),placeholder:"optional"})]}),a.jsxs("div",{className:"rounded-md border bg-background p-3",children:[a.jsx("div",{className:"mb-1 text-sm font-medium",children:"Endpoint overrides"}),a.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:"Override specific endpoints if auto-discovery fails or you want to test against a specific URL. Leave blank to use what the server advertises."}),a.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsxs($e,{className:"text-xs flex items-center gap-1",children:["Authorization server metadata URL",a.jsx(Nr,{text:"The /.well-known/oauth-authorization-server URL. Override if the server uses a non-standard path."})]}),a.jsx(gt,{value:G,onChange:le=>B(le.target.value),placeholder:"https://.../.well-known/oauth-authorization-server"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs($e,{className:"text-xs flex items-center gap-1",children:["Resource server base URL",a.jsx(Nr,{text:"The MCP server's base URL used to look up its /.well-known/oauth-protected-resource metadata. Override if the server uses a different base path."})]}),a.jsx(gt,{value:he,onChange:le=>V(le.target.value),placeholder:"https://resource.example.com"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs($e,{className:"text-xs flex items-center gap-1",children:["Authorization endpoint",a.jsx(Nr,{text:"The URL where users are redirected to log in and grant consent. Normally discovered automatically from the server metadata."})]}),a.jsx(gt,{value:J,onChange:le=>D(le.target.value),placeholder:"https://.../authorize"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs($e,{className:"text-xs flex items-center gap-1",children:["Token endpoint",a.jsx(Nr,{text:"The URL your app calls to exchange the authorization code for an access token. Normally discovered automatically."})]}),a.jsx(gt,{value:I,onChange:le=>re(le.target.value),placeholder:"https://.../token"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs($e,{className:"text-xs flex items-center gap-1",children:["Registration endpoint (DCR)",a.jsx(Nr,{text:"The URL used to dynamically register a new client (RFC 7591). Only relevant when using DCR. Override if the server doesn't advertise it in its metadata."})]}),a.jsx(gt,{value:ne,onChange:le=>fe(le.target.value),placeholder:"https://.../register"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs($e,{className:"text-xs flex items-center gap-1",children:["CIMD URL override",a.jsx(Nr,{text:"Override the Client ID Metadata Document URL. Use this if the server doesn't discover it automatically or you want to test with a specific metadata document."})]}),a.jsx(gt,{value:U,onChange:le=>R(le.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),a.jsxs(Yo,{children:[a.jsx(wy,{className:"h-4 w-4"}),a.jsx(Xo,{children:"Secrets display"}),a.jsxs(Qo,{className:"space-y-2",children:[a.jsx("p",{children:"By default, full tokens and secrets are visible in the network inspector and exports — useful for debugging but not for sharing."}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Yr,{checked:!x,onCheckedChange:le=>g(le===!1)}),a.jsx($e,{children:"Hide sensitive values in inspector"})]})]})]})]})]}),a.jsx("div",{className:"flex justify-end",children:a.jsxs(se,{type:"button",onClick:()=>{Jt()},disabled:ve,children:[ve&&a.jsx(wr,{className:"mr-2 h-4 w-4 animate-spin"}),"Start OAuth Debug Session"]})})]}),s==="run"&&a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{className:"grid gap-4 xl:grid-cols-[1.2fr_1fr]",children:[a.jsxs(Ue,{className:"xl:col-span-1 min-w-0",children:[a.jsx(Pt,{className:"pb-3",children:a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx(kt,{className:"text-base",children:"Progress"}),a.jsx(Ur,{children:"Visual OAuth flow guide with live session events and next-step actions."})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[ee?.uiHints.authorizationUrl&&Kt&&a.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:a.jsxs("a",{href:Kt,target:"_blank",rel:"noopener noreferrer",children:[a.jsx($h,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{It()},disabled:ve,children:[a.jsx(ma,{className:"mr-2 h-4 w-4"}),"Restart"]}),ae&&a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{mt()},disabled:Ge||!ae,children:[(Ge||L)&&Ge&&a.jsx(wr,{className:"mr-2 h-4 w-4 animate-spin"}),a.jsx(Ph,{className:"mr-2 h-4 w-4"}),"Stop Debug Session"]})]})]})}),a.jsxs(We,{className:"space-y-3",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[a.jsxs("span",{children:[ye.completed+ye.failed,"/",ye.total," steps"]}),a.jsxs("span",{children:[ye.percent,"%"]})]}),a.jsx(Tg,{value:ye.percent,className:"h-2"})]}),ee?.status==="waiting_for_user"&&a.jsx(Ue,{children:a.jsxs(We,{className:"pt-4 space-y-2",children:[a.jsx("div",{className:"text-sm font-medium",children:"Manual callback required"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Open the authorization URL, complete authentication, then paste the final redirect URL here."}),a.jsx(Os,{value:de,onChange:le=>Q(le.target.value),placeholder:"Paste the final redirect URL (with code and state)",className:"min-h-24 text-xs font-mono"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(se,{type:"button",size:"sm",onClick:()=>{Pn()},disabled:ve||!de.trim(),children:[ve&&a.jsx(wr,{className:"mr-2 h-4 w-4 animate-spin"}),"Continue"]}),ee.uiHints.authorizationUrl&&Kt&&a.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:a.jsx("a",{href:Kt,target:"_blank",rel:"noopener noreferrer",children:"Open Authorization URL"})})]})]})}),ee?.status==="waiting_for_browser_callback"&&a.jsxs(Yo,{children:[a.jsx(wy,{className:"h-4 w-4"}),a.jsx(Xo,{children:"Waiting for browser callback"}),a.jsxs(Qo,{className:"space-y-1",children:[a.jsx("p",{className:"text-xs",children:"Complete the authorization flow in your browser. MCP Lab is listening for the callback at:"}),a.jsx("p",{className:"text-xs font-mono break-all",children:ee.uiHints.callbackUrl}),ee.uiHints.authorizationUrl&&Kt&&a.jsx("div",{className:"pt-2",children:a.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:a.jsxs("a",{href:Kt,target:"_blank",rel:"noopener noreferrer",children:[a.jsx($h,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})})})]})]}),a.jsx("div",{className:"space-y-2",children:ee?.stepStates.map(le=>{const at=Ee.get(le.id);return a.jsxs("div",{className:"rounded-md border p-3",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"min-w-0 flex items-start gap-2",children:[a.jsx("div",{className:"mt-0.5 inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full border bg-muted text-xs font-semibold",children:at}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-sm font-medium",children:le.title}),a.jsx("div",{className:"text-xs text-muted-foreground",children:le.description})]})]}),a.jsx(qe,{variant:le.status==="failed"?"destructive":le.status==="completed"?"outline":le.status==="active"?"secondary":"outline",className:le.status==="completed"?"border-emerald-300 bg-emerald-50 text-emerald-700":void 0,children:le.status})]}),le.outcomeSummary&&a.jsx("p",{className:"mt-2 text-xs text-muted-foreground break-all",children:le.outcomeSummary})]},le.id)})||a.jsx("p",{className:"text-sm text-muted-foreground",children:"No steps yet."})})]})]}),a.jsx("div",{className:"space-y-4 xl:col-span-1 min-w-0",children:a.jsxs(Ue,{children:[a.jsx(Pt,{className:"pb-3",children:a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx(kt,{className:"text-base",children:"Inspect"}),a.jsx(Ur,{children:"Live events and network requests/responses for the OAuth flow."})]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Lt("raw")},disabled:!ae||!ee,children:[a.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Copy/Export Raw Trace"]})]})}),a.jsx(We,{className:"space-y-3",children:a.jsxs(Sg,{value:Wt,onValueChange:le=>Qt(le),className:"min-w-0",children:[a.jsxs(Xf,{className:"grid grid-cols-2",children:[a.jsx(Cs,{value:"inspector",children:"Network Inspector"}),a.jsx(Cs,{value:"events",children:"Live Debug"})]}),a.jsx(Nf,{value:"events",className:"mt-3",children:a.jsxs("div",{className:"max-h-64 space-y-1 overflow-auto rounded-md border bg-muted/10 p-3 text-xs",children:[Ce.length===0?a.jsx("p",{className:"text-muted-foreground",children:"No events yet."}):Ce.map((le,at)=>a.jsxs("div",{className:"break-all",children:[a.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(le.ts).toLocaleTimeString()}),a.jsx(qe,{variant:"outline",className:"mr-2 text-[10px]",children:le.type}),typeof le.payload.message=="string"?le.payload.message:JSON.stringify(le.payload)]},`${le.ts}-${at}`)),a.jsx("div",{ref:Xe})]})}),a.jsxs(Nf,{value:"inspector",className:"space-y-3 mt-3",children:[a.jsxs("div",{className:"grid gap-2 md:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx($e,{className:"text-xs",children:"Filter by step"}),a.jsxs(jn,{value:pt,onValueChange:vt,children:[a.jsx(mn,{className:"h-8",children:a.jsx(Sn,{})}),a.jsxs(vn,{children:[a.jsx(et,{value:"all",children:"All steps"}),(ee?.stepStates??[]).map(le=>a.jsxs(et,{value:le.id,children:[Ee.get(le.id),". ",le.title]},le.id))]})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx($e,{className:"text-xs",children:"Filter by status"}),a.jsxs(jn,{value:zt,onValueChange:qt,children:[a.jsx(mn,{className:"h-8",children:a.jsx(Sn,{})}),a.jsxs(vn,{children:[a.jsx(et,{value:"all",children:"All"}),a.jsx(et,{value:"ok",children:"Successful responses"}),a.jsx(et,{value:"error",children:"Error responses"})]})]})]})]}),a.jsx("div",{className:"max-h-[34rem] min-w-0 space-y-2 overflow-auto",children:Ve.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No network exchanges captured yet."}):Ve.map(le=>a.jsxs("details",{className:"rounded-md border p-3",children:[a.jsx("summary",{className:"cursor-pointer list-none",children:a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"min-w-0 flex items-start gap-2",children:[a.jsx("div",{className:"mt-0.5 inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full border bg-muted text-xs font-semibold",children:Ee.get(le.stepId)}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-sm font-medium",children:le.label}),a.jsxs("div",{className:"text-xs text-muted-foreground break-all",children:[le.method?`${le.method} `:"",le.url]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(qe,{variant:"outline",children:"request"}),a.jsx(qe,{variant:"outline",children:"response"}),typeof le.response?.status=="number"&&a.jsx(qe,{variant:le.response.status>=400?"destructive":"secondary",children:le.response.status})]})]})}),a.jsxs("div",{className:"mt-3 space-y-3",children:[a.jsxs("div",{children:[a.jsx("div",{className:"mb-1 text-xs font-medium",children:"Request Headers"}),a.jsx("pre",{className:"max-h-40 max-w-full overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2 text-xs",children:JSON.stringify(le.request?.headers??{},null,2)})]}),le.request?.bodyText&&a.jsxs("div",{children:[a.jsx("div",{className:"mb-1 text-xs font-medium",children:"Request Body"}),a.jsx("pre",{className:"max-h-64 max-w-full overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2 text-xs",children:le.request.bodyText})]}),a.jsxs("div",{children:[a.jsx("div",{className:"mb-1 text-xs font-medium",children:"Response Headers"}),a.jsx("pre",{className:"max-h-40 max-w-full overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2 text-xs",children:JSON.stringify(le.response?.headers??{},null,2)})]}),le.response?.bodyText&&a.jsxs("div",{children:[a.jsx("div",{className:"mb-1 text-xs font-medium",children:"Response Body"}),a.jsx("pre",{className:"max-h-64 max-w-full overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2 text-xs",children:le.response.bodyText})]}),a.jsx("div",{className:"flex gap-2",children:a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{p$(JSON.stringify(le,null,2))},children:[a.jsx(_s,{className:"mr-2 h-4 w-4"}),"Copy JSON"]})})]})]},le.key))})]})]})})]})})]})}),s==="report"&&ee&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl font-semibold",children:"Report / Export"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"OAuth debug session summary, validations, and trace exports."})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>i("configure"),children:"Back to Configure"}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Lt("json")},children:[a.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Lt("markdown")},children:[a.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Lt("raw")},children:[a.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Copy/Export Raw Trace"]})]})]}),a.jsxs(Yo,{children:[a.jsx(wy,{className:"h-4 w-4"}),a.jsx(Xo,{children:"Secrets display mode"}),a.jsx(Qo,{children:ee.summary?.showSensitiveValues?"This session is configured to show full tokens and secrets in network logs/exports.":"Sensitive values are hidden in the inspector for this session."})]}),a.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[a.jsx(Ue,{children:a.jsxs(We,{className:"pt-4",children:[a.jsx("div",{className:"text-xs text-muted-foreground",children:"Status"}),a.jsx("div",{className:"text-lg font-semibold",children:ee.status})]})}),a.jsx(Ue,{children:a.jsxs(We,{className:"pt-4",children:[a.jsx("div",{className:"text-xs text-muted-foreground",children:"Requests"}),a.jsx("div",{className:"text-lg font-semibold",children:ee.networkSummary.requestCount})]})}),a.jsx(Ue,{children:a.jsxs(We,{className:"pt-4",children:[a.jsx("div",{className:"text-xs text-muted-foreground",children:"Network errors"}),a.jsx("div",{className:"text-lg font-semibold",children:ee.networkSummary.errorCount})]})}),a.jsx(Ue,{children:a.jsxs(We,{className:"pt-4",children:[a.jsx("div",{className:"text-xs text-muted-foreground",children:"Validation findings"}),a.jsx("div",{className:"text-lg font-semibold",children:ee.validations.length})]})})]}),a.jsxs(Ue,{children:[a.jsx(Pt,{className:"pb-3",children:a.jsx(kt,{className:"text-base",children:"Key values"})}),a.jsxs(We,{className:"grid gap-3 md:grid-cols-2",children:[a.jsxs("div",{children:[a.jsx($e,{className:"text-xs",children:"Issuer"}),a.jsx("p",{className:"text-sm break-all",children:ee.summary?.issuer||"-"})]}),a.jsxs("div",{children:[a.jsx($e,{className:"text-xs",children:"Client ID"}),a.jsx("p",{className:"text-sm break-all",children:ee.summary?.clientId||"-"})]}),a.jsxs("div",{children:[a.jsx($e,{className:"text-xs",children:"Redirect URI"}),a.jsx("p",{className:"text-sm break-all",children:ee.summary?.redirectUri||"-"})]}),a.jsxs("div",{children:[a.jsx($e,{className:"text-xs",children:"Token endpoint status"}),a.jsx("p",{className:"text-sm",children:ee.summary?.tokenEndpointStatus??"-"})]}),a.jsxs("div",{children:[a.jsx($e,{className:"text-xs",children:"Token type"}),a.jsx("p",{className:"text-sm",children:ee.summary?.tokenType||"-"})]}),a.jsxs("div",{children:[a.jsx($e,{className:"text-xs",children:"Scopes granted"}),a.jsx("p",{className:"text-sm break-all",children:(ee.summary?.grantedScopes??[]).join(", ")||"-"})]}),a.jsxs("div",{children:[a.jsx($e,{className:"text-xs",children:"Token validity"}),a.jsxs("p",{className:"text-sm",children:[typeof ee.summary?.accessTokenValidForSeconds=="number"?`${X1(ee.summary.accessTokenValidForSeconds)} remaining`:typeof ee.summary?.accessTokenExpiresInSeconds=="number"?`${X1(ee.summary.accessTokenExpiresInSeconds)} from issuance`:"No expiry advertised by token endpoint",ee.summary?.accessTokenExpiresAt?` (until ${new Date(ee.summary.accessTokenExpiresAt).toLocaleTimeString()})`:""]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Source:"," ",ee.summary?.accessTokenExpirySource==="expires_in"?"token endpoint expires_in":ee.summary?.accessTokenExpirySource==="jwt_exp"?"JWT exp claim":"not available"]})]}),a.jsxs("div",{children:[a.jsx($e,{className:"text-xs",children:"Refresh option"}),a.jsx("p",{className:"text-sm",children:ee.summary?.refreshTokenAvailable?"Refresh token available (silent refresh possible)":"No refresh token in response (full login likely required after expiry)"})]}),ee.summary?.accessToken&&a.jsxs("div",{className:"md:col-span-2 space-y-1",children:[a.jsx($e,{className:"text-xs",children:"Access token"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("code",{className:"flex-1 truncate rounded bg-muted px-2 py-1 text-xs font-mono text-muted-foreground",children:[ee.summary.accessToken.slice(0,48),"…"]}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",className:"shrink-0 h-7 px-2 text-xs",onClick:()=>{p$(ee.summary.accessToken)},children:[a.jsx(_s,{className:"mr-1 h-3 w-3"}),"Copy token"]})]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:['Visible because "Hide sensitive values" is off. Use this token with the CLI via ',a.jsx("code",{className:"font-mono",children:"--oauth-token"}),"."]})]})]})]}),a.jsxs(Ue,{children:[a.jsx(Pt,{className:"pb-3",children:a.jsx(kt,{className:"text-base",children:"Validation findings"})}),a.jsx(We,{className:"space-y-2",children:ee.validations.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No validation findings recorded."}):ee.validations.map((le,at)=>a.jsxs("div",{className:"rounded-md border p-3",children:[a.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.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:at+1}),a.jsx("span",{className:"font-bold",children:le.title})]}),a.jsx(qe,{variant:qn(le.severity),children:le.severity})]}),a.jsxs("p",{className:"text-sm",children:[a.jsx("span",{className:"font-bold",children:"Finding:"})," ",le.detail]}),le.recommendation&&a.jsxs("div",{className:"mt-2 rounded-md border px-2.5 py-2 text-xs",children:[a.jsx("div",{className:"mb-1 font-medium text-muted-foreground",children:"Suggested improvement"}),a.jsx("p",{children:le.recommendation})]}),a.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Step: ",le.stepId,le.specReference&&a.jsxs(a.Fragment,{children:[" · ",a.jsx("a",{href:le.specReference,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"Spec reference"})]})]})]},le.id))})]})]})]})}function Oxe(e){const t=e.filter(n=>typeof n.sourcePath=="string"&&n.sourcePath.trim().length>0&&typeof n.relativePath=="string"&&n.relativePath.trim().length>0).map(n=>[n.sourcePath,n.relativePath]);return new Map(t)}function Txe(e){const t=e.filter(n=>typeof n.sourcePath=="string"&&n.sourcePath.trim().length>0).map(n=>[n.sourcePath,n.configName?.trim()||n.name]);return new Map(t)}function Rxe(e,t){const n=new Map;for(const r of e){if(!r.sourcePath)continue;const s=new Map,i=r.scenarioEntries&&r.scenarioEntries.length>0?r.scenarioEntries:r.scenarios.map(o=>({kind:"inline",scenario:o}));for(const o of i){if(o.kind==="inline"){s.set(o.scenario.id,o.scenario.name?.trim()||o.scenario.id);continue}const c=t.find(d=>d.id===o.ref);s.set(o.ref,c?.name?.trim()||o.ref)}n.set(r.sourcePath,s)}return n}function h$(e,t){const n=t.get(e);if(n)return n;const r=e.replace(/\\/g,"/"),s="/evals/",i=r.lastIndexOf(s);if(i>=0)return r.slice(i+s.length);const o=r.split("/").filter(Boolean);return o.length<=1?r:o.slice(-3).join("/")}function m$(e,t,n){const r=t.get(n);if(!e||e.length===0){if(r&&r.size===1){const i=r.values().next().value;if(i)return i}return"All scenarios"}if(!r)return e.length===1?e[0]:`${e[0]} +${e.length-1}`;const s=e.map(i=>r.get(i)??i);return s.length===1?s[0]:`${s[0]} +${s.length-1}`}const Kj="mcplab.runEvaluation.activeJobId",Ixe=()=>{const[e]=vi(),[t,n]=m.useState(""),[r,s]=m.useState("1"),[i,o]=m.useState(!1),[c,d]=m.useState(0),[f,h]=m.useState([]),[p,x]=m.useState(!1),[g,j]=m.useState(!1),[b,y]=m.useState(""),[S,C]=m.useState(null),[N,E]=m.useState([]),[A,P]=m.useState([]),[O,T]=m.useState(!0),[$,z]=m.useState(""),[q,F]=m.useState(""),[H,U]=m.useState(!1),[R,W]=m.useState([]),[X,G]=m.useState(null),[B,J]=m.useState(!1),[D,I]=m.useState(null),re=m.useRef(null),ne=m.useRef(null),fe=m.useRef(!1),{configs:he,reload:V}=Mf(),{source:de}=Ln(),Q=Ag("snapshots",!1),{agents:ee,scenarios:pe,servers:ae,reload:Re}=rs(),Ce=b.trim(),Me=Ce?`/results/${encodeURIComponent(Ce)}${t?`?configId=${encodeURIComponent(t)}`:""}`:"/results",L=he.find(ye=>ye.id===t),oe=m.useMemo(()=>Oxe(he),[he]),ve=m.useMemo(()=>Txe(he),[he]),Pe=m.useMemo(()=>Rxe(he,pe),[he,pe]),Ge=e.get("configId"),lt=m.useMemo(()=>{if(!L)return[];const ye=new Map,Ve=L.agentEntries&&L.agentEntries.length>0?L.agentEntries:L.agents.map(Be=>({kind:"inline",agent:Be}));for(const Be of Ve){if(Be.kind==="inline"){const Ee=Be.agent.id;ye.has(Ee)||ye.set(Ee,Be.agent);continue}const xt=ee.find(Ee=>Ee.id===Be.ref);xt&&!ye.has(xt.id)&&ye.set(xt.id,xt)}for(const Be of ee)ye.has(Be.id)||ye.set(Be.id,Be);return Array.from(ye.values())},[L,ee]),pt=m.useMemo(()=>{if(!L)return[];const ye=new Map,Ve=L.scenarioEntries&&L.scenarioEntries.length>0?L.scenarioEntries:L.scenarios.map(Be=>({kind:"inline",scenario:Be}));for(const Be of Ve){if(Be.kind==="inline"){ye.has(Be.scenario.id)||ye.set(Be.scenario.id,Be.scenario);continue}const xt=pe.find(Ee=>Ee.id===Be.ref);xt&&!ye.has(xt.id)&&ye.set(xt.id,xt)}return Array.from(ye.values())},[L,pe]);m.useEffect(()=>{Ge&&he.some(ye=>ye.id===Ge)&&n(Ge)},[Ge,he]);const vt=m.useRef("");m.useEffect(()=>{const ye=L?`${L.id}::${L.sourcePath??""}`:"";if(ye===vt.current)return;if(vt.current=ye,!L){E([]),P([]);return}const Ve=lt.filter(Be=>(L.runDefaults?.selectedAgentNames??[]).includes(Be.id)).map(Be=>Be.id);E(Ve.length>0?Ve:lt.map(Be=>Be.id)),P(pt.map(Be=>Be.id)),T(!0)},[L?.id,L?.sourcePath,lt,pt]);const zt=async()=>{if(!L?.sourcePath){h(Ee=>[...Ee,`[${new Date().toLocaleTimeString()}] Missing source path for selected config.`]);return}const ye=lt.filter(Ee=>N.includes(Ee.id));if(ye.length===0){h(Ee=>[...Ee,`[${new Date().toLocaleTimeString()}] Select at least one agent.`]);return}const Ve=pt.filter(Ee=>A.includes(Ee.id));if(Ve.length===0){h(Ee=>[...Ee,`[${new Date().toLocaleTimeString()}] Select at least one test.`]);return}const Be=Array.from(new Set(Ve.flatMap(Ee=>Ee.serverIds||[]).filter(Ee=>{const ue=(L.servers??[]).find(ht=>ht.id===Ee),Ze=ae.find(ht=>ht.id===Ee);return(ue||Ze)?.authType==="oauth2"})));try{Be.length>0&&(J(!0),await ii({serverNames:Be,source:de,onServerAuthStart:Ee=>{h(ue=>[...ue,`[${new Date().toLocaleTimeString()}] OAuth login required for '${Ee}'. Complete the browser sign-in flow...`])}}),h(Ee=>[...Ee,`[${new Date().toLocaleTimeString()}] OAuth login completed for required server(s): ${Be.join(", ")}.`]))}catch(Ee){const ue=Ee instanceof Error?Ee.message:String(Ee);h(Ze=>[...Ze,`[${new Date().toLocaleTimeString()}] OAuth error: ${ue}`]),J(!1);return}finally{J(!1)}o(!0),x(!1),j(!1),y("");const xt=(L.serverEntries??[]).some(Ee=>Ee.kind==="referenced")||(L.agentEntries??[]).some(Ee=>Ee.kind==="referenced")||(L.scenarioEntries??[]).some(Ee=>Ee.kind==="referenced")?"refs-composed":"single-file/inline";h([`[${new Date().toLocaleTimeString()}] Starting evaluation run...`,`[${new Date().toLocaleTimeString()}] Config=${L.name} mode=${xt} agents=${ye.map(Ee=>Ee.name||Ee.id).join(", ")} tests=${Ve.map(Ee=>Ee.id).join(", ")} runs=${Number(r)} snapshotEval=${Q&&O?"on":"off"}${$.trim()?` note=${$.trim()}`:""}`]),d(10);try{const{jobId:Ee}=await de.startRun({configPath:L.sourcePath,runsPerScenario:Number(r),agents:ye.map(ue=>ue.id),scenarioIds:Ve.map(ue=>ue.id),applySnapshotEval:Q?O:!1,runNote:$.trim()?$.trim():void 0});C(Ee),Xe(Ee),Ut(Ee),Fe()}catch(Ee){const ue=Ee instanceof Error?Ee.message:String(Ee),Ze=ue.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(ht=>[...ht,`[${new Date().toLocaleTimeString()}] Error: ${ue}${Ze}`]),o(!1),d(0),C(null),J(!1)}},qt=()=>{zt()},Wt=()=>{S&&de.stopRun(S),ne.current?.(),ne.current=null,Ne(),C(null),o(!1),x(!1),j(!0),h(ye=>[...ye,`[${new Date().toLocaleTimeString()}] Run aborted by user.`]),Fe()},Qt=async()=>{if(b){U(!0);try{const ye=await de.createSnapshotFromRun(b,q.trim()||void 0);_e({title:"Snapshot saved",description:`Created ${ye.name} (${ye.id})`}),q.trim()||F(ye.name)}catch(ye){_e({title:"Could not save snapshot",description:ye instanceof Error?ye.message:String(ye),variant:"destructive"})}finally{U(!1)}}};m.useEffect(()=>{re.current&&(re.current.scrollTop=re.current.scrollHeight)},[f]),m.useEffect(()=>()=>{ne.current?.()},[]),m.useEffect(()=>{if(S||p)return;let ye="";try{ye=sessionStorage.getItem(Kj)??""}catch{ye=""}if(ye)return C(ye),o(!0),x(!1),j(!1),h(Ve=>Ve.length>0?Ve:[`[${new Date().toLocaleTimeString()}] Reattached to in-progress evaluation run...`]),Ut(ye),()=>{}},[S,p]);const Ne=()=>{try{sessionStorage.removeItem(Kj)}catch{}},Xe=ye=>{try{sessionStorage.setItem(Kj,ye)}catch{}},Fe=async()=>{try{const ye=await de.getRunQueue();W(ye.queued),G(ye.active);const Ve=ye.queued.find(Be=>Be.status==="blocked_auth"&&Be.blockedReason==="oauth_required");Ve&&(Ve.requiredServers??[]).length>0?I(Be=>Be?.jobId===Ve.jobId?Be:{jobId:Ve.jobId,servers:Ve.requiredServers}):ye.queued.some(Be=>Be.status==="blocked_auth")||I(null)}catch{}},Ft=()=>{V(),Re()};m.useEffect(()=>{Ft(),Fe();const ye=()=>{Ft(),Fe()};return window.addEventListener("focus",ye),()=>{window.removeEventListener("focus",ye)}},[V,Re]);const on=async ye=>{try{await de.removeQueuedRun(ye),W(Ve=>Ve.filter(Be=>Be.jobId!==ye))}catch(Ve){const Be=Ve instanceof Error?Ve.message:String(Ve);if(Be.includes("Use the /stop endpoint"))try{await de.stopRun(ye)}catch{}else _e({title:"Could not remove queued run",description:Be,variant:"destructive"})}Fe()},Ut=ye=>{S===ye&&ne.current||(ne.current?.(),ne.current=de.subscribeRunJob(ye,Ve=>{const Be=new Date(Ve.ts).toLocaleTimeString();if(Ve.type==="queued"){h(xt=>{const Ee=Ve.payload.position?` (position ${Ve.payload.position})`:"",ue=`[${Be}] Run queued${Ee}. Waiting for active run to finish...`;return xt.includes(ue)?xt:[...xt,ue]}),d(5);return}if(Ve.type==="oauth_required"){const xt=Array.isArray(Ve.payload.servers)?Ve.payload.servers:[],Ee=String(Ve.payload.jobId??"");I({jobId:Ee,servers:xt}),h(ue=>{const Ze=`[${Be}] OAuth required for server(s): ${xt.join(", ")}. Click "Connect & Resume" to authenticate.`;return ue.includes(Ze)?ue:[...ue,Ze]});return}if(Ve.type==="started"&&(I(null),fe.current=!1,o(!0),x(!1),j(!1),h(xt=>{const Ee=`[${Be}] Run started.`;return xt.includes(Ee)?xt:[...xt,Ee]}),d(xt=>Math.max(xt,30)),Fe()),Ve.type==="log"){const xt=String(Ve.payload.message??"").trim();xt&&(h(Ee=>{const ue=`[${Be}] ${xt}`;return Ee.includes(ue)?Ee:[...Ee,ue]}),d(Ee=>{const ue=xt.toLowerCase();if(ue.startsWith("loading mcp evaluation config"))return Math.max(Ee,15);if(ue.startsWith("loaded config"))return Math.max(Ee,20);if(ue.startsWith("selected "))return Math.max(Ee,30);if(ue.startsWith("using requested agents")||ue.startsWith("using resolved default agents"))return Math.max(Ee,35);if(ue.startsWith("expanded to "))return Math.max(Ee,45);if(ue.startsWith("running evaluation"))return Math.max(Ee,50);const Ze=ue.match(/^scenario (\d+)\/(\d+) finished:/);if(Ze){const ht=Number(Ze[1]),Ot=Number(Ze[2]);return Math.max(Ee,50+Math.round(ht/Ot*25))}return ue.startsWith("evaluation execution finished")?Math.max(Ee,78):ue.startsWith("applying snapshot evaluation policy")?Math.max(Ee,82):ue.includes("snapshot evaluation applied")||ue.includes("snapshot evaluation enabled")?Math.max(Ee,88):ue.startsWith("writing results to ")?Math.max(Ee,94):ue.startsWith("run finished:")?Math.max(Ee,98):Ee}))}if(Ve.type==="completed"){const xt=String(Ve.payload.runId??"").trim();if(I(null),fe.current=!1,h(Ee=>{const ue=`[${Be}] Run completed.`;return Ee.includes(ue)?Ee:[...Ee,ue]}),Ve.payload.snapshotEval&&typeof Ve.payload.snapshotEval=="object"){const Ee=Ve.payload.snapshotEval;h(ue=>{const Ze=`[${Be}] Snapshot eval (${Ee.mode??"warn"}) baseline=${Ee.baseline_snapshot_id??"-"} score=${Ee.overall_score??"-"} status=${Ee.status??"-"}`;return ue.includes(Ze)?ue:[...ue,Ze]})}d(100),o(!1),x(!0),j(!1),y(xt),Ne(),C(null),ne.current?.(),ne.current=null,Fe()}if(Ve.type==="error"){const xt=String(Ve.payload.message??"Unknown error"),Ee=xt.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.":"";I(null),fe.current=!1,h(ue=>[...ue,`[${Be}] Error: ${xt}${Ee}`]),o(!1),x(!1),j(!1),d(0),Ne(),C(null),ne.current?.(),ne.current=null,Fe()}}))};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[a.jsx(ti,{className:"h-6 w-6"}),"Run Evaluation"]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Execute evaluation scenarios against MCP servers"})]}),a.jsx(Ue,{children:a.jsxs(We,{className:"pt-6 space-y-4",children:[a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx($e,{children:"MCP Evaluation"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(jn,{value:t,onValueChange:n,children:[a.jsx(mn,{children:a.jsx(Sn,{placeholder:"Select a config"})}),a.jsx(vn,{children:he.map(ye=>a.jsx(et,{value:ye.id,children:ye.name},ye.id))})]}),a.jsx(se,{type:"button",variant:"outline",size:"icon",className:"h-10 w-10 shrink-0",onClick:Ft,"aria-label":"Refresh configs",title:"Refresh configs",children:a.jsx(ma,{className:"h-4 w-4"})})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx($e,{children:"Variance Runs"}),a.jsx(gt,{type:"number",min:"1",max:"10",value:r,onChange:ye=>s(ye.target.value)})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx($e,{htmlFor:"run-note",children:"Run Note"}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[$.length,"/500"]})]}),a.jsx(Os,{id:"run-note",value:$,onChange:ye=>z(ye.target.value.slice(0,500)),placeholder:"Optional context for this run (for example: mcp-server v1.8.2 #staging)",rows:2})]}),L&&a.jsxs("div",{className:"space-y-2",children:[Q&&L.snapshotEval?.enabled&&a.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 (",L.snapshotEval.mode,") · baseline:"," ",a.jsx("span",{className:"font-mono",children:L.snapshotEval.baselineSnapshotId??"none"})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx($e,{children:"Agents"}),a.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[a.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>E(lt.map(ye=>ye.id)),children:"Select all"}),a.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>E([]),children:"Clear"})]})]}),a.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:lt.map(ye=>{const Ve=N.includes(ye.id);return a.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[a.jsx(Yr,{checked:Ve,onCheckedChange:Be=>{const xt=Be===!0;E(Ee=>xt?[...Ee,ye.id]:Ee.filter(ue=>ue!==ye.id))}}),a.jsx("span",{children:ye.name||ye.id})]},ye.id)})}),lt.length===0&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents available. Add agents to your workspace library, or define inline agents in this config."})]}),L&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx($e,{children:"Tests"}),a.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[a.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>P(pt.map(ye=>ye.id)),children:"Select all"}),a.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>P([]),children:"Clear"})]})]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[A.length," of ",pt.length," selected"]}),a.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:pt.map(ye=>{const Ve=A.includes(ye.id);return a.jsxs("label",{className:"flex items-start gap-2 text-sm rounded-md border p-2",children:[a.jsx(Yr,{checked:Ve,onCheckedChange:Be=>{const xt=Be===!0;P(Ee=>xt?[...Ee,ye.id]:Ee.filter(ue=>ue!==ye.id))}}),a.jsxs("span",{className:"min-w-0",children:[a.jsx("span",{className:"block font-medium",children:ye.name||ye.id}),a.jsx("span",{className:"block font-mono text-xs text-muted-foreground truncate",children:ye.id})]})]},ye.id)})})]}),Q&&a.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[a.jsx(Yr,{checked:O,onCheckedChange:ye=>T(ye===!0)}),a.jsx("span",{children:"Apply snapshot evaluation policy (if configured)"})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(se,{onClick:qt,disabled:!t||B||lt.length>0&&N.length===0||pt.length>0&&A.length===0,children:[a.jsx(ti,{className:"mr-2 h-4 w-4"}),X?"Queue Run":"Run"]}),i&&a.jsxs(se,{variant:"destructive",onClick:Wt,children:[a.jsx(Ph,{className:"mr-2 h-4 w-4"}),"Stop"]})]})]})}),(i||f.length>0)&&a.jsxs(Ue,{children:[a.jsx(Pt,{className:"pb-3",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(kt,{className:"text-base",children:"Progress"}),a.jsxs("span",{className:"text-xs text-muted-foreground font-mono",children:[Math.round(c),"%"]})]})}),a.jsxs(We,{className:"space-y-4",children:[a.jsx(Tg,{value:c,className:"h-2"}),D&&a.jsxs("div",{className:"flex items-center justify-between rounded-md border border-yellow-500/40 bg-yellow-500/10 px-3 py-2 text-sm",children:[a.jsxs("span",{className:"text-yellow-700 dark:text-yellow-400",children:["OAuth required for: ",a.jsx("strong",{children:D.servers.join(", ")})]}),a.jsx(se,{size:"sm",variant:"outline",disabled:B,onClick:()=>{fe.current||(fe.current=!0,J(!0),ii({serverNames:D.servers,source:de,onServerAuthStart:ye=>{h(Ve=>[...Ve,`[${new Date().toLocaleTimeString()}] OAuth sign-in opened for '${ye}'...`])}}).then(()=>de.resumeQueue()).then(()=>{const ye=D?.jobId;h(Ve=>[...Ve,`[${new Date().toLocaleTimeString()}] OAuth complete. Resuming run...`]),ye&&(C(ye),Xe(ye),o(!0),x(!1),Ut(ye))}).catch(ye=>{const Ve=ye instanceof Error?ye.message:String(ye);h(Be=>[...Be,`[${new Date().toLocaleTimeString()}] OAuth error: ${Ve}`]),fe.current=!1}).finally(()=>{J(!1)}))},children:B?"Connecting...":"Connect & Resume"})]}),a.jsx("div",{ref:re,className:"h-64 overflow-auto rounded-md border bg-muted/30 p-3 font-mono text-xs space-y-0.5",children:f.map((ye,Ve)=>a.jsx("div",{className:ye.includes("✓")?"text-success":ye.includes("aborted")?"text-destructive":"text-foreground",children:ye},Ve))})]})]}),a.jsxs(Ue,{children:[a.jsx(Pt,{className:"pb-3",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(kt,{className:"inline-flex items-center gap-2 text-base",children:[a.jsx(hi,{className:"h-4 w-4"}),"Run Queue"]}),a.jsx(se,{variant:"ghost",size:"sm",onClick:()=>{Fe()},children:a.jsx(ma,{className:"h-3 w-3"})})]})}),a.jsx(We,{children:!X&&R.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No active or queued runs. Start a run above."}):a.jsxs("div",{className:"space-y-2",children:[X&&a.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===X.jobId?"ring-2 ring-primary/40":""}`,onClick:()=>{S!==X.jobId&&(C(X.jobId),Xe(X.jobId),o(!0),x(!1),j(!1),h([`[${new Date().toLocaleTimeString()}] Attached to running job ${X.jobId}...`]),d(10),Ut(X.jobId))},title:"Click to view progress",children:[a.jsxs("div",{className:"min-w-0 flex items-center gap-2",children:[a.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"}),a.jsx("span",{className:"text-xs font-bold",children:ve.get(X.runParams.configPath)||m$(X.runParams.scenarioIds,Pe,X.runParams.configPath)}),a.jsx("span",{className:"font-mono text-xs",children:h$(X.runParams.configPath,oe)}),X.runParams.agents&&a.jsxs("span",{className:"text-xs text-muted-foreground",children:["agents: ",X.runParams.agents.join(", ")]}),X.runParams.runNote&&a.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["note: ",X.runParams.runNote]})]}),a.jsxs(se,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-destructive hover:text-destructive hover:bg-destructive/10",onClick:ye=>{ye.stopPropagation(),X&&(de.stopRun(X.jobId),Fe())},title:"Stop running job",children:[a.jsx(Ph,{className:"mr-1 h-3 w-3"}),"Stop"]})]}),R.map((ye,Ve)=>{const Be=h$(ye.runParams.configPath,oe),xt=m$(ye.runParams.scenarioIds,Pe,ye.runParams.configPath),Ee=ve.get(ye.runParams.configPath)||xt,ue=ye.status==="blocked_auth";return a.jsxs("div",{className:`flex items-center justify-between rounded-md border p-2 text-sm ${ue?"border-yellow-500/40 bg-yellow-500/5":""}`,children:[a.jsxs("div",{className:"min-w-0 flex items-center gap-2 flex-wrap",children:[ue?a.jsxs("span",{className:"inline-flex items-center rounded-full bg-yellow-500/15 px-2 py-0.5 text-xs font-medium text-yellow-700 dark:text-yellow-400",children:["#",Ve+1," Blocked"]}):a.jsxs("span",{className:"inline-flex items-center rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:["#",Ve+1," Queued"]}),a.jsx("span",{className:"text-xs font-bold",children:Ee}),a.jsx("span",{className:"font-mono text-xs",children:Be}),ue&&(ye.requiredServers??[]).length>0&&a.jsxs("span",{className:"text-xs text-yellow-700 dark:text-yellow-400",children:["OAuth: ",ye.requiredServers.join(", ")]}),!ue&&ye.runParams.agents&&a.jsxs("span",{className:"text-xs text-muted-foreground",children:["agents: ",ye.runParams.agents.join(", ")]}),ye.runParams.runNote&&a.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["note: ",ye.runParams.runNote]})]}),a.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[ue&&a.jsx(se,{size:"sm",variant:"outline",className:"h-7 text-xs border-yellow-500/50 text-yellow-700 dark:text-yellow-400 hover:bg-yellow-500/10",disabled:B,onClick:()=>{if(fe.current)return;const Ze=ye.requiredServers??[];Ze.length!==0&&(fe.current=!0,I({jobId:ye.jobId,servers:Ze}),J(!0),ii({serverNames:Ze,source:de,onServerAuthStart:ht=>{h(Ot=>[...Ot,`[${new Date().toLocaleTimeString()}] OAuth sign-in opened for '${ht}'...`])}}).then(()=>de.resumeQueue()).then(()=>{h(ht=>[...ht,`[${new Date().toLocaleTimeString()}] OAuth complete. Resuming run...`]),C(ye.jobId),Xe(ye.jobId),o(!0),x(!1),Ut(ye.jobId)}).catch(ht=>{const Ot=ht instanceof Error?ht.message:String(ht);h(Jt=>[...Jt,`[${new Date().toLocaleTimeString()}] OAuth error: ${Ot}`]),fe.current=!1}).finally(()=>{J(!1)}))},children:B&&D?.jobId===ye.jobId?"Connecting...":"Connect & Resume"}),a.jsx(se,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:()=>{on(ye.jobId)},title:"Remove from queue",children:a.jsx(As,{className:"h-4 w-4"})})]})]},ye.jobId)})]})})]}),g&&!i&&!p&&a.jsx(Ue,{className:"border-amber-300/60 bg-amber-50/40",children:a.jsx(We,{className:"pt-6",children:a.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[a.jsx(Ph,{className:"h-5 w-5 text-amber-700"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"font-medium",children:"Run stopped"}),a.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."})]}),a.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[a.jsx(se,{type:"button",variant:"outline",onClick:()=>{h([]),d(0),j(!1)},children:"Clear Progress"}),a.jsxs(se,{type:"button",onClick:qt,disabled:!t,children:[a.jsx(ti,{className:"mr-2 h-4 w-4"}),"Run Again"]})]})]})})}),p&&a.jsx(Ue,{className:"border-success/50",children:a.jsxs(We,{className:"pt-6",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Qi,{className:"h-6 w-6 text-success"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"Evaluation Complete"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"All scenarios have been evaluated successfully."})]}),a.jsx(se,{asChild:!0,className:"ml-auto",children:a.jsx(At,{to:Me,children:Ce?"View Results":"View Runs"})})]}),Q&&Ce&&a.jsxs("div",{className:"mt-4 flex flex-wrap items-end gap-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx($e,{className:"text-xs",children:"Snapshot name (optional)"}),a.jsx(gt,{value:q,onChange:ye=>F(ye.target.value),placeholder:"e.g. baseline-v1",className:"h-8 w-64"})]}),a.jsx(se,{type:"button",variant:"outline",size:"sm",onClick:()=>{Qt()},disabled:H,children:H?"Saving...":"Save Snapshot"})]})]})})]})};function R6({title:e,description:t,expanded:n,onToggleExpanded:r,onHide:s,messages:i,pendingToolCalls:o,loading:c,input:d,onInputChange:f,onSend:h,inputPlaceholder:p,snippets:x,snippetsLabel:g="Result Assistant Snippets",onSnippetSelect:j,onApproveToolCall:b,onDenyToolCall:y,chatEndRef:S,inputRef:C,renderMessage:N,renderMessageExtras:E,className:A="min-w-0 overflow-hidden xl:flex xl:h-full xl:min-h-0 xl:flex-col",contentClassName:P="flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1"}){return a.jsxs(Ue,{className:A,children:[a.jsx(Pt,{className:"border-b px-4 py-3",children:a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs(kt,{className:"flex items-center gap-2 text-base",children:[a.jsx(qr,{className:"h-4 w-4 text-amber-500"}),e]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:r,children:[n?a.jsx(tS,{className:"h-3.5 w-3.5"}):a.jsx(nS,{className:"h-3.5 w-3.5"}),n?"Compact":"Expand"]}),a.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:s,children:"Hide"})]})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:t})]})}),a.jsxs(We,{className:P,children:[a.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto bg-muted/15 px-4 py-4",children:a.jsxs("div",{className:"space-y-3 pr-2",children:[i.map((O,T)=>{const $=O.role==="user",z=O.role==="assistant",q=O.role==="system",F=O.role==="tool",H=O.pendingToolCallId?o.find(R=>R.id===O.pendingToolCallId):void 0;return N?N({message:O,index:T,linkedPendingToolCall:H,isUser:$,isAssistant:z,isSystem:q,isTool:F}):z&&!!O.pendingToolCallId?a.jsxs("div",{className:"rounded-md border bg-background p-3",children:[a.jsx(Oa,{text:O.text,className:"text-sm"}),H&&a.jsx(Y1,{call:H,loading:c,onApprove:b,onDeny:y,className:"mt-3"})]},`${O.id??`${O.role}-${T}`}-tool`):a.jsx(Gz,{message:O},O.id??`${O.role}-${T}`)}),E,c&&a.jsx(Yz,{}),a.jsx("div",{ref:S})]})}),a.jsx("div",{className:"border-t bg-background px-4 py-3",children:a.jsx(Xz,{input:d,onInputChange:f,onSend:h,inputPlaceholder:p,snippets:x,snippetsLabel:g,onSnippetSelect:j,loading:c,inputRef:C})})]})]})}function yd(e){return e instanceof $N&&e.status===404}function I6(e){const{source:t,open:n,scope:r,runId:s,onSessionSync:i}=e,[o,c]=m.useState(null),[d,f]=m.useState([]),[h,p]=m.useState([]),[x,g]=m.useState(""),[j,b]=m.useState(!1),y=m.useRef(null),S=m.useRef(t),C=m.useRef(i),N=m.useRef(null),E=m.useRef(null);m.useEffect(()=>{y.current=o},[o]),m.useEffect(()=>{S.current=t},[t]),m.useEffect(()=>{C.current=i},[i]);const A=m.useCallback((H,U)=>{c(U??H.id),f(R=>R.length>H.messages.length?R:H.messages),p(H.pendingToolCalls),C.current?.(H)},[]),P=m.useCallback(async(H,U)=>{const R=U.session.id||H;A(U.session,R)},[A]),O=m.useCallback(async()=>{const H=x.trim();if(!H||r==="run"&&!s)return;const U=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,R={id:U,role:"user",text:H,createdAt:new Date().toISOString()};g(""),f(W=>[...W,R]),b(!0);try{let W=o;if(!W){const X=r==="run"&&s?await t.createResultAssistantSession({runId:s,scope:"run"}):await t.createResultAssistantSession({scope:"all_runs"});W=X.sessionId||X.session.id,A(X.session,W),f(G=>G.some(J=>J.id===U)?[...X.session.messages,R]:X.session.messages)}try{const X=await t.sendResultAssistantMessage(W,H);await P(W,X)}catch(X){if(!yd(X))throw X;const G=r==="run"&&s?await t.createResultAssistantSession({runId:s,scope:"run"}):await t.createResultAssistantSession({scope:"all_runs"}),B=G.sessionId||G.session.id;A(G.session,B),f(D=>D.some(re=>re.id===U)?[...G.session.messages,R]:G.session.messages);const J=await t.sendResultAssistantMessage(B,H);await P(B,J)}}catch(W){f(X=>X.filter(G=>G.id!==U)),_e({title:"MCP Lab Assistant error",description:W instanceof Error?W.message:String(W),variant:"destructive"})}finally{b(!1)}},[x,r,s,o,t,A,P]),T=m.useCallback(async H=>{if(o){b(!0);try{const U=await t.approveResultAssistantToolCall(o,H);await P(o,U)}catch(U){yd(U)&&(c(null),p([])),_e({title:"Could not approve assistant action",description:yd(U)?"Assistant session expired. Ask a new question to start a fresh session.":U instanceof Error?U.message:String(U),variant:"destructive"})}finally{b(!1)}}},[o,t,P]),$=m.useCallback(async H=>{if(o){b(!0);try{const U=await t.denyResultAssistantToolCall(o,H);await P(o,U)}catch(U){yd(U)&&(c(null),p([])),_e({title:"Could not deny assistant action",description:yd(U)?"Assistant session expired. Ask a new question to start a fresh session.":U instanceof Error?U.message:String(U),variant:"destructive"})}finally{b(!1)}}},[o,t,P]),z=m.useCallback(()=>{const H=y.current;H&&t.closeResultAssistantSession(H).catch(()=>{}),y.current=null,c(null),f([]),p([]),g("")},[t]),q=m.useCallback(H=>{f(U=>U.length>0?U:[{id:`msg-${Date.now()}`,role:"assistant",text:H,createdAt:new Date().toISOString()}])},[]),F=m.useCallback(H=>{g(H),requestAnimationFrame(()=>E.current?.focus())},[]);return m.useEffect(()=>{if(!n)return;const H=window.setTimeout(()=>{N.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(H)},[n,d.length,j]),m.useEffect(()=>{const H=E.current;if(!H)return;H.style.height="0px";const U=Math.min(H.scrollHeight,160);H.style.height=`${Math.max(40,U)}px`},[x,n]),m.useEffect(()=>{if(!(!n||!o))return S.current.subscribeResultAssistantSessionEvents(o,H=>{A(H.payload.session,H.payload.sessionId)})},[n,o,A]),m.useEffect(()=>()=>{const H=y.current;H&&S.current.closeResultAssistantSession(H).catch(()=>{})},[]),{assistantSessionId:o,assistantMessages:d,assistantPendingToolCalls:h,assistantInput:x,assistantLoading:j,assistantChatEndRef:N,assistantInputRef:E,setAssistantInput:g,setAssistantMessages:f,askAssistant:O,approveResultAssistantToolCall:T,denyResultAssistantToolCall:$,applyResultAssistantSnippet:F,ensureIntroMessage:q,resetAssistantSession:z}}function Mh(e){const t=String(e??"").trim();return t&&(t.split("::").pop()??t).replace(/^mcplab__/,"").replace(/^mcplab_/,"").replace(/_/g," ").replace(/\s+/g," ").trim()||"unknown_tool"}function M6(e){const t=Array.from(new Map(e.scenarios.map(p=>{const x=String(p.scenarioId??"").trim(),g=String(p.scenarioName??"").trim();return!x&&!g?null:[x||g,g||x]}).filter(p=>!!p)).values()),n=Array.from(new Set(e.scenarios.map(p=>p.agentName||p.agentId).filter(Boolean))),r=Array.from(new Set(e.scenarios.map(p=>p.model).filter(p=>!!p))),s=t.slice(0,2).join(", "),i=t.length>2?` +${t.length-2}`:"",o=r.slice(0,2).join(", "),c=r.length>2?` +${r.length-2}`:"",d=e.configName?.trim()||"",f=e.configPath?.trim()||"",h=d&&f?`${d} · ${f}`:d||f;return{scenarioCount:t.length,agentCount:n.length,scopePreview:h||(s?`${s}${i}`:"n/a"),modelSummary:o?`${o}${c}`:""}}const Mxe=[{label:"Summarize Run Trends",description:"Highlight the main changes across the selected runs.",prompt:"Summarize the main trends across these runs. Call out pass-rate changes, latency, and tool usage shifts."},{label:"Explain Failures",description:"Identify the most important failures and likely root causes.",prompt:"Identify the most important failures across these runs and explain likely root causes from the traces."},{label:"Compare Agents",description:"Compare agent behavior, tool use, and answer quality across runs.",prompt:"Compare agent behavior across these runs. Highlight differences in tool use, answer quality, and consistency."},{label:"Spot Anomalies",description:"Find outliers in latency, tool calls, or pass rate.",prompt:"Find unusual runs or outliers in latency, tool calls, or pass rate, and explain why they stand out."}],$xe=()=>{const[e]=vi(),{source:t}=Ln(),[n,r]=m.useState([]),[s,i]=m.useState(!1),[o,c]=m.useState(null),[d,f]=m.useState(!1),[h,p]=m.useState("timestamp"),[x,g]=m.useState("desc"),[j,b]=m.useState("all"),[y,S]=m.useState(!1),[C,N]=m.useState(!1),[E,A]=m.useState(!1),P=Q=>{if(h===Q){g(ee=>ee==="asc"?"desc":"asc");return}p(Q),g(Q==="timestamp"?"desc":"asc")},O=async()=>{i(!0);try{r(await t.listResults())}catch(Q){_e({title:"Could not load results",description:Q instanceof Error?Q.message:String(Q),variant:"destructive"})}finally{i(!1)}};m.useEffect(()=>{let Q=!0;return i(!0),t.listResults().then(ee=>{Q&&r(ee)}).catch(ee=>{Q&&_e({title:"Could not load results",description:ee instanceof Error?ee.message:String(ee),variant:"destructive"})}).finally(()=>{Q&&i(!1)}),()=>{Q=!1}},[t]);const{assistantMessages:T,assistantPendingToolCalls:$,assistantInput:z,assistantLoading:q,assistantChatEndRef:F,assistantInputRef:H,setAssistantInput:U,askAssistant:R,approveResultAssistantToolCall:W,denyResultAssistantToolCall:X,applyResultAssistantSnippet:G,ensureIntroMessage:B}=I6({source:t,open:C,scope:"all_runs"}),J=m.useMemo(()=>{const Q=new Map;return n.forEach(ee=>{ee.scenarios.forEach(pe=>{const ae=String(pe.scenarioName??"").trim(),Re=String(pe.scenarioId??"").trim();if(Re){Q.set(Re,ae||Re);return}ae&&Q.set(ae,ae)})}),Array.from(Q.entries()).map(([ee,pe])=>({value:ee,label:pe})).sort((ee,pe)=>ee.label.localeCompare(pe.label))},[n]);m.useEffect(()=>{const Q=(e.get("scenario")??"").trim();if(Q){if(J.some(ee=>ee.value===Q||ee.label===Q)){b(Q);return}n.length>0&&b("all")}},[e,J,n.length]);const D=m.useMemo(()=>j==="all"?n:n.filter(Q=>Q.scenarios.some(ee=>{const pe=String(ee.scenarioName??"").trim(),ae=String(ee.scenarioId??"").trim();return pe===j||ae===j})),[n,j]),I=m.useMemo(()=>j==="all"?"All scenarios":J.find(ee=>ee.value===j||ee.label===j)?.label??j,[j,J]),re=m.useMemo(()=>{const Q=(pe,ae)=>pe===null&&ae===null?0:pe===null?1:ae===null?-1:x==="asc"?pe-ae:ae-pe;return[...D].sort((pe,ae)=>{if(h==="toolTokens")return Q(pe.toolTokenUsage?.totalTokens??null,ae.toolTokenUsage?.totalTokens??null);let Re=0;return h==="id"&&(Re=pe.id.localeCompare(ae.id)),h==="timestamp"&&(Re=new Date(pe.timestamp).getTime()-new Date(ae.timestamp).getTime()),h==="passRate"&&(Re=pe.overallPassRate-ae.overallPassRate),h==="scenarios"&&(Re=pe.totalScenarios-ae.totalScenarios),h==="avgToolCalls"&&(Re=pe.avgToolCalls-ae.avgToolCalls),x==="asc"?Re:-Re})},[D,h,x]),ne=Q=>h!==Q?a.jsx(xc,{className:"h-3.5 w-3.5 text-muted-foreground"}):x==="asc"?a.jsx(ws,{className:"h-3.5 w-3.5"}):a.jsx(Yt,{className:"h-3.5 w-3.5"}),fe=Q=>{const ee=Q.toolTokenUsage?.totalTokens;return typeof ee=="number"?ee.toLocaleString():"n/a"},he=m.useMemo(()=>{const Q=new Map;for(const ee of re)Q.set(ee.id,M6(ee));return Q},[re]),V=()=>{N(!0),B("Ask me to compare runs, explain regressions over time, or summarize historical drift patterns.")},de=async Q=>{f(!0);try{await t.deleteResult(Q),r(ee=>ee.filter(pe=>pe.id!==Q)),_e({title:"Run deleted",description:Q}),c(null)}catch(ee){_e({title:"Could not delete run",description:ee instanceof Error?ee.message:String(ee),variant:"destructive"})}finally{f(!1)}};return a.jsxs("div",{className:"space-y-6",children:[a.jsx(Ls,{open:o!==null,onOpenChange:Q=>{!Q&&!d&&c(null)},children:a.jsxs(ss,{children:[a.jsxs(is,{children:[a.jsx(ls,{children:"Delete run?"}),a.jsxs(cs,{children:["This will permanently remove the run artifacts from disk for"," ",a.jsx("span",{className:"font-mono",children:o??""}),"."]})]}),a.jsxs(os,{children:[a.jsx(ds,{disabled:d,children:"Cancel"}),a.jsx(us,{disabled:d||!o,onClick:Q=>{Q.preventDefault(),o&&de(o)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:d?"Deleting...":"Delete run"})]})]})}),a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[a.jsx(Ac,{className:"h-6 w-6"}),"Results"]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Browse evaluation runs and open detailed results"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(iu,{open:y,onOpenChange:S,children:[a.jsx(ou,{asChild:!0,children:a.jsxs(se,{type:"button",variant:"outline",role:"combobox","aria-expanded":y,className:"w-[260px] justify-between font-normal",children:[a.jsx("span",{className:"truncate text-left",children:I}),a.jsx(Yt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsx(cl,{className:"w-[260px] p-0",align:"start",children:a.jsxs(dl,{children:[a.jsx(fl,{placeholder:"Search scenarios..."}),a.jsxs(pl,{children:[a.jsx(hl,{children:"No scenarios found."}),a.jsxs(ml,{children:[a.jsx(ua,{value:"all scenarios",onSelect:()=>{b("all"),S(!1)},children:"All scenarios"}),J.map(Q=>a.jsx(ua,{value:`${Q.label} ${Q.value}`,onSelect:()=>{b(Q.value),S(!1)},children:Q.label},Q.value))]})]})]})})]}),a.jsx(se,{variant:"outline",onClick:()=>{O()},disabled:s,children:s?"Refreshing...":"Refresh"}),a.jsxs(se,{type:"button",variant:"outline",className:"gap-1.5",onClick:V,children:[a.jsx(qr,{className:"h-4 w-4 text-amber-500"}),"MCP Lab Assistant"]})]})]}),a.jsxs("div",{className:`grid gap-6 ${C?E?"xl:grid-cols-[minmax(0,1fr)_52rem]":"xl:grid-cols-[minmax(0,1fr)_30rem]":"grid-cols-1"}`,children:[a.jsx(Ue,{children:a.jsx(We,{className:"p-0",children:a.jsxs(Wr,{children:[a.jsx(Vr,{children:a.jsxs(Gt,{children:[a.jsx(rt,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>P("id"),children:["Run ID",ne("id")]})}),a.jsx(rt,{children:"Evaluated"}),a.jsx(rt,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>P("timestamp"),children:["Timestamp",ne("timestamp")]})}),a.jsx(rt,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>P("passRate"),children:["Pass Rate",ne("passRate")]})}),a.jsx(rt,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>P("scenarios"),children:["Scenarios",ne("scenarios")]})}),a.jsx(rt,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>P("avgToolCalls"),children:["Avg Tool Calls",ne("avgToolCalls")]})}),a.jsx(rt,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>P("toolTokens"),children:["Tool Tokens",ne("toolTokens")]})}),a.jsx(rt,{className:"w-10"})]})}),a.jsx(Hr,{children:re.map(Q=>a.jsxs(Gt,{children:[a.jsx(ze,{children:a.jsxs("div",{className:"space-y-1",children:[a.jsx(At,{to:`/results/${Q.id}`,className:"font-mono text-xs text-primary hover:underline",children:Q.id}),Q.runNote?a.jsxs("div",{className:"text-[11px] text-muted-foreground break-words",children:["Note: ",Q.runNote]}):null]})}),a.jsx(ze,{className:"text-[11px] text-muted-foreground",children:(()=>{const ee=he.get(Q.id)??{scenarioCount:0,agentCount:0,scopePreview:"n/a",modelSummary:""};return a.jsxs("div",{className:"space-y-0.5",children:[a.jsxs("div",{children:["Evaluated: ",ee.scenarioCount," scenario",ee.scenarioCount===1?"":"s"," ·"," ",ee.agentCount," agent",ee.agentCount===1?"":"s",ee.modelSummary?` · ${ee.modelSummary}`:""]}),a.jsx("div",{className:"font-mono text-xs text-foreground/80",children:ee.scopePreview})]})})()}),a.jsx(ze,{className:"text-xs text-muted-foreground",children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(hi,{className:"h-3 w-3"}),new Date(Q.timestamp).toLocaleString()]})}),a.jsx(ze,{children:a.jsx(Js,{rate:Q.overallPassRate})}),a.jsx(ze,{className:"font-mono text-sm",children:Q.totalScenarios}),a.jsx(ze,{className:"font-mono text-sm",children:Q.avgToolCalls.toFixed(0)}),a.jsx(ze,{className:"font-mono text-sm",children:fe(Q)}),a.jsx(ze,{children:a.jsxs(Gf,{children:[a.jsx(Yf,{asChild:!0,children:a.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:a.jsx(av,{className:"h-4 w-4"})})}),a.jsxs(Nu,{align:"end",children:[a.jsx(Gr,{asChild:!0,children:a.jsxs(At,{to:`/results/${Q.id}`,children:[a.jsx(k7,{className:"mr-2 h-3.5 w-3.5"}),"View"]})}),a.jsxs(Gr,{children:[a.jsx(Ea,{className:"mr-2 h-3.5 w-3.5"}),"Export JSON"]}),a.jsxs(Gr,{className:"text-destructive",onSelect:ee=>{ee.preventDefault();const pe=document.activeElement;pe instanceof HTMLElement&&pe.blur(),c(Q.id)},children:[a.jsx(Ta,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]})})]},Q.id))})]})})}),C&&a.jsx(R6,{title:"MCP Lab Assistant",description:"Analyze historical differences and trends across all result runs.",expanded:E,onToggleExpanded:()=>A(Q=>!Q),onHide:()=>N(!1),messages:T,pendingToolCalls:$,loading:q,input:z,onInputChange:U,onSend:()=>{R()},inputPlaceholder:"Ask about historical run differences...",snippets:Mxe,onSnippetSelect:Q=>{N(!0),G(Q)},onApproveToolCall:Q=>{W(Q)},onDenyToolCall:Q=>{X(Q)},chatEndRef:F,inputRef:H,className:"min-w-0 overflow-hidden xl:flex xl:h-[calc(100vh-14rem)] xl:min-h-0 xl:flex-col",renderMessage:({message:Q,index:ee,linkedPendingToolCall:pe,isUser:ae,isAssistant:Re,isSystem:Ce,isTool:Me})=>{const L=Re&&!!Q.pendingToolCallId;if(Me&&/^(Approved|Denied) tool call\b/i.test(String(Q.text??"").trim()))return null;if(L){const oe=Mh(pe?.tool??Q.toolRequestName??pe?.publicToolName??Q.toolRequestPublicName??"unknown_tool");return a.jsxs("div",{className:"flex items-start gap-2",children:[a.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:a.jsx(Pr,{className:"h-3 w-3"})}),a.jsxs("details",{open:!!pe,className:"group min-w-0 w-full max-w-[92%] overflow-hidden rounded-md border border-border/60 bg-background",children:[a.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2",children:[a.jsx("div",{className:"min-w-0 flex-1",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ja,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),a.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:`Tool call ${oe}`}),a.jsx("span",{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${pe?"bg-amber-100 text-amber-900":"bg-muted text-muted-foreground"}`,children:pe?"Needs approval":"Completed"})]})}),a.jsx(Yt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),a.jsx("div",{className:"min-w-0 space-y-2 border-t border-border/50 px-3 py-2",children:a.jsx(Oa,{text:Q.text,className:"text-sm"})})]})]},`${Q.id??`${Q.role}-${ee}`}:tool`)}return a.jsxs("div",{className:`flex items-start gap-2 ${ae?"justify-end":"justify-start"}`,children:[!ae&&a.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:Ce?a.jsx(fN,{className:"h-3 w-3"}):a.jsx(Pr,{className:"h-3 w-3"})}),a.jsx("div",{className:`min-w-0 max-w-[92%] break-words rounded-md border p-3 text-sm ${ae?"border-primary/20 bg-primary/10":Ce?"border-amber-400/30 bg-amber-50/70":Me?"border-blue-300/30 bg-blue-50/50":"border-border/80 bg-background shadow-sm"}`,children:a.jsx(Oa,{text:Q.text,className:"text-sm"})}),ae&&a.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:a.jsx(Pc,{className:"h-3 w-3"})})]},Q.id??`${Q.role}-${ee}`)}})]})]})};function Dxe(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 s=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">${Do(c.scenarioName)}</span>
|
|
153
|
+
<span class="scenario-agent">${Do(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">${Do(f.name)} <small>${f.duration}ms</small></span>`).join("")}
|
|
166
|
+
</div>
|
|
167
|
+
${d.failureReasons.length?`<div class="failure-reasons">${d.failureReasons.map(f=>Do(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 — ${Do(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">${Do(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">${Do(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(s)},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 Do(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}const Lxe="mcplab.resultAssistantScenarioHandoff",Fxe=[{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 v$(e){const t=new Date().toISOString().replace(/[:]/g,"-").replace(/\..+/,"");return`mcplab/reports/result-assistant/${e}-${t}.md`}function g$(e){const t=e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}const Bxe=()=>{const{id:e}=yl(),t=Ia(),[n]=vi(),{source:r}=Ln(),s=n.get("embed")==="1",i=Ag("snapshots",!1),{configs:o}=Mf(),{scenarios:c}=rs(),[d,f]=m.useState(void 0),[h,p]=m.useState(!0),[x,g]=m.useState(!1),[j,b]=m.useState(""),[y,S]=m.useState(!1),[C,N]=m.useState(new Set),[E,A]=m.useState(new Set),[P,O]=m.useState([]),[T,$]=m.useState(""),[z,q]=m.useState(null),[F,H]=m.useState(!1),[U,R]=m.useState(""),[W,X]=m.useState(""),[G,B]=m.useState(!1),[J,D]=m.useState(!1),[I,re]=m.useState(!1),[ne,fe]=m.useState("assistant"),[he,V]=m.useState(null),[de,Q]=m.useState(!1),[ee,pe]=m.useState(""),[ae,Re]=m.useState(""),[Ce,Me]=m.useState(!1),[L,oe]=m.useState(!1),[ve,Pe]=m.useState(!1),[Ge,lt]=m.useState([]),[pt,vt]=m.useState(!1),[zt,qt]=m.useState(""),[Wt,Qt]=m.useState(null),[Ne,Xe]=m.useState(!1),[Fe,Ft]=m.useState(null),{assistantMessages:on,assistantPendingToolCalls:Ut,assistantInput:ye,assistantLoading:Ve,assistantChatEndRef:Be,assistantInputRef:xt,setAssistantInput:Ee,askAssistant:ue,approveResultAssistantToolCall:Ze,denyResultAssistantToolCall:ht,applyResultAssistantSnippet:Ot,ensureIntroMessage:Jt,resetAssistantSession:Pn}=I6({source:r,open:J,scope:"run",runId:e,onSessionSync:void 0}),mt=m.useCallback(async(Z,we)=>{vt(!0);try{const De=(await r.listMarkdownReports()).filter(Xt=>{const Rt=String(Xt.relativePath??""),xn=String(Xt.name??"");return Rt.includes(Z)||xn.includes(Z)});if(lt(De),we&&De.length>0){const Xt=De.find(Rt=>Rt.relativePath===we||Rt.path===we||Rt.relativePath.endsWith(we)||Rt.path.endsWith(we));Xt&&qt(Xt.relativePath)}return De}catch{return lt([]),[]}finally{vt(!1)}},[r]);m.useEffect(()=>{if(!e)return;let Z=!0;return Pn(),p(!0),r.getResult(e).then(we=>{Z&&(f(we),b(we?.runNote??""),g(!1),p(!1))}),()=>{Z=!1}},[e,r,Pn]),m.useEffect(()=>{let Z=!0;return r.listSnapshots().then(we=>{Z&&O(we)}).catch(()=>{Z&&O([])}),()=>{Z=!1}},[r]),m.useEffect(()=>{if(!d?.id){lt([]);return}let Z=!0;return(async()=>{const we=await mt(d.id)})(),()=>{Z=!1}},[d?.id,mt]),m.useEffect(()=>{if(Ge.length===0){qt(""),Qt(null),Ft(null);return}(!zt||!Ge.some(Z=>Z.relativePath===zt))&&qt(Ge[0].relativePath)},[Ge,zt]),m.useEffect(()=>{if(!J||ne!=="reports")return;if(!zt){Qt(null),Ft(null);return}let Z=!0;return Xe(!0),Ft(null),r.getMarkdownReport(zt).then(we=>{Z&&Qt(we)}).catch(we=>{Z&&(Qt(null),Ft(we instanceof Error?we.message:String(we)))}).finally(()=>{Z&&Xe(!1)}),()=>{Z=!1}},[J,ne,zt,r]);const It=n.get("configId")??"",Lt=(n.get("agent")??"").trim(),Kt=m.useMemo(()=>{const Z=It?o.find(we=>we.id===It):void 0;return Z||(d?o.find(we=>we.id===d.configId):void 0)},[o,It,d]),qn=m.useMemo(()=>{const Z=d?.configName?.trim();if(Z)return Z;const we=d?.configPath?.trim();if(we)return we;const st=Kt?.relativePath?.trim()||Kt?.name?.trim();return st||d?.configId?.trim()||""},[d,Kt]),le=m.useMemo(()=>{const Z=d?.configName?.trim();return Z||Kt?.name?.trim()||""},[d,Kt]),at=m.useMemo(()=>{const Z=d?.configPath?.trim();return Z||Kt?.relativePath?.trim()||""},[d,Kt]),Ct=m.useMemo(()=>{const Z=new Map;if(Kt){for(const we of Kt.scenarios)Z.set(we.id,we),we.name&&!Z.has(we.name)&&Z.set(we.name,we);for(const we of Kt.scenarioEntries??[]){if(we.kind!=="referenced")continue;const st=c.find(De=>De.id===we.ref);st&&(Z.set(st.id,st),st.name&&Z.set(st.name,st),Z.has(we.ref)||Z.set(we.ref,st))}}for(const we of c)Z.has(we.id)||Z.set(we.id,we),we.name&&!Z.has(we.name)&&Z.set(we.name,we);return Z},[Kt,c]),an=m.useMemo(()=>{if(!d?.snapshotEval?.baselineSnapshotId)return"";const Z=o.filter(we=>we.snapshotEval?.baselineSnapshotId===d.snapshotEval?.baselineSnapshotId);return Z.length===1?Z[0].id:""},[o,d?.snapshotEval?.baselineSnapshotId]);m.useEffect(()=>{d?.snapshotEval?.baselineSnapshotId&&$(Z=>Z||d.snapshotEval.baselineSnapshotId)},[d?.snapshotEval?.baselineSnapshotId]),m.useEffect(()=>{if(It&&o.some(Z=>Z.id===It)){R(It);return}an&&R(Z=>Z||an)},[It,o,an]);const{filteredScenarios:bt,filteredTotalRuns:kn,filteredPassCount:Fn,displayPassRate:Tr,displayAvgToolCalls:ji,displayAvgLatency:Fs,displayToolTokenUsage:Si}=m.useMemo(()=>{if(!d)return{filteredScenarios:[],filteredTotalRuns:0,filteredPassCount:0,displayPassRate:0,displayAvgToolCalls:0,displayAvgLatency:0,displayToolTokenUsage:null};const Z=Lt?d.scenarios.filter(Rt=>Rt.agentId===Lt||Rt.agentName===Lt):d.scenarios,we=Z.reduce((Rt,xn)=>Rt+xn.runs.length,0),st=Z.reduce((Rt,xn)=>Rt+xn.runs.filter(sr=>sr.passed).length,0),De=Z.reduce((Rt,xn)=>Rt+xn.runs.reduce((sr,ln)=>sr+ln.toolCalls.length,0),0),Xt=Z.reduce((Rt,xn)=>Rt+xn.runs.reduce((sr,ln)=>sr+ln.duration,0),0);return{filteredScenarios:Z,filteredTotalRuns:we,filteredPassCount:st,displayPassRate:we===0?0:st/we,displayAvgToolCalls:we===0?0:De/we,displayAvgLatency:we===0?0:Math.round(Xt/we),displayToolTokenUsage:yY(Z.map(Rt=>Rt.toolTokenUsage))}},[d,Lt]),Da=m.useMemo(()=>{const Z={};return bt.forEach(we=>we.runs.forEach(st=>st.toolCalls.forEach(De=>{Z[De.name]=(Z[De.name]||0)+1}))),Object.entries(Z).map(([we,st])=>({name:we,count:st})).sort((we,st)=>st.count-we.count)},[bt]);if(h)return a.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Loading result..."});if(!d)return a.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Result not found"});const K=Object.entries(d.mcpServerVersions??{}).map(([Z,we])=>`${Z}: ${we??"unknown"}`).join(", "),ge=Fn,He=Math.max(0,kn-ge),ct=[{name:"Pass",value:ge,color:"hsl(152, 69%, 40%)"},{name:"Fail",value:He,color:"hsl(0, 72%, 51%)"}],Vt=Z=>{N(we=>{const st=new Set(we);return st.has(Z)?st.delete(Z):st.add(Z),st})},yt=(Z,we,st,De)=>`${Z}:${we}:${st}:${De}`,Un=(Z,we)=>`${Z}::${we}`,In=Z=>{A(we=>{const st=new Set(we);return st.has(Z)?st.delete(Z):st.add(Z),st})},Ae=Z=>{const we=!Z.endsWith(":conversation");return E.has(Z)?!we:we},On=new Map((z?.scenario_results??[]).map(Z=>[Z.scenario_id,Z])),Et=async()=>{if(!(!d||!T)){H(!0);try{const Z=await r.compareSnapshot(T,d.id);q(Z)}finally{H(!1)}}},Zt=async Z=>{const we=Z||d.snapshotEval?.baselineSnapshotId;if(we){$(we),H(!0);try{const st=await r.compareSnapshot(we,d.id);q(st)}catch(st){_e({title:"Could not review drift",description:st instanceof Error?st.message:String(st),variant:"destructive"})}finally{H(!1)}}},Jr=async()=>{if(!U){_e({title:"Select a configuration",description:"Choose which config should receive the new baseline.",variant:"destructive"});return}B(!0);try{const Z=await r.generateSnapshotEvalBaseline(d.id,U,W.trim()||void 0);O(we=>[Z.snapshot,...we.filter(st=>st.id!==Z.snapshot.id)]),$(Z.snapshot.id),_e({title:"Baseline updated",description:`${Z.snapshot.name} is now linked to the selected config.`}),W.trim()||X(Z.snapshot.name),d.snapshotEval?.applied&&Zt(Z.snapshot.id)}catch(Z){_e({title:"Could not accept new baseline",description:Z instanceof Error?Z.message:String(Z),variant:"destructive"})}finally{B(!1)}},Ni=(Z,we)=>{fe("assistant"),D(!0),V(we?.scenarioId??null),Jt("Ask me to explain failures, tool usage, snapshot drift, or suggest what to inspect next in this result."),Z&&Ee(Z)},Eu=Ut.filter(Z=>Z.status==="pending"&&!on.some(we=>we.pendingToolCallId===Z.id)),El=Z=>{fe("reports"),D(!0)},va=()=>{fe("note"),D(!0)},Rg=Z=>{if(!d)return;if(!he){_e({title:"No scenario context",description:"Ask about a specific scenario or run first, then send the suggestion.",variant:"destructive"});return}const we=c.find(De=>De.id===he)??c.find(De=>De.name===he);if(!we){_e({title:"Scenario not found in library",description:`Could not find library scenario '${he}' to open in Scenario Assistant.`,variant:"destructive"});return}const st=[`I am sending a suggestion from the Result Assistant for scenario '${he}' based on run '${d.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:",Z].join(`
|
|
249
|
+
`);try{window.sessionStorage.setItem(Lxe,JSON.stringify({type:"result-assistant-handoff-v1",runId:d.id,configId:It||d.configId||"",scenarioId:we.id,prompt:st,sourceReply:Z})),t(`/libraries/test-cases/${encodeURIComponent(we.id)}?assistantHandoff=1`)}catch(De){_e({title:"Could not create handoff",description:De instanceof Error?De.message:String(De),variant:"destructive"})}},Rr=Z=>{d&&(Pe(!1),pe(Z),Re(v$(d.id)),Me(!1),Q(!0))},Ig=()=>{d&&(Pe(!0),pe(""),Re(v$(d.id)),Me(!1),Q(!0))},Mg=async()=>{if(!d)return;if(!ee.trim()){_e({title:"No markdown to write",description:"The selected assistant response is empty.",variant:"destructive"});return}oe(!0);try{const we=await r.applyResultAssistantReport({runId:d.id,markdown:ee,outputPath:ae.trim()||void 0,overwrite:Ce});_e({title:"Markdown report written",description:typeof we.path=="string"&&we.path?we.path:we.outputPath}),await mt(d.id,typeof we.path=="string"&&we.path||we.outputPath||void 0),J&&fe("reports"),Q(!1)}catch(we){_e({title:"Could not write markdown report",description:we instanceof Error?we.message:String(we),variant:"destructive"})}finally{oe(!1)}},$g=async Z=>{try{await navigator.clipboard.writeText(Z),_e({title:"Copied"})}catch(we){_e({title:"Could not copy",description:we instanceof Error?we.message:String(we),variant:"destructive"})}},Pl=async()=>{if(d){S(!0);try{const Z=j.trim();await r.updateRunNote(d.id,Z||void 0),f(we=>we&&{...we,runNote:Z||void 0}),b(Z),g(!1),_e({title:"Run note saved"})}catch(Z){_e({title:"Could not save run note",description:Z instanceof Error?Z.message:String(Z),variant:"destructive"})}finally{S(!1)}}};return a.jsxs("div",{className:`${J?"xl:flex xl:h-[calc(100vh-2rem-48px)] xl:min-h-0 xl:flex-col xl:overflow-hidden":""}`,children:[a.jsx("div",{className:`${J?"xl:shrink-0 xl:pb-6":"mb-6"}`,children:a.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[!s&&a.jsx(se,{variant:"ghost",size:"icon",asChild:!0,children:a.jsx(At,{to:"/results",children:a.jsx(Jo,{className:"h-4 w-4"})})}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("h1",{className:"text-2xl font-bold font-mono",children:d.id}),a.jsx(Js,{rate:Tr}),i&&d.snapshotEval?.applied&&a.jsxs(qe,{variant:"outline",className:"text-xs",children:["Snapshot policy · ",d.snapshotEval.mode," · ",d.snapshotEval.status]})]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[a.jsxs("span",{className:"inline-flex items-center gap-1 align-middle",children:[a.jsx(P7,{className:"h-3 w-3 shrink-0"}),new Date(d.timestamp).toLocaleString()]}),a.jsx("span",{className:"mx-1",children:"·"}),Lt?a.jsxs(a.Fragment,{children:[a.jsxs("span",{className:"inline-flex items-center align-middle",children:["Agent: ",Lt]}),a.jsx("span",{className:"mx-1",children:"·"})]}):null,le?a.jsxs("span",{className:"inline-flex items-center align-middle",children:["Eval: ",a.jsx("span",{className:"ml-1 font-medium",children:le})]}):null,le&&at?a.jsx("span",{className:"mx-1",children:"·"}):null,at?a.jsxs("span",{className:"inline-flex items-center align-middle",children:["Path: ",a.jsx("span",{className:"ml-1 font-mono",children:at})]}):null,!le&&!at&&qn?a.jsxs("span",{className:"inline-flex items-center align-middle",children:["Config: ",a.jsx("span",{className:"ml-1 font-mono",children:qn})]}):null]}),i&&d.snapshotEval?.applied&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Baseline: ",a.jsx("span",{className:"font-mono",children:d.snapshotEval.baselineSnapshotId})," · score: ",d.snapshotEval.overallScore]})]})]}),a.jsxs("div",{className:"flex w-full min-w-0 items-center justify-between gap-2 sm:ml-auto sm:w-auto",children:[K?a.jsxs("span",{className:"inline-flex max-w-[18rem] min-w-0 items-center rounded-sm border border-border/60 bg-muted/30 px-1.5 py-1 text-[11px] text-muted-foreground",children:[a.jsx("span",{className:"font-medium",children:"MCP:"}),a.jsx("span",{className:"ml-1 min-w-0 truncate font-mono",children:K})]}):null,a.jsxs("div",{className:"flex min-w-0 flex-wrap items-center justify-end gap-2",children:[i&&d.snapshotEval?.applied&&a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"max-w-full gap-1.5",onClick:()=>{Zt()},disabled:F,children:[a.jsx(dN,{className:"h-3.5 w-3.5"}),F?"Reviewing drift...":"Review Drift"]}),a.jsxs(se,{variant:"outline",size:"sm",className:`max-w-full gap-1.5 ${s?"px-2":""}`,onClick:()=>{const Z=Dxe(d),we=new Blob([Z],{type:"text/html"}),st=URL.createObjectURL(we),De=document.createElement("a");De.href=st,De.download=`mcplab-report-${d.id}.html`,De.click(),URL.revokeObjectURL(st)},"aria-label":"Download Report",title:"Download Report",children:[a.jsx(Ea,{className:"h-3.5 w-3.5"}),!s&&"Download Report"]}),a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"max-w-full gap-1.5",onClick:()=>El(),disabled:pt,children:[a.jsx(fc,{className:"h-3.5 w-3.5"}),pt?"Reference Reports...":`Reference Reports${Ge.length?` (${Ge.length})`:""}`]}),a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"max-w-full gap-1.5",onClick:()=>va(),children:[a.jsx(fc,{className:"h-3.5 w-3.5"}),"Run Note"]}),a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"max-w-full gap-1.5",onClick:()=>Ni(),children:[a.jsx(qr,{className:"h-4 w-4 text-amber-500"}),"MCP Lab Assistant"]})]})]})]})}),a.jsxs("div",{className:`grid gap-6 items-start ${J?I?"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:[a.jsxs("div",{className:`min-w-0 space-y-6 ${J?"xl:h-full xl:min-h-0 xl:overflow-y-auto xl:pr-2":""}`,children:[i&&d.snapshotEval?.applied&&a.jsxs(Ue,{className:"border-amber-500/30",children:[a.jsx(Pt,{className:"pb-3",children:a.jsx(kt,{className:"text-base",children:"Snapshot Drift Review"})}),a.jsxs(We,{className:"space-y-3",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[a.jsxs(qe,{variant:"outline",children:["Mode: ",d.snapshotEval.mode]}),a.jsxs(qe,{variant:"outline",children:["Status: ",d.snapshotEval.status]}),a.jsxs(qe,{variant:"outline",children:["Overall score: ",d.snapshotEval.overallScore]}),a.jsxs(qe,{variant:"outline",className:"font-mono",children:["Baseline: ",d.snapshotEval.baselineSnapshotId]})]}),d.snapshotEval.impactedScenarios.length>0&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Impacted scenarios: ",d.snapshotEval.impactedScenarios.join(", ")]}),a.jsxs("div",{className:"grid gap-3 lg:grid-cols-[1.2fr_1fr_auto] items-end",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Target config for baseline update"}),a.jsxs(jn,{value:U,onValueChange:R,children:[a.jsx(mn,{className:"h-8",children:a.jsx(Sn,{placeholder:"Select config to update"})}),a.jsx(vn,{children:o.map(Z=>a.jsx(et,{value:Z.id,children:Z.name},Z.id))})]}),!U&&a.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Tip: open results from the Run page to prefill the config automatically."})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"New snapshot name (optional)"}),a.jsx("div",{className:"relative",children:a.jsx("input",{value:W,onChange:Z=>X(Z.target.value),placeholder:`Snapshot ${d.id}`,className:"h-8 w-full rounded-md border bg-background px-2 text-xs"})})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5",onClick:()=>{Zt()},disabled:F,children:[a.jsx(ma,{className:`h-3.5 w-3.5 ${F?"animate-spin":""}`}),"Review Drift"]}),a.jsx(se,{type:"button",size:"sm",className:"h-8",onClick:()=>{Jr()},disabled:G||Tr!==1,children:G?"Accepting...":"Accept as New Baseline"})]})]}),Tr!==1&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"Baseline updates require a fully passing run (same rule as snapshot creation)."})]})]}),a.jsxs("div",{className:`grid gap-4 ${J?"grid-cols-3":"sm:grid-cols-2 lg:grid-cols-6"}`,children:[a.jsx(vs,{title:"Scenarios",value:bt.length,icon:Zj}),a.jsx(vs,{title:"Total Runs",value:kn,icon:Q$}),a.jsx(vs,{title:"Pass Rate",value:`${Math.round(Tr*100)}%`,icon:Ac}),a.jsx(vs,{title:"Avg Tool Calls",value:g$(ji),icon:Qi}),a.jsx(vs,{title:"Avg Latency",value:`${Fs}ms`,icon:sD}),a.jsx(vs,{title:"Tool Tokens",value:aa(Si?.totalTokens),icon:Ja})]}),a.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[a.jsxs(Ue,{children:[a.jsx(Pt,{className:"pb-2",children:a.jsx(kt,{className:"text-base",children:"Pass / Fail"})}),a.jsxs(We,{className:"flex items-center justify-center",children:[a.jsxs(ope,{width:180,height:180,children:[a.jsx(bi,{data:ct,dataKey:"value",innerRadius:50,outerRadius:75,paddingAngle:3,children:ct.map((Z,we)=>a.jsx(zv,{fill:Z.color},we))}),a.jsx(zr,{})]}),a.jsxs("div",{className:"ml-4 space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx("div",{className:"h-3 w-3 rounded-full bg-success"}),ge," passed"]}),a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx("div",{className:"h-3 w-3 rounded-full bg-destructive"}),He," failed"]})]})]})]}),a.jsxs(Ue,{children:[a.jsx(Pt,{className:"pb-2",children:a.jsx(kt,{className:"text-base",children:"Tool Usage"})}),a.jsx(We,{children:a.jsx(rm,{width:"100%",height:180,children:a.jsxs(ipe,{data:Da,layout:"vertical",children:[a.jsx(io,{type:"number",tick:{fontSize:11}}),a.jsx(oo,{type:"category",dataKey:"name",tick:{fontSize:11},width:120}),a.jsx(zr,{}),a.jsx(Cl,{dataKey:"count",fill:"hsl(38, 92%, 50%)",radius:[0,4,4,0]})]})})})]})]}),a.jsxs(Ue,{children:[a.jsx(Pt,{className:"pb-3",children:a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx(kt,{className:"text-base",children:"Scenarios"}),a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5 px-2 text-xs",onClick:()=>Ni("Summarize the scenario results in this run. Highlight failed scenarios/checks first, then mention notable tool usage and extracted values."),children:[a.jsx(qr,{className:"h-4 w-4 text-amber-500"}),"Ask Assistant"]})]})}),a.jsxs(We,{className:"p-0",children:[i&&a.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-b p-3",children:[a.jsxs("div",{className:"min-w-60 space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Snapshot"}),a.jsxs(jn,{value:T,onValueChange:$,children:[a.jsx(mn,{className:"h-8",children:a.jsx(Sn,{placeholder:"Select snapshot"})}),a.jsx(vn,{children:P.map(Z=>a.jsx(et,{value:Z.id,children:Z.name},Z.id))})]})]}),a.jsx(se,{type:"button",variant:"outline",size:"sm",disabled:!T||F,onClick:()=>{Et()},children:F?"Comparing...":"Compare Snapshot"}),z&&a.jsxs(qe,{variant:"outline",className:"h-8 px-2 py-0 text-xs",children:["Overall snapshot score: ",z.overall_score]})]}),a.jsxs(Wr,{children:[a.jsx(Vr,{children:a.jsxs(Gt,{children:[a.jsx(rt,{className:"w-8"}),a.jsx(rt,{children:"Scenario"}),a.jsx(rt,{children:"Agent"}),a.jsx(rt,{children:"Runs"}),a.jsx(rt,{children:"Pass Rate"}),a.jsx(rt,{children:"Tool Calls"}),a.jsx(rt,{children:"Tool Tokens"}),a.jsx(rt,{children:"Snapshot"})]})}),a.jsx(Hr,{children:bt.map(Z=>{const we=Un(Z.scenarioId,Z.agentName),st=Z.scenarioName||Z.scenarioId;return a.jsx(Xa,{open:C.has(we),onOpenChange:()=>Vt(we),asChild:!0,children:a.jsxs(a.Fragment,{children:[a.jsx(_a,{asChild:!0,children:a.jsxs(Gt,{className:"cursor-pointer hover:bg-muted/50",children:[a.jsx(ze,{children:a.jsx(Yt,{className:`h-4 w-4 transition-transform ${C.has(we)?"rotate-180":""}`})}),a.jsx(ze,{className:"font-medium text-sm",children:Z.scenarioName}),a.jsxs(ze,{className:"text-sm",children:[a.jsx("div",{children:Z.agentName}),(Z.provider||Z.model)&&a.jsx("div",{className:"text-xs text-muted-foreground",children:[Z.provider?Qm(Z.provider):null,Z.model].filter(Boolean).join(" · ")})]}),a.jsx(ze,{className:"font-mono text-sm",children:Z.runs.length}),a.jsx(ze,{children:a.jsx(Js,{rate:Z.passRate})}),a.jsx(ze,{className:"font-mono text-sm",children:g$(Z.avgToolCalls)}),a.jsx(ze,{className:"font-mono text-sm",children:aa(Z.toolTokenUsage?.totalTokens)}),a.jsx(ze,{children:(()=>{const De=On.get(Z.scenarioId);if(!De)return a.jsx("span",{className:"text-xs text-muted-foreground",children:"—"});const Xt=De.status==="Match"?"bg-success/15 text-success":De.status==="Warn"?"bg-amber-500/15 text-amber-600":"bg-destructive/15 text-destructive";return a.jsxs(qe,{variant:"outline",className:`text-xs ${Xt}`,children:[De.status," · ",De.score]})})()})]})}),a.jsx(Qa,{asChild:!0,children:a.jsx("tr",{children:a.jsx("td",{colSpan:8,className:"p-0",children:a.jsxs("div",{className:"bg-muted/30 p-4 space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border bg-card px-3 py-2",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"text-xs font-semibold",children:"Scenario details"}),a.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[st," · ",Z.agentName," · ",Math.round(Z.passRate*100),"% pass rate · ",aa(Z.toolTokenUsage?.totalTokens)," tool tokens"]})]}),a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>Ni(`Explain why scenario '${st}' failed (agent: ${Z.agentName}). Summarize the likely cause from the result details and suggest what to inspect next.`,{scenarioId:Z.scenarioId}),children:[a.jsx(qr,{className:"h-4 w-4 text-amber-500"}),"Ask Assistant"]})]}),(()=>{const De=On.get(Z.scenarioId);return!De||De.reasons.length===0?null:a.jsxs("div",{className:"rounded-md border bg-card p-2",children:[a.jsx("p",{className:"mb-1 text-xs font-semibold text-muted-foreground",children:"Snapshot reasons"}),a.jsxs("p",{className:"mb-1 text-[11px] text-muted-foreground",children:["Baseline agents: ",De.baseline_agents.join(", ")||"—"," · observed agents: ",De.observed_agents.join(", ")||"—"]}),a.jsx("ul",{className:"space-y-1 text-xs text-muted-foreground",children:De.reasons.map((Xt,Rt)=>a.jsxs("li",{children:["• ",Xt]},Rt))})]})})(),Z.runs.map(De=>a.jsxs("div",{className:"flex items-start gap-3 rounded-md border bg-card p-3 text-sm",children:[a.jsx("div",{className:"mt-0.5",children:De.passed?a.jsx(Qi,{className:"h-4 w-4 text-success"}):a.jsx(yc,{className:"h-4 w-4 text-destructive"})}),a.jsxs("div",{className:"flex-1 space-y-1",children:[(()=>{const Xt=Ct.get(Z.scenarioId),Rt=Xt?Uxe(Xt.evalRules,De.failureReasons):[],xn=Rt.filter(ln=>ln.status==="failed"),sr=Rt.filter(ln=>ln.status==="passed");return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:["Run #",De.runIndex+1]}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[De.duration,"ms"]}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[aa(De.toolTokenUsage?.totalTokens)," tool tokens"]}),!De.passed&&a.jsx(qe,{variant:"outline",className:"h-5 border-destructive/30 bg-destructive/10 text-destructive text-[10px]",children:"Failed"})]}),De.failureReasons.length>0&&a.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-2",children:[a.jsxs("p",{className:"mb-1 flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-destructive",children:[a.jsx(yc,{className:"h-3.5 w-3.5"}),"Failure reasons"]}),a.jsx("ul",{className:"space-y-1 text-xs text-destructive",children:De.failureReasons.map((ln,yo)=>a.jsxs("li",{children:["• ",w$(ln)]},yo))})]}),Rt.length>0&&a.jsx(Xa,{open:Ae(yt(Z.scenarioId,Z.agentName,De.runIndex,"checks")),onOpenChange:()=>In(yt(Z.scenarioId,Z.agentName,De.runIndex,"checks")),children:a.jsxs("div",{className:"rounded-md border bg-muted/20 p-2",children:[a.jsx(_a,{asChild:!0,children:a.jsxs("button",{type:"button",className:"mb-2 flex w-full flex-wrap items-center gap-2 text-left",children:[a.jsx(Yt,{className:`h-3.5 w-3.5 transition-transform ${Ae(yt(Z.scenarioId,Z.agentName,De.runIndex,"checks"))?"rotate-180":""}`}),a.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Checks"}),a.jsxs(qe,{variant:"outline",className:"h-5 border-success/30 bg-success/10 text-success text-[10px]",children:[sr.length," passed"]}),a.jsxs(qe,{variant:"outline",className:`h-5 text-[10px] ${xn.length>0?"border-destructive/30 bg-destructive/10 text-destructive":""}`,children:[xn.length," failed"]})]})}),a.jsx(Qa,{children:a.jsx("div",{className:"space-y-1",children:Rt.map((ln,yo)=>a.jsxs("div",{className:`flex items-start justify-between gap-2 rounded-md border px-2 py-1.5 text-xs ${ln.status==="failed"?"border-destructive/20 bg-destructive/5":"border-success/20 bg-success/5"}`,children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[ln.status==="failed"?a.jsx(yc,{className:"h-3.5 w-3.5 shrink-0 text-destructive"}):a.jsx(Qi,{className:"h-3.5 w-3.5 shrink-0 text-success"}),a.jsx("span",{className:"font-medium",children:Vxe(ln.rule)})]}),ln.failureReason&&a.jsx("p",{className:"mt-1 pl-5 text-[11px] text-destructive",children:w$(ln.failureReason)})]}),a.jsx(qe,{variant:"outline",className:`shrink-0 text-[10px] ${ln.status==="failed"?"border-destructive/30 text-destructive":"border-success/30 text-success"}`,children:ln.status})]},`${ln.rule.type}-${ln.rule.value??ln.rule.path??""}-${yo}`))})})]})})]})})(),a.jsx(Xa,{open:Ae(yt(Z.scenarioId,Z.agentName,De.runIndex,"extracts")),onOpenChange:()=>In(yt(Z.scenarioId,Z.agentName,De.runIndex,"extracts")),children:a.jsxs("div",{className:"rounded-md border border-violet-500/20 bg-violet-500/5 p-2",children:[a.jsx(_a,{asChild:!0,children:a.jsxs("button",{type:"button",className:"mb-2 flex w-full flex-wrap items-center justify-between gap-2 text-left",children:[a.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[a.jsx(Yt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${Ae(yt(Z.scenarioId,Z.agentName,De.runIndex,"extracts"))?"rotate-180":""}`}),a.jsxs("p",{className:"flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:[a.jsx(Zj,{className:"h-3.5 w-3.5 text-violet-600"}),"Extracted values"]})]}),a.jsxs(qe,{variant:"outline",className:"h-5 text-[10px]",children:[Object.keys(De.extractedValues??{}).length," total"]})]})}),a.jsx(Qa,{children:Object.keys(De.extractedValues??{}).length===0?a.jsx("p",{className:"text-xs text-muted-foreground",children:"No extracted values captured for this run."}):a.jsx("div",{className:"grid gap-1.5 sm:grid-cols-2",children:Object.entries(De.extractedValues??{}).map(([Xt,Rt])=>a.jsxs("div",{className:"rounded-md border bg-background px-2 py-1.5 text-xs",children:[a.jsx("div",{className:"mb-0.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:Xt}),a.jsx("div",{className:"font-mono break-all text-foreground",children:Rt===null?"null":String(Rt)})]},Xt))})})]})}),a.jsx(Xa,{open:Ae(yt(Z.scenarioId,Z.agentName,De.runIndex,"tools")),onOpenChange:()=>In(yt(Z.scenarioId,Z.agentName,De.runIndex,"tools")),children:a.jsxs("div",{className:"rounded-md border border-sky-500/20 bg-sky-500/5 p-2",children:[a.jsx(_a,{asChild:!0,children:a.jsxs("button",{type:"button",className:"mb-2 flex w-full flex-wrap items-center justify-between gap-2 text-left",children:[a.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[a.jsx(Yt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${Ae(yt(Z.scenarioId,Z.agentName,De.runIndex,"tools"))?"rotate-180":""}`}),a.jsxs("p",{className:"flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:[a.jsx(Ja,{className:"h-3.5 w-3.5 text-sky-600"}),"Tool call sequence"]})]}),a.jsxs(qe,{variant:"outline",className:"h-5 text-[10px]",children:[De.toolCalls.length," total"]})]})}),a.jsx(Qa,{children:De.toolCalls.length===0?a.jsx("p",{className:"text-xs text-muted-foreground",children:"No tool calls captured for this run."}):a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:"flex flex-wrap gap-1",children:a.jsx(ro,{delayDuration:0,children:De.toolCalls.map((Xt,Rt)=>{const xn=De.conversation.filter(ln=>ln.kind==="tool_call")[Rt]?.estimatedTokens,sr=typeof xn?.totalTokens=="number";return a.jsxs(ao,{children:[a.jsx(so,{asChild:!0,children:a.jsxs(qe,{variant:"outline",className:"font-mono text-xs bg-background",children:[a.jsxs("span",{className:"mr-1 text-muted-foreground",children:["#",Rt+1]}),Xt.name,a.jsxs("span",{className:"ml-1 text-muted-foreground",children:[Xt.duration,"ms"]}),sr&&a.jsxs("span",{className:"ml-1 text-muted-foreground",children:["· ",aa(xn?.totalTokens),"tok"]})]})}),sr&&a.jsx(ui,{className:"text-xs",children:`${Xt.name} · tokens total: ${aa(xn?.totalTokens)} · in: ${aa(xn?.inputTokens)} · out: ${aa(xn?.outputTokens)}`})]},Rt)})})}),a.jsxs("div",{className:"rounded-md border bg-background p-2",children:[a.jsxs("div",{className:"mb-1.5 flex items-center justify-between gap-2",children:[a.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Tool token estimate"}),a.jsx(qe,{variant:"outline",className:"h-5 text-[10px]",children:"estimated"})]}),Object.keys(De.toolTokenUsageByTool??{}).length===0?a.jsx("p",{className:"text-xs text-muted-foreground",children:"n/a"}):a.jsx("div",{className:"grid gap-1.5 sm:grid-cols-2",children:Object.entries(De.toolTokenUsageByTool??{}).map(([Xt,Rt])=>a.jsxs("div",{className:"rounded border bg-muted/30 px-2 py-1.5 text-xs",children:[a.jsx("div",{className:"font-mono text-[11px]",children:Xt}),a.jsxs("div",{className:"text-muted-foreground",children:["total: ",aa(Rt.totalTokens)," · in: ",aa(Rt.inputTokens)," · out: ",aa(Rt.outputTokens)]})]},Xt))})]})]})})]})}),a.jsx(Xa,{open:Ae(yt(Z.scenarioId,Z.agentName,De.runIndex,"final")),onOpenChange:()=>In(yt(Z.scenarioId,Z.agentName,De.runIndex,"final")),children:a.jsxs("div",{className:"rounded-md border border-muted-foreground/20 bg-card p-2",children:[a.jsx(_a,{asChild:!0,children:a.jsxs("button",{type:"button",className:"mb-2 flex w-full items-center gap-2 text-left",children:[a.jsx(Yt,{className:`h-3.5 w-3.5 transition-transform ${Ae(yt(Z.scenarioId,Z.agentName,De.runIndex,"final"))?"rotate-180":""}`}),a.jsxs("p",{className:"flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:[a.jsx(Pr,{className:"h-3.5 w-3.5"}),"Final answer"]})]})}),a.jsx(Qa,{children:a.jsx(aN,{text:De.finalAnswer||"No final answer captured.",maxLength:1200,className:"text-xs text-foreground"})})]})}),a.jsx(Xa,{open:Ae(yt(Z.scenarioId,Z.agentName,De.runIndex,"conversation")),onOpenChange:()=>In(yt(Z.scenarioId,Z.agentName,De.runIndex,"conversation")),children:a.jsxs("div",{className:"rounded-md border bg-muted/10 p-2",children:[a.jsxs("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[a.jsx(_a,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex min-w-0 items-center gap-2 text-left",children:[a.jsx(Yt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${Ae(yt(Z.scenarioId,Z.agentName,De.runIndex,"conversation"))?"rotate-180":""}`}),a.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Conversation trace"})]})}),a.jsx("div",{className:"flex flex-wrap gap-2",children:a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>Ni(`Explain Run #${De.runIndex+1} for scenario '${st}'. It ${De.passed?"passed":"failed"} in ${De.duration}ms. Focus on the tool sequence and ${De.passed?"why it passed":"what caused the failure"}.`,{scenarioId:Z.scenarioId}),children:[a.jsx(qr,{className:"h-4 w-4 text-amber-500"}),"Ask Assistant"]})})]}),a.jsx(Qa,{children:a.jsx("div",{className:"space-y-2 rounded-md border bg-muted/20 p-2",children:De.conversation.length===0?a.jsx("p",{className:"text-xs text-muted-foreground",children:"No conversation trace captured."}):De.conversation.map(Xt=>a.jsx(zxe,{item:Xt,fallbackUserPrompt:Ct.get(Z.scenarioId)?.prompt},Xt.id))})}),!Ae(yt(Z.scenarioId,Z.agentName,De.runIndex,"conversation"))&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"Expand to inspect user/assistant/tool messages for this run."})]})})]})]},De.runIndex))]})})})})]})},we)})})]})]})]})]}),J&&a.jsxs("div",{className:"min-w-0 space-y-0 xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[a.jsx(Sg,{value:ne,onValueChange:Z=>fe(Z),className:"min-w-0 -mb-px px-3 pt-1",children:a.jsxs(Xf,{className:"h-auto w-full justify-start rounded-none border-b bg-transparent p-0",children:[a.jsx(Cs,{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"}),a.jsx(Cs,{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"}),a.jsx(Cs,{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"})]})}),ne==="assistant"?a.jsx(R6,{title:"MCP Lab Assistant",description:"Ask questions about this run result, failures, tool usage, and snapshot drift.",expanded:I,onToggleExpanded:()=>re(Z=>!Z),onHide:()=>D(!1),messages:on,pendingToolCalls:Ut,loading:Ve,input:ye,onInputChange:Ee,onSend:()=>{ue()},inputPlaceholder:"Ask about this result...",snippets:Fxe,onSnippetSelect:Ot,onApproveToolCall:Z=>{Ze(Z)},onDenyToolCall:Z=>{ht(Z)},chatEndRef:Be,inputRef:xt,className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",renderMessage:({message:Z,index:we,linkedPendingToolCall:st,isUser:De,isAssistant:Xt,isSystem:Rt,isTool:xn})=>{const sr=Xt&&!!Z.pendingToolCallId;if(xn&&/^(Approved|Denied) tool call\\b/i.test(String(Z.text??"").trim()))return null;const ln=st?.tool??Z.toolRequestName,yo=st?.publicToolName??Z.toolRequestPublicName,kl=Xt&&!sr&&qxe(Z.text,!!he);if(sr){const Ol=st?.status==="pending",Zf=Mh(ln??yo??"unknown_tool");return a.jsxs("div",{className:"flex items-start gap-2",children:[a.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:a.jsx(Pr,{className:"h-3 w-3"})}),a.jsxs("details",{open:!!st,className:"group min-w-0 w-full max-w-[92%] overflow-hidden rounded-md border border-border/60 bg-background",children:[a.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2",children:[a.jsx("div",{className:"min-w-0 flex-1",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ja,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),a.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:`Tool call ${Zf}`}),a.jsx("span",{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${Ol?"bg-amber-100 text-amber-900":"bg-muted text-muted-foreground"}`,children:Ol?"Needs approval":"Completed"})]})}),a.jsx(Yt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),a.jsxs("div",{className:"min-w-0 space-y-2 border-t border-border/50 px-3 py-2",children:[a.jsx(Oa,{text:Z.text,className:"text-sm"}),Ol&&st&&a.jsxs(a.Fragment,{children:[a.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:a.jsx("code",{className:"break-words",children:JSON.stringify(st.arguments??{},null,2)})}),a.jsxs("div",{className:"flex justify-end gap-2",children:[a.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:Ve,onClick:()=>{ht(st.id)},children:"Deny"}),a.jsx(se,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:Ve,onClick:()=>{Ze(st.id)},children:"Approve"})]})]})]})]})]},`${Z.id??`${Z.role}-${we}`}:${st?"pending":"completed"}`)}const sn=De||Xt&&!xn&&!Rt;return a.jsxs("div",{className:`flex items-start gap-2 ${De?"justify-end":"justify-start"}`,children:[!De&&a.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:Rt?a.jsx(fN,{className:"h-3 w-3"}):a.jsx(Pr,{className:"h-3 w-3"})}),a.jsxs("div",{className:"relative max-w-[92%]",children:[a.jsxs("div",{className:`max-w-full rounded-md border p-3 text-sm ${De?"border-primary/20 bg-primary/10":Rt?"border-amber-400/30 bg-amber-50/70":xn?"border-blue-300/30 bg-blue-50/50":"border-border/80 bg-background shadow-sm"}`,children:[!(De||Rt)&&a.jsx("p",{className:`mb-2 text-[11px] font-semibold text-muted-foreground ${De?"text-right":""}`,children:xn?"Tool":"Assistant"}),a.jsx(Oa,{text:Z.text,className:"text-sm"}),kl&&a.jsxs("div",{className:"mt-3 flex max-w-full flex-wrap justify-end gap-2 overflow-x-auto pb-1",children:[a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>Rg(Z.text),children:[a.jsx(qr,{className:"h-4 w-4 text-amber-500"}),"Send to Scenario Assistant"]}),a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>Rr(Z.text),children:[a.jsx(Ja,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})]}),!kl&&Xt&&!sr&&a.jsx("div",{className:"mt-3 flex max-w-full justify-end overflow-x-auto pb-1",children:a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>Rr(Z.text),children:[a.jsx(Ja,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})})]}),sn&&a.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"absolute -right-8 bottom-1 h-6 w-6 text-muted-foreground",onClick:()=>{$g(Z.text)},"aria-label":"Copy message",title:"Copy message",children:a.jsx(_s,{className:"h-3.5 w-3.5"})})]}),De&&a.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:a.jsx(Pc,{className:"h-3 w-3"})})]},Z.id??`${Z.role}-${we}`)},renderMessageExtras:Eu.length>0?a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Pending actions (approve/deny)"}),Eu.map(Z=>a.jsxs("details",{open:!0,className:"group min-w-0 rounded-md border bg-background",children:[a.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-2 p-3",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"break-all font-mono text-xs font-semibold",children:Mh(Z.publicToolName)}),a.jsxs("p",{className:"break-all text-xs text-muted-foreground",children:[Z.server,"::",Mh(Z.tool)]})]}),a.jsx(Yt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),a.jsxs("div",{className:"border-t px-3 pb-3 pt-2",children:[a.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:a.jsx("code",{className:"break-words",children:JSON.stringify(Z.arguments??{},null,2)})}),a.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[a.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:Ve,onClick:()=>{ht(Z.id)},children:"Deny"}),a.jsx(se,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:Ve,onClick:()=>{Ze(Z.id)},children:"Approve"})]})]})]},Z.id))]}):null}):ne==="reports"?a.jsxs(Ue,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[a.jsx(Pt,{className:"border-b px-4 py-3",children:a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs(kt,{className:"flex items-center gap-2 text-base",children:[a.jsx(fc,{className:"h-4 w-4 text-muted-foreground"}),"Reference Reports"]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>re(Z=>!Z),children:[I?a.jsx(tS,{className:"h-3.5 w-3.5"}):a.jsx(nS,{className:"h-3.5 w-3.5"}),I?"Compact":"Expand"]}),a.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>D(!1),children:"Hide"})]})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Review markdown reports for this run while keeping the result visible."})]})}),a.jsxs(We,{className:"flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1",children:[(pt||Ge.length===0||Ge.length>1)&&a.jsx("div",{className:"border-b px-4 py-3",children:pt?a.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading reference reports..."}):Ge.length===0?a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"No reference reports for this run yet."}),a.jsxs(se,{type:"button",size:"sm",variant:"outline",className:"shrink-0 gap-1.5",onClick:()=>Ig(),children:[a.jsx(oi,{className:"h-3.5 w-3.5"}),"New Report"]})]}):a.jsx("div",{className:"space-y-2",children:Ge.length>1?a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Selected report"}),a.jsxs(jn,{value:zt,onValueChange:qt,children:[a.jsx(mn,{className:"h-8",children:a.jsx(Sn,{placeholder:"Select a report"})}),a.jsx(vn,{children:Ge.map(Z=>a.jsx(et,{value:Z.relativePath,children:Z.name},Z.path))})]})]}):null})}),a.jsx(ZC,{className:"min-h-0 flex-1 bg-muted/15 px-4 py-4",children:Ge.length===0?a.jsx("div",{className:"text-sm text-muted-foreground",children:"No report selected."}):Ne?a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[a.jsx(wr,{className:"h-4 w-4 animate-spin"}),"Loading report..."]}):Fe?a.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive",children:["Could not load report: ",Fe]}):Wt?a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"rounded-md border bg-background p-3",children:[a.jsx("p",{className:"font-mono text-xs font-semibold",children:Wt.name}),a.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:Wt.relativePath}),a.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:new Date(Wt.mtime).toLocaleString()})]}),a.jsx("div",{className:"rounded-md border bg-background p-3",children:a.jsx(Oa,{text:Wt.content,className:"text-sm"})})]}):a.jsx("div",{className:"text-sm text-muted-foreground",children:"Select a report to preview."})})]})]}):a.jsxs(Ue,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[a.jsx(Pt,{className:"border-b px-4 py-3",children:a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs(kt,{className:"flex items-center gap-2 text-base",children:[a.jsx(fc,{className:"h-4 w-4 text-muted-foreground"}),"Run Note"]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>re(Z=>!Z),children:[I?a.jsx(tS,{className:"h-3.5 w-3.5"}):a.jsx(nS,{className:"h-3.5 w-3.5"}),I?"Compact":"Expand"]}),a.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>D(!1),children:"Hide"})]})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Add context for this run, such as server version or environment details."})]})}),a.jsx(We,{className:"flex h-[70vh] min-h-[520px] flex-col p-4 xl:h-auto xl:min-h-0 xl:flex-1",children:x?a.jsxs("div",{className:"w-full max-w-xl space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("p",{className:"text-xs font-medium",children:"Run note"}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[j.length,"/500"]})]}),a.jsx(Os,{value:j,onChange:Z=>b(Z.target.value.slice(0,500)),placeholder:"Optional context for this run",rows:3,className:"min-h-20 resize"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(se,{size:"sm",onClick:()=>{Pl()},disabled:y,children:y?"Saving...":"Save note"}),a.jsx(se,{size:"sm",variant:"outline",onClick:()=>{b(d.runNote??""),g(!1)},disabled:y,children:"Cancel"})]})]}):a.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:[a.jsxs("div",{className:"min-w-0 flex items-center gap-2",children:[a.jsx("span",{className:"text-muted-foreground",children:"Run note:"}),a.jsx("span",{className:`break-words ${d.runNote?"text-foreground":"text-muted-foreground"}`,children:d.runNote||"none"})]}),a.jsx(se,{size:"sm",variant:"ghost",className:"ml-auto h-6 px-2 text-xs",onClick:()=>g(!0),children:d.runNote?"Edit":"Add note"})]})})]})]}),a.jsx(Ls,{open:de,onOpenChange:Z=>!L&&Q(Z),children:a.jsxs(ss,{className:"max-w-2xl",children:[a.jsxs(is,{children:[a.jsx(ls,{children:ve?"Create markdown report":"Approve MCP action: write markdown report"}),a.jsx(cs,{children:ve?"Write a custom markdown report and save it to the workspace.":a.jsxs(a.Fragment,{children:["This will call ",a.jsx("code",{children:"mcplab_write_markdown_report"})," via the local MCPLab MCP server."]})})]}),a.jsxs("div",{className:"space-y-3",children:[!ve&&a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Output path"}),a.jsx(gt,{value:ae,onChange:Z=>Re(Z.target.value),placeholder:"mcplab/reports/result-assistant/my-report.md",disabled:L})]}),a.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[a.jsx(Yr,{checked:Ce,onCheckedChange:Z=>Me(Z===!0),disabled:L}),a.jsx("span",{children:"Overwrite if file exists"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:ve?"Markdown content":"Markdown preview (to be written)"}),a.jsx(Os,{value:ee,onChange:Z=>pe(Z.target.value),rows:10,className:"font-mono text-xs",disabled:L})]})]}),a.jsxs(os,{children:[a.jsx(ds,{disabled:L,children:"Cancel"}),a.jsx(us,{onClick:Z=>{Z.preventDefault(),Mg()},disabled:L,children:L?"Writing...":ve?"Save Report":"Approve & Write"})]})]})})]})]})};function zxe({item:e,fallbackUserPrompt:t}){if(e.kind==="tool_call"){const d=x$(e,"input");return a.jsx(b$,{variant:"call",title:`Tool call · ${e.toolName||"unknown"}${d}`,text:e.text})}if(e.kind==="tool_result"){const d=x$(e,"output"),f=e.ok?a.jsx(Qi,{className:"h-3.5 w-3.5 text-emerald-700 dark:text-emerald-300"}):a.jsx(yc,{className:"h-3.5 w-3.5 text-rose-700 dark:text-rose-300"});return a.jsx(b$,{variant:e.ok?"result_ok":"result_error",title:`Tool result · ${e.toolName||"unknown"} · ${e.ok?"ok":"error"}${typeof e.durationMs=="number"?` · ${e.durationMs}ms`:""}${d}`,text:e.text,icon:f})}const n=e.kind==="user_prompt",r=y$(e.text,e.kind),s=t?y$(t,"user_prompt"):"",i=n&&!r&&s?s:r,o=n?"User prompt":e.kind==="assistant_final"?"Agent final":"Agent",c=n?Pc:Pr;return a.jsxs("div",{className:`flex items-start gap-2 text-xs ${n?"justify-end":"justify-start"}`,children:[!n&&a.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:a.jsx(c,{className:"h-3 w-3"})}),a.jsxs("div",{className:`max-w-[90%] rounded-md p-2 ${n?"bg-primary/10":"bg-muted/50"}`,children:[a.jsx("p",{className:`mb-1 text-[11px] font-semibold text-muted-foreground ${n?"text-right":""}`,children:o}),n?a.jsx(aN,{text:i,maxLength:280,className:"text-xs"}):a.jsx(aN,{text:i,maxLength:500,className:"text-xs"})]}),n&&a.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:a.jsx(c,{className:"h-3 w-3"})})]})}function x$(e,t){const n=t==="input"?e.estimatedTokens?.inputTokens:e.estimatedTokens?.outputTokens;return typeof n!="number"?"":` · ${aa(n)} tokens`}function y$(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 qxe(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 "],s=["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))&&!s.some(h=>n.includes(h)))return!1;const o=r.some(h=>n.includes(h)),c=s.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 b$({variant:e,title:t,text:n,icon:r}){const[s,i]=m.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 a.jsx(Xa,{open:s,onOpenChange:i,children:a.jsxs("div",{className:`rounded-md border p-2 text-xs ${o[e]}`,children:[a.jsx(_a,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex w-full items-center justify-between gap-2 text-left",children:[a.jsxs("div",{className:"flex items-center gap-1.5 font-mono text-[11px]",children:[r??a.jsx(Ja,{className:"h-3.5 w-3.5"}),a.jsx("span",{children:t})]}),a.jsx("span",{className:"text-[11px] font-semibold",children:s?"Hide content":"Show content"})]})}),a.jsx(Qa,{children:a.jsx("p",{className:"mt-2 font-mono whitespace-pre-wrap text-foreground",children:n})})]})})}function aN({text:e,maxLength:t,className:n}){const[r,s]=m.useState(!1),i=e.length>t,o=r||!i?e:`${e.slice(0,t)}...`;return a.jsxs("div",{children:[a.jsx(Oa,{text:o,className:n}),i&&a.jsx("button",{type:"button",className:"mt-1 text-[11px] font-medium text-primary hover:underline",onClick:()=>s(c=>!c),children:r?"Show less":"Show all"})]})}function Uxe(e,t){return e.map(n=>{const r=Wxe(n,t);return{rule:n,status:r?"failed":"passed",failureReason:r}})}function Wxe(e,t){const n=e.type==="required_tool"?`Required tool not used: ${e.value}`:e.type==="forbidden_tool"?`Forbidden tool used: ${e.value}`:e.type==="response_contains"?`Contains assertion failed: ${e.value}`:e.type==="response_not_contains"?`Not-contains assertion failed: ${e.value}`:e.type==="response_starts_with"?`Starts-with assertion failed: ${e.value}`:e.type==="response_ends_with"?`Ends-with assertion failed: ${e.value}`:e.type==="response_equals"?`Equals assertion failed: ${e.value}`:e.type==="response_regex"?`Regex assertion failed: ${e.value}`:e.type==="response_jsonpath"?e.equals!==void 0?`JSONPath equals assertion failed: ${e.path}`:`JSONPath assertion failed: ${e.path}`:e.type==="response_jsonpath_exists"?`JSONPath assertion failed: ${e.path}`:e.type==="response_jsonpath_not_exists"?`JSONPath not-exists assertion failed: ${e.path}`:"",r=t.find(s=>s===n);if(r)return r;if(e.type==="response_regex")return t.find(s=>s.startsWith("Regex assertion failed:")&&s.includes(e.value??""));if(e.type==="response_jsonpath"||e.type==="response_jsonpath_exists"||e.type==="response_jsonpath_not_exists")return t.find(s=>s.includes(e.path??""))}function Vxe(e){return e.type==="required_tool"?`Required tool · ${e.value}`:e.type==="forbidden_tool"?`Forbidden tool · ${e.value}`:e.type==="response_contains"?`Text contains · ${e.value}`:e.type==="response_not_contains"?`Text does not contain · ${e.value}`:e.type==="response_starts_with"?`Text starts with · ${e.value}`:e.type==="response_ends_with"?`Text ends with · ${e.value}`:e.type==="response_equals"?`Text equals · ${e.value}`:e.type==="response_regex"?`Text matches regex · ${e.value}`:e.type==="response_jsonpath"?e.equals!==void 0?`JSONPath equals · ${e.path} == ${String(e.equals)}`:`JSONPath exists · ${e.path}`:e.type==="response_jsonpath_exists"?`JSONPath exists · ${e.path}`:e.type==="response_jsonpath_not_exists"?`JSONPath not exists · ${e.path}`:`${e.type} · ${e.value}`}function w$(e){const t=String(e??"").trim(),n=t.match(/^Regex assertion failed:\s*(.+)$/i);return n?`Text match failed: ${n[1]}`:t}const Gj=["hsl(38, 92%, 50%)","hsl(200, 80%, 50%)","hsl(152, 69%, 40%)","hsl(280, 60%, 50%)","hsl(0, 72%, 51%)"];function Hxe(e,t){return e.length!==t.length?!1:e.every((n,r)=>n===t[r])}function Kxe(e){const t=e.find(n=>n.provider&&n.model)??e.find(n=>n.provider||n.model);return{provider:t?.provider,model:t?.model}}const Gxe=()=>{const{source:e}=Ln(),[t,n]=vi(),r=t.get("mode")==="within-run"?"within-run":"runs",[s,i]=m.useState([]),[o,c]=m.useState(!1),[d,f]=m.useState(new Set),[h,p]=m.useState("timestamp"),[x,g]=m.useState("desc"),[j,b]=m.useState("all"),[y,S]=m.useState(!1),C=t.get("runId")??"",N=(t.get("agents")??"").split(",").map(L=>L.trim()).filter(Boolean),E=t.get("scenario")??"all",[A,P]=m.useState(C),[O,T]=m.useState(N),[$,z]=m.useState(E),[q,F]=m.useState(!1),H=async()=>{c(!0);try{i(await e.listResults())}catch(L){_e({title:"Could not load results",description:L instanceof Error?L.message:String(L),variant:"destructive"})}finally{c(!1)}};m.useEffect(()=>{let L=!0;return c(!0),e.listResults().then(oe=>{L&&i(oe)}).catch(oe=>{L&&_e({title:"Could not load results",description:oe instanceof Error?oe.message:String(oe),variant:"destructive"})}).finally(()=>{L&&c(!1)}),()=>{L=!1}},[e]);const U=L=>{if(h===L){g(oe=>oe==="asc"?"desc":"asc");return}p(L),g(L==="timestamp"?"desc":"asc")},R=L=>{f(oe=>{const ve=new Set(oe);return ve.has(L)?ve.delete(L):ve.add(L),ve})},W=m.useMemo(()=>{const L=new Set;return s.forEach(oe=>{oe.scenarios.forEach(ve=>{const Pe=String(ve.scenarioName??"").trim(),Ge=String(ve.scenarioId??"").trim(),lt=Pe||Ge;lt&&L.add(lt)})}),Array.from(L).sort((oe,ve)=>oe.localeCompare(ve))},[s]),X=m.useMemo(()=>j==="all"?s:s.filter(L=>L.scenarios.some(oe=>{const ve=String(oe.scenarioName??"").trim(),Pe=String(oe.scenarioId??"").trim();return(ve||Pe)===j})),[s,j]),G=m.useMemo(()=>[...X].sort((L,oe)=>{let ve=0;return h==="id"&&(ve=L.id.localeCompare(oe.id)),h==="timestamp"&&(ve=new Date(L.timestamp).getTime()-new Date(oe.timestamp).getTime()),h==="passRate"&&(ve=L.overallPassRate-oe.overallPassRate),h==="scenarios"&&(ve=L.totalScenarios-oe.totalScenarios),x==="asc"?ve:-ve}),[X,h,x]),B=m.useMemo(()=>G.filter(L=>d.has(L.id)),[G,d]),J=L=>h!==L?a.jsx(xc,{className:"h-3.5 w-3.5 text-muted-foreground"}):x==="asc"?a.jsx(ws,{className:"h-3.5 w-3.5"}):a.jsx(Yt,{className:"h-3.5 w-3.5"}),D=m.useMemo(()=>{const L=new Map;for(const oe of G)L.set(oe.id,M6(oe));return L},[G]),I=L=>{const oe=Array.from(new Set(L.scenarios.map(ve=>ve.agentId).filter(Boolean)));return oe.slice(0,Math.min(2,oe.length))},re=L=>{const oe=I(L);P(L.id),T(oe),z("all");const ve=new URLSearchParams(t);ve.set("mode","within-run"),ve.set("runId",L.id),oe.length>0?ve.set("agents",oe.join(",")):ve.delete("agents"),ve.delete("scenario"),n(ve,{replace:!0})},ne=m.useMemo(()=>[...new Set(B.flatMap(L=>L.scenarios.map(oe=>oe.scenarioId)))],[B]),fe=m.useMemo(()=>{const L=new Map;for(const oe of B)for(const ve of oe.scenarios){const Pe=String(ve.scenarioId??"").trim();if(!Pe)continue;const Ge=String(ve.scenarioName??"").trim();L.set(Pe,Ge||Pe)}return L},[B]),he=m.useMemo(()=>s.find(L=>L.id===A),[s,A]),V=m.useMemo(()=>{if(!he)return[];const L=new Map;for(const oe of he.scenarios)L.set(oe.agentId,oe.agentName||oe.agentId);return Array.from(L.entries()).map(([oe,ve])=>({id:oe,name:ve})).sort((oe,ve)=>oe.name.localeCompare(ve.name))},[he]),de=m.useMemo(()=>{if(!he)return[];const L=new Set;for(const oe of he.scenarios){const ve=String(oe.scenarioName??"").trim(),Pe=String(oe.scenarioId??"").trim(),Ge=ve||Pe;Ge&&L.add(Ge)}return Array.from(L).sort((oe,ve)=>oe.localeCompare(ve))},[he]),Q=m.useMemo(()=>O.join(","),[O]);m.useEffect(()=>{if(r==="within-run"){const L=t.get("runId")??"",oe=(t.get("agents")??"").split(",").map(Pe=>Pe.trim()).filter(Boolean),ve=t.get("scenario")??"all";P(Pe=>Pe===L?Pe:L),T(Pe=>Hxe(Pe,oe)?Pe:oe),z(Pe=>Pe===ve?Pe:ve)}},[r,t]),m.useEffect(()=>{if(r!=="within-run"||s.length===0)return;let L=A;(!L||!s.some(vt=>vt.id===L))&&(L=s[0].id);const oe=s.find(vt=>vt.id===L),ve=(()=>{if(!oe)return[];const vt=new Map;for(const zt of oe.scenarios)vt.set(zt.agentId,zt.agentName||zt.agentId);return Array.from(vt.keys())})(),Pe=new Set(ve);let Ge=Q.split(",").map(vt=>vt.trim()).filter(vt=>!!vt).filter(vt=>Pe.has(vt));Ge.length===0&&ve.length>0&&(Ge=ve.slice(0,Math.min(2,ve.length)));const lt=(()=>{if(!oe)return new Set;const vt=new Set;for(const zt of oe.scenarios){const qt=String(zt.scenarioName??"").trim(),Wt=String(zt.scenarioId??"").trim(),Qt=qt||Wt;Qt&&vt.add(Qt)}return new Set(vt)})(),pt=$!=="all"&&!lt.has($)?"all":$;L!==A&&P(L),Ge.join(",")!==Q&&T(Ge),pt!==$&&z(pt)},[r,s,A,Q,$]),m.useEffect(()=>{const L=new URLSearchParams(t);r==="within-run"?(L.set("mode","within-run"),A?L.set("runId",A):L.delete("runId"),O.length>0?L.set("agents",O.join(",")):L.delete("agents"),$!=="all"?L.set("scenario",$):L.delete("scenario")):(L.delete("mode"),L.delete("runId"),L.delete("agents"),L.delete("scenario"));const oe=t.toString(),ve=L.toString();oe!==ve&&n(L,{replace:!0})},[r,A,O,$,t,n]);const ee=m.useMemo(()=>{if(!he)return[];const L=new Map;for(const ve of he.scenarios){const Pe=String(ve.scenarioId??"").trim(),Ge=String(ve.scenarioName??"").trim(),lt=Ge||Pe;if(!Pe&&!lt)continue;const pt=Pe||lt,vt=L.get(pt);if(vt){vt.byAgent[ve.agentId]=ve;continue}L.set(pt,{scenarioId:Pe||lt,scenarioName:Ge,displayLabel:lt||Pe,byAgent:{[ve.agentId]:ve}})}const oe=Array.from(L.values()).sort((ve,Pe)=>{const Ge=(ve.displayLabel||ve.scenarioId).toLowerCase(),lt=(Pe.displayLabel||Pe.scenarioId).toLowerCase();return Ge.localeCompare(lt)});return $==="all"?oe:oe.filter(ve=>ve.displayLabel===$)},[he,$]),pe=m.useMemo(()=>{const L=new Map(V.map(oe=>[oe.id,oe]));return O.map(oe=>L.get(oe)).filter(oe=>!!oe)},[O,V]),ae=m.useMemo(()=>{if(!he||pe.length!==2)return null;const[L,oe]=pe;return{left:L,right:oe,link:`/compare/results?left=${encodeURIComponent(he.id)}&right=${encodeURIComponent(he.id)}&leftConfig=${encodeURIComponent(he.configId)}&rightConfig=${encodeURIComponent(he.configId)}&leftAgent=${encodeURIComponent(L.id)}&rightAgent=${encodeURIComponent(oe.id)}`}},[he,pe]),Re=m.useMemo(()=>!he||pe.length===0?[]:pe.map(L=>{const oe=ee.map(qt=>qt.byAgent[L.id]).filter(qt=>!!qt),ve=oe.flatMap(qt=>qt.runs),Pe=ve.length,Ge=ve.filter(qt=>qt.passed).length,lt=ve.reduce((qt,Wt)=>qt+Wt.toolCalls.length,0),pt=ve.reduce((qt,Wt)=>qt+Wt.duration,0),{provider:vt,model:zt}=Kxe(oe);return{agentId:L.id,agentName:L.name,provider:vt,model:zt,passRate:Pe===0?0:Ge/Pe,totalRuns:Pe,avgToolCalls:Pe===0?0:lt/Pe,avgLatency:Pe===0?0:pt/Pe}}),[he,pe,ee]),Ce=L=>{T(oe=>oe.includes(L)?oe.filter(ve=>ve!==L):[...oe,L])},Me=L=>a.jsxs("div",{className:"min-w-0 rounded border bg-muted/20 px-2 py-1.5",children:[a.jsxs("div",{className:"text-xs",children:[a.jsxs("span",{className:"font-mono",children:["#",L.runIndex+1]})," ",a.jsx("span",{className:L.passed?"text-emerald-700":"text-destructive",children:L.passed?"PASS":"FAIL"})," ","· tools: ",L.toolCalls.length," · ",L.duration,"ms"]}),!L.passed&&L.failureReasons.length>0&&a.jsx("div",{className:"mt-1 max-h-16 overflow-y-auto whitespace-pre-wrap break-all pr-1 text-[11px] text-muted-foreground",children:L.failureReasons.join("; ")})]},L.runIndex);return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[a.jsx(dN,{className:"h-6 w-6"}),"Compare Runs"]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:r==="runs"?"Select 2–5 runs to compare":"Compare agents side-by-side within one run"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[r==="within-run"&&a.jsxs(se,{variant:"outline",size:"sm",onClick:()=>{const L=new URLSearchParams(t);L.delete("mode"),L.delete("runId"),L.delete("agents"),L.delete("scenario"),n(L,{replace:!0})},children:[a.jsx(J$,{className:"mr-1.5 h-4 w-4"}),"Back to Compare"]}),r==="runs"&&a.jsxs(iu,{open:y,onOpenChange:S,children:[a.jsx(ou,{asChild:!0,children:a.jsxs(se,{type:"button",variant:"outline",role:"combobox","aria-expanded":y,className:"w-[260px] justify-between font-normal",children:[a.jsx("span",{className:"truncate text-left",children:j==="all"?"All scenarios":j}),a.jsx(Yt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsx(cl,{className:"w-[260px] p-0",align:"start",children:a.jsxs(dl,{children:[a.jsx(fl,{placeholder:"Search scenarios..."}),a.jsxs(pl,{children:[a.jsx(hl,{children:"No scenarios found."}),a.jsxs(ml,{children:[a.jsx(ua,{value:"all scenarios",onSelect:()=>{b("all"),S(!1)},children:"All scenarios"}),W.map(L=>a.jsx(ua,{value:L,onSelect:()=>{b(L),S(!1)},children:L},L))]})]})]})})]}),a.jsx(se,{variant:"outline",onClick:()=>{H()},disabled:o,children:o?"Refreshing...":"Refresh"})]})]}),r==="within-run"&&a.jsxs(Ue,{children:[a.jsx(Pt,{className:"pb-3",children:a.jsx(kt,{className:"text-base",children:"Within One Run Controls"})}),a.jsxs(We,{className:"space-y-4",children:[a.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Run"}),a.jsxs(jn,{value:A,onValueChange:P,children:[a.jsx(mn,{children:a.jsx(Sn,{placeholder:"Select run"})}),a.jsx(vn,{children:s.map(L=>a.jsx(et,{value:L.id,children:L.id},L.id))})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Scenario filter"}),a.jsxs(iu,{open:q,onOpenChange:F,children:[a.jsx(ou,{asChild:!0,children:a.jsxs(se,{type:"button",variant:"outline",role:"combobox","aria-expanded":q,className:"w-full justify-between font-normal",children:[a.jsx("span",{className:"truncate text-left",children:$==="all"?"All scenarios":$}),a.jsx(Yt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsx(cl,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:a.jsxs(dl,{children:[a.jsx(fl,{placeholder:"Search scenarios..."}),a.jsxs(pl,{children:[a.jsx(hl,{children:"No scenarios found."}),a.jsxs(ml,{children:[a.jsx(ua,{value:"all scenarios",onSelect:()=>{z("all"),F(!1)},children:"All scenarios"}),de.map(L=>a.jsx(ua,{value:L,onSelect:()=>{z(L),F(!1)},children:L},L))]})]})]})})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Agents (select 2+)"}),a.jsxs("div",{className:"flex flex-wrap gap-3 rounded-md border p-3",children:[V.length===0&&a.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents available for selected run."}),V.map(L=>a.jsxs("label",{className:"inline-flex items-center gap-2 text-sm",children:[a.jsx(Yr,{checked:O.includes(L.id),onCheckedChange:()=>Ce(L.id)}),a.jsx("span",{children:L.name})]},L.id))]})]})]})]}),r==="runs"&&a.jsx(Ue,{children:a.jsx(We,{className:"p-0",children:a.jsxs(Wr,{containerClassName:"max-h-[36rem] overflow-auto",children:[a.jsx(Vr,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:a.jsxs(Gt,{children:[a.jsx(rt,{className:"w-10"}),a.jsx(rt,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>U("id"),children:["Run ID",J("id")]})}),a.jsx(rt,{children:"Evaluated"}),a.jsx(rt,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>U("timestamp"),children:["Timestamp",J("timestamp")]})}),a.jsx(rt,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>U("passRate"),children:["Pass Rate",J("passRate")]})}),a.jsx(rt,{children:a.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>U("scenarios"),children:["Scenarios",J("scenarios")]})}),a.jsx(rt,{children:"Agents"}),a.jsx(rt,{className:"w-[140px] text-right",children:"Action"})]})}),a.jsx(Hr,{children:G.map(L=>a.jsxs(Gt,{children:[a.jsx(ze,{children:a.jsx(Yr,{checked:d.has(L.id),onCheckedChange:()=>R(L.id),disabled:!d.has(L.id)&&d.size>=5})}),a.jsx(ze,{className:"font-mono text-xs",children:L.id}),a.jsx(ze,{className:"text-[11px] text-muted-foreground",children:(()=>{const oe=D.get(L.id)??{scenarioCount:0,agentCount:0,scopePreview:"n/a",modelSummary:""};return a.jsxs("div",{className:"space-y-0.5",children:[a.jsxs("div",{children:["Evaluated: ",oe.scenarioCount," scenario",oe.scenarioCount===1?"":"s"," · ",oe.agentCount," agent",oe.agentCount===1?"":"s",oe.modelSummary?` · ${oe.modelSummary}`:""]}),a.jsx("div",{className:"font-mono text-xs text-foreground/80",children:oe.scopePreview})]})})()}),a.jsx(ze,{className:"text-xs text-muted-foreground",children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(hi,{className:"h-3 w-3"}),new Date(L.timestamp).toLocaleString()]})}),a.jsx(ze,{children:a.jsx(Js,{rate:L.overallPassRate})}),a.jsx(ze,{className:"font-mono text-sm",children:L.totalScenarios}),a.jsx(ze,{className:"font-mono text-sm",children:D.get(L.id)?.agentCount??0}),a.jsx(ze,{className:"text-right",children:(D.get(L.id)?.agentCount??0)>1?a.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>re(L),children:"Compare agents"}):a.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})})]},L.id))})]})})}),r==="runs"&&B.length===0&&a.jsx(Ue,{children:a.jsxs(We,{className:"py-12 text-center",children:[a.jsx("p",{className:"text-sm font-medium",children:"No runs selected"}),a.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Select 2–5 runs from the table above to start a comparison."})]})}),r==="runs"&&B.length>=2&&a.jsxs(a.Fragment,{children:[B.length===2&&a.jsx(Ue,{children:a.jsx(We,{className:"pt-6",children:a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium",children:"Need a deeper comparison?"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Open the two selected runs in a dedicated side-by-side full result compare view."})]}),a.jsx(se,{asChild:!0,size:"sm",children:a.jsx(At,{to:`/compare/results?left=${encodeURIComponent(B[0].id)}&right=${encodeURIComponent(B[1].id)}&leftConfig=${encodeURIComponent(B[0].configId)}&rightConfig=${encodeURIComponent(B[1].configId)}`,children:"Compare full results"})})]})})}),a.jsxs(Ue,{children:[a.jsx(Pt,{className:"pb-3",children:a.jsx(kt,{className:"text-base",children:"Summary Comparison"})}),a.jsx(We,{className:"max-h-[24rem] overflow-auto p-0",children:a.jsxs(Wr,{className:"table-fixed",children:[a.jsx(Vr,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:a.jsxs(Gt,{children:[a.jsx(rt,{className:"w-[220px]",children:"Metric"}),B.map((L,oe)=>a.jsx(rt,{style:{color:Gj[oe]},className:"font-mono text-xs",children:L.id},L.id))]})}),a.jsxs(Hr,{children:[a.jsxs(Gt,{children:[a.jsx(ze,{className:"font-medium",children:"Pass Rate"}),B.map(L=>a.jsx(ze,{children:a.jsx(Js,{rate:L.overallPassRate})},L.id))]}),a.jsxs(Gt,{children:[a.jsx(ze,{className:"font-medium",children:"Total Runs"}),B.map(L=>a.jsx(ze,{className:"font-mono",children:L.totalRuns},L.id))]}),a.jsxs(Gt,{children:[a.jsx(ze,{className:"font-medium",children:"Tool Calls"}),B.map(L=>a.jsx(ze,{className:"font-mono",children:L.avgToolCalls.toFixed(1)},L.id))]}),a.jsxs(Gt,{children:[a.jsx(ze,{className:"font-medium",children:"Avg Latency"}),B.map(L=>a.jsxs(ze,{className:"font-mono",children:[L.avgLatency,"ms"]},L.id))]})]})]})})]}),a.jsxs(Ue,{children:[a.jsx(Pt,{className:"pb-3",children:a.jsx(kt,{className:"text-base",children:"Scenario Breakdown"})}),a.jsx(We,{className:"max-h-[26rem] overflow-auto p-0",children:a.jsxs(Wr,{className:"table-fixed",children:[a.jsx(Vr,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:a.jsxs(Gt,{children:[a.jsx(rt,{className:"w-[220px]",children:"Scenario"}),B.map((L,oe)=>a.jsx(rt,{style:{color:Gj[oe]},className:"font-mono text-xs",children:L.id},L.id))]})}),a.jsx(Hr,{children:ne.map(L=>a.jsxs(Gt,{children:[a.jsx(ze,{className:"font-medium text-sm",children:fe.get(L)??L}),B.map(oe=>{const ve=oe.scenarios.find(Pe=>Pe.scenarioId===L);return a.jsx(ze,{children:ve?a.jsx(Js,{rate:ve.passRate}):a.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},oe.id)})]},L))})]})})]})]}),r==="runs"&&B.length>=2&&a.jsxs(Ue,{children:[a.jsx(Pt,{className:"pb-3",children:a.jsx(kt,{className:"text-base",children:"Pass Rate Trend"})}),a.jsx(We,{className:"h-72",children:a.jsx(rm,{width:"100%",height:"100%",children:a.jsxs(z1,{data:B.map((L,oe)=>({idx:oe+1,runId:L.id,passRate:Number((L.overallPassRate*100).toFixed(1))})),children:[a.jsx(io,{dataKey:"idx",tickFormatter:L=>String(L)}),a.jsx(oo,{unit:"%",domain:[0,100]}),a.jsx(zr,{formatter:L=>[`${L}%`,"Pass Rate"],labelFormatter:L=>`Run ${L}`}),a.jsx(Ho,{}),a.jsx(il,{type:"monotone",dataKey:"passRate",stroke:Gj[0],strokeWidth:2.5,dot:!0})]})})})]}),r==="within-run"&&he&&pe.length<2&&a.jsx(Ue,{children:a.jsx(We,{className:"pt-6 text-sm text-muted-foreground",children:"Select at least 2 agents to compare side-by-side within this run."})}),r==="within-run"&&he&&pe.length>=2&&a.jsxs(a.Fragment,{children:[a.jsx(Ue,{children:a.jsx(We,{className:"pt-6",children:a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium",children:"Need full result details?"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:ae?"Open a side-by-side full result view filtered by the selected agents.":"Open the complete run result page for all details and trace navigation."})]}),a.jsx(se,{asChild:!0,size:"sm",children:ae?a.jsx(At,{to:ae.link,children:"Compare full results"}):a.jsx(At,{to:`/results/${encodeURIComponent(he.id)}${he.configId?`?configId=${encodeURIComponent(he.configId)}`:""}`,children:"Open full result"})})]})})}),a.jsxs(Ue,{children:[a.jsx(Pt,{className:"pb-3",children:a.jsx(kt,{className:"text-base",children:"Agent Summary"})}),a.jsx(We,{className:"max-h-[24rem] overflow-auto p-0",children:a.jsxs(Wr,{children:[a.jsx(Vr,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:a.jsxs(Gt,{children:[a.jsx(rt,{children:"Metric"}),Re.map(L=>a.jsxs(rt,{children:[a.jsx("div",{className:"font-medium text-sm",children:L.agentName}),(L.provider||L.model)&&a.jsx("div",{className:"font-mono text-xs font-normal text-muted-foreground",children:[L.provider?Qm(L.provider):null,L.model].filter(Boolean).join(" · ")})]},L.agentId))]})}),a.jsxs(Hr,{children:[a.jsxs(Gt,{children:[a.jsx(ze,{className:"font-medium",children:"Pass Rate"}),Re.map(L=>a.jsx(ze,{children:a.jsx(Js,{rate:L.passRate})},L.agentId))]}),a.jsxs(Gt,{children:[a.jsx(ze,{className:"font-medium",children:"Total Runs"}),Re.map(L=>a.jsx(ze,{className:"font-mono",children:L.totalRuns},L.agentId))]}),a.jsxs(Gt,{children:[a.jsx(ze,{className:"font-medium",children:"Avg Tool Calls"}),Re.map(L=>a.jsx(ze,{className:"font-mono",children:L.avgToolCalls.toFixed(1)},L.agentId))]}),a.jsxs(Gt,{children:[a.jsx(ze,{className:"font-medium",children:"Avg Latency"}),Re.map(L=>a.jsxs(ze,{className:"font-mono",children:[Math.round(L.avgLatency),"ms"]},L.agentId))]})]})]})})]}),a.jsxs(Ue,{children:[a.jsx(Pt,{className:"pb-3",children:a.jsx(kt,{className:"text-base",children:"Scenario × Agent Matrix"})}),a.jsx(We,{className:"max-h-[34rem] overflow-auto p-0",children:a.jsxs(Wr,{className:"table-fixed",children:[a.jsx(Vr,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:a.jsxs(Gt,{children:[a.jsx(rt,{className:"w-[260px]",children:"Scenario"}),pe.map(L=>{const oe=Re.find(ve=>ve.agentId===L.id);return a.jsxs(rt,{children:[a.jsx("div",{className:"font-medium text-sm",children:L.name}),(oe?.provider||oe?.model)&&a.jsx("div",{className:"font-mono text-xs font-normal text-muted-foreground",children:[oe.provider?Qm(oe.provider):null,oe.model].filter(Boolean).join(" · ")})]},L.id)})]})}),a.jsx(Hr,{children:ee.map(L=>a.jsxs(Gt,{children:[a.jsx(ze,{className:"font-medium text-sm",children:L.displayLabel}),pe.map(oe=>{const ve=L.byAgent[oe.id];return ve?a.jsx(ze,{className:"min-w-0 align-top",children:a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"text-xs text-muted-foreground",children:[a.jsx(Js,{rate:ve.passRate})," ",a.jsxs("span",{className:"ml-2",children:["runs: ",ve.runs.length]})," ","· calls: ",ve.avgToolCalls.toFixed(1)," · latency: ",Math.round(ve.avgDuration),"ms"]}),ve.runs.length>0?a.jsx("div",{className:"space-y-1.5",children:ve.runs.map(Pe=>Me(Pe))}):a.jsx("div",{className:"text-xs text-muted-foreground",children:"No runs captured."})]})},oe.id):a.jsx(ze,{children:a.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},oe.id)})]},L.scenarioId))})]})})]})]})]})},j$=(e,t,n)=>{const r=new URLSearchParams;return t&&r.set("configId",t),n&&r.set("agent",n),r.set("embed","1"),`/results/${encodeURIComponent(e)}?${r.toString()}`},S$=(e,t,n)=>{const r=new URLSearchParams;t&&r.set("configId",t),n&&r.set("agent",n);const s=r.toString();return`/results/${encodeURIComponent(e)}${s?`?${s}`:""}`},Yxe=()=>{const[e]=vi(),t=e.get("left")??"",n=e.get("right")??"",r=e.get("leftConfig"),s=e.get("rightConfig"),i=e.get("leftAgent"),o=e.get("rightAgent"),c=i?`${t} · ${i}`:t,d=o?`${n} · ${o}`:n;return!t||!n?a.jsxs(Ue,{children:[a.jsx(Pt,{children:a.jsx(kt,{className:"text-base",children:"Full Result Compare"})}),a.jsxs(We,{className:"space-y-3",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Select exactly two runs in Compare and use the “Compare full results” action."}),a.jsx(se,{asChild:!0,variant:"outline",children:a.jsx(At,{to:"/compare",children:"Back to Compare"})})]})]}):a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold",children:"Full Result Compare"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:i||o?"Side-by-side Result Detail views for deep inspection, filtered by selected agents.":"Side-by-side Result Detail views for deep inspection."})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(se,{variant:"outline",size:"sm",asChild:!0,children:a.jsxs(At,{to:"/compare",children:[a.jsx(J$,{className:"mr-1.5 h-4 w-4"}),"Back to Compare"]})}),a.jsx(se,{variant:"outline",size:"sm",asChild:!0,children:a.jsxs("a",{href:S$(t,r,i),target:"_blank",rel:"noreferrer",children:["Open Left",a.jsx($h,{className:"ml-1.5 h-3.5 w-3.5"})]})}),a.jsx(se,{variant:"outline",size:"sm",asChild:!0,children:a.jsxs("a",{href:S$(n,s,o),target:"_blank",rel:"noreferrer",children:["Open Right",a.jsx($h,{className:"ml-1.5 h-3.5 w-3.5"})]})})]})]}),a.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[a.jsxs(Ue,{className:"overflow-hidden",children:[a.jsx(Pt,{className:"py-3",children:a.jsx(kt,{className:"text-sm font-mono",children:c})}),a.jsx(We,{className:"p-0",children:a.jsx("iframe",{title:`Result ${c}`,src:j$(t,r,i),className:"h-[calc(100vh-15rem)] w-full border-0"})})]}),a.jsxs(Ue,{className:"overflow-hidden",children:[a.jsx(Pt,{className:"py-3",children:a.jsx(kt,{className:"text-sm font-mono",children:d})}),a.jsx(We,{className:"p-0",children:a.jsx("iframe",{title:`Result ${d}`,src:j$(n,s,o),className:"h-[calc(100vh-15rem)] w-full border-0"})})]})]})]})};function Xxe(e){return e.match(/(?:^|\/)(?:result-assistant|results?)\/([0-9]{8}-[0-9]{6})(?:-|\/)/i)?.[1]??null}function Qxe(){const{source:e}=Ln(),[t,n]=m.useState([]),[r,s]=m.useState(!0),[i,o]=m.useState(null),[c,d]=m.useState(!1),f=async()=>{s(!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{s(!1)}};m.useEffect(()=>{f()},[]);const h=m.useMemo(()=>t[0],[t]),p=m.useMemo(()=>t.find(g=>g.relativePath===i)??null,[t,i]),x=async()=>{if(i){d(!0);try{await e.deleteMarkdownReport(i),n(g=>g.filter(j=>j.relativePath!==i)),_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 a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[a.jsx(fc,{className:"h-6 w-6"}),"Markdown Reports"]}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Browse Markdown files under ",a.jsx("code",{children:"mcplab/reports"}),"."]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(se,{variant:"outline",onClick:()=>{f()},children:"Refresh"}),h?a.jsx(se,{asChild:!0,variant:"outline",children:a.jsx(At,{to:`/markdown-reports/view?path=${encodeURIComponent(h.relativePath)}`,children:"Open latest"})}):null]})]}),a.jsx(Ue,{children:a.jsx(We,{className:"p-0",children:r?a.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Loading markdown reports..."}):t.length===0?a.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"No markdown reports found yet."}):a.jsxs(Wr,{children:[a.jsx(Vr,{children:a.jsxs(Gt,{children:[a.jsx(rt,{children:"Report"}),a.jsx(rt,{children:"Result"}),a.jsx(rt,{children:"Folder"}),a.jsx(rt,{children:"Timestamp"}),a.jsx(rt,{className:"w-10"})]})}),a.jsx(Hr,{children:t.map(g=>a.jsxs(Gt,{children:[a.jsx(ze,{children:a.jsxs("div",{className:"space-y-1",children:[a.jsx(At,{to:`/markdown-reports/view?path=${encodeURIComponent(g.relativePath)}`,className:"font-mono text-xs text-primary hover:underline",children:g.name}),a.jsx("div",{className:"font-mono text-[11px] text-muted-foreground",children:g.relativePath})]})}),a.jsx(ze,{className:"text-xs text-muted-foreground font-mono",children:(()=>{const j=Xxe(g.relativePath);return j?a.jsx(At,{to:`/results/${encodeURIComponent(j)}`,className:"text-primary hover:underline",children:j}):a.jsx("span",{className:"text-muted-foreground",children:"—"})})()}),a.jsx(ze,{className:"text-xs text-muted-foreground font-mono",children:g.relativePath.includes("/")?g.relativePath.slice(0,g.relativePath.lastIndexOf("/")):"."}),a.jsx(ze,{className:"text-xs text-muted-foreground",children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(hi,{className:"h-3 w-3"}),new Date(g.mtime).toLocaleString()]})}),a.jsx(ze,{children:a.jsxs(Gf,{children:[a.jsx(Yf,{asChild:!0,children:a.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:a.jsx(av,{className:"h-4 w-4"})})}),a.jsxs(Nu,{align:"end",children:[a.jsx(Gr,{asChild:!0,children:a.jsx(At,{to:`/markdown-reports/view?path=${encodeURIComponent(g.relativePath)}`,children:"View"})}),a.jsxs(Gr,{className:"text-destructive",onSelect:j=>{j.preventDefault(),o(g.relativePath)},children:[a.jsx(Ta,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},g.path))})]})})}),a.jsx(Ls,{open:!!i,onOpenChange:g=>!g&&o(null),children:a.jsxs(ss,{children:[a.jsxs(is,{children:[a.jsx(ls,{children:"Delete markdown report?"}),a.jsx(cs,{children:p?`Delete '${p.name}' from disk? This cannot be undone.`:"Delete this report from disk? This cannot be undone."})]}),a.jsxs(os,{children:[a.jsx(ds,{disabled:c,children:"Cancel"}),a.jsx(us,{onClick:g=>{g.preventDefault(),x()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}function Jxe(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Zxe(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 eye(){const{source:e}=Ln(),[t]=vi(),n=(t.get("path")??"").trim(),[r,s]=m.useState(null),[i,o]=m.useState(!0),[c,d]=m.useState(!1),[f,h]=m.useState(!1);if(m.useEffect(()=>{let x=!0;if(s(null),d(!1),!n){o(!1);return}return o(!0),e.getMarkdownReport(n).then(g=>{x&&s(g)}).catch(g=>{if(!x)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(()=>{x&&o(!1)}),()=>{x=!1}},[n,e]),!n)return a.jsxs("div",{className:"space-y-4",children:[a.jsx("h1",{className:"text-2xl font-bold",children:"Markdown Report"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Missing report path."}),a.jsx(se,{asChild:!0,variant:"outline",children:a.jsx(At,{to:"/markdown-reports",children:"Back to Markdown Reports"})})]});if(i)return a.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading markdown report..."});if(c||!r)return a.jsxs("div",{className:"space-y-4",children:[a.jsx("h1",{className:"text-2xl font-bold",children:"Markdown Report"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Report not found."}),a.jsx(se,{asChild:!0,variant:"outline",children:a.jsx(At,{to:"/markdown-reports",children:"Back to Markdown Reports"})})]});const p=Zxe(r);return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("h1",{className:"font-mono text-xl font-semibold",children:r.name}),a.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[a.jsx("span",{className:"font-mono",children:r.relativePath}),a.jsx("span",{"aria-hidden":!0,children:"·"}),a.jsxs("span",{className:"inline-flex items-center gap-1 align-middle",children:[a.jsx(hi,{className:"h-3 w-3 shrink-0"}),new Date(r.mtime).toLocaleString()]}),a.jsx("span",{"aria-hidden":!0,children:"·"}),a.jsx("span",{children:Jxe(r.sizeBytes)})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[p?a.jsxs(a.Fragment,{children:[a.jsx(se,{variant:"outline",size:"sm",onClick:()=>h(!0),children:"Open Result Panel"}),a.jsx(se,{asChild:!0,variant:"outline",size:"sm",children:a.jsx(At,{to:`/results/${encodeURIComponent(p)}`,children:"Open Result"})})]}):null,a.jsx(se,{asChild:!0,variant:"outline",size:"sm",children:a.jsx(At,{to:"/markdown-reports",children:"Back to reports"})})]})]}),a.jsx(Ue,{children:a.jsx(We,{className:"pt-6",children:a.jsx(Oa,{text:r.content,variant:"assistant"})})}),p?a.jsx(B5,{open:f,onOpenChange:h,children:a.jsxs(MN,{side:"right",className:"w-[96vw] max-w-none p-0 sm:max-w-5xl",children:[a.jsx(q5,{className:"border-b px-4 py-3 pr-12",children:a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs(U5,{className:"text-base",children:["Result ",p]}),a.jsx(se,{asChild:!0,variant:"outline",size:"sm",children:a.jsx(At,{to:`/results/${encodeURIComponent(p)}`,target:"_blank",rel:"noreferrer",children:"Open full page"})})]})}),a.jsx("div",{className:"h-[calc(100vh-64px)]",children:a.jsx("iframe",{title:`Result ${p}`,src:`/results/${encodeURIComponent(p)}?embed=1`,className:"h-full w-full border-0"})})]})}):null]})}const tye=()=>{const e=Is();return m.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),a.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:a.jsxs("div",{className:"text-center",children:[a.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),a.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),a.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})},nye=new xH;function rye(){const{scenarioId:e}=yl();return a.jsx(l5,{to:e?`/libraries/test-cases/${encodeURIComponent(e)}`:"/libraries/test-cases",replace:!0})}const aye=()=>a.jsx(bH,{client:nye,children:a.jsx(ro,{children:a.jsx(OY,{children:a.jsx(MY,{children:a.jsxs(IY,{children:[a.jsx(N9,{}),a.jsx(nW,{}),a.jsx(wK,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:a.jsxs(fK,{children:[a.jsxs(pn,{element:a.jsx(RY,{}),children:[a.jsx(pn,{path:"/",element:a.jsx(lpe,{})}),a.jsx(pn,{path:"/mcp-evaluations",element:a.jsx(Eme,{})}),a.jsx(pn,{path:"/mcp-evaluations/:id",element:a.jsx(KM,{})}),a.jsx(pn,{path:"/mcp-evaluations/:id/:tab",element:a.jsx(KM,{})}),a.jsx(pn,{path:"/tool-analysis",element:a.jsx(Cxe,{})}),a.jsx(pn,{path:"/tool-analysis-results",element:a.jsx(_xe,{})}),a.jsx(pn,{path:"/tool-analysis-results/:id",element:a.jsx(Axe,{})}),a.jsx(pn,{path:"/oauth-debugger",element:a.jsx(kxe,{})}),a.jsx(pn,{path:"/libraries/servers",element:a.jsx(Bve,{})}),a.jsx(pn,{path:"/libraries/servers/:serverId",element:a.jsx(zve,{})}),a.jsx(pn,{path:"/libraries/agents",element:a.jsx(qve,{})}),a.jsx(pn,{path:"/libraries/agents/:agentName",element:a.jsx(Qge,{})}),a.jsx(pn,{path:"/libraries/test-cases",element:a.jsx(r$,{})}),a.jsx(pn,{path:"/libraries/test-cases/:testCaseId",element:a.jsx(r$,{})}),a.jsx(pn,{path:"/libraries/scenarios",element:a.jsx(l5,{to:"/libraries/test-cases",replace:!0})}),a.jsx(pn,{path:"/libraries/scenarios/:scenarioId",element:a.jsx(rye,{})}),a.jsx(pn,{path:"/settings",element:a.jsx(Jge,{})}),a.jsx(pn,{path:"/settings/mcp",element:a.jsx(sxe,{})}),a.jsx(pn,{path:"/run",element:a.jsx(Ixe,{})}),a.jsx(pn,{path:"/results",element:a.jsx($xe,{})}),a.jsx(pn,{path:"/results/:id",element:a.jsx(Bxe,{})}),a.jsx(pn,{path:"/markdown-reports",element:a.jsx(Qxe,{})}),a.jsx(pn,{path:"/markdown-reports/view",element:a.jsx(eye,{})}),a.jsx(pn,{path:"/compare",element:a.jsx(Gxe,{})}),a.jsx(pn,{path:"/compare/results",element:a.jsx(Yxe,{})})]}),a.jsx(pn,{path:"*",element:a.jsx(tye,{})})]})})]})})})})});jU.createRoot(document.getElementById("root")).render(a.jsx(aye,{}));
|