@inspectr/mcplab 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/assets/index-B2nN65ad.css +1 -0
- package/dist/app/assets/index-KAvcXAwp.js +249 -0
- package/dist/app/index.html +2 -2
- package/dist/app-server/runs-routes.d.ts +12 -0
- package/dist/app-server/runs-routes.d.ts.map +1 -1
- package/dist/app-server/runs-routes.js +11 -2
- package/dist/app-server/runs-routes.js.map +1 -1
- package/dist/cli.js +16 -3
- package/dist/cli.js.map +1 -1
- package/package.json +4 -4
- package/dist/app/assets/index-BjhCjzvC.css +0 -1
- package/dist/app/assets/index-BvtmNz6z.js +0 -249
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
function jU(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();var Ip=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ky={exports:{}},Mu={},Gy={exports:{}},Rt={};var tE;function SU(){if(tE)return Rt;tE=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function y(z){return z===null||typeof z!="object"?null:(z=p&&z[p]||z["@@iterator"],typeof z=="function"?z:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,b={};function x(z,M,re){this.props=z,this.context=M,this.refs=b,this.updater=re||g}x.prototype.isReactComponent={},x.prototype.setState=function(z,M){if(typeof z!="object"&&typeof z!="function"&&z!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,z,M,"setState")},x.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function S(){}S.prototype=x.prototype;function N(z,M,re){this.props=z,this.context=M,this.refs=b,this.updater=re||g}var C=N.prototype=new S;C.constructor=N,j(C,x.prototype),C.isPureReactComponent=!0;var E=Array.isArray,_=Object.prototype.hasOwnProperty,k={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function R(z,M,re){var te,G={},de=null,ce=null;if(M!=null)for(te in M.ref!==void 0&&(ce=M.ref),M.key!==void 0&&(de=""+M.key),M)_.call(M,te)&&!O.hasOwnProperty(te)&&(G[te]=M[te]);var he=arguments.length-2;if(he===1)G.children=re;else if(1<he){for(var ie=Array(he),ue=0;ue<he;ue++)ie[ue]=arguments[ue+2];G.children=ie}if(z&&z.defaultProps)for(te in he=z.defaultProps,he)G[te]===void 0&&(G[te]=he[te]);return{$$typeof:e,type:z,key:de,ref:ce,props:G,_owner:k.current}}function T(z,M){return{$$typeof:e,type:z.type,key:M,ref:z.ref,props:z.props,_owner:z._owner}}function F(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function L(z){var M={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(re){return M[re]})}var $=/\/+/g;function Y(z,M){return typeof z=="object"&&z!==null&&z.key!=null?L(""+z.key):M.toString(36)}function H(z,M,re,te,G){var de=typeof z;(de==="undefined"||de==="boolean")&&(z=null);var ce=!1;if(z===null)ce=!0;else switch(de){case"string":case"number":ce=!0;break;case"object":switch(z.$$typeof){case e:case t:ce=!0}}if(ce)return ce=z,G=G(ce),z=te===""?"."+Y(ce,0):te,E(G)?(re="",z!=null&&(re=z.replace($,"$&/")+"/"),H(G,M,re,"",function(ue){return ue})):G!=null&&(F(G)&&(G=T(G,re+(!G.key||ce&&ce.key===G.key?"":(""+G.key).replace($,"$&/")+"/")+z)),M.push(G)),1;if(ce=0,te=te===""?".":te+":",E(z))for(var he=0;he<z.length;he++){de=z[he];var ie=te+Y(de,he);ce+=H(de,M,re,ie,G)}else if(ie=y(z),typeof ie=="function")for(z=ie.call(z),he=0;!(de=z.next()).done;)de=de.value,ie=te+Y(de,he++),ce+=H(de,M,re,ie,G);else if(de==="object")throw M=String(z),Error("Objects are not valid as a React child (found: "+(M==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":M)+"). If you meant to render a collection of children, use an array instead.");return ce}function K(z,M,re){if(z==null)return z;var te=[],G=0;return H(z,te,"","",function(de){return M.call(re,de,G++)}),te}function J(z){if(z._status===-1){var M=z._result;M=M(),M.then(function(re){(z._status===0||z._status===-1)&&(z._status=1,z._result=re)},function(re){(z._status===0||z._status===-1)&&(z._status=2,z._result=re)}),z._status===-1&&(z._status=0,z._result=M)}if(z._status===1)return z._result.default;throw z._result}var Q={current:null},D={transition:null},B={ReactCurrentDispatcher:Q,ReactCurrentBatchConfig:D,ReactCurrentOwner:k};function Z(){throw Error("act(...) is not supported in production builds of React.")}return Rt.Children={map:K,forEach:function(z,M,re){K(z,function(){M.apply(this,arguments)},re)},count:function(z){var M=0;return K(z,function(){M++}),M},toArray:function(z){return K(z,function(M){return M})||[]},only:function(z){if(!F(z))throw Error("React.Children.only expected to receive a single React element child.");return z}},Rt.Component=x,Rt.Fragment=n,Rt.Profiler=a,Rt.PureComponent=N,Rt.StrictMode=r,Rt.Suspense=d,Rt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=B,Rt.act=Z,Rt.cloneElement=function(z,M,re){if(z==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+z+".");var te=j({},z.props),G=z.key,de=z.ref,ce=z._owner;if(M!=null){if(M.ref!==void 0&&(de=M.ref,ce=k.current),M.key!==void 0&&(G=""+M.key),z.type&&z.type.defaultProps)var he=z.type.defaultProps;for(ie in M)_.call(M,ie)&&!O.hasOwnProperty(ie)&&(te[ie]=M[ie]===void 0&&he!==void 0?he[ie]:M[ie])}var ie=arguments.length-2;if(ie===1)te.children=re;else if(1<ie){he=Array(ie);for(var ue=0;ue<ie;ue++)he[ue]=arguments[ue+2];te.children=he}return{$$typeof:e,type:z.type,key:G,ref:de,props:te,_owner:ce}},Rt.createContext=function(z){return z={$$typeof:o,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},z.Provider={$$typeof:i,_context:z},z.Consumer=z},Rt.createElement=R,Rt.createFactory=function(z){var M=R.bind(null,z);return M.type=z,M},Rt.createRef=function(){return{current:null}},Rt.forwardRef=function(z){return{$$typeof:c,render:z}},Rt.isValidElement=F,Rt.lazy=function(z){return{$$typeof:h,_payload:{_status:-1,_result:z},_init:J}},Rt.memo=function(z,M){return{$$typeof:f,type:z,compare:M===void 0?null:M}},Rt.startTransition=function(z){var M=D.transition;D.transition={};try{z()}finally{D.transition=M}},Rt.unstable_act=Z,Rt.useCallback=function(z,M){return Q.current.useCallback(z,M)},Rt.useContext=function(z){return Q.current.useContext(z)},Rt.useDebugValue=function(){},Rt.useDeferredValue=function(z){return Q.current.useDeferredValue(z)},Rt.useEffect=function(z,M){return Q.current.useEffect(z,M)},Rt.useId=function(){return Q.current.useId()},Rt.useImperativeHandle=function(z,M,re){return Q.current.useImperativeHandle(z,M,re)},Rt.useInsertionEffect=function(z,M){return Q.current.useInsertionEffect(z,M)},Rt.useLayoutEffect=function(z,M){return Q.current.useLayoutEffect(z,M)},Rt.useMemo=function(z,M){return Q.current.useMemo(z,M)},Rt.useReducer=function(z,M,re){return Q.current.useReducer(z,M,re)},Rt.useRef=function(z){return Q.current.useRef(z)},Rt.useState=function(z){return Q.current.useState(z)},Rt.useSyncExternalStore=function(z,M,re){return Q.current.useSyncExternalStore(z,M,re)},Rt.useTransition=function(){return Q.current.useTransition()},Rt.version="18.3.1",Rt}var nE;function TS(){return nE||(nE=1,Gy.exports=SU()),Gy.exports}var rE;function NU(){if(rE)return Mu;rE=1;var e=TS(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(c,d,f){var h,p={},y=null,g=null;f!==void 0&&(y=""+f),d.key!==void 0&&(y=""+d.key),d.ref!==void 0&&(g=d.ref);for(h in d)r.call(d,h)&&!i.hasOwnProperty(h)&&(p[h]=d[h]);if(c&&c.defaultProps)for(h in d=c.defaultProps,d)p[h]===void 0&&(p[h]=d[h]);return{$$typeof:t,type:c,key:y,ref:g,props:p,_owner:a.current}}return Mu.Fragment=n,Mu.jsx=o,Mu.jsxs=o,Mu}var aE;function CU(){return aE||(aE=1,Ky.exports=NU()),Ky.exports}var s=CU(),Mp={},Yy={exports:{}},Tr={},Xy={exports:{}},Qy={};var sE;function AU(){return sE||(sE=1,(function(e){function t(D,B){var Z=D.length;D.push(B);e:for(;0<Z;){var z=Z-1>>>1,M=D[z];if(0<a(M,B))D[z]=B,D[Z]=M,Z=z;else break e}}function n(D){return D.length===0?null:D[0]}function r(D){if(D.length===0)return null;var B=D[0],Z=D.pop();if(Z!==B){D[0]=Z;e:for(var z=0,M=D.length,re=M>>>1;z<re;){var te=2*(z+1)-1,G=D[te],de=te+1,ce=D[de];if(0>a(G,Z))de<M&&0>a(ce,G)?(D[z]=ce,D[de]=Z,z=de):(D[z]=G,D[te]=Z,z=te);else if(de<M&&0>a(ce,Z))D[z]=ce,D[de]=Z,z=de;else break e}}return B}function a(D,B){var Z=D.sortIndex-B.sortIndex;return Z!==0?Z:D.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,y=3,g=!1,j=!1,b=!1,x=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(D){for(var B=n(f);B!==null;){if(B.callback===null)r(f);else if(B.startTime<=D)r(f),B.sortIndex=B.expirationTime,t(d,B);else break;B=n(f)}}function E(D){if(b=!1,C(D),!j)if(n(d)!==null)j=!0,J(_);else{var B=n(f);B!==null&&Q(E,B.startTime-D)}}function _(D,B){j=!1,b&&(b=!1,S(R),R=-1),g=!0;var Z=y;try{for(C(B),p=n(d);p!==null&&(!(p.expirationTime>B)||D&&!L());){var z=p.callback;if(typeof z=="function"){p.callback=null,y=p.priorityLevel;var M=z(p.expirationTime<=B);B=e.unstable_now(),typeof M=="function"?p.callback=M:p===n(d)&&r(d),C(B)}else r(d);p=n(d)}if(p!==null)var re=!0;else{var te=n(f);te!==null&&Q(E,te.startTime-B),re=!1}return re}finally{p=null,y=Z,g=!1}}var k=!1,O=null,R=-1,T=5,F=-1;function L(){return!(e.unstable_now()-F<T)}function $(){if(O!==null){var D=e.unstable_now();F=D;var B=!0;try{B=O(!0,D)}finally{B?Y():(k=!1,O=null)}}else k=!1}var Y;if(typeof N=="function")Y=function(){N($)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,K=H.port2;H.port1.onmessage=$,Y=function(){K.postMessage(null)}}else Y=function(){x($,0)};function J(D){O=D,k||(k=!0,Y())}function Q(D,B){R=x(function(){D(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(D){D.callback=null},e.unstable_continueExecution=function(){j||g||(j=!0,J(_))},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(D){switch(y){case 1:case 2:case 3:var B=3;break;default:B=y}var Z=y;y=B;try{return D()}finally{y=Z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(D,B){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var Z=y;y=D;try{return B()}finally{y=Z}},e.unstable_scheduleCallback=function(D,B,Z){var z=e.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?z+Z:z):Z=z,D){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=Z+M,D={id:h++,callback:B,priorityLevel:D,startTime:Z,expirationTime:M,sortIndex:-1},Z>z?(D.sortIndex=Z,t(f,D),n(d)===null&&D===n(f)&&(b?(S(R),R=-1):b=!0,Q(E,Z-z))):(D.sortIndex=M,t(d,D),j||g||(j=!0,J(_))),D},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(D){var B=y;return function(){var Z=y;y=B;try{return D.apply(this,arguments)}finally{y=Z}}}})(Qy)),Qy}var iE;function _U(){return iE||(iE=1,Xy.exports=AU()),Xy.exports}var oE;function EU(){if(oE)return Tr;oE=1;var e=TS(),t=_U();function n(l){for(var u="https://reactjs.org/docs/error-decoder.html?invariant="+l,m=1;m<arguments.length;m++)u+="&args[]="+encodeURIComponent(arguments[m]);return"Minified React error #"+l+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,a={};function i(l,u){o(l,u),o(l+"Capture",u)}function o(l,u){for(a[l]=u,l=0;l<u.length;l++)r.add(u[l])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,h={},p={};function y(l){return d.call(p,l)?!0:d.call(h,l)?!1:f.test(l)?p[l]=!0:(h[l]=!0,!1)}function g(l,u,m,w){if(m!==null&&m.type===0)return!1;switch(typeof u){case"function":case"symbol":return!0;case"boolean":return w?!1:m!==null?!m.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function j(l,u,m,w){if(u===null||typeof u>"u"||g(l,u,m,w))return!0;if(w)return!1;if(m!==null)switch(m.type){case 3:return!u;case 4:return u===!1;case 5:return isNaN(u);case 6:return isNaN(u)||1>u}return!1}function b(l,u,m,w,A,P,I){this.acceptsBooleans=u===2||u===3||u===4,this.attributeName=w,this.attributeNamespace=A,this.mustUseProperty=m,this.propertyName=l,this.type=u,this.sanitizeURL=P,this.removeEmptyString=I}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){x[l]=new b(l,0,!1,l,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(l){var u=l[0];x[u]=new b(u,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){x[l]=new b(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){x[l]=new b(l,2,!1,l,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(l){x[l]=new b(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){x[l]=new b(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){x[l]=new b(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){x[l]=new b(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){x[l]=new b(l,5,!1,l.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function N(l){return l[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(l){var u=l.replace(S,N);x[u]=new b(u,1,!1,l,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(l){var u=l.replace(S,N);x[u]=new b(u,1,!1,l,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(l){var u=l.replace(S,N);x[u]=new b(u,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){x[l]=new b(l,1,!1,l.toLowerCase(),null,!1,!1)}),x.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){x[l]=new b(l,1,!1,l.toLowerCase(),null,!0,!0)});function C(l,u,m,w){var A=x.hasOwnProperty(u)?x[u]:null;(A!==null?A.type!==0:w||!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(j(u,m,A,w)&&(m=null),w||A===null?y(u)&&(m===null?l.removeAttribute(u):l.setAttribute(u,""+m)):A.mustUseProperty?l[A.propertyName]=m===null?A.type===3?!1:"":m:(u=A.attributeName,w=A.attributeNamespace,m===null?l.removeAttribute(u):(A=A.type,m=A===3||A===4&&m===!0?"":""+m,w?l.setAttributeNS(w,u,m):l.setAttribute(u,m))))}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,_=Symbol.for("react.element"),k=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),F=Symbol.for("react.provider"),L=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),Q=Symbol.for("react.offscreen"),D=Symbol.iterator;function B(l){return l===null||typeof l!="object"?null:(l=D&&l[D]||l["@@iterator"],typeof l=="function"?l:null)}var Z=Object.assign,z;function M(l){if(z===void 0)try{throw Error()}catch(m){var u=m.stack.trim().match(/\n( *(at )?)/);z=u&&u[1]||""}return`
|
|
2
|
-
`+z+l}var re=!1;function te(l,u){if(!l||re)return"";re=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(u)if(u=function(){throw Error()},Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(ge){var w=ge}Reflect.construct(l,[],u)}else{try{u.call()}catch(ge){w=ge}l.call(u.prototype)}else{try{throw Error()}catch(ge){w=ge}l()}}catch(ge){if(ge&&w&&typeof ge.stack=="string"){for(var A=ge.stack.split(`
|
|
3
|
-
`),P=w.stack.split(`
|
|
4
|
-
`),I=A.length-1,X=P.length-1;1<=I&&0<=X&&A[I]!==P[X];)X--;for(;1<=I&&0<=X;I--,X--)if(A[I]!==P[X]){if(I!==1||X!==1)do if(I--,X--,0>X||A[I]!==P[X]){var ne=`
|
|
5
|
-
`+A[I].replace(" at new "," at ");return l.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",l.displayName)),ne}while(1<=I&&0<=X);break}}}finally{re=!1,Error.prepareStackTrace=m}return(l=l?l.displayName||l.name:"")?M(l):""}function G(l){switch(l.tag){case 5:return M(l.type);case 16:return M("Lazy");case 13:return M("Suspense");case 19:return M("SuspenseList");case 0:case 2:case 15:return l=te(l.type,!1),l;case 11:return l=te(l.type.render,!1),l;case 1:return l=te(l.type,!0),l;default:return""}}function de(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 k:return"Portal";case T:return"Profiler";case R:return"StrictMode";case Y:return"Suspense";case H:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case L:return(l.displayName||"Context")+".Consumer";case F:return(l._context.displayName||"Context")+".Provider";case $:var u=l.render;return l=l.displayName,l||(l=u.displayName||u.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case K:return u=l.displayName||null,u!==null?u:de(l.type)||"Memo";case J:u=l._payload,l=l._init;try{return de(l(u))}catch{}}return null}function ce(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 de(u);case 8:return u===R?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u}return null}function he(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function ie(l){var u=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function ue(l){var u=ie(l)?"checked":"value",m=Object.getOwnPropertyDescriptor(l.constructor.prototype,u),w=""+l[u];if(!l.hasOwnProperty(u)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var A=m.get,P=m.set;return Object.defineProperty(l,u,{configurable:!0,get:function(){return A.call(this)},set:function(I){w=""+I,P.call(this,I)}}),Object.defineProperty(l,u,{enumerable:m.enumerable}),{getValue:function(){return w},setValue:function(I){w=""+I},stopTracking:function(){l._valueTracker=null,delete l[u]}}}}function Ae(l){l._valueTracker||(l._valueTracker=ue(l))}function ae(l){if(!l)return!1;var u=l._valueTracker;if(!u)return!0;var m=u.getValue(),w="";return l&&(w=ie(l)?l.checked?"true":"false":l.value),l=w,l!==m?(u.setValue(l),!0):!1}function $e(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 W(l,u){var m=u.checked;return Z({},u,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:m??l._wrapperState.initialChecked})}function ve(l,u){var m=u.defaultValue==null?"":u.defaultValue,w=u.checked!=null?u.checked:u.defaultChecked;m=he(u.value!=null?u.value:m),l._wrapperState={initialChecked:w,initialValue:m,controlled:u.type==="checkbox"||u.type==="radio"?u.checked!=null:u.value!=null}}function oe(l,u){u=u.checked,u!=null&&C(l,"checked",u,!1)}function be(l,u){oe(l,u);var m=he(u.value),w=u.type;if(m!=null)w==="number"?(m===0&&l.value===""||l.value!=m)&&(l.value=""+m):l.value!==""+m&&(l.value=""+m);else if(w==="submit"||w==="reset"){l.removeAttribute("value");return}u.hasOwnProperty("value")?Ye(l,u.type,m):u.hasOwnProperty("defaultValue")&&Ye(l,u.type,he(u.defaultValue)),u.checked==null&&u.defaultChecked!=null&&(l.defaultChecked=!!u.defaultChecked)}function Ie(l,u,m){if(u.hasOwnProperty("value")||u.hasOwnProperty("defaultValue")){var w=u.type;if(!(w!=="submit"&&w!=="reset"||u.value!==void 0&&u.value!==null))return;u=""+l._wrapperState.initialValue,m||u===l.value||(l.value=u),l.defaultValue=u}m=l.name,m!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,m!==""&&(l.name=m)}function Ye(l,u,m){(u!=="number"||$e(l.ownerDocument)!==l)&&(m==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+m&&(l.defaultValue=""+m))}var je=Array.isArray;function Re(l,u,m,w){if(l=l.options,u){u={};for(var A=0;A<m.length;A++)u["$"+m[A]]=!0;for(m=0;m<l.length;m++)A=u.hasOwnProperty("$"+l[m].value),l[m].selected!==A&&(l[m].selected=A),A&&w&&(l[m].defaultSelected=!0)}else{for(m=""+he(m),u=null,A=0;A<l.length;A++){if(l[A].value===m){l[A].selected=!0,w&&(l[A].defaultSelected=!0);return}u!==null||l[A].disabled||(u=l[A])}u!==null&&(u.selected=!0)}}function Xe(l,u){if(u.dangerouslySetInnerHTML!=null)throw Error(n(91));return Z({},u,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function It(l,u){var m=u.value;if(m==null){if(m=u.children,u=u.defaultValue,m!=null){if(u!=null)throw Error(n(92));if(je(m)){if(1<m.length)throw Error(n(93));m=m[0]}u=m}u==null&&(u=""),m=u}l._wrapperState={initialValue:he(m)}}function qt(l,u){var m=he(u.value),w=he(u.defaultValue);m!=null&&(m=""+m,m!==l.value&&(l.value=m),u.defaultValue==null&&l.defaultValue!==m&&(l.defaultValue=m)),w!=null&&(l.defaultValue=""+w)}function ee(l){var u=l.textContent;u===l._wrapperState.initialValue&&u!==""&&u!==null&&(l.value=u)}function Ce(l){switch(l){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ne(l,u){return l==null||l==="http://www.w3.org/1999/xhtml"?Ce(u):l==="http://www.w3.org/2000/svg"&&u==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var Me,Be=(function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(u,m,w,A){MSApp.execUnsafeLocalFunction(function(){return l(u,m,w,A)})}:l})(function(l,u){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=u;else{for(Me=Me||document.createElement("div"),Me.innerHTML="<svg>"+u.valueOf().toString()+"</svg>",u=Me.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;u.firstChild;)l.appendChild(u.firstChild)}});function et(l,u){if(u){var m=l.firstChild;if(m&&m===l.lastChild&&m.nodeType===3){m.nodeValue=u;return}}l.textContent=u}var Et={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},Sn=["Webkit","ms","Moz","O"];Object.keys(Et).forEach(function(l){Sn.forEach(function(u){u=u+l.charAt(0).toUpperCase()+l.substring(1),Et[u]=Et[l]})});function Nn(l,u,m){return u==null||typeof u=="boolean"||u===""?"":m||typeof u!="number"||u===0||Et.hasOwnProperty(l)&&Et[l]?(""+u).trim():u+"px"}function cr(l,u){l=l.style;for(var m in u)if(u.hasOwnProperty(m)){var w=m.indexOf("--")===0,A=Nn(m,u[m],w);m==="float"&&(m="cssFloat"),w?l.setProperty(m,A):l[m]=A}}var ur=Z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Dn(l,u){if(u){if(ur[l]&&(u.children!=null||u.dangerouslySetInnerHTML!=null))throw Error(n(137,l));if(u.dangerouslySetInnerHTML!=null){if(u.children!=null)throw Error(n(60));if(typeof u.dangerouslySetInnerHTML!="object"||!("__html"in u.dangerouslySetInnerHTML))throw Error(n(61))}if(u.style!=null&&typeof u.style!="object")throw Error(n(62))}}function dr(l,u){if(l.indexOf("-")===-1)return typeof u.is=="string";switch(l){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var _r=null;function Ur(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var qr=null,Yn=null,Xt=null;function En(l){if(l=bu(l)){if(typeof qr!="function")throw Error(n(280));var u=l.stateNode;u&&(u=Yf(u),qr(l.stateNode,l.type,u))}}function fe(l){Yn?Xt?Xt.push(l):Xt=[l]:Yn=l}function De(){if(Yn){var l=Yn,u=Xt;if(Xt=Yn=null,En(l),u)for(l=0;l<u.length;l++)En(u[l])}}function st(l,u){return l(u)}function xt(){}var $t=!1;function an(l,u,m){if($t)return l(u,m);$t=!0;try{return st(l,u,m)}finally{$t=!1,(Yn!==null||Xt!==null)&&(xt(),De())}}function fn(l,u){var m=l.stateNode;if(m===null)return null;var w=Yf(m);if(w===null)return null;m=w[u];e:switch(u){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(w=!w.disabled)||(l=l.type,w=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!w;break e;default:l=!1}if(l)return null;if(m&&typeof m!="function")throw Error(n(231,u,typeof m));return m}var Xn=!1;if(c)try{var Cn={};Object.defineProperty(Cn,"passive",{get:function(){Xn=!0}}),window.addEventListener("test",Cn,Cn),window.removeEventListener("test",Cn,Cn)}catch{Xn=!1}function rr(l,u,m,w,A,P,I,X,ne){var ge=Array.prototype.slice.call(arguments,3);try{u.apply(m,ge)}catch(Ee){this.onError(Ee)}}var fr=!1,Wr=null,oi=!1,li=null,tl={onError:function(l){fr=!0,Wr=l}};function V(l,u,m,w,A,P,I,X,ne){fr=!1,Wr=null,rr.apply(tl,arguments)}function ye(l,u,m,w,A,P,I,X,ne){if(V.apply(this,arguments),fr){if(fr){var ge=Wr;fr=!1,Wr=null}else throw Error(n(198));oi||(oi=!0,li=ge)}}function Ve(l){var u=l,m=l;if(l.alternate)for(;u.return;)u=u.return;else{l=u;do u=l,(u.flags&4098)!==0&&(m=u.return),l=u.return;while(l)}return u.tag===3?m:null}function ut(l){if(l.tag===13){var u=l.memoizedState;if(u===null&&(l=l.alternate,l!==null&&(u=l.memoizedState)),u!==null)return u.dehydrated}return null}function kt(l){if(Ve(l)!==l)throw Error(n(188))}function Tt(l){var u=l.alternate;if(!u){if(u=Ve(l),u===null)throw Error(n(188));return u!==l?null:l}for(var m=l,w=u;;){var A=m.return;if(A===null)break;var P=A.alternate;if(P===null){if(w=A.return,w!==null){m=w;continue}break}if(A.child===P.child){for(P=A.child;P;){if(P===m)return kt(A),l;if(P===w)return kt(A),u;P=P.sibling}throw Error(n(188))}if(m.return!==w.return)m=A,w=P;else{for(var I=!1,X=A.child;X;){if(X===m){I=!0,m=A,w=P;break}if(X===w){I=!0,w=A,m=P;break}X=X.sibling}if(!I){for(X=P.child;X;){if(X===m){I=!0,m=P,w=A;break}if(X===w){I=!0,w=P,m=A;break}X=X.sibling}if(!I)throw Error(n(189))}}if(m.alternate!==w)throw Error(n(190))}if(m.tag!==3)throw Error(n(188));return m.stateNode.current===m?l:u}function Ot(l){return l=Tt(l),l!==null?Pn(l):null}function Pn(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var u=Pn(l);if(u!==null)return u;l=l.sibling}return null}var He=t.unstable_scheduleCallback,Wt=t.unstable_cancelCallback,Dt=t.unstable_shouldYield,kn=t.unstable_requestPaint,pn=t.unstable_now,pg=t.unstable_getCurrentPriorityLevel,nl=t.unstable_ImmediatePriority,kf=t.unstable_UserBlockingPriority,ci=t.unstable_NormalPriority,Of=t.unstable_LowPriority,ru=t.unstable_IdlePriority,As=null,oa=null;function hg(l){if(oa&&typeof oa.onCommitFiberRoot=="function")try{oa.onCommitFiberRoot(As,l,void 0,(l.current.flags&128)===128)}catch{}}var Vr=Math.clz32?Math.clz32:vg,Rf=Math.log,mg=Math.LN2;function vg(l){return l>>>=0,l===0?32:31-(Rf(l)/mg|0)|0}var rl=64,al=4194304;function q(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 xe(l,u){var m=l.pendingLanes;if(m===0)return 0;var w=0,A=l.suspendedLanes,P=l.pingedLanes,I=m&268435455;if(I!==0){var X=I&~A;X!==0?w=q(X):(P&=I,P!==0&&(w=q(P)))}else I=m&~A,I!==0?w=q(I):P!==0&&(w=q(P));if(w===0)return 0;if(u!==0&&u!==w&&(u&A)===0&&(A=w&-w,P=u&-u,A>=P||A===16&&(P&4194240)!==0))return u;if((w&4)!==0&&(w|=m&16),u=l.entangledLanes,u!==0)for(l=l.entanglements,u&=w;0<u;)m=31-Vr(u),A=1<<m,w|=l[m],u&=~A;return w}function rt(l,u){switch(l){case 1:case 2:case 4:return u+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Te(l,u){for(var m=l.suspendedLanes,w=l.pingedLanes,A=l.expirationTimes,P=l.pendingLanes;0<P;){var I=31-Vr(P),X=1<<I,ne=A[I];ne===-1?((X&m)===0||(X&w)!==0)&&(A[I]=rt(X,u)):ne<=u&&(l.expiredLanes|=X),P&=~X}}function Pt(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function ft(){var l=rl;return rl<<=1,(rl&4194240)===0&&(rl=64),l}function Vt(l){for(var u=[],m=0;31>m;m++)u.push(l);return u}function Ln(l,u,m){l.pendingLanes|=u,u!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,u=31-Vr(u),l[u]=m}function Qt(l,u){var m=l.pendingLanes&~u;l.pendingLanes=u,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=u,l.mutableReadLanes&=u,l.entangledLanes&=u,u=l.entanglements;var w=l.eventTimes;for(l=l.expirationTimes;0<m;){var A=31-Vr(m),P=1<<A;u[A]=0,w[A]=-1,l[A]=-1,m&=~P}}function la(l,u){var m=l.entangledLanes|=u;for(l=l.entanglements;m;){var w=31-Vr(m),A=1<<w;A&u|l[w]&u&&(l[w]|=u),m&=~A}}var Ft=0;function Tf(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var sl,gg,MC,$C,DC,yg=!1,If=[],ui=null,di=null,fi=null,au=new Map,su=new Map,pi=[],W8="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 LC(l,u){switch(l){case"focusin":case"focusout":ui=null;break;case"dragenter":case"dragleave":di=null;break;case"mouseover":case"mouseout":fi=null;break;case"pointerover":case"pointerout":au.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":su.delete(u.pointerId)}}function iu(l,u,m,w,A,P){return l===null||l.nativeEvent!==P?(l={blockedOn:u,domEventName:m,eventSystemFlags:w,nativeEvent:P,targetContainers:[A]},u!==null&&(u=bu(u),u!==null&&gg(u)),l):(l.eventSystemFlags|=w,u=l.targetContainers,A!==null&&u.indexOf(A)===-1&&u.push(A),l)}function V8(l,u,m,w,A){switch(u){case"focusin":return ui=iu(ui,l,u,m,w,A),!0;case"dragenter":return di=iu(di,l,u,m,w,A),!0;case"mouseover":return fi=iu(fi,l,u,m,w,A),!0;case"pointerover":var P=A.pointerId;return au.set(P,iu(au.get(P)||null,l,u,m,w,A)),!0;case"gotpointercapture":return P=A.pointerId,su.set(P,iu(su.get(P)||null,l,u,m,w,A)),!0}return!1}function FC(l){var u=no(l.target);if(u!==null){var m=Ve(u);if(m!==null){if(u=m.tag,u===13){if(u=ut(m),u!==null){l.blockedOn=u,DC(l.priority,function(){MC(m)});return}}else if(u===3&&m.stateNode.current.memoizedState.isDehydrated){l.blockedOn=m.tag===3?m.stateNode.containerInfo:null;return}}}l.blockedOn=null}function Mf(l){if(l.blockedOn!==null)return!1;for(var u=l.targetContainers;0<u.length;){var m=bg(l.domEventName,l.eventSystemFlags,u[0],l.nativeEvent);if(m===null){m=l.nativeEvent;var w=new m.constructor(m.type,m);_r=w,m.target.dispatchEvent(w),_r=null}else return u=bu(m),u!==null&&gg(u),l.blockedOn=m,!1;u.shift()}return!0}function BC(l,u,m){Mf(l)&&m.delete(u)}function H8(){yg=!1,ui!==null&&Mf(ui)&&(ui=null),di!==null&&Mf(di)&&(di=null),fi!==null&&Mf(fi)&&(fi=null),au.forEach(BC),su.forEach(BC)}function ou(l,u){l.blockedOn===u&&(l.blockedOn=null,yg||(yg=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,H8)))}function lu(l){function u(A){return ou(A,l)}if(0<If.length){ou(If[0],l);for(var m=1;m<If.length;m++){var w=If[m];w.blockedOn===l&&(w.blockedOn=null)}}for(ui!==null&&ou(ui,l),di!==null&&ou(di,l),fi!==null&&ou(fi,l),au.forEach(u),su.forEach(u),m=0;m<pi.length;m++)w=pi[m],w.blockedOn===l&&(w.blockedOn=null);for(;0<pi.length&&(m=pi[0],m.blockedOn===null);)FC(m),m.blockedOn===null&&pi.shift()}var il=E.ReactCurrentBatchConfig,$f=!0;function K8(l,u,m,w){var A=Ft,P=il.transition;il.transition=null;try{Ft=1,xg(l,u,m,w)}finally{Ft=A,il.transition=P}}function G8(l,u,m,w){var A=Ft,P=il.transition;il.transition=null;try{Ft=4,xg(l,u,m,w)}finally{Ft=A,il.transition=P}}function xg(l,u,m,w){if($f){var A=bg(l,u,m,w);if(A===null)Dg(l,u,w,Df,m),LC(l,w);else if(V8(A,l,u,m,w))w.stopPropagation();else if(LC(l,w),u&4&&-1<W8.indexOf(l)){for(;A!==null;){var P=bu(A);if(P!==null&&sl(P),P=bg(l,u,m,w),P===null&&Dg(l,u,w,Df,m),P===A)break;A=P}A!==null&&w.stopPropagation()}else Dg(l,u,w,null,m)}}var Df=null;function bg(l,u,m,w){if(Df=null,l=Ur(w),l=no(l),l!==null)if(u=Ve(l),u===null)l=null;else if(m=u.tag,m===13){if(l=ut(u),l!==null)return l;l=null}else if(m===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;l=null}else u!==l&&(l=null);return Df=l,null}function zC(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(pg()){case nl:return 1;case kf:return 4;case ci:case Of:return 16;case ru:return 536870912;default:return 16}default:return 16}}var hi=null,wg=null,Lf=null;function UC(){if(Lf)return Lf;var l,u=wg,m=u.length,w,A="value"in hi?hi.value:hi.textContent,P=A.length;for(l=0;l<m&&u[l]===A[l];l++);var I=m-l;for(w=1;w<=I&&u[m-w]===A[P-w];w++);return Lf=A.slice(l,1<w?1-w:void 0)}function Ff(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 Bf(){return!0}function qC(){return!1}function Hr(l){function u(m,w,A,P,I){this._reactName=m,this._targetInst=A,this.type=w,this.nativeEvent=P,this.target=I,this.currentTarget=null;for(var X in l)l.hasOwnProperty(X)&&(m=l[X],this[X]=m?m(P):P[X]);return this.isDefaultPrevented=(P.defaultPrevented!=null?P.defaultPrevented:P.returnValue===!1)?Bf:qC,this.isPropagationStopped=qC,this}return Z(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var m=this.nativeEvent;m&&(m.preventDefault?m.preventDefault():typeof m.returnValue!="unknown"&&(m.returnValue=!1),this.isDefaultPrevented=Bf)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=Bf)},persist:function(){},isPersistent:Bf}),u}var ol={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jg=Hr(ol),cu=Z({},ol,{view:0,detail:0}),Y8=Hr(cu),Sg,Ng,uu,zf=Z({},cu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ag,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!==uu&&(uu&&l.type==="mousemove"?(Sg=l.screenX-uu.screenX,Ng=l.screenY-uu.screenY):Ng=Sg=0,uu=l),Sg)},movementY:function(l){return"movementY"in l?l.movementY:Ng}}),WC=Hr(zf),X8=Z({},zf,{dataTransfer:0}),Q8=Hr(X8),J8=Z({},cu,{relatedTarget:0}),Cg=Hr(J8),Z8=Z({},ol,{animationName:0,elapsedTime:0,pseudoElement:0}),e6=Hr(Z8),t6=Z({},ol,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),n6=Hr(t6),r6=Z({},ol,{data:0}),VC=Hr(r6),a6={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},s6={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"},i6={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function o6(l){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(l):(l=i6[l])?!!u[l]:!1}function Ag(){return o6}var l6=Z({},cu,{key:function(l){if(l.key){var u=a6[l.key]||l.key;if(u!=="Unidentified")return u}return l.type==="keypress"?(l=Ff(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?s6[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ag,charCode:function(l){return l.type==="keypress"?Ff(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?Ff(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),c6=Hr(l6),u6=Z({},zf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),HC=Hr(u6),d6=Z({},cu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ag}),f6=Hr(d6),p6=Z({},ol,{propertyName:0,elapsedTime:0,pseudoElement:0}),h6=Hr(p6),m6=Z({},zf,{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}),v6=Hr(m6),g6=[9,13,27,32],_g=c&&"CompositionEvent"in window,du=null;c&&"documentMode"in document&&(du=document.documentMode);var y6=c&&"TextEvent"in window&&!du,KC=c&&(!_g||du&&8<du&&11>=du),GC=" ",YC=!1;function XC(l,u){switch(l){case"keyup":return g6.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function QC(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var ll=!1;function x6(l,u){switch(l){case"compositionend":return QC(u);case"keypress":return u.which!==32?null:(YC=!0,GC);case"textInput":return l=u.data,l===GC&&YC?null:l;default:return null}}function b6(l,u){if(ll)return l==="compositionend"||!_g&&XC(l,u)?(l=UC(),Lf=wg=hi=null,ll=!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 KC&&u.locale!=="ko"?null:u.data;default:return null}}var w6={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 JC(l){var u=l&&l.nodeName&&l.nodeName.toLowerCase();return u==="input"?!!w6[l.type]:u==="textarea"}function ZC(l,u,m,w){fe(w),u=Hf(u,"onChange"),0<u.length&&(m=new jg("onChange","change",null,m,w),l.push({event:m,listeners:u}))}var fu=null,pu=null;function j6(l){gA(l,0)}function Uf(l){var u=pl(l);if(ae(u))return l}function S6(l,u){if(l==="change")return u}var eA=!1;if(c){var Eg;if(c){var Pg="oninput"in document;if(!Pg){var tA=document.createElement("div");tA.setAttribute("oninput","return;"),Pg=typeof tA.oninput=="function"}Eg=Pg}else Eg=!1;eA=Eg&&(!document.documentMode||9<document.documentMode)}function nA(){fu&&(fu.detachEvent("onpropertychange",rA),pu=fu=null)}function rA(l){if(l.propertyName==="value"&&Uf(pu)){var u=[];ZC(u,pu,l,Ur(l)),an(j6,u)}}function N6(l,u,m){l==="focusin"?(nA(),fu=u,pu=m,fu.attachEvent("onpropertychange",rA)):l==="focusout"&&nA()}function C6(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return Uf(pu)}function A6(l,u){if(l==="click")return Uf(u)}function _6(l,u){if(l==="input"||l==="change")return Uf(u)}function E6(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var ka=typeof Object.is=="function"?Object.is:E6;function hu(l,u){if(ka(l,u))return!0;if(typeof l!="object"||l===null||typeof u!="object"||u===null)return!1;var m=Object.keys(l),w=Object.keys(u);if(m.length!==w.length)return!1;for(w=0;w<m.length;w++){var A=m[w];if(!d.call(u,A)||!ka(l[A],u[A]))return!1}return!0}function aA(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function sA(l,u){var m=aA(l);l=0;for(var w;m;){if(m.nodeType===3){if(w=l+m.textContent.length,l<=u&&w>=u)return{node:m,offset:u-l};l=w}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=aA(m)}}function iA(l,u){return l&&u?l===u?!0:l&&l.nodeType===3?!1:u&&u.nodeType===3?iA(l,u.parentNode):"contains"in l?l.contains(u):l.compareDocumentPosition?!!(l.compareDocumentPosition(u)&16):!1:!1}function oA(){for(var l=window,u=$e();u instanceof l.HTMLIFrameElement;){try{var m=typeof u.contentWindow.location.href=="string"}catch{m=!1}if(m)l=u.contentWindow;else break;u=$e(l.document)}return u}function kg(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 P6(l){var u=oA(),m=l.focusedElem,w=l.selectionRange;if(u!==m&&m&&m.ownerDocument&&iA(m.ownerDocument.documentElement,m)){if(w!==null&&kg(m)){if(u=w.start,l=w.end,l===void 0&&(l=u),"selectionStart"in m)m.selectionStart=u,m.selectionEnd=Math.min(l,m.value.length);else if(l=(u=m.ownerDocument||document)&&u.defaultView||window,l.getSelection){l=l.getSelection();var A=m.textContent.length,P=Math.min(w.start,A);w=w.end===void 0?P:Math.min(w.end,A),!l.extend&&P>w&&(A=w,w=P,P=A),A=sA(m,P);var I=sA(m,w);A&&I&&(l.rangeCount!==1||l.anchorNode!==A.node||l.anchorOffset!==A.offset||l.focusNode!==I.node||l.focusOffset!==I.offset)&&(u=u.createRange(),u.setStart(A.node,A.offset),l.removeAllRanges(),P>w?(l.addRange(u),l.extend(I.node,I.offset)):(u.setEnd(I.node,I.offset),l.addRange(u)))}}for(u=[],l=m;l=l.parentNode;)l.nodeType===1&&u.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<u.length;m++)l=u[m],l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}var k6=c&&"documentMode"in document&&11>=document.documentMode,cl=null,Og=null,mu=null,Rg=!1;function lA(l,u,m){var w=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;Rg||cl==null||cl!==$e(w)||(w=cl,"selectionStart"in w&&kg(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}),mu&&hu(mu,w)||(mu=w,w=Hf(Og,"onSelect"),0<w.length&&(u=new jg("onSelect","select",null,u,m),l.push({event:u,listeners:w}),u.target=cl)))}function qf(l,u){var m={};return m[l.toLowerCase()]=u.toLowerCase(),m["Webkit"+l]="webkit"+u,m["Moz"+l]="moz"+u,m}var ul={animationend:qf("Animation","AnimationEnd"),animationiteration:qf("Animation","AnimationIteration"),animationstart:qf("Animation","AnimationStart"),transitionend:qf("Transition","TransitionEnd")},Tg={},cA={};c&&(cA=document.createElement("div").style,"AnimationEvent"in window||(delete ul.animationend.animation,delete ul.animationiteration.animation,delete ul.animationstart.animation),"TransitionEvent"in window||delete ul.transitionend.transition);function Wf(l){if(Tg[l])return Tg[l];if(!ul[l])return l;var u=ul[l],m;for(m in u)if(u.hasOwnProperty(m)&&m in cA)return Tg[l]=u[m];return l}var uA=Wf("animationend"),dA=Wf("animationiteration"),fA=Wf("animationstart"),pA=Wf("transitionend"),hA=new Map,mA="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 mi(l,u){hA.set(l,u),i(u,[l])}for(var Ig=0;Ig<mA.length;Ig++){var Mg=mA[Ig],O6=Mg.toLowerCase(),R6=Mg[0].toUpperCase()+Mg.slice(1);mi(O6,"on"+R6)}mi(uA,"onAnimationEnd"),mi(dA,"onAnimationIteration"),mi(fA,"onAnimationStart"),mi("dblclick","onDoubleClick"),mi("focusin","onFocus"),mi("focusout","onBlur"),mi(pA,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vu="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(" "),T6=new Set("cancel close invalid load scroll toggle".split(" ").concat(vu));function vA(l,u,m){var w=l.type||"unknown-event";l.currentTarget=m,ye(w,u,void 0,l),l.currentTarget=null}function gA(l,u){u=(u&4)!==0;for(var m=0;m<l.length;m++){var w=l[m],A=w.event;w=w.listeners;e:{var P=void 0;if(u)for(var I=w.length-1;0<=I;I--){var X=w[I],ne=X.instance,ge=X.currentTarget;if(X=X.listener,ne!==P&&A.isPropagationStopped())break e;vA(A,X,ge),P=ne}else for(I=0;I<w.length;I++){if(X=w[I],ne=X.instance,ge=X.currentTarget,X=X.listener,ne!==P&&A.isPropagationStopped())break e;vA(A,X,ge),P=ne}}}if(oi)throw l=li,oi=!1,li=null,l}function hn(l,u){var m=u[qg];m===void 0&&(m=u[qg]=new Set);var w=l+"__bubble";m.has(w)||(yA(u,l,2,!1),m.add(w))}function $g(l,u,m){var w=0;u&&(w|=4),yA(m,l,w,u)}var Vf="_reactListening"+Math.random().toString(36).slice(2);function gu(l){if(!l[Vf]){l[Vf]=!0,r.forEach(function(m){m!=="selectionchange"&&(T6.has(m)||$g(m,!1,l),$g(m,!0,l))});var u=l.nodeType===9?l:l.ownerDocument;u===null||u[Vf]||(u[Vf]=!0,$g("selectionchange",!1,u))}}function yA(l,u,m,w){switch(zC(u)){case 1:var A=K8;break;case 4:A=G8;break;default:A=xg}m=A.bind(null,u,m,l),A=void 0,!Xn||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(A=!0),w?A!==void 0?l.addEventListener(u,m,{capture:!0,passive:A}):l.addEventListener(u,m,!0):A!==void 0?l.addEventListener(u,m,{passive:A}):l.addEventListener(u,m,!1)}function Dg(l,u,m,w,A){var P=w;if((u&1)===0&&(u&2)===0&&w!==null)e:for(;;){if(w===null)return;var I=w.tag;if(I===3||I===4){var X=w.stateNode.containerInfo;if(X===A||X.nodeType===8&&X.parentNode===A)break;if(I===4)for(I=w.return;I!==null;){var ne=I.tag;if((ne===3||ne===4)&&(ne=I.stateNode.containerInfo,ne===A||ne.nodeType===8&&ne.parentNode===A))return;I=I.return}for(;X!==null;){if(I=no(X),I===null)return;if(ne=I.tag,ne===5||ne===6){w=P=I;continue e}X=X.parentNode}}w=w.return}an(function(){var ge=P,Ee=Ur(m),Oe=[];e:{var _e=hA.get(l);if(_e!==void 0){var Ge=jg,nt=l;switch(l){case"keypress":if(Ff(m)===0)break e;case"keydown":case"keyup":Ge=c6;break;case"focusin":nt="focus",Ge=Cg;break;case"focusout":nt="blur",Ge=Cg;break;case"beforeblur":case"afterblur":Ge=Cg;break;case"click":if(m.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ge=WC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ge=Q8;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ge=f6;break;case uA:case dA:case fA:Ge=e6;break;case pA:Ge=h6;break;case"scroll":Ge=Y8;break;case"wheel":Ge=v6;break;case"copy":case"cut":case"paste":Ge=n6;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ge=HC}var at=(u&4)!==0,On=!at&&l==="scroll",pe=at?_e!==null?_e+"Capture":null:_e;at=[];for(var se=ge,me;se!==null;){me=se;var Le=me.stateNode;if(me.tag===5&&Le!==null&&(me=Le,pe!==null&&(Le=fn(se,pe),Le!=null&&at.push(yu(se,Le,me)))),On)break;se=se.return}0<at.length&&(_e=new Ge(_e,nt,null,m,Ee),Oe.push({event:_e,listeners:at}))}}if((u&7)===0){e:{if(_e=l==="mouseover"||l==="pointerover",Ge=l==="mouseout"||l==="pointerout",_e&&m!==_r&&(nt=m.relatedTarget||m.fromElement)&&(no(nt)||nt[_s]))break e;if((Ge||_e)&&(_e=Ee.window===Ee?Ee:(_e=Ee.ownerDocument)?_e.defaultView||_e.parentWindow:window,Ge?(nt=m.relatedTarget||m.toElement,Ge=ge,nt=nt?no(nt):null,nt!==null&&(On=Ve(nt),nt!==On||nt.tag!==5&&nt.tag!==6)&&(nt=null)):(Ge=null,nt=ge),Ge!==nt)){if(at=WC,Le="onMouseLeave",pe="onMouseEnter",se="mouse",(l==="pointerout"||l==="pointerover")&&(at=HC,Le="onPointerLeave",pe="onPointerEnter",se="pointer"),On=Ge==null?_e:pl(Ge),me=nt==null?_e:pl(nt),_e=new at(Le,se+"leave",Ge,m,Ee),_e.target=On,_e.relatedTarget=me,Le=null,no(Ee)===ge&&(at=new at(pe,se+"enter",nt,m,Ee),at.target=me,at.relatedTarget=On,Le=at),On=Le,Ge&&nt)t:{for(at=Ge,pe=nt,se=0,me=at;me;me=dl(me))se++;for(me=0,Le=pe;Le;Le=dl(Le))me++;for(;0<se-me;)at=dl(at),se--;for(;0<me-se;)pe=dl(pe),me--;for(;se--;){if(at===pe||pe!==null&&at===pe.alternate)break t;at=dl(at),pe=dl(pe)}at=null}else at=null;Ge!==null&&xA(Oe,_e,Ge,at,!1),nt!==null&&On!==null&&xA(Oe,On,nt,at,!0)}}e:{if(_e=ge?pl(ge):window,Ge=_e.nodeName&&_e.nodeName.toLowerCase(),Ge==="select"||Ge==="input"&&_e.type==="file")var ot=S6;else if(JC(_e))if(eA)ot=_6;else{ot=C6;var pt=N6}else(Ge=_e.nodeName)&&Ge.toLowerCase()==="input"&&(_e.type==="checkbox"||_e.type==="radio")&&(ot=A6);if(ot&&(ot=ot(l,ge))){ZC(Oe,ot,m,Ee);break e}pt&&pt(l,_e,ge),l==="focusout"&&(pt=_e._wrapperState)&&pt.controlled&&_e.type==="number"&&Ye(_e,"number",_e.value)}switch(pt=ge?pl(ge):window,l){case"focusin":(JC(pt)||pt.contentEditable==="true")&&(cl=pt,Og=ge,mu=null);break;case"focusout":mu=Og=cl=null;break;case"mousedown":Rg=!0;break;case"contextmenu":case"mouseup":case"dragend":Rg=!1,lA(Oe,m,Ee);break;case"selectionchange":if(k6)break;case"keydown":case"keyup":lA(Oe,m,Ee)}var ht;if(_g)e:{switch(l){case"compositionstart":var bt="onCompositionStart";break e;case"compositionend":bt="onCompositionEnd";break e;case"compositionupdate":bt="onCompositionUpdate";break e}bt=void 0}else ll?XC(l,m)&&(bt="onCompositionEnd"):l==="keydown"&&m.keyCode===229&&(bt="onCompositionStart");bt&&(KC&&m.locale!=="ko"&&(ll||bt!=="onCompositionStart"?bt==="onCompositionEnd"&&ll&&(ht=UC()):(hi=Ee,wg="value"in hi?hi.value:hi.textContent,ll=!0)),pt=Hf(ge,bt),0<pt.length&&(bt=new VC(bt,l,null,m,Ee),Oe.push({event:bt,listeners:pt}),ht?bt.data=ht:(ht=QC(m),ht!==null&&(bt.data=ht)))),(ht=y6?x6(l,m):b6(l,m))&&(ge=Hf(ge,"onBeforeInput"),0<ge.length&&(Ee=new VC("onBeforeInput","beforeinput",null,m,Ee),Oe.push({event:Ee,listeners:ge}),Ee.data=ht))}gA(Oe,u)})}function yu(l,u,m){return{instance:l,listener:u,currentTarget:m}}function Hf(l,u){for(var m=u+"Capture",w=[];l!==null;){var A=l,P=A.stateNode;A.tag===5&&P!==null&&(A=P,P=fn(l,m),P!=null&&w.unshift(yu(l,P,A)),P=fn(l,u),P!=null&&w.push(yu(l,P,A))),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 xA(l,u,m,w,A){for(var P=u._reactName,I=[];m!==null&&m!==w;){var X=m,ne=X.alternate,ge=X.stateNode;if(ne!==null&&ne===w)break;X.tag===5&&ge!==null&&(X=ge,A?(ne=fn(m,P),ne!=null&&I.unshift(yu(m,ne,X))):A||(ne=fn(m,P),ne!=null&&I.push(yu(m,ne,X)))),m=m.return}I.length!==0&&l.push({event:u,listeners:I})}var I6=/\r\n?/g,M6=/\u0000|\uFFFD/g;function bA(l){return(typeof l=="string"?l:""+l).replace(I6,`
|
|
6
|
-
`).replace(M6,"")}function Kf(l,u,m){if(u=bA(u),bA(l)!==u&&m)throw Error(n(425))}function Gf(){}var Lg=null,Fg=null;function Bg(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 zg=typeof setTimeout=="function"?setTimeout:void 0,$6=typeof clearTimeout=="function"?clearTimeout:void 0,wA=typeof Promise=="function"?Promise:void 0,D6=typeof queueMicrotask=="function"?queueMicrotask:typeof wA<"u"?function(l){return wA.resolve(null).then(l).catch(L6)}:zg;function L6(l){setTimeout(function(){throw l})}function Ug(l,u){var m=u,w=0;do{var A=m.nextSibling;if(l.removeChild(m),A&&A.nodeType===8)if(m=A.data,m==="/$"){if(w===0){l.removeChild(A),lu(u);return}w--}else m!=="$"&&m!=="$?"&&m!=="$!"||w++;m=A}while(m);lu(u)}function vi(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 jA(l){l=l.previousSibling;for(var u=0;l;){if(l.nodeType===8){var m=l.data;if(m==="$"||m==="$!"||m==="$?"){if(u===0)return l;u--}else m==="/$"&&u++}l=l.previousSibling}return null}var fl=Math.random().toString(36).slice(2),ns="__reactFiber$"+fl,xu="__reactProps$"+fl,_s="__reactContainer$"+fl,qg="__reactEvents$"+fl,F6="__reactListeners$"+fl,B6="__reactHandles$"+fl;function no(l){var u=l[ns];if(u)return u;for(var m=l.parentNode;m;){if(u=m[_s]||m[ns]){if(m=u.alternate,u.child!==null||m!==null&&m.child!==null)for(l=jA(l);l!==null;){if(m=l[ns])return m;l=jA(l)}return u}l=m,m=l.parentNode}return null}function bu(l){return l=l[ns]||l[_s],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function pl(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(n(33))}function Yf(l){return l[xu]||null}var Wg=[],hl=-1;function gi(l){return{current:l}}function mn(l){0>hl||(l.current=Wg[hl],Wg[hl]=null,hl--)}function sn(l,u){hl++,Wg[hl]=l.current,l.current=u}var yi={},pr=gi(yi),Er=gi(!1),ro=yi;function ml(l,u){var m=l.type.contextTypes;if(!m)return yi;var w=l.stateNode;if(w&&w.__reactInternalMemoizedUnmaskedChildContext===u)return w.__reactInternalMemoizedMaskedChildContext;var A={},P;for(P in m)A[P]=u[P];return w&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=u,l.__reactInternalMemoizedMaskedChildContext=A),A}function Pr(l){return l=l.childContextTypes,l!=null}function Xf(){mn(Er),mn(pr)}function SA(l,u,m){if(pr.current!==yi)throw Error(n(168));sn(pr,u),sn(Er,m)}function NA(l,u,m){var w=l.stateNode;if(u=u.childContextTypes,typeof w.getChildContext!="function")return m;w=w.getChildContext();for(var A in w)if(!(A in u))throw Error(n(108,ce(l)||"Unknown",A));return Z({},m,w)}function Qf(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||yi,ro=pr.current,sn(pr,l),sn(Er,Er.current),!0}function CA(l,u,m){var w=l.stateNode;if(!w)throw Error(n(169));m?(l=NA(l,u,ro),w.__reactInternalMemoizedMergedChildContext=l,mn(Er),mn(pr),sn(pr,l)):mn(Er),sn(Er,m)}var Es=null,Jf=!1,Vg=!1;function AA(l){Es===null?Es=[l]:Es.push(l)}function z6(l){Jf=!0,AA(l)}function xi(){if(!Vg&&Es!==null){Vg=!0;var l=0,u=Ft;try{var m=Es;for(Ft=1;l<m.length;l++){var w=m[l];do w=w(!0);while(w!==null)}Es=null,Jf=!1}catch(A){throw Es!==null&&(Es=Es.slice(l+1)),He(nl,xi),A}finally{Ft=u,Vg=!1}}return null}var vl=[],gl=0,Zf=null,ep=0,ca=[],ua=0,ao=null,Ps=1,ks="";function so(l,u){vl[gl++]=ep,vl[gl++]=Zf,Zf=l,ep=u}function _A(l,u,m){ca[ua++]=Ps,ca[ua++]=ks,ca[ua++]=ao,ao=l;var w=Ps;l=ks;var A=32-Vr(w)-1;w&=~(1<<A),m+=1;var P=32-Vr(u)+A;if(30<P){var I=A-A%5;P=(w&(1<<I)-1).toString(32),w>>=I,A-=I,Ps=1<<32-Vr(u)+A|m<<A|w,ks=P+l}else Ps=1<<P|m<<A|w,ks=l}function Hg(l){l.return!==null&&(so(l,1),_A(l,1,0))}function Kg(l){for(;l===Zf;)Zf=vl[--gl],vl[gl]=null,ep=vl[--gl],vl[gl]=null;for(;l===ao;)ao=ca[--ua],ca[ua]=null,ks=ca[--ua],ca[ua]=null,Ps=ca[--ua],ca[ua]=null}var Kr=null,Gr=null,yn=!1,Oa=null;function EA(l,u){var m=ha(5,null,null,0);m.elementType="DELETED",m.stateNode=u,m.return=l,u=l.deletions,u===null?(l.deletions=[m],l.flags|=16):u.push(m)}function PA(l,u){switch(l.tag){case 5:var m=l.type;return u=u.nodeType!==1||m.toLowerCase()!==u.nodeName.toLowerCase()?null:u,u!==null?(l.stateNode=u,Kr=l,Gr=vi(u.firstChild),!0):!1;case 6:return u=l.pendingProps===""||u.nodeType!==3?null:u,u!==null?(l.stateNode=u,Kr=l,Gr=null,!0):!1;case 13:return u=u.nodeType!==8?null:u,u!==null?(m=ao!==null?{id:Ps,overflow:ks}:null,l.memoizedState={dehydrated:u,treeContext:m,retryLane:1073741824},m=ha(18,null,null,0),m.stateNode=u,m.return=l,l.child=m,Kr=l,Gr=null,!0):!1;default:return!1}}function Gg(l){return(l.mode&1)!==0&&(l.flags&128)===0}function Yg(l){if(yn){var u=Gr;if(u){var m=u;if(!PA(l,u)){if(Gg(l))throw Error(n(418));u=vi(m.nextSibling);var w=Kr;u&&PA(l,u)?EA(w,m):(l.flags=l.flags&-4097|2,yn=!1,Kr=l)}}else{if(Gg(l))throw Error(n(418));l.flags=l.flags&-4097|2,yn=!1,Kr=l}}}function kA(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;Kr=l}function tp(l){if(l!==Kr)return!1;if(!yn)return kA(l),yn=!0,!1;var u;if((u=l.tag!==3)&&!(u=l.tag!==5)&&(u=l.type,u=u!=="head"&&u!=="body"&&!Bg(l.type,l.memoizedProps)),u&&(u=Gr)){if(Gg(l))throw OA(),Error(n(418));for(;u;)EA(l,u),u=vi(u.nextSibling)}if(kA(l),l.tag===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(n(317));e:{for(l=l.nextSibling,u=0;l;){if(l.nodeType===8){var m=l.data;if(m==="/$"){if(u===0){Gr=vi(l.nextSibling);break e}u--}else m!=="$"&&m!=="$!"&&m!=="$?"||u++}l=l.nextSibling}Gr=null}}else Gr=Kr?vi(l.stateNode.nextSibling):null;return!0}function OA(){for(var l=Gr;l;)l=vi(l.nextSibling)}function yl(){Gr=Kr=null,yn=!1}function Xg(l){Oa===null?Oa=[l]:Oa.push(l)}var U6=E.ReactCurrentBatchConfig;function wu(l,u,m){if(l=m.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(m._owner){if(m=m._owner,m){if(m.tag!==1)throw Error(n(309));var w=m.stateNode}if(!w)throw Error(n(147,l));var A=w,P=""+l;return u!==null&&u.ref!==null&&typeof u.ref=="function"&&u.ref._stringRef===P?u.ref:(u=function(I){var X=A.refs;I===null?delete X[P]:X[P]=I},u._stringRef=P,u)}if(typeof l!="string")throw Error(n(284));if(!m._owner)throw Error(n(290,l))}return l}function np(l,u){throw l=Object.prototype.toString.call(u),Error(n(31,l==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":l))}function RA(l){var u=l._init;return u(l._payload)}function TA(l){function u(pe,se){if(l){var me=pe.deletions;me===null?(pe.deletions=[se],pe.flags|=16):me.push(se)}}function m(pe,se){if(!l)return null;for(;se!==null;)u(pe,se),se=se.sibling;return null}function w(pe,se){for(pe=new Map;se!==null;)se.key!==null?pe.set(se.key,se):pe.set(se.index,se),se=se.sibling;return pe}function A(pe,se){return pe=_i(pe,se),pe.index=0,pe.sibling=null,pe}function P(pe,se,me){return pe.index=me,l?(me=pe.alternate,me!==null?(me=me.index,me<se?(pe.flags|=2,se):me):(pe.flags|=2,se)):(pe.flags|=1048576,se)}function I(pe){return l&&pe.alternate===null&&(pe.flags|=2),pe}function X(pe,se,me,Le){return se===null||se.tag!==6?(se=zy(me,pe.mode,Le),se.return=pe,se):(se=A(se,me),se.return=pe,se)}function ne(pe,se,me,Le){var ot=me.type;return ot===O?Ee(pe,se,me.props.children,Le,me.key):se!==null&&(se.elementType===ot||typeof ot=="object"&&ot!==null&&ot.$$typeof===J&&RA(ot)===se.type)?(Le=A(se,me.props),Le.ref=wu(pe,se,me),Le.return=pe,Le):(Le=Ap(me.type,me.key,me.props,null,pe.mode,Le),Le.ref=wu(pe,se,me),Le.return=pe,Le)}function ge(pe,se,me,Le){return se===null||se.tag!==4||se.stateNode.containerInfo!==me.containerInfo||se.stateNode.implementation!==me.implementation?(se=Uy(me,pe.mode,Le),se.return=pe,se):(se=A(se,me.children||[]),se.return=pe,se)}function Ee(pe,se,me,Le,ot){return se===null||se.tag!==7?(se=ho(me,pe.mode,Le,ot),se.return=pe,se):(se=A(se,me),se.return=pe,se)}function Oe(pe,se,me){if(typeof se=="string"&&se!==""||typeof se=="number")return se=zy(""+se,pe.mode,me),se.return=pe,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case _:return me=Ap(se.type,se.key,se.props,null,pe.mode,me),me.ref=wu(pe,null,se),me.return=pe,me;case k:return se=Uy(se,pe.mode,me),se.return=pe,se;case J:var Le=se._init;return Oe(pe,Le(se._payload),me)}if(je(se)||B(se))return se=ho(se,pe.mode,me,null),se.return=pe,se;np(pe,se)}return null}function _e(pe,se,me,Le){var ot=se!==null?se.key:null;if(typeof me=="string"&&me!==""||typeof me=="number")return ot!==null?null:X(pe,se,""+me,Le);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case _:return me.key===ot?ne(pe,se,me,Le):null;case k:return me.key===ot?ge(pe,se,me,Le):null;case J:return ot=me._init,_e(pe,se,ot(me._payload),Le)}if(je(me)||B(me))return ot!==null?null:Ee(pe,se,me,Le,null);np(pe,me)}return null}function Ge(pe,se,me,Le,ot){if(typeof Le=="string"&&Le!==""||typeof Le=="number")return pe=pe.get(me)||null,X(se,pe,""+Le,ot);if(typeof Le=="object"&&Le!==null){switch(Le.$$typeof){case _:return pe=pe.get(Le.key===null?me:Le.key)||null,ne(se,pe,Le,ot);case k:return pe=pe.get(Le.key===null?me:Le.key)||null,ge(se,pe,Le,ot);case J:var pt=Le._init;return Ge(pe,se,me,pt(Le._payload),ot)}if(je(Le)||B(Le))return pe=pe.get(me)||null,Ee(se,pe,Le,ot,null);np(se,Le)}return null}function nt(pe,se,me,Le){for(var ot=null,pt=null,ht=se,bt=se=0,Zn=null;ht!==null&&bt<me.length;bt++){ht.index>bt?(Zn=ht,ht=null):Zn=ht.sibling;var Bt=_e(pe,ht,me[bt],Le);if(Bt===null){ht===null&&(ht=Zn);break}l&&ht&&Bt.alternate===null&&u(pe,ht),se=P(Bt,se,bt),pt===null?ot=Bt:pt.sibling=Bt,pt=Bt,ht=Zn}if(bt===me.length)return m(pe,ht),yn&&so(pe,bt),ot;if(ht===null){for(;bt<me.length;bt++)ht=Oe(pe,me[bt],Le),ht!==null&&(se=P(ht,se,bt),pt===null?ot=ht:pt.sibling=ht,pt=ht);return yn&&so(pe,bt),ot}for(ht=w(pe,ht);bt<me.length;bt++)Zn=Ge(ht,pe,bt,me[bt],Le),Zn!==null&&(l&&Zn.alternate!==null&&ht.delete(Zn.key===null?bt:Zn.key),se=P(Zn,se,bt),pt===null?ot=Zn:pt.sibling=Zn,pt=Zn);return l&&ht.forEach(function(Ei){return u(pe,Ei)}),yn&&so(pe,bt),ot}function at(pe,se,me,Le){var ot=B(me);if(typeof ot!="function")throw Error(n(150));if(me=ot.call(me),me==null)throw Error(n(151));for(var pt=ot=null,ht=se,bt=se=0,Zn=null,Bt=me.next();ht!==null&&!Bt.done;bt++,Bt=me.next()){ht.index>bt?(Zn=ht,ht=null):Zn=ht.sibling;var Ei=_e(pe,ht,Bt.value,Le);if(Ei===null){ht===null&&(ht=Zn);break}l&&ht&&Ei.alternate===null&&u(pe,ht),se=P(Ei,se,bt),pt===null?ot=Ei:pt.sibling=Ei,pt=Ei,ht=Zn}if(Bt.done)return m(pe,ht),yn&&so(pe,bt),ot;if(ht===null){for(;!Bt.done;bt++,Bt=me.next())Bt=Oe(pe,Bt.value,Le),Bt!==null&&(se=P(Bt,se,bt),pt===null?ot=Bt:pt.sibling=Bt,pt=Bt);return yn&&so(pe,bt),ot}for(ht=w(pe,ht);!Bt.done;bt++,Bt=me.next())Bt=Ge(ht,pe,bt,Bt.value,Le),Bt!==null&&(l&&Bt.alternate!==null&&ht.delete(Bt.key===null?bt:Bt.key),se=P(Bt,se,bt),pt===null?ot=Bt:pt.sibling=Bt,pt=Bt);return l&&ht.forEach(function(wU){return u(pe,wU)}),yn&&so(pe,bt),ot}function On(pe,se,me,Le){if(typeof me=="object"&&me!==null&&me.type===O&&me.key===null&&(me=me.props.children),typeof me=="object"&&me!==null){switch(me.$$typeof){case _:e:{for(var ot=me.key,pt=se;pt!==null;){if(pt.key===ot){if(ot=me.type,ot===O){if(pt.tag===7){m(pe,pt.sibling),se=A(pt,me.props.children),se.return=pe,pe=se;break e}}else if(pt.elementType===ot||typeof ot=="object"&&ot!==null&&ot.$$typeof===J&&RA(ot)===pt.type){m(pe,pt.sibling),se=A(pt,me.props),se.ref=wu(pe,pt,me),se.return=pe,pe=se;break e}m(pe,pt);break}else u(pe,pt);pt=pt.sibling}me.type===O?(se=ho(me.props.children,pe.mode,Le,me.key),se.return=pe,pe=se):(Le=Ap(me.type,me.key,me.props,null,pe.mode,Le),Le.ref=wu(pe,se,me),Le.return=pe,pe=Le)}return I(pe);case k:e:{for(pt=me.key;se!==null;){if(se.key===pt)if(se.tag===4&&se.stateNode.containerInfo===me.containerInfo&&se.stateNode.implementation===me.implementation){m(pe,se.sibling),se=A(se,me.children||[]),se.return=pe,pe=se;break e}else{m(pe,se);break}else u(pe,se);se=se.sibling}se=Uy(me,pe.mode,Le),se.return=pe,pe=se}return I(pe);case J:return pt=me._init,On(pe,se,pt(me._payload),Le)}if(je(me))return nt(pe,se,me,Le);if(B(me))return at(pe,se,me,Le);np(pe,me)}return typeof me=="string"&&me!==""||typeof me=="number"?(me=""+me,se!==null&&se.tag===6?(m(pe,se.sibling),se=A(se,me),se.return=pe,pe=se):(m(pe,se),se=zy(me,pe.mode,Le),se.return=pe,pe=se),I(pe)):m(pe,se)}return On}var xl=TA(!0),IA=TA(!1),rp=gi(null),ap=null,bl=null,Qg=null;function Jg(){Qg=bl=ap=null}function Zg(l){var u=rp.current;mn(rp),l._currentValue=u}function ey(l,u,m){for(;l!==null;){var w=l.alternate;if((l.childLanes&u)!==u?(l.childLanes|=u,w!==null&&(w.childLanes|=u)):w!==null&&(w.childLanes&u)!==u&&(w.childLanes|=u),l===m)break;l=l.return}}function wl(l,u){ap=l,Qg=bl=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&u)!==0&&(kr=!0),l.firstContext=null)}function da(l){var u=l._currentValue;if(Qg!==l)if(l={context:l,memoizedValue:u,next:null},bl===null){if(ap===null)throw Error(n(308));bl=l,ap.dependencies={lanes:0,firstContext:l}}else bl=bl.next=l;return u}var io=null;function ty(l){io===null?io=[l]:io.push(l)}function MA(l,u,m,w){var A=u.interleaved;return A===null?(m.next=m,ty(u)):(m.next=A.next,A.next=m),u.interleaved=m,Os(l,w)}function Os(l,u){l.lanes|=u;var m=l.alternate;for(m!==null&&(m.lanes|=u),m=l,l=l.return;l!==null;)l.childLanes|=u,m=l.alternate,m!==null&&(m.childLanes|=u),m=l,l=l.return;return m.tag===3?m.stateNode:null}var bi=!1;function ny(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $A(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 Rs(l,u){return{eventTime:l,lane:u,tag:0,payload:null,callback:null,next:null}}function wi(l,u,m){var w=l.updateQueue;if(w===null)return null;if(w=w.shared,(Lt&2)!==0){var A=w.pending;return A===null?u.next=u:(u.next=A.next,A.next=u),w.pending=u,Os(l,m)}return A=w.interleaved,A===null?(u.next=u,ty(w)):(u.next=A.next,A.next=u),w.interleaved=u,Os(l,m)}function sp(l,u,m){if(u=u.updateQueue,u!==null&&(u=u.shared,(m&4194240)!==0)){var w=u.lanes;w&=l.pendingLanes,m|=w,u.lanes=m,la(l,m)}}function DA(l,u){var m=l.updateQueue,w=l.alternate;if(w!==null&&(w=w.updateQueue,m===w)){var A=null,P=null;if(m=m.firstBaseUpdate,m!==null){do{var I={eventTime:m.eventTime,lane:m.lane,tag:m.tag,payload:m.payload,callback:m.callback,next:null};P===null?A=P=I:P=P.next=I,m=m.next}while(m!==null);P===null?A=P=u:P=P.next=u}else A=P=u;m={baseState:w.baseState,firstBaseUpdate:A,lastBaseUpdate:P,shared:w.shared,effects:w.effects},l.updateQueue=m;return}l=m.lastBaseUpdate,l===null?m.firstBaseUpdate=u:l.next=u,m.lastBaseUpdate=u}function ip(l,u,m,w){var A=l.updateQueue;bi=!1;var P=A.firstBaseUpdate,I=A.lastBaseUpdate,X=A.shared.pending;if(X!==null){A.shared.pending=null;var ne=X,ge=ne.next;ne.next=null,I===null?P=ge:I.next=ge,I=ne;var Ee=l.alternate;Ee!==null&&(Ee=Ee.updateQueue,X=Ee.lastBaseUpdate,X!==I&&(X===null?Ee.firstBaseUpdate=ge:X.next=ge,Ee.lastBaseUpdate=ne))}if(P!==null){var Oe=A.baseState;I=0,Ee=ge=ne=null,X=P;do{var _e=X.lane,Ge=X.eventTime;if((w&_e)===_e){Ee!==null&&(Ee=Ee.next={eventTime:Ge,lane:0,tag:X.tag,payload:X.payload,callback:X.callback,next:null});e:{var nt=l,at=X;switch(_e=u,Ge=m,at.tag){case 1:if(nt=at.payload,typeof nt=="function"){Oe=nt.call(Ge,Oe,_e);break e}Oe=nt;break e;case 3:nt.flags=nt.flags&-65537|128;case 0:if(nt=at.payload,_e=typeof nt=="function"?nt.call(Ge,Oe,_e):nt,_e==null)break e;Oe=Z({},Oe,_e);break e;case 2:bi=!0}}X.callback!==null&&X.lane!==0&&(l.flags|=64,_e=A.effects,_e===null?A.effects=[X]:_e.push(X))}else Ge={eventTime:Ge,lane:_e,tag:X.tag,payload:X.payload,callback:X.callback,next:null},Ee===null?(ge=Ee=Ge,ne=Oe):Ee=Ee.next=Ge,I|=_e;if(X=X.next,X===null){if(X=A.shared.pending,X===null)break;_e=X,X=_e.next,_e.next=null,A.lastBaseUpdate=_e,A.shared.pending=null}}while(!0);if(Ee===null&&(ne=Oe),A.baseState=ne,A.firstBaseUpdate=ge,A.lastBaseUpdate=Ee,u=A.shared.interleaved,u!==null){A=u;do I|=A.lane,A=A.next;while(A!==u)}else P===null&&(A.shared.lanes=0);co|=I,l.lanes=I,l.memoizedState=Oe}}function LA(l,u,m){if(l=u.effects,u.effects=null,l!==null)for(u=0;u<l.length;u++){var w=l[u],A=w.callback;if(A!==null){if(w.callback=null,w=m,typeof A!="function")throw Error(n(191,A));A.call(w)}}}var ju={},rs=gi(ju),Su=gi(ju),Nu=gi(ju);function oo(l){if(l===ju)throw Error(n(174));return l}function ry(l,u){switch(sn(Nu,u),sn(Su,l),sn(rs,ju),l=u.nodeType,l){case 9:case 11:u=(u=u.documentElement)?u.namespaceURI:Ne(null,"");break;default:l=l===8?u.parentNode:u,u=l.namespaceURI||null,l=l.tagName,u=Ne(u,l)}mn(rs),sn(rs,u)}function jl(){mn(rs),mn(Su),mn(Nu)}function FA(l){oo(Nu.current);var u=oo(rs.current),m=Ne(u,l.type);u!==m&&(sn(Su,l),sn(rs,m))}function ay(l){Su.current===l&&(mn(rs),mn(Su))}var bn=gi(0);function op(l){for(var u=l;u!==null;){if(u.tag===13){var m=u.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||m.data==="$?"||m.data==="$!"))return u}else if(u.tag===19&&u.memoizedProps.revealOrder!==void 0){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===l)break;for(;u.sibling===null;){if(u.return===null||u.return===l)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var sy=[];function iy(){for(var l=0;l<sy.length;l++)sy[l]._workInProgressVersionPrimary=null;sy.length=0}var lp=E.ReactCurrentDispatcher,oy=E.ReactCurrentBatchConfig,lo=0,wn=null,Fn=null,Qn=null,cp=!1,Cu=!1,Au=0,q6=0;function hr(){throw Error(n(321))}function ly(l,u){if(u===null)return!1;for(var m=0;m<u.length&&m<l.length;m++)if(!ka(l[m],u[m]))return!1;return!0}function cy(l,u,m,w,A,P){if(lo=P,wn=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,lp.current=l===null||l.memoizedState===null?K6:G6,l=m(w,A),Cu){P=0;do{if(Cu=!1,Au=0,25<=P)throw Error(n(301));P+=1,Qn=Fn=null,u.updateQueue=null,lp.current=Y6,l=m(w,A)}while(Cu)}if(lp.current=fp,u=Fn!==null&&Fn.next!==null,lo=0,Qn=Fn=wn=null,cp=!1,u)throw Error(n(300));return l}function uy(){var l=Au!==0;return Au=0,l}function as(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qn===null?wn.memoizedState=Qn=l:Qn=Qn.next=l,Qn}function fa(){if(Fn===null){var l=wn.alternate;l=l!==null?l.memoizedState:null}else l=Fn.next;var u=Qn===null?wn.memoizedState:Qn.next;if(u!==null)Qn=u,Fn=l;else{if(l===null)throw Error(n(310));Fn=l,l={memoizedState:Fn.memoizedState,baseState:Fn.baseState,baseQueue:Fn.baseQueue,queue:Fn.queue,next:null},Qn===null?wn.memoizedState=Qn=l:Qn=Qn.next=l}return Qn}function _u(l,u){return typeof u=="function"?u(l):u}function dy(l){var u=fa(),m=u.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=l;var w=Fn,A=w.baseQueue,P=m.pending;if(P!==null){if(A!==null){var I=A.next;A.next=P.next,P.next=I}w.baseQueue=A=P,m.pending=null}if(A!==null){P=A.next,w=w.baseState;var X=I=null,ne=null,ge=P;do{var Ee=ge.lane;if((lo&Ee)===Ee)ne!==null&&(ne=ne.next={lane:0,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null}),w=ge.hasEagerState?ge.eagerState:l(w,ge.action);else{var Oe={lane:Ee,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null};ne===null?(X=ne=Oe,I=w):ne=ne.next=Oe,wn.lanes|=Ee,co|=Ee}ge=ge.next}while(ge!==null&&ge!==P);ne===null?I=w:ne.next=X,ka(w,u.memoizedState)||(kr=!0),u.memoizedState=w,u.baseState=I,u.baseQueue=ne,m.lastRenderedState=w}if(l=m.interleaved,l!==null){A=l;do P=A.lane,wn.lanes|=P,co|=P,A=A.next;while(A!==l)}else A===null&&(m.lanes=0);return[u.memoizedState,m.dispatch]}function fy(l){var u=fa(),m=u.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=l;var w=m.dispatch,A=m.pending,P=u.memoizedState;if(A!==null){m.pending=null;var I=A=A.next;do P=l(P,I.action),I=I.next;while(I!==A);ka(P,u.memoizedState)||(kr=!0),u.memoizedState=P,u.baseQueue===null&&(u.baseState=P),m.lastRenderedState=P}return[P,w]}function BA(){}function zA(l,u){var m=wn,w=fa(),A=u(),P=!ka(w.memoizedState,A);if(P&&(w.memoizedState=A,kr=!0),w=w.queue,py(WA.bind(null,m,w,l),[l]),w.getSnapshot!==u||P||Qn!==null&&Qn.memoizedState.tag&1){if(m.flags|=2048,Eu(9,qA.bind(null,m,w,A,u),void 0,null),Jn===null)throw Error(n(349));(lo&30)!==0||UA(m,u,A)}return A}function UA(l,u,m){l.flags|=16384,l={getSnapshot:u,value:m},u=wn.updateQueue,u===null?(u={lastEffect:null,stores:null},wn.updateQueue=u,u.stores=[l]):(m=u.stores,m===null?u.stores=[l]:m.push(l))}function qA(l,u,m,w){u.value=m,u.getSnapshot=w,VA(u)&&HA(l)}function WA(l,u,m){return m(function(){VA(u)&&HA(l)})}function VA(l){var u=l.getSnapshot;l=l.value;try{var m=u();return!ka(l,m)}catch{return!0}}function HA(l){var u=Os(l,1);u!==null&&Ma(u,l,1,-1)}function KA(l){var u=as();return typeof l=="function"&&(l=l()),u.memoizedState=u.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:_u,lastRenderedState:l},u.queue=l,l=l.dispatch=H6.bind(null,wn,l),[u.memoizedState,l]}function Eu(l,u,m,w){return l={tag:l,create:u,destroy:m,deps:w,next:null},u=wn.updateQueue,u===null?(u={lastEffect:null,stores:null},wn.updateQueue=u,u.lastEffect=l.next=l):(m=u.lastEffect,m===null?u.lastEffect=l.next=l:(w=m.next,m.next=l,l.next=w,u.lastEffect=l)),l}function GA(){return fa().memoizedState}function up(l,u,m,w){var A=as();wn.flags|=l,A.memoizedState=Eu(1|u,m,void 0,w===void 0?null:w)}function dp(l,u,m,w){var A=fa();w=w===void 0?null:w;var P=void 0;if(Fn!==null){var I=Fn.memoizedState;if(P=I.destroy,w!==null&&ly(w,I.deps)){A.memoizedState=Eu(u,m,P,w);return}}wn.flags|=l,A.memoizedState=Eu(1|u,m,P,w)}function YA(l,u){return up(8390656,8,l,u)}function py(l,u){return dp(2048,8,l,u)}function XA(l,u){return dp(4,2,l,u)}function QA(l,u){return dp(4,4,l,u)}function JA(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 ZA(l,u,m){return m=m!=null?m.concat([l]):null,dp(4,4,JA.bind(null,u,l),m)}function hy(){}function e_(l,u){var m=fa();u=u===void 0?null:u;var w=m.memoizedState;return w!==null&&u!==null&&ly(u,w[1])?w[0]:(m.memoizedState=[l,u],l)}function t_(l,u){var m=fa();u=u===void 0?null:u;var w=m.memoizedState;return w!==null&&u!==null&&ly(u,w[1])?w[0]:(l=l(),m.memoizedState=[l,u],l)}function n_(l,u,m){return(lo&21)===0?(l.baseState&&(l.baseState=!1,kr=!0),l.memoizedState=m):(ka(m,u)||(m=ft(),wn.lanes|=m,co|=m,l.baseState=!0),u)}function W6(l,u){var m=Ft;Ft=m!==0&&4>m?m:4,l(!0);var w=oy.transition;oy.transition={};try{l(!1),u()}finally{Ft=m,oy.transition=w}}function r_(){return fa().memoizedState}function V6(l,u,m){var w=Ci(l);if(m={lane:w,action:m,hasEagerState:!1,eagerState:null,next:null},a_(l))s_(u,m);else if(m=MA(l,u,m,w),m!==null){var A=br();Ma(m,l,w,A),i_(m,u,w)}}function H6(l,u,m){var w=Ci(l),A={lane:w,action:m,hasEagerState:!1,eagerState:null,next:null};if(a_(l))s_(u,A);else{var P=l.alternate;if(l.lanes===0&&(P===null||P.lanes===0)&&(P=u.lastRenderedReducer,P!==null))try{var I=u.lastRenderedState,X=P(I,m);if(A.hasEagerState=!0,A.eagerState=X,ka(X,I)){var ne=u.interleaved;ne===null?(A.next=A,ty(u)):(A.next=ne.next,ne.next=A),u.interleaved=A;return}}catch{}m=MA(l,u,A,w),m!==null&&(A=br(),Ma(m,l,w,A),i_(m,u,w))}}function a_(l){var u=l.alternate;return l===wn||u!==null&&u===wn}function s_(l,u){Cu=cp=!0;var m=l.pending;m===null?u.next=u:(u.next=m.next,m.next=u),l.pending=u}function i_(l,u,m){if((m&4194240)!==0){var w=u.lanes;w&=l.pendingLanes,m|=w,u.lanes=m,la(l,m)}}var fp={readContext:da,useCallback:hr,useContext:hr,useEffect:hr,useImperativeHandle:hr,useInsertionEffect:hr,useLayoutEffect:hr,useMemo:hr,useReducer:hr,useRef:hr,useState:hr,useDebugValue:hr,useDeferredValue:hr,useTransition:hr,useMutableSource:hr,useSyncExternalStore:hr,useId:hr,unstable_isNewReconciler:!1},K6={readContext:da,useCallback:function(l,u){return as().memoizedState=[l,u===void 0?null:u],l},useContext:da,useEffect:YA,useImperativeHandle:function(l,u,m){return m=m!=null?m.concat([l]):null,up(4194308,4,JA.bind(null,u,l),m)},useLayoutEffect:function(l,u){return up(4194308,4,l,u)},useInsertionEffect:function(l,u){return up(4,2,l,u)},useMemo:function(l,u){var m=as();return u=u===void 0?null:u,l=l(),m.memoizedState=[l,u],l},useReducer:function(l,u,m){var w=as();return u=m!==void 0?m(u):u,w.memoizedState=w.baseState=u,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:u},w.queue=l,l=l.dispatch=V6.bind(null,wn,l),[w.memoizedState,l]},useRef:function(l){var u=as();return l={current:l},u.memoizedState=l},useState:KA,useDebugValue:hy,useDeferredValue:function(l){return as().memoizedState=l},useTransition:function(){var l=KA(!1),u=l[0];return l=W6.bind(null,l[1]),as().memoizedState=l,[u,l]},useMutableSource:function(){},useSyncExternalStore:function(l,u,m){var w=wn,A=as();if(yn){if(m===void 0)throw Error(n(407));m=m()}else{if(m=u(),Jn===null)throw Error(n(349));(lo&30)!==0||UA(w,u,m)}A.memoizedState=m;var P={value:m,getSnapshot:u};return A.queue=P,YA(WA.bind(null,w,P,l),[l]),w.flags|=2048,Eu(9,qA.bind(null,w,P,m,u),void 0,null),m},useId:function(){var l=as(),u=Jn.identifierPrefix;if(yn){var m=ks,w=Ps;m=(w&~(1<<32-Vr(w)-1)).toString(32)+m,u=":"+u+"R"+m,m=Au++,0<m&&(u+="H"+m.toString(32)),u+=":"}else m=q6++,u=":"+u+"r"+m.toString(32)+":";return l.memoizedState=u},unstable_isNewReconciler:!1},G6={readContext:da,useCallback:e_,useContext:da,useEffect:py,useImperativeHandle:ZA,useInsertionEffect:XA,useLayoutEffect:QA,useMemo:t_,useReducer:dy,useRef:GA,useState:function(){return dy(_u)},useDebugValue:hy,useDeferredValue:function(l){var u=fa();return n_(u,Fn.memoizedState,l)},useTransition:function(){var l=dy(_u)[0],u=fa().memoizedState;return[l,u]},useMutableSource:BA,useSyncExternalStore:zA,useId:r_,unstable_isNewReconciler:!1},Y6={readContext:da,useCallback:e_,useContext:da,useEffect:py,useImperativeHandle:ZA,useInsertionEffect:XA,useLayoutEffect:QA,useMemo:t_,useReducer:fy,useRef:GA,useState:function(){return fy(_u)},useDebugValue:hy,useDeferredValue:function(l){var u=fa();return Fn===null?u.memoizedState=l:n_(u,Fn.memoizedState,l)},useTransition:function(){var l=fy(_u)[0],u=fa().memoizedState;return[l,u]},useMutableSource:BA,useSyncExternalStore:zA,useId:r_,unstable_isNewReconciler:!1};function Ra(l,u){if(l&&l.defaultProps){u=Z({},u),l=l.defaultProps;for(var m in l)u[m]===void 0&&(u[m]=l[m]);return u}return u}function my(l,u,m,w){u=l.memoizedState,m=m(w,u),m=m==null?u:Z({},u,m),l.memoizedState=m,l.lanes===0&&(l.updateQueue.baseState=m)}var pp={isMounted:function(l){return(l=l._reactInternals)?Ve(l)===l:!1},enqueueSetState:function(l,u,m){l=l._reactInternals;var w=br(),A=Ci(l),P=Rs(w,A);P.payload=u,m!=null&&(P.callback=m),u=wi(l,P,A),u!==null&&(Ma(u,l,A,w),sp(u,l,A))},enqueueReplaceState:function(l,u,m){l=l._reactInternals;var w=br(),A=Ci(l),P=Rs(w,A);P.tag=1,P.payload=u,m!=null&&(P.callback=m),u=wi(l,P,A),u!==null&&(Ma(u,l,A,w),sp(u,l,A))},enqueueForceUpdate:function(l,u){l=l._reactInternals;var m=br(),w=Ci(l),A=Rs(m,w);A.tag=2,u!=null&&(A.callback=u),u=wi(l,A,w),u!==null&&(Ma(u,l,w,m),sp(u,l,w))}};function o_(l,u,m,w,A,P,I){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(w,P,I):u.prototype&&u.prototype.isPureReactComponent?!hu(m,w)||!hu(A,P):!0}function l_(l,u,m){var w=!1,A=yi,P=u.contextType;return typeof P=="object"&&P!==null?P=da(P):(A=Pr(u)?ro:pr.current,w=u.contextTypes,P=(w=w!=null)?ml(l,A):yi),u=new u(m,P),l.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=pp,l.stateNode=u,u._reactInternals=l,w&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=A,l.__reactInternalMemoizedMaskedChildContext=P),u}function c_(l,u,m,w){l=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(m,w),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(m,w),u.state!==l&&pp.enqueueReplaceState(u,u.state,null)}function vy(l,u,m,w){var A=l.stateNode;A.props=m,A.state=l.memoizedState,A.refs={},ny(l);var P=u.contextType;typeof P=="object"&&P!==null?A.context=da(P):(P=Pr(u)?ro:pr.current,A.context=ml(l,P)),A.state=l.memoizedState,P=u.getDerivedStateFromProps,typeof P=="function"&&(my(l,u,P,m),A.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof A.getSnapshotBeforeUpdate=="function"||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(u=A.state,typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount(),u!==A.state&&pp.enqueueReplaceState(A,A.state,null),ip(l,m,A,w),A.state=l.memoizedState),typeof A.componentDidMount=="function"&&(l.flags|=4194308)}function Sl(l,u){try{var m="",w=u;do m+=G(w),w=w.return;while(w);var A=m}catch(P){A=`
|
|
7
|
-
Error generating stack: `+P.message+`
|
|
8
|
-
`+P.stack}return{value:l,source:u,stack:A,digest:null}}function gy(l,u,m){return{value:l,source:null,stack:m??null,digest:u??null}}function yy(l,u){try{console.error(u.value)}catch(m){setTimeout(function(){throw m})}}var X6=typeof WeakMap=="function"?WeakMap:Map;function u_(l,u,m){m=Rs(-1,m),m.tag=3,m.payload={element:null};var w=u.value;return m.callback=function(){bp||(bp=!0,Ty=w),yy(l,u)},m}function d_(l,u,m){m=Rs(-1,m),m.tag=3;var w=l.type.getDerivedStateFromError;if(typeof w=="function"){var A=u.value;m.payload=function(){return w(A)},m.callback=function(){yy(l,u)}}var P=l.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(m.callback=function(){yy(l,u),typeof w!="function"&&(Si===null?Si=new Set([this]):Si.add(this));var I=u.stack;this.componentDidCatch(u.value,{componentStack:I!==null?I:""})}),m}function f_(l,u,m){var w=l.pingCache;if(w===null){w=l.pingCache=new X6;var A=new Set;w.set(u,A)}else A=w.get(u),A===void 0&&(A=new Set,w.set(u,A));A.has(m)||(A.add(m),l=uU.bind(null,l,u,m),u.then(l,l))}function p_(l){do{var u;if((u=l.tag===13)&&(u=l.memoizedState,u=u!==null?u.dehydrated!==null:!0),u)return l;l=l.return}while(l!==null);return null}function h_(l,u,m,w,A){return(l.mode&1)===0?(l===u?l.flags|=65536:(l.flags|=128,m.flags|=131072,m.flags&=-52805,m.tag===1&&(m.alternate===null?m.tag=17:(u=Rs(-1,1),u.tag=2,wi(m,u,1))),m.lanes|=1),l):(l.flags|=65536,l.lanes=A,l)}var Q6=E.ReactCurrentOwner,kr=!1;function xr(l,u,m,w){u.child=l===null?IA(u,null,m,w):xl(u,l.child,m,w)}function m_(l,u,m,w,A){m=m.render;var P=u.ref;return wl(u,A),w=cy(l,u,m,w,P,A),m=uy(),l!==null&&!kr?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~A,Ts(l,u,A)):(yn&&m&&Hg(u),u.flags|=1,xr(l,u,w,A),u.child)}function v_(l,u,m,w,A){if(l===null){var P=m.type;return typeof P=="function"&&!By(P)&&P.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(u.tag=15,u.type=P,g_(l,u,P,w,A)):(l=Ap(m.type,null,w,u,u.mode,A),l.ref=u.ref,l.return=u,u.child=l)}if(P=l.child,(l.lanes&A)===0){var I=P.memoizedProps;if(m=m.compare,m=m!==null?m:hu,m(I,w)&&l.ref===u.ref)return Ts(l,u,A)}return u.flags|=1,l=_i(P,w),l.ref=u.ref,l.return=u,u.child=l}function g_(l,u,m,w,A){if(l!==null){var P=l.memoizedProps;if(hu(P,w)&&l.ref===u.ref)if(kr=!1,u.pendingProps=w=P,(l.lanes&A)!==0)(l.flags&131072)!==0&&(kr=!0);else return u.lanes=l.lanes,Ts(l,u,A)}return xy(l,u,m,w,A)}function y_(l,u,m){var w=u.pendingProps,A=w.children,P=l!==null?l.memoizedState:null;if(w.mode==="hidden")if((u.mode&1)===0)u.memoizedState={baseLanes:0,cachePool:null,transitions:null},sn(Cl,Yr),Yr|=m;else{if((m&1073741824)===0)return l=P!==null?P.baseLanes|m:m,u.lanes=u.childLanes=1073741824,u.memoizedState={baseLanes:l,cachePool:null,transitions:null},u.updateQueue=null,sn(Cl,Yr),Yr|=l,null;u.memoizedState={baseLanes:0,cachePool:null,transitions:null},w=P!==null?P.baseLanes:m,sn(Cl,Yr),Yr|=w}else P!==null?(w=P.baseLanes|m,u.memoizedState=null):w=m,sn(Cl,Yr),Yr|=w;return xr(l,u,A,m),u.child}function x_(l,u){var m=u.ref;(l===null&&m!==null||l!==null&&l.ref!==m)&&(u.flags|=512,u.flags|=2097152)}function xy(l,u,m,w,A){var P=Pr(m)?ro:pr.current;return P=ml(u,P),wl(u,A),m=cy(l,u,m,w,P,A),w=uy(),l!==null&&!kr?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~A,Ts(l,u,A)):(yn&&w&&Hg(u),u.flags|=1,xr(l,u,m,A),u.child)}function b_(l,u,m,w,A){if(Pr(m)){var P=!0;Qf(u)}else P=!1;if(wl(u,A),u.stateNode===null)mp(l,u),l_(u,m,w),vy(u,m,w,A),w=!0;else if(l===null){var I=u.stateNode,X=u.memoizedProps;I.props=X;var ne=I.context,ge=m.contextType;typeof ge=="object"&&ge!==null?ge=da(ge):(ge=Pr(m)?ro:pr.current,ge=ml(u,ge));var Ee=m.getDerivedStateFromProps,Oe=typeof Ee=="function"||typeof I.getSnapshotBeforeUpdate=="function";Oe||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(X!==w||ne!==ge)&&c_(u,I,w,ge),bi=!1;var _e=u.memoizedState;I.state=_e,ip(u,w,I,A),ne=u.memoizedState,X!==w||_e!==ne||Er.current||bi?(typeof Ee=="function"&&(my(u,m,Ee,w),ne=u.memoizedState),(X=bi||o_(u,m,X,w,_e,ne,ge))?(Oe||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount()),typeof I.componentDidMount=="function"&&(u.flags|=4194308)):(typeof I.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=w,u.memoizedState=ne),I.props=w,I.state=ne,I.context=ge,w=X):(typeof I.componentDidMount=="function"&&(u.flags|=4194308),w=!1)}else{I=u.stateNode,$A(l,u),X=u.memoizedProps,ge=u.type===u.elementType?X:Ra(u.type,X),I.props=ge,Oe=u.pendingProps,_e=I.context,ne=m.contextType,typeof ne=="object"&&ne!==null?ne=da(ne):(ne=Pr(m)?ro:pr.current,ne=ml(u,ne));var Ge=m.getDerivedStateFromProps;(Ee=typeof Ge=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(X!==Oe||_e!==ne)&&c_(u,I,w,ne),bi=!1,_e=u.memoizedState,I.state=_e,ip(u,w,I,A);var nt=u.memoizedState;X!==Oe||_e!==nt||Er.current||bi?(typeof Ge=="function"&&(my(u,m,Ge,w),nt=u.memoizedState),(ge=bi||o_(u,m,ge,w,_e,nt,ne)||!1)?(Ee||typeof I.UNSAFE_componentWillUpdate!="function"&&typeof I.componentWillUpdate!="function"||(typeof I.componentWillUpdate=="function"&&I.componentWillUpdate(w,nt,ne),typeof I.UNSAFE_componentWillUpdate=="function"&&I.UNSAFE_componentWillUpdate(w,nt,ne)),typeof I.componentDidUpdate=="function"&&(u.flags|=4),typeof I.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof I.componentDidUpdate!="function"||X===l.memoizedProps&&_e===l.memoizedState||(u.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||X===l.memoizedProps&&_e===l.memoizedState||(u.flags|=1024),u.memoizedProps=w,u.memoizedState=nt),I.props=w,I.state=nt,I.context=ne,w=ge):(typeof I.componentDidUpdate!="function"||X===l.memoizedProps&&_e===l.memoizedState||(u.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||X===l.memoizedProps&&_e===l.memoizedState||(u.flags|=1024),w=!1)}return by(l,u,m,w,P,A)}function by(l,u,m,w,A,P){x_(l,u);var I=(u.flags&128)!==0;if(!w&&!I)return A&&CA(u,m,!1),Ts(l,u,P);w=u.stateNode,Q6.current=u;var X=I&&typeof m.getDerivedStateFromError!="function"?null:w.render();return u.flags|=1,l!==null&&I?(u.child=xl(u,l.child,null,P),u.child=xl(u,null,X,P)):xr(l,u,X,P),u.memoizedState=w.state,A&&CA(u,m,!0),u.child}function w_(l){var u=l.stateNode;u.pendingContext?SA(l,u.pendingContext,u.pendingContext!==u.context):u.context&&SA(l,u.context,!1),ry(l,u.containerInfo)}function j_(l,u,m,w,A){return yl(),Xg(A),u.flags|=256,xr(l,u,m,w),u.child}var wy={dehydrated:null,treeContext:null,retryLane:0};function jy(l){return{baseLanes:l,cachePool:null,transitions:null}}function S_(l,u,m){var w=u.pendingProps,A=bn.current,P=!1,I=(u.flags&128)!==0,X;if((X=I)||(X=l!==null&&l.memoizedState===null?!1:(A&2)!==0),X?(P=!0,u.flags&=-129):(l===null||l.memoizedState!==null)&&(A|=1),sn(bn,A&1),l===null)return Yg(u),l=u.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?((u.mode&1)===0?u.lanes=1:l.data==="$!"?u.lanes=8:u.lanes=1073741824,null):(I=w.children,l=w.fallback,P?(w=u.mode,P=u.child,I={mode:"hidden",children:I},(w&1)===0&&P!==null?(P.childLanes=0,P.pendingProps=I):P=_p(I,w,0,null),l=ho(l,w,m,null),P.return=u,l.return=u,P.sibling=l,u.child=P,u.child.memoizedState=jy(m),u.memoizedState=wy,l):Sy(u,I));if(A=l.memoizedState,A!==null&&(X=A.dehydrated,X!==null))return J6(l,u,I,w,X,A,m);if(P){P=w.fallback,I=u.mode,A=l.child,X=A.sibling;var ne={mode:"hidden",children:w.children};return(I&1)===0&&u.child!==A?(w=u.child,w.childLanes=0,w.pendingProps=ne,u.deletions=null):(w=_i(A,ne),w.subtreeFlags=A.subtreeFlags&14680064),X!==null?P=_i(X,P):(P=ho(P,I,m,null),P.flags|=2),P.return=u,w.return=u,w.sibling=P,u.child=w,w=P,P=u.child,I=l.child.memoizedState,I=I===null?jy(m):{baseLanes:I.baseLanes|m,cachePool:null,transitions:I.transitions},P.memoizedState=I,P.childLanes=l.childLanes&~m,u.memoizedState=wy,w}return P=l.child,l=P.sibling,w=_i(P,{mode:"visible",children:w.children}),(u.mode&1)===0&&(w.lanes=m),w.return=u,w.sibling=null,l!==null&&(m=u.deletions,m===null?(u.deletions=[l],u.flags|=16):m.push(l)),u.child=w,u.memoizedState=null,w}function Sy(l,u){return u=_p({mode:"visible",children:u},l.mode,0,null),u.return=l,l.child=u}function hp(l,u,m,w){return w!==null&&Xg(w),xl(u,l.child,null,m),l=Sy(u,u.pendingProps.children),l.flags|=2,u.memoizedState=null,l}function J6(l,u,m,w,A,P,I){if(m)return u.flags&256?(u.flags&=-257,w=gy(Error(n(422))),hp(l,u,I,w)):u.memoizedState!==null?(u.child=l.child,u.flags|=128,null):(P=w.fallback,A=u.mode,w=_p({mode:"visible",children:w.children},A,0,null),P=ho(P,A,I,null),P.flags|=2,w.return=u,P.return=u,w.sibling=P,u.child=w,(u.mode&1)!==0&&xl(u,l.child,null,I),u.child.memoizedState=jy(I),u.memoizedState=wy,P);if((u.mode&1)===0)return hp(l,u,I,null);if(A.data==="$!"){if(w=A.nextSibling&&A.nextSibling.dataset,w)var X=w.dgst;return w=X,P=Error(n(419)),w=gy(P,w,void 0),hp(l,u,I,w)}if(X=(I&l.childLanes)!==0,kr||X){if(w=Jn,w!==null){switch(I&-I){case 4:A=2;break;case 16:A=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:A=32;break;case 536870912:A=268435456;break;default:A=0}A=(A&(w.suspendedLanes|I))!==0?0:A,A!==0&&A!==P.retryLane&&(P.retryLane=A,Os(l,A),Ma(w,l,A,-1))}return Fy(),w=gy(Error(n(421))),hp(l,u,I,w)}return A.data==="$?"?(u.flags|=128,u.child=l.child,u=dU.bind(null,l),A._reactRetry=u,null):(l=P.treeContext,Gr=vi(A.nextSibling),Kr=u,yn=!0,Oa=null,l!==null&&(ca[ua++]=Ps,ca[ua++]=ks,ca[ua++]=ao,Ps=l.id,ks=l.overflow,ao=u),u=Sy(u,w.children),u.flags|=4096,u)}function N_(l,u,m){l.lanes|=u;var w=l.alternate;w!==null&&(w.lanes|=u),ey(l.return,u,m)}function Ny(l,u,m,w,A){var P=l.memoizedState;P===null?l.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:w,tail:m,tailMode:A}:(P.isBackwards=u,P.rendering=null,P.renderingStartTime=0,P.last=w,P.tail=m,P.tailMode=A)}function C_(l,u,m){var w=u.pendingProps,A=w.revealOrder,P=w.tail;if(xr(l,u,w.children,m),w=bn.current,(w&2)!==0)w=w&1|2,u.flags|=128;else{if(l!==null&&(l.flags&128)!==0)e:for(l=u.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&N_(l,m,u);else if(l.tag===19)N_(l,m,u);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===u)break e;for(;l.sibling===null;){if(l.return===null||l.return===u)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}w&=1}if(sn(bn,w),(u.mode&1)===0)u.memoizedState=null;else switch(A){case"forwards":for(m=u.child,A=null;m!==null;)l=m.alternate,l!==null&&op(l)===null&&(A=m),m=m.sibling;m=A,m===null?(A=u.child,u.child=null):(A=m.sibling,m.sibling=null),Ny(u,!1,A,m,P);break;case"backwards":for(m=null,A=u.child,u.child=null;A!==null;){if(l=A.alternate,l!==null&&op(l)===null){u.child=A;break}l=A.sibling,A.sibling=m,m=A,A=l}Ny(u,!0,m,null,P);break;case"together":Ny(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 Ts(l,u,m){if(l!==null&&(u.dependencies=l.dependencies),co|=u.lanes,(m&u.childLanes)===0)return null;if(l!==null&&u.child!==l.child)throw Error(n(153));if(u.child!==null){for(l=u.child,m=_i(l,l.pendingProps),u.child=m,m.return=u;l.sibling!==null;)l=l.sibling,m=m.sibling=_i(l,l.pendingProps),m.return=u;m.sibling=null}return u.child}function Z6(l,u,m){switch(u.tag){case 3:w_(u),yl();break;case 5:FA(u);break;case 1:Pr(u.type)&&Qf(u);break;case 4:ry(u,u.stateNode.containerInfo);break;case 10:var w=u.type._context,A=u.memoizedProps.value;sn(rp,w._currentValue),w._currentValue=A;break;case 13:if(w=u.memoizedState,w!==null)return w.dehydrated!==null?(sn(bn,bn.current&1),u.flags|=128,null):(m&u.child.childLanes)!==0?S_(l,u,m):(sn(bn,bn.current&1),l=Ts(l,u,m),l!==null?l.sibling:null);sn(bn,bn.current&1);break;case 19:if(w=(m&u.childLanes)!==0,(l.flags&128)!==0){if(w)return C_(l,u,m);u.flags|=128}if(A=u.memoizedState,A!==null&&(A.rendering=null,A.tail=null,A.lastEffect=null),sn(bn,bn.current),w)break;return null;case 22:case 23:return u.lanes=0,y_(l,u,m)}return Ts(l,u,m)}var A_,Cy,__,E_;A_=function(l,u){for(var m=u.child;m!==null;){if(m.tag===5||m.tag===6)l.appendChild(m.stateNode);else if(m.tag!==4&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===u)break;for(;m.sibling===null;){if(m.return===null||m.return===u)return;m=m.return}m.sibling.return=m.return,m=m.sibling}},Cy=function(){},__=function(l,u,m,w){var A=l.memoizedProps;if(A!==w){l=u.stateNode,oo(rs.current);var P=null;switch(m){case"input":A=W(l,A),w=W(l,w),P=[];break;case"select":A=Z({},A,{value:void 0}),w=Z({},w,{value:void 0}),P=[];break;case"textarea":A=Xe(l,A),w=Xe(l,w),P=[];break;default:typeof A.onClick!="function"&&typeof w.onClick=="function"&&(l.onclick=Gf)}Dn(m,w);var I;m=null;for(ge in A)if(!w.hasOwnProperty(ge)&&A.hasOwnProperty(ge)&&A[ge]!=null)if(ge==="style"){var X=A[ge];for(I in X)X.hasOwnProperty(I)&&(m||(m={}),m[I]="")}else ge!=="dangerouslySetInnerHTML"&&ge!=="children"&&ge!=="suppressContentEditableWarning"&&ge!=="suppressHydrationWarning"&&ge!=="autoFocus"&&(a.hasOwnProperty(ge)?P||(P=[]):(P=P||[]).push(ge,null));for(ge in w){var ne=w[ge];if(X=A?.[ge],w.hasOwnProperty(ge)&&ne!==X&&(ne!=null||X!=null))if(ge==="style")if(X){for(I in X)!X.hasOwnProperty(I)||ne&&ne.hasOwnProperty(I)||(m||(m={}),m[I]="");for(I in ne)ne.hasOwnProperty(I)&&X[I]!==ne[I]&&(m||(m={}),m[I]=ne[I])}else m||(P||(P=[]),P.push(ge,m)),m=ne;else ge==="dangerouslySetInnerHTML"?(ne=ne?ne.__html:void 0,X=X?X.__html:void 0,ne!=null&&X!==ne&&(P=P||[]).push(ge,ne)):ge==="children"?typeof ne!="string"&&typeof ne!="number"||(P=P||[]).push(ge,""+ne):ge!=="suppressContentEditableWarning"&&ge!=="suppressHydrationWarning"&&(a.hasOwnProperty(ge)?(ne!=null&&ge==="onScroll"&&hn("scroll",l),P||X===ne||(P=[])):(P=P||[]).push(ge,ne))}m&&(P=P||[]).push("style",m);var ge=P;(u.updateQueue=ge)&&(u.flags|=4)}},E_=function(l,u,m,w){m!==w&&(u.flags|=4)};function Pu(l,u){if(!yn)switch(l.tailMode){case"hidden":u=l.tail;for(var m=null;u!==null;)u.alternate!==null&&(m=u),u=u.sibling;m===null?l.tail=null:m.sibling=null;break;case"collapsed":m=l.tail;for(var w=null;m!==null;)m.alternate!==null&&(w=m),m=m.sibling;w===null?u||l.tail===null?l.tail=null:l.tail.sibling=null:w.sibling=null}}function mr(l){var u=l.alternate!==null&&l.alternate.child===l.child,m=0,w=0;if(u)for(var A=l.child;A!==null;)m|=A.lanes|A.childLanes,w|=A.subtreeFlags&14680064,w|=A.flags&14680064,A.return=l,A=A.sibling;else for(A=l.child;A!==null;)m|=A.lanes|A.childLanes,w|=A.subtreeFlags,w|=A.flags,A.return=l,A=A.sibling;return l.subtreeFlags|=w,l.childLanes=m,u}function eU(l,u,m){var w=u.pendingProps;switch(Kg(u),u.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mr(u),null;case 1:return Pr(u.type)&&Xf(),mr(u),null;case 3:return w=u.stateNode,jl(),mn(Er),mn(pr),iy(),w.pendingContext&&(w.context=w.pendingContext,w.pendingContext=null),(l===null||l.child===null)&&(tp(u)?u.flags|=4:l===null||l.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Oa!==null&&($y(Oa),Oa=null))),Cy(l,u),mr(u),null;case 5:ay(u);var A=oo(Nu.current);if(m=u.type,l!==null&&u.stateNode!=null)__(l,u,m,w,A),l.ref!==u.ref&&(u.flags|=512,u.flags|=2097152);else{if(!w){if(u.stateNode===null)throw Error(n(166));return mr(u),null}if(l=oo(rs.current),tp(u)){w=u.stateNode,m=u.type;var P=u.memoizedProps;switch(w[ns]=u,w[xu]=P,l=(u.mode&1)!==0,m){case"dialog":hn("cancel",w),hn("close",w);break;case"iframe":case"object":case"embed":hn("load",w);break;case"video":case"audio":for(A=0;A<vu.length;A++)hn(vu[A],w);break;case"source":hn("error",w);break;case"img":case"image":case"link":hn("error",w),hn("load",w);break;case"details":hn("toggle",w);break;case"input":ve(w,P),hn("invalid",w);break;case"select":w._wrapperState={wasMultiple:!!P.multiple},hn("invalid",w);break;case"textarea":It(w,P),hn("invalid",w)}Dn(m,P),A=null;for(var I in P)if(P.hasOwnProperty(I)){var X=P[I];I==="children"?typeof X=="string"?w.textContent!==X&&(P.suppressHydrationWarning!==!0&&Kf(w.textContent,X,l),A=["children",X]):typeof X=="number"&&w.textContent!==""+X&&(P.suppressHydrationWarning!==!0&&Kf(w.textContent,X,l),A=["children",""+X]):a.hasOwnProperty(I)&&X!=null&&I==="onScroll"&&hn("scroll",w)}switch(m){case"input":Ae(w),Ie(w,P,!0);break;case"textarea":Ae(w),ee(w);break;case"select":case"option":break;default:typeof P.onClick=="function"&&(w.onclick=Gf)}w=A,u.updateQueue=w,w!==null&&(u.flags|=4)}else{I=A.nodeType===9?A:A.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=Ce(m)),l==="http://www.w3.org/1999/xhtml"?m==="script"?(l=I.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof w.is=="string"?l=I.createElement(m,{is:w.is}):(l=I.createElement(m),m==="select"&&(I=l,w.multiple?I.multiple=!0:w.size&&(I.size=w.size))):l=I.createElementNS(l,m),l[ns]=u,l[xu]=w,A_(l,u,!1,!1),u.stateNode=l;e:{switch(I=dr(m,w),m){case"dialog":hn("cancel",l),hn("close",l),A=w;break;case"iframe":case"object":case"embed":hn("load",l),A=w;break;case"video":case"audio":for(A=0;A<vu.length;A++)hn(vu[A],l);A=w;break;case"source":hn("error",l),A=w;break;case"img":case"image":case"link":hn("error",l),hn("load",l),A=w;break;case"details":hn("toggle",l),A=w;break;case"input":ve(l,w),A=W(l,w),hn("invalid",l);break;case"option":A=w;break;case"select":l._wrapperState={wasMultiple:!!w.multiple},A=Z({},w,{value:void 0}),hn("invalid",l);break;case"textarea":It(l,w),A=Xe(l,w),hn("invalid",l);break;default:A=w}Dn(m,A),X=A;for(P in X)if(X.hasOwnProperty(P)){var ne=X[P];P==="style"?cr(l,ne):P==="dangerouslySetInnerHTML"?(ne=ne?ne.__html:void 0,ne!=null&&Be(l,ne)):P==="children"?typeof ne=="string"?(m!=="textarea"||ne!=="")&&et(l,ne):typeof ne=="number"&&et(l,""+ne):P!=="suppressContentEditableWarning"&&P!=="suppressHydrationWarning"&&P!=="autoFocus"&&(a.hasOwnProperty(P)?ne!=null&&P==="onScroll"&&hn("scroll",l):ne!=null&&C(l,P,ne,I))}switch(m){case"input":Ae(l),Ie(l,w,!1);break;case"textarea":Ae(l),ee(l);break;case"option":w.value!=null&&l.setAttribute("value",""+he(w.value));break;case"select":l.multiple=!!w.multiple,P=w.value,P!=null?Re(l,!!w.multiple,P,!1):w.defaultValue!=null&&Re(l,!!w.multiple,w.defaultValue,!0);break;default:typeof A.onClick=="function"&&(l.onclick=Gf)}switch(m){case"button":case"input":case"select":case"textarea":w=!!w.autoFocus;break e;case"img":w=!0;break e;default:w=!1}}w&&(u.flags|=4)}u.ref!==null&&(u.flags|=512,u.flags|=2097152)}return mr(u),null;case 6:if(l&&u.stateNode!=null)E_(l,u,l.memoizedProps,w);else{if(typeof w!="string"&&u.stateNode===null)throw Error(n(166));if(m=oo(Nu.current),oo(rs.current),tp(u)){if(w=u.stateNode,m=u.memoizedProps,w[ns]=u,(P=w.nodeValue!==m)&&(l=Kr,l!==null))switch(l.tag){case 3:Kf(w.nodeValue,m,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&Kf(w.nodeValue,m,(l.mode&1)!==0)}P&&(u.flags|=4)}else w=(m.nodeType===9?m:m.ownerDocument).createTextNode(w),w[ns]=u,u.stateNode=w}return mr(u),null;case 13:if(mn(bn),w=u.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(yn&&Gr!==null&&(u.mode&1)!==0&&(u.flags&128)===0)OA(),yl(),u.flags|=98560,P=!1;else if(P=tp(u),w!==null&&w.dehydrated!==null){if(l===null){if(!P)throw Error(n(318));if(P=u.memoizedState,P=P!==null?P.dehydrated:null,!P)throw Error(n(317));P[ns]=u}else yl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;mr(u),P=!1}else Oa!==null&&($y(Oa),Oa=null),P=!0;if(!P)return u.flags&65536?u:null}return(u.flags&128)!==0?(u.lanes=m,u):(w=w!==null,w!==(l!==null&&l.memoizedState!==null)&&w&&(u.child.flags|=8192,(u.mode&1)!==0&&(l===null||(bn.current&1)!==0?Bn===0&&(Bn=3):Fy())),u.updateQueue!==null&&(u.flags|=4),mr(u),null);case 4:return jl(),Cy(l,u),l===null&&gu(u.stateNode.containerInfo),mr(u),null;case 10:return Zg(u.type._context),mr(u),null;case 17:return Pr(u.type)&&Xf(),mr(u),null;case 19:if(mn(bn),P=u.memoizedState,P===null)return mr(u),null;if(w=(u.flags&128)!==0,I=P.rendering,I===null)if(w)Pu(P,!1);else{if(Bn!==0||l!==null&&(l.flags&128)!==0)for(l=u.child;l!==null;){if(I=op(l),I!==null){for(u.flags|=128,Pu(P,!1),w=I.updateQueue,w!==null&&(u.updateQueue=w,u.flags|=4),u.subtreeFlags=0,w=m,m=u.child;m!==null;)P=m,l=w,P.flags&=14680066,I=P.alternate,I===null?(P.childLanes=0,P.lanes=l,P.child=null,P.subtreeFlags=0,P.memoizedProps=null,P.memoizedState=null,P.updateQueue=null,P.dependencies=null,P.stateNode=null):(P.childLanes=I.childLanes,P.lanes=I.lanes,P.child=I.child,P.subtreeFlags=0,P.deletions=null,P.memoizedProps=I.memoizedProps,P.memoizedState=I.memoizedState,P.updateQueue=I.updateQueue,P.type=I.type,l=I.dependencies,P.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),m=m.sibling;return sn(bn,bn.current&1|2),u.child}l=l.sibling}P.tail!==null&&pn()>Al&&(u.flags|=128,w=!0,Pu(P,!1),u.lanes=4194304)}else{if(!w)if(l=op(I),l!==null){if(u.flags|=128,w=!0,m=l.updateQueue,m!==null&&(u.updateQueue=m,u.flags|=4),Pu(P,!0),P.tail===null&&P.tailMode==="hidden"&&!I.alternate&&!yn)return mr(u),null}else 2*pn()-P.renderingStartTime>Al&&m!==1073741824&&(u.flags|=128,w=!0,Pu(P,!1),u.lanes=4194304);P.isBackwards?(I.sibling=u.child,u.child=I):(m=P.last,m!==null?m.sibling=I:u.child=I,P.last=I)}return P.tail!==null?(u=P.tail,P.rendering=u,P.tail=u.sibling,P.renderingStartTime=pn(),u.sibling=null,m=bn.current,sn(bn,w?m&1|2:m&1),u):(mr(u),null);case 22:case 23:return Ly(),w=u.memoizedState!==null,l!==null&&l.memoizedState!==null!==w&&(u.flags|=8192),w&&(u.mode&1)!==0?(Yr&1073741824)!==0&&(mr(u),u.subtreeFlags&6&&(u.flags|=8192)):mr(u),null;case 24:return null;case 25:return null}throw Error(n(156,u.tag))}function tU(l,u){switch(Kg(u),u.tag){case 1:return Pr(u.type)&&Xf(),l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 3:return jl(),mn(Er),mn(pr),iy(),l=u.flags,(l&65536)!==0&&(l&128)===0?(u.flags=l&-65537|128,u):null;case 5:return ay(u),null;case 13:if(mn(bn),l=u.memoizedState,l!==null&&l.dehydrated!==null){if(u.alternate===null)throw Error(n(340));yl()}return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 19:return mn(bn),null;case 4:return jl(),null;case 10:return Zg(u.type._context),null;case 22:case 23:return Ly(),null;case 24:return null;default:return null}}var vp=!1,vr=!1,nU=typeof WeakSet=="function"?WeakSet:Set,Qe=null;function Nl(l,u){var m=l.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(w){An(l,u,w)}else m.current=null}function Ay(l,u,m){try{m()}catch(w){An(l,u,w)}}var P_=!1;function rU(l,u){if(Lg=$f,l=oA(),kg(l)){if("selectionStart"in l)var m={start:l.selectionStart,end:l.selectionEnd};else e:{m=(m=l.ownerDocument)&&m.defaultView||window;var w=m.getSelection&&m.getSelection();if(w&&w.rangeCount!==0){m=w.anchorNode;var A=w.anchorOffset,P=w.focusNode;w=w.focusOffset;try{m.nodeType,P.nodeType}catch{m=null;break e}var I=0,X=-1,ne=-1,ge=0,Ee=0,Oe=l,_e=null;t:for(;;){for(var Ge;Oe!==m||A!==0&&Oe.nodeType!==3||(X=I+A),Oe!==P||w!==0&&Oe.nodeType!==3||(ne=I+w),Oe.nodeType===3&&(I+=Oe.nodeValue.length),(Ge=Oe.firstChild)!==null;)_e=Oe,Oe=Ge;for(;;){if(Oe===l)break t;if(_e===m&&++ge===A&&(X=I),_e===P&&++Ee===w&&(ne=I),(Ge=Oe.nextSibling)!==null)break;Oe=_e,_e=Oe.parentNode}Oe=Ge}m=X===-1||ne===-1?null:{start:X,end:ne}}else m=null}m=m||{start:0,end:0}}else m=null;for(Fg={focusedElem:l,selectionRange:m},$f=!1,Qe=u;Qe!==null;)if(u=Qe,l=u.child,(u.subtreeFlags&1028)!==0&&l!==null)l.return=u,Qe=l;else for(;Qe!==null;){u=Qe;try{var nt=u.alternate;if((u.flags&1024)!==0)switch(u.tag){case 0:case 11:case 15:break;case 1:if(nt!==null){var at=nt.memoizedProps,On=nt.memoizedState,pe=u.stateNode,se=pe.getSnapshotBeforeUpdate(u.elementType===u.type?at:Ra(u.type,at),On);pe.__reactInternalSnapshotBeforeUpdate=se}break;case 3:var me=u.stateNode.containerInfo;me.nodeType===1?me.textContent="":me.nodeType===9&&me.documentElement&&me.removeChild(me.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Le){An(u,u.return,Le)}if(l=u.sibling,l!==null){l.return=u.return,Qe=l;break}Qe=u.return}return nt=P_,P_=!1,nt}function ku(l,u,m){var w=u.updateQueue;if(w=w!==null?w.lastEffect:null,w!==null){var A=w=w.next;do{if((A.tag&l)===l){var P=A.destroy;A.destroy=void 0,P!==void 0&&Ay(u,m,P)}A=A.next}while(A!==w)}}function gp(l,u){if(u=u.updateQueue,u=u!==null?u.lastEffect:null,u!==null){var m=u=u.next;do{if((m.tag&l)===l){var w=m.create;m.destroy=w()}m=m.next}while(m!==u)}}function _y(l){var u=l.ref;if(u!==null){var m=l.stateNode;l.tag,l=m,typeof u=="function"?u(l):u.current=l}}function k_(l){var u=l.alternate;u!==null&&(l.alternate=null,k_(u)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(u=l.stateNode,u!==null&&(delete u[ns],delete u[xu],delete u[qg],delete u[F6],delete u[B6])),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 O_(l){return l.tag===5||l.tag===3||l.tag===4}function R_(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||O_(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 Ey(l,u,m){var w=l.tag;if(w===5||w===6)l=l.stateNode,u?m.nodeType===8?m.parentNode.insertBefore(l,u):m.insertBefore(l,u):(m.nodeType===8?(u=m.parentNode,u.insertBefore(l,m)):(u=m,u.appendChild(l)),m=m._reactRootContainer,m!=null||u.onclick!==null||(u.onclick=Gf));else if(w!==4&&(l=l.child,l!==null))for(Ey(l,u,m),l=l.sibling;l!==null;)Ey(l,u,m),l=l.sibling}function Py(l,u,m){var w=l.tag;if(w===5||w===6)l=l.stateNode,u?m.insertBefore(l,u):m.appendChild(l);else if(w!==4&&(l=l.child,l!==null))for(Py(l,u,m),l=l.sibling;l!==null;)Py(l,u,m),l=l.sibling}var ar=null,Ta=!1;function ji(l,u,m){for(m=m.child;m!==null;)T_(l,u,m),m=m.sibling}function T_(l,u,m){if(oa&&typeof oa.onCommitFiberUnmount=="function")try{oa.onCommitFiberUnmount(As,m)}catch{}switch(m.tag){case 5:vr||Nl(m,u);case 6:var w=ar,A=Ta;ar=null,ji(l,u,m),ar=w,Ta=A,ar!==null&&(Ta?(l=ar,m=m.stateNode,l.nodeType===8?l.parentNode.removeChild(m):l.removeChild(m)):ar.removeChild(m.stateNode));break;case 18:ar!==null&&(Ta?(l=ar,m=m.stateNode,l.nodeType===8?Ug(l.parentNode,m):l.nodeType===1&&Ug(l,m),lu(l)):Ug(ar,m.stateNode));break;case 4:w=ar,A=Ta,ar=m.stateNode.containerInfo,Ta=!0,ji(l,u,m),ar=w,Ta=A;break;case 0:case 11:case 14:case 15:if(!vr&&(w=m.updateQueue,w!==null&&(w=w.lastEffect,w!==null))){A=w=w.next;do{var P=A,I=P.destroy;P=P.tag,I!==void 0&&((P&2)!==0||(P&4)!==0)&&Ay(m,u,I),A=A.next}while(A!==w)}ji(l,u,m);break;case 1:if(!vr&&(Nl(m,u),w=m.stateNode,typeof w.componentWillUnmount=="function"))try{w.props=m.memoizedProps,w.state=m.memoizedState,w.componentWillUnmount()}catch(X){An(m,u,X)}ji(l,u,m);break;case 21:ji(l,u,m);break;case 22:m.mode&1?(vr=(w=vr)||m.memoizedState!==null,ji(l,u,m),vr=w):ji(l,u,m);break;default:ji(l,u,m)}}function I_(l){var u=l.updateQueue;if(u!==null){l.updateQueue=null;var m=l.stateNode;m===null&&(m=l.stateNode=new nU),u.forEach(function(w){var A=fU.bind(null,l,w);m.has(w)||(m.add(w),w.then(A,A))})}}function Ia(l,u){var m=u.deletions;if(m!==null)for(var w=0;w<m.length;w++){var A=m[w];try{var P=l,I=u,X=I;e:for(;X!==null;){switch(X.tag){case 5:ar=X.stateNode,Ta=!1;break e;case 3:ar=X.stateNode.containerInfo,Ta=!0;break e;case 4:ar=X.stateNode.containerInfo,Ta=!0;break e}X=X.return}if(ar===null)throw Error(n(160));T_(P,I,A),ar=null,Ta=!1;var ne=A.alternate;ne!==null&&(ne.return=null),A.return=null}catch(ge){An(A,u,ge)}}if(u.subtreeFlags&12854)for(u=u.child;u!==null;)M_(u,l),u=u.sibling}function M_(l,u){var m=l.alternate,w=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(Ia(u,l),ss(l),w&4){try{ku(3,l,l.return),gp(3,l)}catch(at){An(l,l.return,at)}try{ku(5,l,l.return)}catch(at){An(l,l.return,at)}}break;case 1:Ia(u,l),ss(l),w&512&&m!==null&&Nl(m,m.return);break;case 5:if(Ia(u,l),ss(l),w&512&&m!==null&&Nl(m,m.return),l.flags&32){var A=l.stateNode;try{et(A,"")}catch(at){An(l,l.return,at)}}if(w&4&&(A=l.stateNode,A!=null)){var P=l.memoizedProps,I=m!==null?m.memoizedProps:P,X=l.type,ne=l.updateQueue;if(l.updateQueue=null,ne!==null)try{X==="input"&&P.type==="radio"&&P.name!=null&&oe(A,P),dr(X,I);var ge=dr(X,P);for(I=0;I<ne.length;I+=2){var Ee=ne[I],Oe=ne[I+1];Ee==="style"?cr(A,Oe):Ee==="dangerouslySetInnerHTML"?Be(A,Oe):Ee==="children"?et(A,Oe):C(A,Ee,Oe,ge)}switch(X){case"input":be(A,P);break;case"textarea":qt(A,P);break;case"select":var _e=A._wrapperState.wasMultiple;A._wrapperState.wasMultiple=!!P.multiple;var Ge=P.value;Ge!=null?Re(A,!!P.multiple,Ge,!1):_e!==!!P.multiple&&(P.defaultValue!=null?Re(A,!!P.multiple,P.defaultValue,!0):Re(A,!!P.multiple,P.multiple?[]:"",!1))}A[xu]=P}catch(at){An(l,l.return,at)}}break;case 6:if(Ia(u,l),ss(l),w&4){if(l.stateNode===null)throw Error(n(162));A=l.stateNode,P=l.memoizedProps;try{A.nodeValue=P}catch(at){An(l,l.return,at)}}break;case 3:if(Ia(u,l),ss(l),w&4&&m!==null&&m.memoizedState.isDehydrated)try{lu(u.containerInfo)}catch(at){An(l,l.return,at)}break;case 4:Ia(u,l),ss(l);break;case 13:Ia(u,l),ss(l),A=l.child,A.flags&8192&&(P=A.memoizedState!==null,A.stateNode.isHidden=P,!P||A.alternate!==null&&A.alternate.memoizedState!==null||(Ry=pn())),w&4&&I_(l);break;case 22:if(Ee=m!==null&&m.memoizedState!==null,l.mode&1?(vr=(ge=vr)||Ee,Ia(u,l),vr=ge):Ia(u,l),ss(l),w&8192){if(ge=l.memoizedState!==null,(l.stateNode.isHidden=ge)&&!Ee&&(l.mode&1)!==0)for(Qe=l,Ee=l.child;Ee!==null;){for(Oe=Qe=Ee;Qe!==null;){switch(_e=Qe,Ge=_e.child,_e.tag){case 0:case 11:case 14:case 15:ku(4,_e,_e.return);break;case 1:Nl(_e,_e.return);var nt=_e.stateNode;if(typeof nt.componentWillUnmount=="function"){w=_e,m=_e.return;try{u=w,nt.props=u.memoizedProps,nt.state=u.memoizedState,nt.componentWillUnmount()}catch(at){An(w,m,at)}}break;case 5:Nl(_e,_e.return);break;case 22:if(_e.memoizedState!==null){L_(Oe);continue}}Ge!==null?(Ge.return=_e,Qe=Ge):L_(Oe)}Ee=Ee.sibling}e:for(Ee=null,Oe=l;;){if(Oe.tag===5){if(Ee===null){Ee=Oe;try{A=Oe.stateNode,ge?(P=A.style,typeof P.setProperty=="function"?P.setProperty("display","none","important"):P.display="none"):(X=Oe.stateNode,ne=Oe.memoizedProps.style,I=ne!=null&&ne.hasOwnProperty("display")?ne.display:null,X.style.display=Nn("display",I))}catch(at){An(l,l.return,at)}}}else if(Oe.tag===6){if(Ee===null)try{Oe.stateNode.nodeValue=ge?"":Oe.memoizedProps}catch(at){An(l,l.return,at)}}else if((Oe.tag!==22&&Oe.tag!==23||Oe.memoizedState===null||Oe===l)&&Oe.child!==null){Oe.child.return=Oe,Oe=Oe.child;continue}if(Oe===l)break e;for(;Oe.sibling===null;){if(Oe.return===null||Oe.return===l)break e;Ee===Oe&&(Ee=null),Oe=Oe.return}Ee===Oe&&(Ee=null),Oe.sibling.return=Oe.return,Oe=Oe.sibling}}break;case 19:Ia(u,l),ss(l),w&4&&I_(l);break;case 21:break;default:Ia(u,l),ss(l)}}function ss(l){var u=l.flags;if(u&2){try{e:{for(var m=l.return;m!==null;){if(O_(m)){var w=m;break e}m=m.return}throw Error(n(160))}switch(w.tag){case 5:var A=w.stateNode;w.flags&32&&(et(A,""),w.flags&=-33);var P=R_(l);Py(l,P,A);break;case 3:case 4:var I=w.stateNode.containerInfo,X=R_(l);Ey(l,X,I);break;default:throw Error(n(161))}}catch(ne){An(l,l.return,ne)}l.flags&=-3}u&4096&&(l.flags&=-4097)}function aU(l,u,m){Qe=l,$_(l)}function $_(l,u,m){for(var w=(l.mode&1)!==0;Qe!==null;){var A=Qe,P=A.child;if(A.tag===22&&w){var I=A.memoizedState!==null||vp;if(!I){var X=A.alternate,ne=X!==null&&X.memoizedState!==null||vr;X=vp;var ge=vr;if(vp=I,(vr=ne)&&!ge)for(Qe=A;Qe!==null;)I=Qe,ne=I.child,I.tag===22&&I.memoizedState!==null?F_(A):ne!==null?(ne.return=I,Qe=ne):F_(A);for(;P!==null;)Qe=P,$_(P),P=P.sibling;Qe=A,vp=X,vr=ge}D_(l)}else(A.subtreeFlags&8772)!==0&&P!==null?(P.return=A,Qe=P):D_(l)}}function D_(l){for(;Qe!==null;){var u=Qe;if((u.flags&8772)!==0){var m=u.alternate;try{if((u.flags&8772)!==0)switch(u.tag){case 0:case 11:case 15:vr||gp(5,u);break;case 1:var w=u.stateNode;if(u.flags&4&&!vr)if(m===null)w.componentDidMount();else{var A=u.elementType===u.type?m.memoizedProps:Ra(u.type,m.memoizedProps);w.componentDidUpdate(A,m.memoizedState,w.__reactInternalSnapshotBeforeUpdate)}var P=u.updateQueue;P!==null&&LA(u,P,w);break;case 3:var I=u.updateQueue;if(I!==null){if(m=null,u.child!==null)switch(u.child.tag){case 5:m=u.child.stateNode;break;case 1:m=u.child.stateNode}LA(u,I,m)}break;case 5:var X=u.stateNode;if(m===null&&u.flags&4){m=X;var ne=u.memoizedProps;switch(u.type){case"button":case"input":case"select":case"textarea":ne.autoFocus&&m.focus();break;case"img":ne.src&&(m.src=ne.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(u.memoizedState===null){var ge=u.alternate;if(ge!==null){var Ee=ge.memoizedState;if(Ee!==null){var Oe=Ee.dehydrated;Oe!==null&&lu(Oe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}vr||u.flags&512&&_y(u)}catch(_e){An(u,u.return,_e)}}if(u===l){Qe=null;break}if(m=u.sibling,m!==null){m.return=u.return,Qe=m;break}Qe=u.return}}function L_(l){for(;Qe!==null;){var u=Qe;if(u===l){Qe=null;break}var m=u.sibling;if(m!==null){m.return=u.return,Qe=m;break}Qe=u.return}}function F_(l){for(;Qe!==null;){var u=Qe;try{switch(u.tag){case 0:case 11:case 15:var m=u.return;try{gp(4,u)}catch(ne){An(u,m,ne)}break;case 1:var w=u.stateNode;if(typeof w.componentDidMount=="function"){var A=u.return;try{w.componentDidMount()}catch(ne){An(u,A,ne)}}var P=u.return;try{_y(u)}catch(ne){An(u,P,ne)}break;case 5:var I=u.return;try{_y(u)}catch(ne){An(u,I,ne)}}}catch(ne){An(u,u.return,ne)}if(u===l){Qe=null;break}var X=u.sibling;if(X!==null){X.return=u.return,Qe=X;break}Qe=u.return}}var sU=Math.ceil,yp=E.ReactCurrentDispatcher,ky=E.ReactCurrentOwner,pa=E.ReactCurrentBatchConfig,Lt=0,Jn=null,In=null,sr=0,Yr=0,Cl=gi(0),Bn=0,Ou=null,co=0,xp=0,Oy=0,Ru=null,Or=null,Ry=0,Al=1/0,Is=null,bp=!1,Ty=null,Si=null,wp=!1,Ni=null,jp=0,Tu=0,Iy=null,Sp=-1,Np=0;function br(){return(Lt&6)!==0?pn():Sp!==-1?Sp:Sp=pn()}function Ci(l){return(l.mode&1)===0?1:(Lt&2)!==0&&sr!==0?sr&-sr:U6.transition!==null?(Np===0&&(Np=ft()),Np):(l=Ft,l!==0||(l=window.event,l=l===void 0?16:zC(l.type)),l)}function Ma(l,u,m,w){if(50<Tu)throw Tu=0,Iy=null,Error(n(185));Ln(l,m,w),((Lt&2)===0||l!==Jn)&&(l===Jn&&((Lt&2)===0&&(xp|=m),Bn===4&&Ai(l,sr)),Rr(l,w),m===1&&Lt===0&&(u.mode&1)===0&&(Al=pn()+500,Jf&&xi()))}function Rr(l,u){var m=l.callbackNode;Te(l,u);var w=xe(l,l===Jn?sr:0);if(w===0)m!==null&&Wt(m),l.callbackNode=null,l.callbackPriority=0;else if(u=w&-w,l.callbackPriority!==u){if(m!=null&&Wt(m),u===1)l.tag===0?z6(z_.bind(null,l)):AA(z_.bind(null,l)),D6(function(){(Lt&6)===0&&xi()}),m=null;else{switch(Tf(w)){case 1:m=nl;break;case 4:m=kf;break;case 16:m=ci;break;case 536870912:m=ru;break;default:m=ci}m=Y_(m,B_.bind(null,l))}l.callbackPriority=u,l.callbackNode=m}}function B_(l,u){if(Sp=-1,Np=0,(Lt&6)!==0)throw Error(n(327));var m=l.callbackNode;if(_l()&&l.callbackNode!==m)return null;var w=xe(l,l===Jn?sr:0);if(w===0)return null;if((w&30)!==0||(w&l.expiredLanes)!==0||u)u=Cp(l,w);else{u=w;var A=Lt;Lt|=2;var P=q_();(Jn!==l||sr!==u)&&(Is=null,Al=pn()+500,fo(l,u));do try{lU();break}catch(X){U_(l,X)}while(!0);Jg(),yp.current=P,Lt=A,In!==null?u=0:(Jn=null,sr=0,u=Bn)}if(u!==0){if(u===2&&(A=Pt(l),A!==0&&(w=A,u=My(l,A))),u===1)throw m=Ou,fo(l,0),Ai(l,w),Rr(l,pn()),m;if(u===6)Ai(l,w);else{if(A=l.current.alternate,(w&30)===0&&!iU(A)&&(u=Cp(l,w),u===2&&(P=Pt(l),P!==0&&(w=P,u=My(l,P))),u===1))throw m=Ou,fo(l,0),Ai(l,w),Rr(l,pn()),m;switch(l.finishedWork=A,l.finishedLanes=w,u){case 0:case 1:throw Error(n(345));case 2:po(l,Or,Is);break;case 3:if(Ai(l,w),(w&130023424)===w&&(u=Ry+500-pn(),10<u)){if(xe(l,0)!==0)break;if(A=l.suspendedLanes,(A&w)!==w){br(),l.pingedLanes|=l.suspendedLanes&A;break}l.timeoutHandle=zg(po.bind(null,l,Or,Is),u);break}po(l,Or,Is);break;case 4:if(Ai(l,w),(w&4194240)===w)break;for(u=l.eventTimes,A=-1;0<w;){var I=31-Vr(w);P=1<<I,I=u[I],I>A&&(A=I),w&=~P}if(w=A,w=pn()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*sU(w/1960))-w,10<w){l.timeoutHandle=zg(po.bind(null,l,Or,Is),w);break}po(l,Or,Is);break;case 5:po(l,Or,Is);break;default:throw Error(n(329))}}}return Rr(l,pn()),l.callbackNode===m?B_.bind(null,l):null}function My(l,u){var m=Ru;return l.current.memoizedState.isDehydrated&&(fo(l,u).flags|=256),l=Cp(l,u),l!==2&&(u=Or,Or=m,u!==null&&$y(u)),l}function $y(l){Or===null?Or=l:Or.push.apply(Or,l)}function iU(l){for(var u=l;;){if(u.flags&16384){var m=u.updateQueue;if(m!==null&&(m=m.stores,m!==null))for(var w=0;w<m.length;w++){var A=m[w],P=A.getSnapshot;A=A.value;try{if(!ka(P(),A))return!1}catch{return!1}}}if(m=u.child,u.subtreeFlags&16384&&m!==null)m.return=u,u=m;else{if(u===l)break;for(;u.sibling===null;){if(u.return===null||u.return===l)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function Ai(l,u){for(u&=~Oy,u&=~xp,l.suspendedLanes|=u,l.pingedLanes&=~u,l=l.expirationTimes;0<u;){var m=31-Vr(u),w=1<<m;l[m]=-1,u&=~w}}function z_(l){if((Lt&6)!==0)throw Error(n(327));_l();var u=xe(l,0);if((u&1)===0)return Rr(l,pn()),null;var m=Cp(l,u);if(l.tag!==0&&m===2){var w=Pt(l);w!==0&&(u=w,m=My(l,w))}if(m===1)throw m=Ou,fo(l,0),Ai(l,u),Rr(l,pn()),m;if(m===6)throw Error(n(345));return l.finishedWork=l.current.alternate,l.finishedLanes=u,po(l,Or,Is),Rr(l,pn()),null}function Dy(l,u){var m=Lt;Lt|=1;try{return l(u)}finally{Lt=m,Lt===0&&(Al=pn()+500,Jf&&xi())}}function uo(l){Ni!==null&&Ni.tag===0&&(Lt&6)===0&&_l();var u=Lt;Lt|=1;var m=pa.transition,w=Ft;try{if(pa.transition=null,Ft=1,l)return l()}finally{Ft=w,pa.transition=m,Lt=u,(Lt&6)===0&&xi()}}function Ly(){Yr=Cl.current,mn(Cl)}function fo(l,u){l.finishedWork=null,l.finishedLanes=0;var m=l.timeoutHandle;if(m!==-1&&(l.timeoutHandle=-1,$6(m)),In!==null)for(m=In.return;m!==null;){var w=m;switch(Kg(w),w.tag){case 1:w=w.type.childContextTypes,w!=null&&Xf();break;case 3:jl(),mn(Er),mn(pr),iy();break;case 5:ay(w);break;case 4:jl();break;case 13:mn(bn);break;case 19:mn(bn);break;case 10:Zg(w.type._context);break;case 22:case 23:Ly()}m=m.return}if(Jn=l,In=l=_i(l.current,null),sr=Yr=u,Bn=0,Ou=null,Oy=xp=co=0,Or=Ru=null,io!==null){for(u=0;u<io.length;u++)if(m=io[u],w=m.interleaved,w!==null){m.interleaved=null;var A=w.next,P=m.pending;if(P!==null){var I=P.next;P.next=A,w.next=I}m.pending=w}io=null}return l}function U_(l,u){do{var m=In;try{if(Jg(),lp.current=fp,cp){for(var w=wn.memoizedState;w!==null;){var A=w.queue;A!==null&&(A.pending=null),w=w.next}cp=!1}if(lo=0,Qn=Fn=wn=null,Cu=!1,Au=0,ky.current=null,m===null||m.return===null){Bn=1,Ou=u,In=null;break}e:{var P=l,I=m.return,X=m,ne=u;if(u=sr,X.flags|=32768,ne!==null&&typeof ne=="object"&&typeof ne.then=="function"){var ge=ne,Ee=X,Oe=Ee.tag;if((Ee.mode&1)===0&&(Oe===0||Oe===11||Oe===15)){var _e=Ee.alternate;_e?(Ee.updateQueue=_e.updateQueue,Ee.memoizedState=_e.memoizedState,Ee.lanes=_e.lanes):(Ee.updateQueue=null,Ee.memoizedState=null)}var Ge=p_(I);if(Ge!==null){Ge.flags&=-257,h_(Ge,I,X,P,u),Ge.mode&1&&f_(P,ge,u),u=Ge,ne=ge;var nt=u.updateQueue;if(nt===null){var at=new Set;at.add(ne),u.updateQueue=at}else nt.add(ne);break e}else{if((u&1)===0){f_(P,ge,u),Fy();break e}ne=Error(n(426))}}else if(yn&&X.mode&1){var On=p_(I);if(On!==null){(On.flags&65536)===0&&(On.flags|=256),h_(On,I,X,P,u),Xg(Sl(ne,X));break e}}P=ne=Sl(ne,X),Bn!==4&&(Bn=2),Ru===null?Ru=[P]:Ru.push(P),P=I;do{switch(P.tag){case 3:P.flags|=65536,u&=-u,P.lanes|=u;var pe=u_(P,ne,u);DA(P,pe);break e;case 1:X=ne;var se=P.type,me=P.stateNode;if((P.flags&128)===0&&(typeof se.getDerivedStateFromError=="function"||me!==null&&typeof me.componentDidCatch=="function"&&(Si===null||!Si.has(me)))){P.flags|=65536,u&=-u,P.lanes|=u;var Le=d_(P,X,u);DA(P,Le);break e}}P=P.return}while(P!==null)}V_(m)}catch(ot){u=ot,In===m&&m!==null&&(In=m=m.return);continue}break}while(!0)}function q_(){var l=yp.current;return yp.current=fp,l===null?fp:l}function Fy(){(Bn===0||Bn===3||Bn===2)&&(Bn=4),Jn===null||(co&268435455)===0&&(xp&268435455)===0||Ai(Jn,sr)}function Cp(l,u){var m=Lt;Lt|=2;var w=q_();(Jn!==l||sr!==u)&&(Is=null,fo(l,u));do try{oU();break}catch(A){U_(l,A)}while(!0);if(Jg(),Lt=m,yp.current=w,In!==null)throw Error(n(261));return Jn=null,sr=0,Bn}function oU(){for(;In!==null;)W_(In)}function lU(){for(;In!==null&&!Dt();)W_(In)}function W_(l){var u=G_(l.alternate,l,Yr);l.memoizedProps=l.pendingProps,u===null?V_(l):In=u,ky.current=null}function V_(l){var u=l;do{var m=u.alternate;if(l=u.return,(u.flags&32768)===0){if(m=eU(m,u,Yr),m!==null){In=m;return}}else{if(m=tU(m,u),m!==null){m.flags&=32767,In=m;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{Bn=6,In=null;return}}if(u=u.sibling,u!==null){In=u;return}In=u=l}while(u!==null);Bn===0&&(Bn=5)}function po(l,u,m){var w=Ft,A=pa.transition;try{pa.transition=null,Ft=1,cU(l,u,m,w)}finally{pa.transition=A,Ft=w}return null}function cU(l,u,m,w){do _l();while(Ni!==null);if((Lt&6)!==0)throw Error(n(327));m=l.finishedWork;var A=l.finishedLanes;if(m===null)return null;if(l.finishedWork=null,l.finishedLanes=0,m===l.current)throw Error(n(177));l.callbackNode=null,l.callbackPriority=0;var P=m.lanes|m.childLanes;if(Qt(l,P),l===Jn&&(In=Jn=null,sr=0),(m.subtreeFlags&2064)===0&&(m.flags&2064)===0||wp||(wp=!0,Y_(ci,function(){return _l(),null})),P=(m.flags&15990)!==0,(m.subtreeFlags&15990)!==0||P){P=pa.transition,pa.transition=null;var I=Ft;Ft=1;var X=Lt;Lt|=4,ky.current=null,rU(l,m),M_(m,l),P6(Fg),$f=!!Lg,Fg=Lg=null,l.current=m,aU(m),kn(),Lt=X,Ft=I,pa.transition=P}else l.current=m;if(wp&&(wp=!1,Ni=l,jp=A),P=l.pendingLanes,P===0&&(Si=null),hg(m.stateNode),Rr(l,pn()),u!==null)for(w=l.onRecoverableError,m=0;m<u.length;m++)A=u[m],w(A.value,{componentStack:A.stack,digest:A.digest});if(bp)throw bp=!1,l=Ty,Ty=null,l;return(jp&1)!==0&&l.tag!==0&&_l(),P=l.pendingLanes,(P&1)!==0?l===Iy?Tu++:(Tu=0,Iy=l):Tu=0,xi(),null}function _l(){if(Ni!==null){var l=Tf(jp),u=pa.transition,m=Ft;try{if(pa.transition=null,Ft=16>l?16:l,Ni===null)var w=!1;else{if(l=Ni,Ni=null,jp=0,(Lt&6)!==0)throw Error(n(331));var A=Lt;for(Lt|=4,Qe=l.current;Qe!==null;){var P=Qe,I=P.child;if((Qe.flags&16)!==0){var X=P.deletions;if(X!==null){for(var ne=0;ne<X.length;ne++){var ge=X[ne];for(Qe=ge;Qe!==null;){var Ee=Qe;switch(Ee.tag){case 0:case 11:case 15:ku(8,Ee,P)}var Oe=Ee.child;if(Oe!==null)Oe.return=Ee,Qe=Oe;else for(;Qe!==null;){Ee=Qe;var _e=Ee.sibling,Ge=Ee.return;if(k_(Ee),Ee===ge){Qe=null;break}if(_e!==null){_e.return=Ge,Qe=_e;break}Qe=Ge}}}var nt=P.alternate;if(nt!==null){var at=nt.child;if(at!==null){nt.child=null;do{var On=at.sibling;at.sibling=null,at=On}while(at!==null)}}Qe=P}}if((P.subtreeFlags&2064)!==0&&I!==null)I.return=P,Qe=I;else e:for(;Qe!==null;){if(P=Qe,(P.flags&2048)!==0)switch(P.tag){case 0:case 11:case 15:ku(9,P,P.return)}var pe=P.sibling;if(pe!==null){pe.return=P.return,Qe=pe;break e}Qe=P.return}}var se=l.current;for(Qe=se;Qe!==null;){I=Qe;var me=I.child;if((I.subtreeFlags&2064)!==0&&me!==null)me.return=I,Qe=me;else e:for(I=se;Qe!==null;){if(X=Qe,(X.flags&2048)!==0)try{switch(X.tag){case 0:case 11:case 15:gp(9,X)}}catch(ot){An(X,X.return,ot)}if(X===I){Qe=null;break e}var Le=X.sibling;if(Le!==null){Le.return=X.return,Qe=Le;break e}Qe=X.return}}if(Lt=A,xi(),oa&&typeof oa.onPostCommitFiberRoot=="function")try{oa.onPostCommitFiberRoot(As,l)}catch{}w=!0}return w}finally{Ft=m,pa.transition=u}}return!1}function H_(l,u,m){u=Sl(m,u),u=u_(l,u,1),l=wi(l,u,1),u=br(),l!==null&&(Ln(l,1,u),Rr(l,u))}function An(l,u,m){if(l.tag===3)H_(l,l,m);else for(;u!==null;){if(u.tag===3){H_(u,l,m);break}else if(u.tag===1){var w=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(Si===null||!Si.has(w))){l=Sl(m,l),l=d_(u,l,1),u=wi(u,l,1),l=br(),u!==null&&(Ln(u,1,l),Rr(u,l));break}}u=u.return}}function uU(l,u,m){var w=l.pingCache;w!==null&&w.delete(u),u=br(),l.pingedLanes|=l.suspendedLanes&m,Jn===l&&(sr&m)===m&&(Bn===4||Bn===3&&(sr&130023424)===sr&&500>pn()-Ry?fo(l,0):Oy|=m),Rr(l,u)}function K_(l,u){u===0&&((l.mode&1)===0?u=1:(u=al,al<<=1,(al&130023424)===0&&(al=4194304)));var m=br();l=Os(l,u),l!==null&&(Ln(l,u,m),Rr(l,m))}function dU(l){var u=l.memoizedState,m=0;u!==null&&(m=u.retryLane),K_(l,m)}function fU(l,u){var m=0;switch(l.tag){case 13:var w=l.stateNode,A=l.memoizedState;A!==null&&(m=A.retryLane);break;case 19:w=l.stateNode;break;default:throw Error(n(314))}w!==null&&w.delete(u),K_(l,m)}var G_;G_=function(l,u,m){if(l!==null)if(l.memoizedProps!==u.pendingProps||Er.current)kr=!0;else{if((l.lanes&m)===0&&(u.flags&128)===0)return kr=!1,Z6(l,u,m);kr=(l.flags&131072)!==0}else kr=!1,yn&&(u.flags&1048576)!==0&&_A(u,ep,u.index);switch(u.lanes=0,u.tag){case 2:var w=u.type;mp(l,u),l=u.pendingProps;var A=ml(u,pr.current);wl(u,m),A=cy(null,u,w,l,A,m);var P=uy();return u.flags|=1,typeof A=="object"&&A!==null&&typeof A.render=="function"&&A.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,Pr(w)?(P=!0,Qf(u)):P=!1,u.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,ny(u),A.updater=pp,u.stateNode=A,A._reactInternals=u,vy(u,w,l,m),u=by(null,u,w,!0,P,m)):(u.tag=0,yn&&P&&Hg(u),xr(null,u,A,m),u=u.child),u;case 16:w=u.elementType;e:{switch(mp(l,u),l=u.pendingProps,A=w._init,w=A(w._payload),u.type=w,A=u.tag=hU(w),l=Ra(w,l),A){case 0:u=xy(null,u,w,l,m);break e;case 1:u=b_(null,u,w,l,m);break e;case 11:u=m_(null,u,w,l,m);break e;case 14:u=v_(null,u,w,Ra(w.type,l),m);break e}throw Error(n(306,w,""))}return u;case 0:return w=u.type,A=u.pendingProps,A=u.elementType===w?A:Ra(w,A),xy(l,u,w,A,m);case 1:return w=u.type,A=u.pendingProps,A=u.elementType===w?A:Ra(w,A),b_(l,u,w,A,m);case 3:e:{if(w_(u),l===null)throw Error(n(387));w=u.pendingProps,P=u.memoizedState,A=P.element,$A(l,u),ip(u,w,null,m);var I=u.memoizedState;if(w=I.element,P.isDehydrated)if(P={element:w,isDehydrated:!1,cache:I.cache,pendingSuspenseBoundaries:I.pendingSuspenseBoundaries,transitions:I.transitions},u.updateQueue.baseState=P,u.memoizedState=P,u.flags&256){A=Sl(Error(n(423)),u),u=j_(l,u,w,m,A);break e}else if(w!==A){A=Sl(Error(n(424)),u),u=j_(l,u,w,m,A);break e}else for(Gr=vi(u.stateNode.containerInfo.firstChild),Kr=u,yn=!0,Oa=null,m=IA(u,null,w,m),u.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(yl(),w===A){u=Ts(l,u,m);break e}xr(l,u,w,m)}u=u.child}return u;case 5:return FA(u),l===null&&Yg(u),w=u.type,A=u.pendingProps,P=l!==null?l.memoizedProps:null,I=A.children,Bg(w,A)?I=null:P!==null&&Bg(w,P)&&(u.flags|=32),x_(l,u),xr(l,u,I,m),u.child;case 6:return l===null&&Yg(u),null;case 13:return S_(l,u,m);case 4:return ry(u,u.stateNode.containerInfo),w=u.pendingProps,l===null?u.child=xl(u,null,w,m):xr(l,u,w,m),u.child;case 11:return w=u.type,A=u.pendingProps,A=u.elementType===w?A:Ra(w,A),m_(l,u,w,A,m);case 7:return xr(l,u,u.pendingProps,m),u.child;case 8:return xr(l,u,u.pendingProps.children,m),u.child;case 12:return xr(l,u,u.pendingProps.children,m),u.child;case 10:e:{if(w=u.type._context,A=u.pendingProps,P=u.memoizedProps,I=A.value,sn(rp,w._currentValue),w._currentValue=I,P!==null)if(ka(P.value,I)){if(P.children===A.children&&!Er.current){u=Ts(l,u,m);break e}}else for(P=u.child,P!==null&&(P.return=u);P!==null;){var X=P.dependencies;if(X!==null){I=P.child;for(var ne=X.firstContext;ne!==null;){if(ne.context===w){if(P.tag===1){ne=Rs(-1,m&-m),ne.tag=2;var ge=P.updateQueue;if(ge!==null){ge=ge.shared;var Ee=ge.pending;Ee===null?ne.next=ne:(ne.next=Ee.next,Ee.next=ne),ge.pending=ne}}P.lanes|=m,ne=P.alternate,ne!==null&&(ne.lanes|=m),ey(P.return,m,u),X.lanes|=m;break}ne=ne.next}}else if(P.tag===10)I=P.type===u.type?null:P.child;else if(P.tag===18){if(I=P.return,I===null)throw Error(n(341));I.lanes|=m,X=I.alternate,X!==null&&(X.lanes|=m),ey(I,m,u),I=P.sibling}else I=P.child;if(I!==null)I.return=P;else for(I=P;I!==null;){if(I===u){I=null;break}if(P=I.sibling,P!==null){P.return=I.return,I=P;break}I=I.return}P=I}xr(l,u,A.children,m),u=u.child}return u;case 9:return A=u.type,w=u.pendingProps.children,wl(u,m),A=da(A),w=w(A),u.flags|=1,xr(l,u,w,m),u.child;case 14:return w=u.type,A=Ra(w,u.pendingProps),A=Ra(w.type,A),v_(l,u,w,A,m);case 15:return g_(l,u,u.type,u.pendingProps,m);case 17:return w=u.type,A=u.pendingProps,A=u.elementType===w?A:Ra(w,A),mp(l,u),u.tag=1,Pr(w)?(l=!0,Qf(u)):l=!1,wl(u,m),l_(u,w,A),vy(u,w,A,m),by(null,u,w,!0,l,m);case 19:return C_(l,u,m);case 22:return y_(l,u,m)}throw Error(n(156,u.tag))};function Y_(l,u){return He(l,u)}function pU(l,u,m,w){this.tag=l,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=w,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ha(l,u,m,w){return new pU(l,u,m,w)}function By(l){return l=l.prototype,!(!l||!l.isReactComponent)}function hU(l){if(typeof l=="function")return By(l)?1:0;if(l!=null){if(l=l.$$typeof,l===$)return 11;if(l===K)return 14}return 2}function _i(l,u){var m=l.alternate;return m===null?(m=ha(l.tag,u,l.key,l.mode),m.elementType=l.elementType,m.type=l.type,m.stateNode=l.stateNode,m.alternate=l,l.alternate=m):(m.pendingProps=u,m.type=l.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=l.flags&14680064,m.childLanes=l.childLanes,m.lanes=l.lanes,m.child=l.child,m.memoizedProps=l.memoizedProps,m.memoizedState=l.memoizedState,m.updateQueue=l.updateQueue,u=l.dependencies,m.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},m.sibling=l.sibling,m.index=l.index,m.ref=l.ref,m}function Ap(l,u,m,w,A,P){var I=2;if(w=l,typeof l=="function")By(l)&&(I=1);else if(typeof l=="string")I=5;else e:switch(l){case O:return ho(m.children,A,P,u);case R:I=8,A|=8;break;case T:return l=ha(12,m,u,A|2),l.elementType=T,l.lanes=P,l;case Y:return l=ha(13,m,u,A),l.elementType=Y,l.lanes=P,l;case H:return l=ha(19,m,u,A),l.elementType=H,l.lanes=P,l;case Q:return _p(m,A,P,u);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case F:I=10;break e;case L:I=9;break e;case $:I=11;break e;case K:I=14;break e;case J:I=16,w=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return u=ha(I,m,u,A),u.elementType=l,u.type=w,u.lanes=P,u}function ho(l,u,m,w){return l=ha(7,l,w,u),l.lanes=m,l}function _p(l,u,m,w){return l=ha(22,l,w,u),l.elementType=Q,l.lanes=m,l.stateNode={isHidden:!1},l}function zy(l,u,m){return l=ha(6,l,null,u),l.lanes=m,l}function Uy(l,u,m){return u=ha(4,l.children!==null?l.children:[],l.key,u),u.lanes=m,u.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},u}function mU(l,u,m,w,A){this.tag=u,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Vt(0),this.expirationTimes=Vt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vt(0),this.identifierPrefix=w,this.onRecoverableError=A,this.mutableSourceEagerHydrationData=null}function qy(l,u,m,w,A,P,I,X,ne){return l=new mU(l,u,m,X,ne),u===1?(u=1,P===!0&&(u|=8)):u=0,P=ha(3,null,null,u),l.current=P,P.stateNode=l,P.memoizedState={element:w,isDehydrated:m,cache:null,transitions:null,pendingSuspenseBoundaries:null},ny(P),l}function vU(l,u,m){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:k,key:w==null?null:""+w,children:l,containerInfo:u,implementation:m}}function X_(l){if(!l)return yi;l=l._reactInternals;e:{if(Ve(l)!==l||l.tag!==1)throw Error(n(170));var u=l;do{switch(u.tag){case 3:u=u.stateNode.context;break e;case 1:if(Pr(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break e}}u=u.return}while(u!==null);throw Error(n(171))}if(l.tag===1){var m=l.type;if(Pr(m))return NA(l,m,u)}return u}function Q_(l,u,m,w,A,P,I,X,ne){return l=qy(m,w,!0,l,A,P,I,X,ne),l.context=X_(null),m=l.current,w=br(),A=Ci(m),P=Rs(w,A),P.callback=u??null,wi(m,P,A),l.current.lanes=A,Ln(l,A,w),Rr(l,w),l}function Ep(l,u,m,w){var A=u.current,P=br(),I=Ci(A);return m=X_(m),u.context===null?u.context=m:u.pendingContext=m,u=Rs(P,I),u.payload={element:l},w=w===void 0?null:w,w!==null&&(u.callback=w),l=wi(A,u,I),l!==null&&(Ma(l,A,I,P),sp(l,A,I)),I}function Pp(l){return l=l.current,l.child?(l.child.tag===5,l.child.stateNode):null}function J_(l,u){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var m=l.retryLane;l.retryLane=m!==0&&m<u?m:u}}function Wy(l,u){J_(l,u),(l=l.alternate)&&J_(l,u)}function gU(){return null}var Z_=typeof reportError=="function"?reportError:function(l){console.error(l)};function Vy(l){this._internalRoot=l}kp.prototype.render=Vy.prototype.render=function(l){var u=this._internalRoot;if(u===null)throw Error(n(409));Ep(l,u,null,null)},kp.prototype.unmount=Vy.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var u=l.containerInfo;uo(function(){Ep(null,l,null,null)}),u[_s]=null}};function kp(l){this._internalRoot=l}kp.prototype.unstable_scheduleHydration=function(l){if(l){var u=$C();l={blockedOn:null,target:l,priority:u};for(var m=0;m<pi.length&&u!==0&&u<pi[m].priority;m++);pi.splice(m,0,l),m===0&&FC(l)}};function Hy(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function Op(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function eE(){}function yU(l,u,m,w,A){if(A){if(typeof w=="function"){var P=w;w=function(){var ge=Pp(I);P.call(ge)}}var I=Q_(u,w,l,0,null,!1,!1,"",eE);return l._reactRootContainer=I,l[_s]=I.current,gu(l.nodeType===8?l.parentNode:l),uo(),I}for(;A=l.lastChild;)l.removeChild(A);if(typeof w=="function"){var X=w;w=function(){var ge=Pp(ne);X.call(ge)}}var ne=qy(l,0,!1,null,null,!1,!1,"",eE);return l._reactRootContainer=ne,l[_s]=ne.current,gu(l.nodeType===8?l.parentNode:l),uo(function(){Ep(u,ne,m,w)}),ne}function Rp(l,u,m,w,A){var P=m._reactRootContainer;if(P){var I=P;if(typeof A=="function"){var X=A;A=function(){var ne=Pp(I);X.call(ne)}}Ep(u,I,l,A)}else I=yU(m,u,l,A,w);return Pp(I)}sl=function(l){switch(l.tag){case 3:var u=l.stateNode;if(u.current.memoizedState.isDehydrated){var m=q(u.pendingLanes);m!==0&&(la(u,m|1),Rr(u,pn()),(Lt&6)===0&&(Al=pn()+500,xi()))}break;case 13:uo(function(){var w=Os(l,1);if(w!==null){var A=br();Ma(w,l,1,A)}}),Wy(l,1)}},gg=function(l){if(l.tag===13){var u=Os(l,134217728);if(u!==null){var m=br();Ma(u,l,134217728,m)}Wy(l,134217728)}},MC=function(l){if(l.tag===13){var u=Ci(l),m=Os(l,u);if(m!==null){var w=br();Ma(m,l,u,w)}Wy(l,u)}},$C=function(){return Ft},DC=function(l,u){var m=Ft;try{return Ft=l,u()}finally{Ft=m}},qr=function(l,u,m){switch(u){case"input":if(be(l,m),u=m.name,m.type==="radio"&&u!=null){for(m=l;m.parentNode;)m=m.parentNode;for(m=m.querySelectorAll("input[name="+JSON.stringify(""+u)+'][type="radio"]'),u=0;u<m.length;u++){var w=m[u];if(w!==l&&w.form===l.form){var A=Yf(w);if(!A)throw Error(n(90));ae(w),be(w,A)}}}break;case"textarea":qt(l,m);break;case"select":u=m.value,u!=null&&Re(l,!!m.multiple,u,!1)}},st=Dy,xt=uo;var xU={usingClientEntryPoint:!1,Events:[bu,pl,Yf,fe,De,Dy]},Iu={findFiberByHostInstance:no,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},bU={bundleType:Iu.bundleType,version:Iu.version,rendererPackageName:Iu.rendererPackageName,rendererConfig:Iu.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=Ot(l),l===null?null:l.stateNode},findFiberByHostInstance:Iu.findFiberByHostInstance||gU,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 Tp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Tp.isDisabled&&Tp.supportsFiber)try{As=Tp.inject(bU),oa=Tp}catch{}}return Tr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=xU,Tr.createPortal=function(l,u){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Hy(u))throw Error(n(200));return vU(l,u,null,m)},Tr.createRoot=function(l,u){if(!Hy(l))throw Error(n(299));var m=!1,w="",A=Z_;return u!=null&&(u.unstable_strictMode===!0&&(m=!0),u.identifierPrefix!==void 0&&(w=u.identifierPrefix),u.onRecoverableError!==void 0&&(A=u.onRecoverableError)),u=qy(l,1,!1,null,null,m,!1,w,A),l[_s]=u.current,gu(l.nodeType===8?l.parentNode:l),new Vy(u)},Tr.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=Ot(u),l=l===null?null:l.stateNode,l},Tr.flushSync=function(l){return uo(l)},Tr.hydrate=function(l,u,m){if(!Op(u))throw Error(n(200));return Rp(null,l,u,!0,m)},Tr.hydrateRoot=function(l,u,m){if(!Hy(l))throw Error(n(405));var w=m!=null&&m.hydratedSources||null,A=!1,P="",I=Z_;if(m!=null&&(m.unstable_strictMode===!0&&(A=!0),m.identifierPrefix!==void 0&&(P=m.identifierPrefix),m.onRecoverableError!==void 0&&(I=m.onRecoverableError)),u=Q_(u,null,l,1,m??null,A,!1,P,I),l[_s]=u.current,gu(l),w)for(l=0;l<w.length;l++)m=w[l],A=m._getVersion,A=A(m._source),u.mutableSourceEagerHydrationData==null?u.mutableSourceEagerHydrationData=[m,A]:u.mutableSourceEagerHydrationData.push(m,A);return new kp(u)},Tr.render=function(l,u,m){if(!Op(u))throw Error(n(200));return Rp(null,l,u,!1,m)},Tr.unmountComponentAtNode=function(l){if(!Op(l))throw Error(n(40));return l._reactRootContainer?(uo(function(){Rp(null,null,l,!1,function(){l._reactRootContainer=null,l[_s]=null})}),!0):!1},Tr.unstable_batchedUpdates=Dy,Tr.unstable_renderSubtreeIntoContainer=function(l,u,m,w){if(!Op(m))throw Error(n(200));if(l==null||l._reactInternals===void 0)throw Error(n(38));return Rp(l,u,m,!1,w)},Tr.version="18.3.1-next-f1338f8080-20240426",Tr}var lE;function DM(){if(lE)return Yy.exports;lE=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(),Yy.exports=EU(),Yy.exports}var cE;function PU(){if(cE)return Mp;cE=1;var e=DM();return Mp.createRoot=e.createRoot,Mp.hydrateRoot=e.hydrateRoot,Mp}var kU=PU(),v=TS();const U=Yt(v),Im=jU({__proto__:null,default:U},[v]),OU=1,RU=1e6;let Jy=0;function TU(){return Jy=(Jy+1)%Number.MAX_SAFE_INTEGER,Jy.toString()}const Zy=new Map,uE=e=>{if(Zy.has(e))return;const t=setTimeout(()=>{Zy.delete(e),nd({type:"REMOVE_TOAST",toastId:e})},RU);Zy.set(e,t)},IU=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,OU)};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?uE(n):e.toasts.forEach(r=>{uE(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)}}},ih=[];let oh={toasts:[]};function nd(e){oh=IU(oh,e),ih.forEach(t=>{t(oh)})}function Pe({...e}){const t=TU(),n=a=>nd({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>nd({type:"DISMISS_TOAST",toastId:t});return nd({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}}function MU(){const[e,t]=v.useState(oh);return v.useEffect(()=>(ih.push(t),()=>{const n=ih.indexOf(t);n>-1&&ih.splice(n,1)}),[e]),{...e,toast:Pe,dismiss:n=>nd({type:"DISMISS_TOAST",toastId:n})}}var $c=DM();const LM=Yt($c);function ke(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),n===!1||!a.defaultPrevented)return t?.(a)}}function dE(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Cr(...e){return t=>{let n=!1;const r=e.map(a=>{const i=dE(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<r.length;a++){const i=r[a];typeof i=="function"?i():dE(e[a],null)}}}}function vt(...e){return v.useCallback(Cr(...e),e)}function $U(e,t){const n=v.createContext(t),r=i=>{const{children:o,...c}=i,d=v.useMemo(()=>c,Object.values(c));return s.jsx(n.Provider,{value:d,children:o})};r.displayName=e+"Provider";function a(i){const o=v.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,a]}function lr(e,t=[]){let n=[];function r(i,o){const c=v.createContext(o),d=n.length;n=[...n,o];const f=p=>{const{scope:y,children:g,...j}=p,b=y?.[e]?.[d]||c,x=v.useMemo(()=>j,Object.values(j));return s.jsx(b.Provider,{value:x,children:g})};f.displayName=i+"Provider";function h(p,y){const g=y?.[e]?.[d]||c,j=v.useContext(g);if(j)return j;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[f,h]}const a=()=>{const i=n.map(o=>v.createContext(o));return function(c){const d=c?.[e]||i;return v.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return a.scopeName=e,[r,DU(a,...t)]}function DU(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=r.reduce((c,{useScope:d,scopeName:f})=>{const p=d(i)[`__scope${f}`];return{...c,...p}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function fE(e){const t=LU(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(BU);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function LU(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=UU(a),c=zU(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Cr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var FU=Symbol("radix.slottable");function BU(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===FU}function zU(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function UU(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 af(e){const t=e+"CollectionProvider",[n,r]=lr(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=b=>{const{scope:x,children:S}=b,N=U.useRef(null),C=U.useRef(new Map).current;return s.jsx(a,{scope:x,itemMap:C,collectionRef:N,children:S})};o.displayName=t;const c=e+"CollectionSlot",d=fE(c),f=U.forwardRef((b,x)=>{const{scope:S,children:N}=b,C=i(c,S),E=vt(x,C.collectionRef);return s.jsx(d,{ref:E,children:N})});f.displayName=c;const h=e+"CollectionItemSlot",p="data-radix-collection-item",y=fE(h),g=U.forwardRef((b,x)=>{const{scope:S,children:N,...C}=b,E=U.useRef(null),_=vt(x,E),k=i(h,S);return U.useEffect(()=>(k.itemMap.set(E,{ref:E,...C}),()=>{k.itemMap.delete(E)})),s.jsx(y,{[p]:"",ref:_,children:N})});g.displayName=h;function j(b){const x=i(e+"CollectionConsumer",b);return U.useCallback(()=>{const N=x.collectionRef.current;if(!N)return[];const C=Array.from(N.querySelectorAll(`[${p}]`));return Array.from(x.itemMap.values()).sort((k,O)=>C.indexOf(k.ref.current)-C.indexOf(O.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:o,Slot:f,ItemSlot:g},j,r]}function qU(e){const t=WU(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(HU);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function WU(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=GU(a),c=KU(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Cr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var VU=Symbol("radix.slottable");function HU(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===VU}function KU(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function GU(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var YU=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ke=YU.reduce((e,t)=>{const n=qU(`Primitive.${t}`),r=v.forwardRef((a,i)=>{const{asChild:o,...c}=a,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function IS(e,t){e&&$c.flushSync(()=>e.dispatchEvent(t))}function Rn(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>t.current?.(...n),[])}function XU(e,t=globalThis?.document){const n=Rn(e);v.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var QU="DismissableLayer",_1="dismissableLayer.update",JU="dismissableLayer.pointerDownOutside",ZU="dismissableLayer.focusOutside",pE,FM=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Uo=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:c,...d}=e,f=v.useContext(FM),[h,p]=v.useState(null),y=h?.ownerDocument??globalThis?.document,[,g]=v.useState({}),j=vt(t,O=>p(O)),b=Array.from(f.layers),[x]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),S=b.indexOf(x),N=h?b.indexOf(h):-1,C=f.layersWithOutsidePointerEventsDisabled.size>0,E=N>=S,_=t7(O=>{const R=O.target,T=[...f.branches].some(F=>F.contains(R));!E||T||(a?.(O),o?.(O),O.defaultPrevented||c?.())},y),k=n7(O=>{const R=O.target;[...f.branches].some(F=>F.contains(R))||(i?.(O),o?.(O),O.defaultPrevented||c?.())},y);return XU(O=>{N===f.layers.size-1&&(r?.(O),!O.defaultPrevented&&c&&(O.preventDefault(),c()))},y),v.useEffect(()=>{if(h)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(pE=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),hE(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=pE)}},[h,y,n,f]),v.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),hE())},[h,f]),v.useEffect(()=>{const O=()=>g({});return document.addEventListener(_1,O),()=>document.removeEventListener(_1,O)},[]),s.jsx(Ke.div,{...d,ref:j,style:{pointerEvents:C?E?"auto":"none":void 0,...e.style},onFocusCapture:ke(e.onFocusCapture,k.onFocusCapture),onBlurCapture:ke(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:ke(e.onPointerDownCapture,_.onPointerDownCapture)})});Uo.displayName=QU;var e7="DismissableLayerBranch",BM=v.forwardRef((e,t)=>{const n=v.useContext(FM),r=v.useRef(null),a=vt(t,r);return v.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),s.jsx(Ke.div,{...e,ref:a})});BM.displayName=e7;function t7(e,t=globalThis?.document){const n=Rn(e),r=v.useRef(!1),a=v.useRef(()=>{});return v.useEffect(()=>{const i=c=>{if(c.target&&!r.current){let d=function(){zM(JU,n,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=d,t.addEventListener("click",a.current,{once:!0})):d()}else t.removeEventListener("click",a.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function n7(e,t=globalThis?.document){const n=Rn(e),r=v.useRef(!1);return v.useEffect(()=>{const a=i=>{i.target&&!r.current&&zM(ZU,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function hE(){const e=new CustomEvent(_1);document.dispatchEvent(e)}function zM(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?IS(a,i):a.dispatchEvent(i)}var r7=Uo,a7=BM,Hn=globalThis?.document?v.useLayoutEffect:()=>{},s7="Portal",Dc=v.forwardRef((e,t)=>{const{container:n,...r}=e,[a,i]=v.useState(!1);Hn(()=>i(!0),[]);const o=n||a&&globalThis?.document?.body;return o?LM.createPortal(s.jsx(Ke.div,{...r,ref:t}),o):null});Dc.displayName=s7;function i7(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var Kn=e=>{const{present:t,children:n}=e,r=o7(t),a=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),i=vt(r.ref,l7(a));return typeof n=="function"||r.isPresent?v.cloneElement(a,{ref:i}):null};Kn.displayName="Presence";function o7(e){const[t,n]=v.useState(),r=v.useRef(null),a=v.useRef(e),i=v.useRef("none"),o=e?"mounted":"unmounted",[c,d]=i7(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const f=$p(r.current);i.current=c==="mounted"?f:"none"},[c]),Hn(()=>{const f=r.current,h=a.current;if(h!==e){const y=i.current,g=$p(f);e?d("MOUNT"):g==="none"||f?.display==="none"?d("UNMOUNT"):d(h&&y!==g?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,d]),Hn(()=>{if(t){let f;const h=t.ownerDocument.defaultView??window,p=g=>{const b=$p(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&b&&(d("ANIMATION_END"),!a.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",f=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},y=g=>{g.target===t&&(i.current=$p(r.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{h.clearTimeout(f),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:v.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function $p(e){return e?.animationName||"none"}function l7(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 c7=Im[" useInsertionEffect ".trim().toString()]||Hn;function ia({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,o]=u7({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:a;{const h=v.useRef(e!==void 0);v.useEffect(()=>{const p=h.current;p!==c&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=c},[c,r])}const f=v.useCallback(h=>{if(c){const p=d7(h)?h(e):h;p!==e&&o.current?.(p)}else i(h)},[c,e,i,o]);return[d,f]}function u7({defaultProp:e,onChange:t}){const[n,r]=v.useState(e),a=v.useRef(n),i=v.useRef(t);return c7(()=>{i.current=t},[t]),v.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,r,i]}function d7(e){return typeof e=="function"}var UM=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"}),f7="VisuallyHidden",Mm=v.forwardRef((e,t)=>s.jsx(Ke.span,{...e,ref:t,style:{...UM,...e.style}}));Mm.displayName=f7;var p7=Mm,MS="ToastProvider",[$S,h7,m7]=af("Toast"),[qM]=lr("Toast",[m7]),[v7,$m]=qM(MS),WM=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:a="right",swipeThreshold:i=50,children:o}=e,[c,d]=v.useState(null),[f,h]=v.useState(0),p=v.useRef(!1),y=v.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${MS}\`. Expected non-empty \`string\`.`),s.jsx($S.Provider,{scope:t,children:s.jsx(v7,{scope:t,label:n,duration:r,swipeDirection:a,swipeThreshold:i,toastCount:f,viewport:c,onViewportChange:d,onToastAdd:v.useCallback(()=>h(g=>g+1),[]),onToastRemove:v.useCallback(()=>h(g=>g-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:y,children:o})})};WM.displayName=MS;var VM="ToastViewport",g7=["F8"],E1="toast.viewportPause",P1="toast.viewportResume",HM=v.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=g7,label:a="Notifications ({hotkey})",...i}=e,o=$m(VM,n),c=h7(n),d=v.useRef(null),f=v.useRef(null),h=v.useRef(null),p=v.useRef(null),y=vt(t,p,o.onViewportChange),g=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=o.toastCount>0;v.useEffect(()=>{const x=S=>{r.length!==0&&r.every(C=>S[C]||S.code===C)&&p.current?.focus()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]),v.useEffect(()=>{const x=d.current,S=p.current;if(j&&x&&S){const N=()=>{if(!o.isClosePausedRef.current){const k=new CustomEvent(E1);S.dispatchEvent(k),o.isClosePausedRef.current=!0}},C=()=>{if(o.isClosePausedRef.current){const k=new CustomEvent(P1);S.dispatchEvent(k),o.isClosePausedRef.current=!1}},E=k=>{!x.contains(k.relatedTarget)&&C()},_=()=>{x.contains(document.activeElement)||C()};return x.addEventListener("focusin",N),x.addEventListener("focusout",E),x.addEventListener("pointermove",N),x.addEventListener("pointerleave",_),window.addEventListener("blur",N),window.addEventListener("focus",C),()=>{x.removeEventListener("focusin",N),x.removeEventListener("focusout",E),x.removeEventListener("pointermove",N),x.removeEventListener("pointerleave",_),window.removeEventListener("blur",N),window.removeEventListener("focus",C)}}},[j,o.isClosePausedRef]);const b=v.useCallback(({tabbingDirection:x})=>{const N=c().map(C=>{const E=C.ref.current,_=[E,...k7(E)];return x==="forwards"?_:_.reverse()});return(x==="forwards"?N.reverse():N).flat()},[c]);return v.useEffect(()=>{const x=p.current;if(x){const S=N=>{const C=N.altKey||N.ctrlKey||N.metaKey;if(N.key==="Tab"&&!C){const _=document.activeElement,k=N.shiftKey;if(N.target===x&&k){f.current?.focus();return}const T=b({tabbingDirection:k?"backwards":"forwards"}),F=T.findIndex(L=>L===_);ex(T.slice(F+1))?N.preventDefault():k?f.current?.focus():h.current?.focus()}};return x.addEventListener("keydown",S),()=>x.removeEventListener("keydown",S)}},[c,b]),s.jsxs(a7,{ref:d,role:"region","aria-label":a.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:j?void 0:"none"},children:[j&&s.jsx(k1,{ref:f,onFocusFromOutsideViewport:()=>{const x=b({tabbingDirection:"forwards"});ex(x)}}),s.jsx($S.Slot,{scope:n,children:s.jsx(Ke.ol,{tabIndex:-1,...i,ref:y})}),j&&s.jsx(k1,{ref:h,onFocusFromOutsideViewport:()=>{const x=b({tabbingDirection:"backwards"});ex(x)}})]})});HM.displayName=VM;var KM="ToastFocusProxy",k1=v.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,i=$m(KM,n);return s.jsx(Mm,{tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:o=>{const c=o.relatedTarget;!i.viewport?.contains(c)&&r()}})});k1.displayName=KM;var sf="Toast",y7="toast.swipeStart",x7="toast.swipeMove",b7="toast.swipeCancel",w7="toast.swipeEnd",GM=v.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:i,...o}=e,[c,d]=ia({prop:r,defaultProp:a??!0,onChange:i,caller:sf});return s.jsx(Kn,{present:n||c,children:s.jsx(N7,{open:c,...o,ref:t,onClose:()=>d(!1),onPause:Rn(e.onPause),onResume:Rn(e.onResume),onSwipeStart:ke(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ke(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:ke(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:ke(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)})})})});GM.displayName=sf;var[j7,S7]=qM(sf,{onClose(){}}),N7=v.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:a,open:i,onClose:o,onEscapeKeyDown:c,onPause:d,onResume:f,onSwipeStart:h,onSwipeMove:p,onSwipeCancel:y,onSwipeEnd:g,...j}=e,b=$m(sf,n),[x,S]=v.useState(null),N=vt(t,H=>S(H)),C=v.useRef(null),E=v.useRef(null),_=a||b.duration,k=v.useRef(0),O=v.useRef(_),R=v.useRef(0),{onToastAdd:T,onToastRemove:F}=b,L=Rn(()=>{x?.contains(document.activeElement)&&b.viewport?.focus(),o()}),$=v.useCallback(H=>{!H||H===1/0||(window.clearTimeout(R.current),k.current=new Date().getTime(),R.current=window.setTimeout(L,H))},[L]);v.useEffect(()=>{const H=b.viewport;if(H){const K=()=>{$(O.current),f?.()},J=()=>{const Q=new Date().getTime()-k.current;O.current=O.current-Q,window.clearTimeout(R.current),d?.()};return H.addEventListener(E1,J),H.addEventListener(P1,K),()=>{H.removeEventListener(E1,J),H.removeEventListener(P1,K)}}},[b.viewport,_,d,f,$]),v.useEffect(()=>{i&&!b.isClosePausedRef.current&&$(_)},[i,_,b.isClosePausedRef,$]),v.useEffect(()=>(T(),()=>F()),[T,F]);const Y=v.useMemo(()=>x?t$(x):null,[x]);return b.viewport?s.jsxs(s.Fragment,{children:[Y&&s.jsx(C7,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:Y}),s.jsx(j7,{scope:n,onClose:L,children:$c.createPortal(s.jsx($S.ItemSlot,{scope:n,children:s.jsx(r7,{asChild:!0,onEscapeKeyDown:ke(c,()=>{b.isFocusedToastEscapeKeyDownRef.current||L(),b.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx(Ke.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":b.swipeDirection,...j,ref:N,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ke(e.onKeyDown,H=>{H.key==="Escape"&&(c?.(H.nativeEvent),H.nativeEvent.defaultPrevented||(b.isFocusedToastEscapeKeyDownRef.current=!0,L()))}),onPointerDown:ke(e.onPointerDown,H=>{H.button===0&&(C.current={x:H.clientX,y:H.clientY})}),onPointerMove:ke(e.onPointerMove,H=>{if(!C.current)return;const K=H.clientX-C.current.x,J=H.clientY-C.current.y,Q=!!E.current,D=["left","right"].includes(b.swipeDirection),B=["left","up"].includes(b.swipeDirection)?Math.min:Math.max,Z=D?B(0,K):0,z=D?0:B(0,J),M=H.pointerType==="touch"?10:2,re={x:Z,y:z},te={originalEvent:H,delta:re};Q?(E.current=re,Dp(x7,p,te,{discrete:!1})):mE(re,b.swipeDirection,M)?(E.current=re,Dp(y7,h,te,{discrete:!1}),H.target.setPointerCapture(H.pointerId)):(Math.abs(K)>M||Math.abs(J)>M)&&(C.current=null)}),onPointerUp:ke(e.onPointerUp,H=>{const K=E.current,J=H.target;if(J.hasPointerCapture(H.pointerId)&&J.releasePointerCapture(H.pointerId),E.current=null,C.current=null,K){const Q=H.currentTarget,D={originalEvent:H,delta:K};mE(K,b.swipeDirection,b.swipeThreshold)?Dp(w7,g,D,{discrete:!0}):Dp(b7,y,D,{discrete:!0}),Q.addEventListener("click",B=>B.preventDefault(),{once:!0})}})})})}),b.viewport)})]}):null}),C7=e=>{const{__scopeToast:t,children:n,...r}=e,a=$m(sf,t),[i,o]=v.useState(!1),[c,d]=v.useState(!1);return E7(()=>o(!0)),v.useEffect(()=>{const f=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(f)},[]),c?null:s.jsx(Dc,{asChild:!0,children:s.jsx(Mm,{...r,children:i&&s.jsxs(s.Fragment,{children:[a.label," ",n]})})})},A7="ToastTitle",YM=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(Ke.div,{...r,ref:t})});YM.displayName=A7;var _7="ToastDescription",XM=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(Ke.div,{...r,ref:t})});XM.displayName=_7;var QM="ToastAction",JM=v.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?s.jsx(e$,{altText:n,asChild:!0,children:s.jsx(DS,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${QM}\`. Expected non-empty \`string\`.`),null)});JM.displayName=QM;var ZM="ToastClose",DS=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=S7(ZM,n);return s.jsx(e$,{asChild:!0,children:s.jsx(Ke.button,{type:"button",...r,ref:t,onClick:ke(e.onClick,a.onClose)})})});DS.displayName=ZM;var e$=v.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...a}=e;return s.jsx(Ke.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function t$(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),P7(r)){const a=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!a)if(i){const o=r.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...t$(r))}}),t}function Dp(e,t,n,{discrete:r}){const a=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?IS(a,i):a.dispatchEvent(i)}var mE=(e,t,n=0)=>{const r=Math.abs(e.x),a=Math.abs(e.y),i=r>a;return t==="left"||t==="right"?i&&r>n:!i&&a>n};function E7(e=()=>{}){const t=Rn(e);Hn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function P7(e){return e.nodeType===e.ELEMENT_NODE}function k7(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ex(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var O7=WM,n$=HM,r$=GM,a$=YM,s$=XM,i$=JM,o$=DS;function l$(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=l$(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function At(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=l$(e))&&(r&&(r+=" "),r+=t);return r}const vE=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,gE=At,qo=(e,t)=>n=>{var r;if(t?.variants==null)return gE(e,n?.class,n?.className);const{variants:a,defaultVariants:i}=t,o=Object.keys(a).map(f=>{const h=n?.[f],p=i?.[f];if(h===null)return null;const y=vE(h)||vE(p);return a[f][y]}),c=n&&Object.entries(n).reduce((f,h)=>{let[p,y]=h;return y===void 0||(f[p]=y),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,h)=>{let{class:p,className:y,...g}=h;return Object.entries(g).every(j=>{let[b,x]=j;return Array.isArray(x)?x.includes({...i,...c}[b]):{...i,...c}[b]===x})?[...f,p,y]:f},[]);return gE(e,o,d,n?.class,n?.className)};const R7=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),c$=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var T7={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 I7=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:o,...c},d)=>v.createElement("svg",{ref:d,...T7,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:c$("lucide",a),...c},[...o.map(([f,h])=>v.createElement(f,h)),...Array.isArray(i)?i:[i]]));const ct=(e,t)=>{const n=v.forwardRef(({className:r,...a},i)=>v.createElement(I7,{ref:i,iconNode:t,className:c$(`lucide-${R7(e)}`,r),...a}));return n.displayName=`${e}`,n};const u$=ct("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);const M7=ct("ArrowLeftRight",[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]]);const ko=ct("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const ba=ct("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);const fd=ct("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);const sc=ct("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Gt=ct("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const d$=ct("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const ds=ct("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Hl=ct("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);const tx=ct("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const Kl=ct("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const $7=ct("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const lh=ct("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);const D7=ct("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const of=ct("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const zi=ct("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const f$=ct("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);const ja=ct("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);const Dm=ct("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);const mh=ct("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);const L7=ct("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const p$=ct("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);const yE=ct("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const h$=ct("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);const LS=ct("GitCompare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);const F7=ct("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);const O1=ct("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);const m$=ct("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);const B7=ct("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);const or=ct("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const v$=ct("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]);const z7=ct("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);const g$=ct("NotebookTabs",[["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["path",{d:"M15 2v20",key:"dcj49h"}],["path",{d:"M15 7h5",key:"1xj5lc"}],["path",{d:"M15 12h5",key:"w5shd9"}],["path",{d:"M15 17h5",key:"1qaofu"}]]);const Bl=ct("NotepadText",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"16",height:"18",x:"4",y:"4",rx:"2",key:"1u9h20"}],["path",{d:"M8 10h6",key:"3oa6kw"}],["path",{d:"M8 14h8",key:"1fgep2"}],["path",{d:"M8 18h5",key:"17enja"}]]);const U7=ct("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);const nx=ct("PanelRightClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]);const rx=ct("PanelRightOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]]);const Lm=ct("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);const Gl=ct("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const ms=ct("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const y$=ct("RectangleEllipsis",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M17 12h.01",key:"1m0b6t"}],["path",{d:"M7 12h.01",key:"eqddd0"}]]);const Na=ct("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);const q7=ct("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);const FS=ct("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const x$=ct("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);const BS=ct("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const ya=ct("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);const ch=ct("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const b$=ct("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);const Ca=ct("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const uh=ct("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const W7=ct("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);const zS=ct("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);const w$=ct("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);const os=ct("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);const Ys=ct("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),US="-",V7=e=>{const t=K7(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const c=o.split(US);return c[0]===""&&c.length!==1&&c.shift(),j$(c,t)||H7(o)},getConflictingClassGroupIds:(o,c)=>{const d=n[o]||[];return c&&r[o]?[...d,...r[o]]:d}}},j$=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?j$(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(US);return t.validators.find(({validator:o})=>o(i))?.classGroupId},xE=/^\[(.+)\]$/,H7=e=>{if(xE.test(e)){const t=xE.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},K7=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Y7(Object.entries(e.classGroups),n).forEach(([i,o])=>{R1(o,r,i,t)}),r},R1=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:bE(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(G7(a)){R1(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,o])=>{R1(o,bE(t,i),n,r)})})},bE=(e,t)=>{let n=e;return t.split(US).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},G7=e=>e.isThemeGetter,Y7=(e,t)=>t?e.map(([n,r])=>{const a=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,c])=>[t+o,c])):i);return[n,a]}):e,X7=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return a(i,o),o},set(i,o){n.has(i)?n.set(i,o):a(i,o)}}},S$="!",Q7=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,a=t[0],i=t.length,o=c=>{const d=[];let f=0,h=0,p;for(let x=0;x<c.length;x++){let S=c[x];if(f===0){if(S===a&&(r||c.slice(x,x+i)===t)){d.push(c.slice(h,x)),h=x+i;continue}if(S==="/"){p=x;continue}}S==="["?f++:S==="]"&&f--}const y=d.length===0?c:c.substring(h),g=y.startsWith(S$),j=g?y.substring(1):y,b=p&&p>h?p-h:void 0;return{modifiers:d,hasImportantModifier:g,baseClassName:j,maybePostfixModifierPosition:b}};return n?c=>n({className:c,parseClassName:o}):o},J7=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},Z7=e=>({cache:X7(e.cacheSize),parseClassName:Q7(e),...V7(e)}),eq=/\s+/,tq=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],o=e.trim().split(eq);let c="";for(let d=o.length-1;d>=0;d-=1){const f=o[d],{modifiers:h,hasImportantModifier:p,baseClassName:y,maybePostfixModifierPosition:g}=n(f);let j=!!g,b=r(j?y.substring(0,g):y);if(!b){if(!j){c=f+(c.length>0?" "+c:c);continue}if(b=r(y),!b){c=f+(c.length>0?" "+c:c);continue}j=!1}const x=J7(h).join(":"),S=p?x+S$:x,N=S+b;if(i.includes(N))continue;i.push(N);const C=a(b,j);for(let E=0;E<C.length;++E){const _=C[E];i.push(S+_)}c=f+(c.length>0?" "+c:c)}return c};function nq(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=N$(t))&&(r&&(r+=" "),r+=n);return r}const N$=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=N$(e[r]))&&(n&&(n+=" "),n+=t);return n};function rq(e,...t){let n,r,a,i=o;function o(d){const f=t.reduce((h,p)=>p(h),e());return n=Z7(f),r=n.cache.get,a=n.cache.set,i=c,c(d)}function c(d){const f=r(d);if(f)return f;const h=tq(d,n);return a(d,h),h}return function(){return i(nq.apply(null,arguments))}}const vn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},C$=/^\[(?:([a-z-]+):)?(.+)\]$/i,aq=/^\d+\/\d+$/,sq=new Set(["px","full","screen"]),iq=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,oq=/\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$/,lq=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,cq=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,uq=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ms=e=>Yl(e)||sq.has(e)||aq.test(e),Pi=e=>Lc(e,"length",yq),Yl=e=>!!e&&!Number.isNaN(Number(e)),ax=e=>Lc(e,"number",Yl),$u=e=>!!e&&Number.isInteger(Number(e)),dq=e=>e.endsWith("%")&&Yl(e.slice(0,-1)),_t=e=>C$.test(e),ki=e=>iq.test(e),fq=new Set(["length","size","percentage"]),pq=e=>Lc(e,fq,A$),hq=e=>Lc(e,"position",A$),mq=new Set(["image","url"]),vq=e=>Lc(e,mq,bq),gq=e=>Lc(e,"",xq),Du=()=>!0,Lc=(e,t,n)=>{const r=C$.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},yq=e=>oq.test(e)&&!lq.test(e),A$=()=>!1,xq=e=>cq.test(e),bq=e=>uq.test(e),wq=()=>{const e=vn("colors"),t=vn("spacing"),n=vn("blur"),r=vn("brightness"),a=vn("borderColor"),i=vn("borderRadius"),o=vn("borderSpacing"),c=vn("borderWidth"),d=vn("contrast"),f=vn("grayscale"),h=vn("hueRotate"),p=vn("invert"),y=vn("gap"),g=vn("gradientColorStops"),j=vn("gradientColorStopPositions"),b=vn("inset"),x=vn("margin"),S=vn("opacity"),N=vn("padding"),C=vn("saturate"),E=vn("scale"),_=vn("sepia"),k=vn("skew"),O=vn("space"),R=vn("translate"),T=()=>["auto","contain","none"],F=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto",_t,t],$=()=>[_t,t],Y=()=>["",Ms,Pi],H=()=>["auto",Yl,_t],K=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],J=()=>["solid","dashed","dotted","double","none"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],D=()=>["start","end","center","between","around","evenly","stretch"],B=()=>["","0",_t],Z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[Yl,_t];return{cacheSize:500,separator:":",theme:{colors:[Du],spacing:[Ms,Pi],blur:["none","",ki,_t],brightness:z(),borderColor:[e],borderRadius:["none","","full",ki,_t],borderSpacing:$(),borderWidth:Y(),contrast:z(),grayscale:B(),hueRotate:z(),invert:B(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[dq,Pi],inset:L(),margin:L(),opacity:z(),padding:$(),saturate:z(),scale:z(),sepia:B(),skew:z(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",_t]}],container:["container"],columns:[{columns:[ki]}],"break-after":[{"break-after":Z()}],"break-before":[{"break-before":Z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...K(),_t]}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],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",$u,_t]}],basis:[{basis:L()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",_t]}],grow:[{grow:B()}],shrink:[{shrink:B()}],order:[{order:["first","last","none",$u,_t]}],"grid-cols":[{"grid-cols":[Du]}],"col-start-end":[{col:["auto",{span:["full",$u,_t]},_t]}],"col-start":[{"col-start":H()}],"col-end":[{"col-end":H()}],"grid-rows":[{"grid-rows":[Du]}],"row-start-end":[{row:["auto",{span:[$u,_t]},_t]}],"row-start":[{"row-start":H()}],"row-end":[{"row-end":H()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",_t]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",_t]}],gap:[{gap:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"justify-content":[{justify:["normal",...D()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...D(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...D(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[N]}],px:[{px:[N]}],py:[{py:[N]}],ps:[{ps:[N]}],pe:[{pe:[N]}],pt:[{pt:[N]}],pr:[{pr:[N]}],pb:[{pb:[N]}],pl:[{pl:[N]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[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",_t,t]}],"min-w":[{"min-w":[_t,t,"min","max","fit"]}],"max-w":[{"max-w":[_t,t,"none","full","min","max","fit","prose",{screen:[ki]},ki]}],h:[{h:[_t,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[_t,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[_t,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[_t,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ki,Pi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ax]}],"font-family":[{font:[Du]}],"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",_t]}],"line-clamp":[{"line-clamp":["none",Yl,ax]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ms,_t]}],"list-image":[{"list-image":["none",_t]}],"list-style-type":[{list:["none","disc","decimal",_t]}],"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:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ms,Pi]}],"underline-offset":[{"underline-offset":["auto",Ms,_t]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",_t]}],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",_t]}],"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:[...K(),hq]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",pq]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},vq]}],"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:[...J(),"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:J()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...J()]}],"outline-offset":[{"outline-offset":[Ms,_t]}],"outline-w":[{outline:[Ms,Pi]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[Ms,Pi]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ki,gq]}],"shadow-color":[{shadow:[Du]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...Q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",ki,_t]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[p]}],saturate:[{saturate:[C]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",_t]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",_t]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",_t]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[$u,_t]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",_t]}],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",_t]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",_t]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ms,Pi,ax]}],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"]}}},jq=rq(wq);function Se(...e){return jq(At(e))}const Sq=O7,_$=v.forwardRef(({className:e,...t},n)=>s.jsx(n$,{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}));_$.displayName=n$.displayName;const Nq=qo("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"}}),E$=v.forwardRef(({className:e,variant:t,...n},r)=>s.jsx(r$,{ref:r,className:Se(Nq({variant:t}),e),...n}));E$.displayName=r$.displayName;const Cq=v.forwardRef(({className:e,...t},n)=>s.jsx(i$,{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}));Cq.displayName=i$.displayName;const P$=v.forwardRef(({className:e,...t},n)=>s.jsx(o$,{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:s.jsx(Ys,{className:"h-4 w-4"})}));P$.displayName=o$.displayName;const k$=v.forwardRef(({className:e,...t},n)=>s.jsx(a$,{ref:n,className:Se("text-sm font-semibold",e),...t}));k$.displayName=a$.displayName;const O$=v.forwardRef(({className:e,...t},n)=>s.jsx(s$,{ref:n,className:Se("text-sm opacity-90",e),...t}));O$.displayName=s$.displayName;function Aq(){const{toasts:e}=MU();return s.jsxs(Sq,{children:[e.map(function({id:t,title:n,description:r,action:a,...i}){return s.jsxs(E$,{...i,children:[s.jsxs("div",{className:"grid gap-1",children:[n&&s.jsx(k$,{children:n}),r&&s.jsx(O$,{children:r})]}),a,s.jsx(P$,{})]},t)}),s.jsx(_$,{})]})}var wE=["light","dark"],_q="(prefers-color-scheme: dark)",Eq=v.createContext(void 0),Pq={setTheme:e=>{},themes:[]},kq=()=>{var e;return(e=v.useContext(Eq))!=null?e:Pq};v.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:a,defaultTheme:i,value:o,attrs:c,nonce:d})=>{let f=i==="system",h=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${c.map(j=>`'${j}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,p=a?wE.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",y=(j,b=!1,x=!0)=>{let S=o?o[j]:j,N=b?j+"|| ''":`'${S}'`,C="";return a&&x&&!b&&wE.includes(j)&&(C+=`d.style.colorScheme = '${j}';`),n==="class"?b||S?C+=`c.add(${N})`:C+="null":S&&(C+=`d[s](n,${N})`),C},g=e?`!function(){${h}${y(e)}}()`:r?`!function(){try{${h}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${f})){var t='${_q}',m=window.matchMedia(t);if(m.media!==t||m.matches){${y("dark")}}else{${y("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${y(o?"x[e]":"e",!0)}}${f?"":"else{"+y(i,!1,!1)+"}"}${p}}catch(e){}}()`:`!function(){try{${h}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${y(o?"x[e]":"e",!0)}}else{${y(i,!1,!1)};}${p}}catch(t){}}();`;return v.createElement("script",{nonce:d,dangerouslySetInnerHTML:{__html:g}})});var Oq=e=>{switch(e){case"success":return Iq;case"info":return $q;case"warning":return Mq;case"error":return Dq;default:return null}},Rq=Array(12).fill(0),Tq=({visible:e,className:t})=>U.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},U.createElement("div",{className:"sonner-spinner"},Rq.map((n,r)=>U.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Iq=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.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"})),Mq=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},U.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"})),$q=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.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"})),Dq=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.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"})),Lq=U.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"},U.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),U.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Fq=()=>{let[e,t]=U.useState(document.hidden);return U.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},T1=1,Bq=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,a=typeof e?.id=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:T1++,i=this.toasts.find(c=>c.id===a),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(c=>c.id===a?(this.publish({...c,...e,id:a,title:n}),{...c,...e,id:a,dismissible:o,title:n}):c):this.addToast({title:n,...r,dismissible:o,id:a}),a},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),a=n!==void 0,i,o=r.then(async d=>{if(i=["resolve",d],U.isValidElement(d))a=!1,this.create({id:n,type:"default",message:d});else if(Uq(d)&&!d.ok){a=!1;let f=typeof t.error=="function"?await t.error(`HTTP error! status: ${d.status}`):t.error,h=typeof t.description=="function"?await t.description(`HTTP error! status: ${d.status}`):t.description;this.create({id:n,type:"error",message:f,description:h})}else if(t.success!==void 0){a=!1;let f=typeof t.success=="function"?await t.success(d):t.success,h=typeof t.description=="function"?await t.description(d):t.description;this.create({id:n,type:"success",message:f,description:h})}}).catch(async d=>{if(i=["reject",d],t.error!==void 0){a=!1;let f=typeof t.error=="function"?await t.error(d):t.error,h=typeof t.description=="function"?await t.description(d):t.description;this.create({id:n,type:"error",message:f,description:h})}}).finally(()=>{var d;a&&(this.dismiss(n),n=void 0),(d=t.finally)==null||d.call(t)}),c=()=>new Promise((d,f)=>o.then(()=>i[0]==="reject"?f(i[1]):d(i[1])).catch(f));return typeof n!="string"&&typeof n!="number"?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(e,t)=>{let n=t?.id||T1++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Ir=new Bq,zq=(e,t)=>{let n=t?.id||T1++;return Ir.addToast({title:e,...t,id:n}),n},Uq=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",qq=zq,Wq=()=>Ir.toasts,Vq=()=>Ir.getActiveToasts();Object.assign(qq,{success:Ir.success,info:Ir.info,warning:Ir.warning,error:Ir.error,custom:Ir.custom,message:Ir.message,promise:Ir.promise,dismiss:Ir.dismiss,loading:Ir.loading},{getHistory:Wq,getToasts:Vq});function Hq(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))}Hq(`: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 Lp(e){return e.label!==void 0}var Kq=3,Gq="32px",Yq="16px",jE=4e3,Xq=356,Qq=14,Jq=20,Zq=200;function $a(...e){return e.filter(Boolean).join(" ")}function e9(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var t9=e=>{var t,n,r,a,i,o,c,d,f,h,p;let{invert:y,toast:g,unstyled:j,interacting:b,setHeights:x,visibleToasts:S,heights:N,index:C,toasts:E,expanded:_,removeToast:k,defaultRichColors:O,closeButton:R,style:T,cancelButtonStyle:F,actionButtonStyle:L,className:$="",descriptionClassName:Y="",duration:H,position:K,gap:J,loadingIcon:Q,expandByDefault:D,classNames:B,icons:Z,closeButtonAriaLabel:z="Close toast",pauseWhenPageIsHidden:M}=e,[re,te]=U.useState(null),[G,de]=U.useState(null),[ce,he]=U.useState(!1),[ie,ue]=U.useState(!1),[Ae,ae]=U.useState(!1),[$e,W]=U.useState(!1),[ve,oe]=U.useState(!1),[be,Ie]=U.useState(0),[Ye,je]=U.useState(0),Re=U.useRef(g.duration||H||jE),Xe=U.useRef(null),It=U.useRef(null),qt=C===0,ee=C+1<=S,Ce=g.type,Ne=g.dismissible!==!1,Me=g.className||"",Be=g.descriptionClassName||"",et=U.useMemo(()=>N.findIndex(De=>De.toastId===g.id)||0,[N,g.id]),Et=U.useMemo(()=>{var De;return(De=g.closeButton)!=null?De:R},[g.closeButton,R]),Sn=U.useMemo(()=>g.duration||H||jE,[g.duration,H]),Nn=U.useRef(0),cr=U.useRef(0),ur=U.useRef(0),Dn=U.useRef(null),[dr,_r]=K.split("-"),Ur=U.useMemo(()=>N.reduce((De,st,xt)=>xt>=et?De:De+st.height,0),[N,et]),qr=Fq(),Yn=g.invert||y,Xt=Ce==="loading";cr.current=U.useMemo(()=>et*J+Ur,[et,Ur]),U.useEffect(()=>{Re.current=Sn},[Sn]),U.useEffect(()=>{he(!0)},[]),U.useEffect(()=>{let De=It.current;if(De){let st=De.getBoundingClientRect().height;return je(st),x(xt=>[{toastId:g.id,height:st,position:g.position},...xt]),()=>x(xt=>xt.filter($t=>$t.toastId!==g.id))}},[x,g.id]),U.useLayoutEffect(()=>{if(!ce)return;let De=It.current,st=De.style.height;De.style.height="auto";let xt=De.getBoundingClientRect().height;De.style.height=st,je(xt),x($t=>$t.find(an=>an.toastId===g.id)?$t.map(an=>an.toastId===g.id?{...an,height:xt}:an):[{toastId:g.id,height:xt,position:g.position},...$t])},[ce,g.title,g.description,x,g.id]);let En=U.useCallback(()=>{ue(!0),Ie(cr.current),x(De=>De.filter(st=>st.toastId!==g.id)),setTimeout(()=>{k(g)},Zq)},[g,k,x,cr]);U.useEffect(()=>{if(g.promise&&Ce==="loading"||g.duration===1/0||g.type==="loading")return;let De;return _||b||M&&qr?(()=>{if(ur.current<Nn.current){let st=new Date().getTime()-Nn.current;Re.current=Re.current-st}ur.current=new Date().getTime()})():Re.current!==1/0&&(Nn.current=new Date().getTime(),De=setTimeout(()=>{var st;(st=g.onAutoClose)==null||st.call(g,g),En()},Re.current)),()=>clearTimeout(De)},[_,b,g,Ce,M,qr,En]),U.useEffect(()=>{g.delete&&En()},[En,g.delete]);function fe(){var De,st,xt;return Z!=null&&Z.loading?U.createElement("div",{className:$a(B?.loader,(De=g?.classNames)==null?void 0:De.loader,"sonner-loader"),"data-visible":Ce==="loading"},Z.loading):Q?U.createElement("div",{className:$a(B?.loader,(st=g?.classNames)==null?void 0:st.loader,"sonner-loader"),"data-visible":Ce==="loading"},Q):U.createElement(Tq,{className:$a(B?.loader,(xt=g?.classNames)==null?void 0:xt.loader),visible:Ce==="loading"})}return U.createElement("li",{tabIndex:0,ref:It,className:$a($,Me,B?.toast,(t=g?.classNames)==null?void 0:t.toast,B?.default,B?.[Ce],(n=g?.classNames)==null?void 0:n[Ce]),"data-sonner-toast":"","data-rich-colors":(r=g.richColors)!=null?r:O,"data-styled":!(g.jsx||g.unstyled||j),"data-mounted":ce,"data-promise":!!g.promise,"data-swiped":ve,"data-removed":ie,"data-visible":ee,"data-y-position":dr,"data-x-position":_r,"data-index":C,"data-front":qt,"data-swiping":Ae,"data-dismissible":Ne,"data-type":Ce,"data-invert":Yn,"data-swipe-out":$e,"data-swipe-direction":G,"data-expanded":!!(_||D&&ce),style:{"--index":C,"--toasts-before":C,"--z-index":E.length-C,"--offset":`${ie?be:cr.current}px`,"--initial-height":D?"auto":`${Ye}px`,...T,...g.style},onDragEnd:()=>{ae(!1),te(null),Dn.current=null},onPointerDown:De=>{Xt||!Ne||(Xe.current=new Date,Ie(cr.current),De.target.setPointerCapture(De.pointerId),De.target.tagName!=="BUTTON"&&(ae(!0),Dn.current={x:De.clientX,y:De.clientY}))},onPointerUp:()=>{var De,st,xt,$t;if($e||!Ne)return;Dn.current=null;let an=Number(((De=It.current)==null?void 0:De.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),fn=Number(((st=It.current)==null?void 0:st.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Xn=new Date().getTime()-((xt=Xe.current)==null?void 0:xt.getTime()),Cn=re==="x"?an:fn,rr=Math.abs(Cn)/Xn;if(Math.abs(Cn)>=Jq||rr>.11){Ie(cr.current),($t=g.onDismiss)==null||$t.call(g,g),de(re==="x"?an>0?"right":"left":fn>0?"down":"up"),En(),W(!0),oe(!1);return}ae(!1),te(null)},onPointerMove:De=>{var st,xt,$t,an;if(!Dn.current||!Ne||((st=window.getSelection())==null?void 0:st.toString().length)>0)return;let fn=De.clientY-Dn.current.y,Xn=De.clientX-Dn.current.x,Cn=(xt=e.swipeDirections)!=null?xt:e9(K);!re&&(Math.abs(Xn)>1||Math.abs(fn)>1)&&te(Math.abs(Xn)>Math.abs(fn)?"x":"y");let rr={x:0,y:0};re==="y"?(Cn.includes("top")||Cn.includes("bottom"))&&(Cn.includes("top")&&fn<0||Cn.includes("bottom")&&fn>0)&&(rr.y=fn):re==="x"&&(Cn.includes("left")||Cn.includes("right"))&&(Cn.includes("left")&&Xn<0||Cn.includes("right")&&Xn>0)&&(rr.x=Xn),(Math.abs(rr.x)>0||Math.abs(rr.y)>0)&&oe(!0),($t=It.current)==null||$t.style.setProperty("--swipe-amount-x",`${rr.x}px`),(an=It.current)==null||an.style.setProperty("--swipe-amount-y",`${rr.y}px`)}},Et&&!g.jsx?U.createElement("button",{"aria-label":z,"data-disabled":Xt,"data-close-button":!0,onClick:Xt||!Ne?()=>{}:()=>{var De;En(),(De=g.onDismiss)==null||De.call(g,g)},className:$a(B?.closeButton,(a=g?.classNames)==null?void 0:a.closeButton)},(i=Z?.close)!=null?i:Lq):null,g.jsx||v.isValidElement(g.title)?g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title:U.createElement(U.Fragment,null,Ce||g.icon||g.promise?U.createElement("div",{"data-icon":"",className:$a(B?.icon,(o=g?.classNames)==null?void 0:o.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||fe():null,g.type!=="loading"?g.icon||Z?.[Ce]||Oq(Ce):null):null,U.createElement("div",{"data-content":"",className:$a(B?.content,(c=g?.classNames)==null?void 0:c.content)},U.createElement("div",{"data-title":"",className:$a(B?.title,(d=g?.classNames)==null?void 0:d.title)},typeof g.title=="function"?g.title():g.title),g.description?U.createElement("div",{"data-description":"",className:$a(Y,Be,B?.description,(f=g?.classNames)==null?void 0:f.description)},typeof g.description=="function"?g.description():g.description):null),v.isValidElement(g.cancel)?g.cancel:g.cancel&&Lp(g.cancel)?U.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||F,onClick:De=>{var st,xt;Lp(g.cancel)&&Ne&&((xt=(st=g.cancel).onClick)==null||xt.call(st,De),En())},className:$a(B?.cancelButton,(h=g?.classNames)==null?void 0:h.cancelButton)},g.cancel.label):null,v.isValidElement(g.action)?g.action:g.action&&Lp(g.action)?U.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||L,onClick:De=>{var st,xt;Lp(g.action)&&((xt=(st=g.action).onClick)==null||xt.call(st,De),!De.defaultPrevented&&En())},className:$a(B?.actionButton,(p=g?.classNames)==null?void 0:p.actionButton)},g.action.label):null))};function SE(){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 n9(e,t){let n={};return[e,t].forEach((r,a)=>{let i=a===1,o=i?"--mobile-offset":"--offset",c=i?Yq:Gq;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 r9=v.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:a=["altKey","KeyT"],expand:i,closeButton:o,className:c,offset:d,mobileOffset:f,theme:h="light",richColors:p,duration:y,style:g,visibleToasts:j=Kq,toastOptions:b,dir:x=SE(),gap:S=Qq,loadingIcon:N,icons:C,containerAriaLabel:E="Notifications",pauseWhenPageIsHidden:_}=e,[k,O]=U.useState([]),R=U.useMemo(()=>Array.from(new Set([r].concat(k.filter(M=>M.position).map(M=>M.position)))),[k,r]),[T,F]=U.useState([]),[L,$]=U.useState(!1),[Y,H]=U.useState(!1),[K,J]=U.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Q=U.useRef(null),D=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),B=U.useRef(null),Z=U.useRef(!1),z=U.useCallback(M=>{O(re=>{var te;return(te=re.find(G=>G.id===M.id))!=null&&te.delete||Ir.dismiss(M.id),re.filter(({id:G})=>G!==M.id)})},[]);return U.useEffect(()=>Ir.subscribe(M=>{if(M.dismiss){O(re=>re.map(te=>te.id===M.id?{...te,delete:!0}:te));return}setTimeout(()=>{LM.flushSync(()=>{O(re=>{let te=re.findIndex(G=>G.id===M.id);return te!==-1?[...re.slice(0,te),{...re[te],...M},...re.slice(te+1)]:[M,...re]})})})}),[]),U.useEffect(()=>{if(h!=="system"){J(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?J("dark"):J("light")),typeof window>"u")return;let M=window.matchMedia("(prefers-color-scheme: dark)");try{M.addEventListener("change",({matches:re})=>{J(re?"dark":"light")})}catch{M.addListener(({matches:te})=>{try{J(te?"dark":"light")}catch(G){console.error(G)}})}},[h]),U.useEffect(()=>{k.length<=1&&$(!1)},[k]),U.useEffect(()=>{let M=re=>{var te,G;a.every(de=>re[de]||re.code===de)&&($(!0),(te=Q.current)==null||te.focus()),re.code==="Escape"&&(document.activeElement===Q.current||(G=Q.current)!=null&&G.contains(document.activeElement))&&$(!1)};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[a]),U.useEffect(()=>{if(Q.current)return()=>{B.current&&(B.current.focus({preventScroll:!0}),B.current=null,Z.current=!1)}},[Q.current]),U.createElement("section",{ref:t,"aria-label":`${E} ${D}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((M,re)=>{var te;let[G,de]=M.split("-");return k.length?U.createElement("ol",{key:M,dir:x==="auto"?SE():x,tabIndex:-1,ref:Q,className:c,"data-sonner-toaster":!0,"data-theme":K,"data-y-position":G,"data-lifted":L&&k.length>1&&!i,"data-x-position":de,style:{"--front-toast-height":`${((te=T[0])==null?void 0:te.height)||0}px`,"--width":`${Xq}px`,"--gap":`${S}px`,...g,...n9(d,f)},onBlur:ce=>{Z.current&&!ce.currentTarget.contains(ce.relatedTarget)&&(Z.current=!1,B.current&&(B.current.focus({preventScroll:!0}),B.current=null))},onFocus:ce=>{ce.target instanceof HTMLElement&&ce.target.dataset.dismissible==="false"||Z.current||(Z.current=!0,B.current=ce.relatedTarget)},onMouseEnter:()=>$(!0),onMouseMove:()=>$(!0),onMouseLeave:()=>{Y||$(!1)},onDragEnd:()=>$(!1),onPointerDown:ce=>{ce.target instanceof HTMLElement&&ce.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},k.filter(ce=>!ce.position&&re===0||ce.position===M).map((ce,he)=>{var ie,ue;return U.createElement(t9,{key:ce.id,icons:C,index:he,toast:ce,defaultRichColors:p,duration:(ie=b?.duration)!=null?ie:y,className:b?.className,descriptionClassName:b?.descriptionClassName,invert:n,visibleToasts:j,closeButton:(ue=b?.closeButton)!=null?ue:o,interacting:Y,position:M,style:b?.style,unstyled:b?.unstyled,classNames:b?.classNames,cancelButtonStyle:b?.cancelButtonStyle,actionButtonStyle:b?.actionButtonStyle,removeToast:z,toasts:k.filter(Ae=>Ae.position==ce.position),heights:T.filter(Ae=>Ae.position==ce.position),setHeights:F,expandByDefault:i,gap:S,loadingIcon:N,expanded:L,pauseWhenPageIsHidden:_,swipeDirections:e.swipeDirections})})):null}))});const a9=({...e})=>{const{theme:t="system"}=kq();return s.jsx(r9,{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 s9=Im[" useId ".trim().toString()]||(()=>{}),i9=0;function Vn(e){const[t,n]=v.useState(s9());return Hn(()=>{n(r=>r??String(i9++))},[e]),e||(t?`radix-${t}`:"")}const o9=["top","right","bottom","left"],Ui=Math.min,Zr=Math.max,vh=Math.round,Fp=Math.floor,fs=e=>({x:e,y:e}),l9={left:"right",right:"left",bottom:"top",top:"bottom"},c9={start:"end",end:"start"};function I1(e,t,n){return Zr(e,Ui(t,n))}function Xs(e,t){return typeof e=="function"?e(t):e}function Qs(e){return e.split("-")[0]}function Fc(e){return e.split("-")[1]}function qS(e){return e==="x"?"y":"x"}function WS(e){return e==="y"?"height":"width"}const u9=new Set(["top","bottom"]);function cs(e){return u9.has(Qs(e))?"y":"x"}function VS(e){return qS(cs(e))}function d9(e,t,n){n===void 0&&(n=!1);const r=Fc(e),a=VS(e),i=WS(a);let o=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=gh(o)),[o,gh(o)]}function f9(e){const t=gh(e);return[M1(e),t,M1(t)]}function M1(e){return e.replace(/start|end/g,t=>c9[t])}const NE=["left","right"],CE=["right","left"],p9=["top","bottom"],h9=["bottom","top"];function m9(e,t,n){switch(e){case"top":case"bottom":return n?t?CE:NE:t?NE:CE;case"left":case"right":return t?p9:h9;default:return[]}}function v9(e,t,n,r){const a=Fc(e);let i=m9(Qs(e),n==="start",r);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(M1)))),i}function gh(e){return e.replace(/left|right|bottom|top/g,t=>l9[t])}function g9(e){return{top:0,right:0,bottom:0,left:0,...e}}function R$(e){return typeof e!="number"?g9(e):{top:e,right:e,bottom:e,left:e}}function yh(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function AE(e,t,n){let{reference:r,floating:a}=e;const i=cs(t),o=VS(t),c=WS(o),d=Qs(t),f=i==="y",h=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2,y=r[c]/2-a[c]/2;let g;switch(d){case"top":g={x:h,y:r.y-a.height};break;case"bottom":g={x:h,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:p};break;case"left":g={x:r.x-a.width,y:p};break;default:g={x:r.x,y:r.y}}switch(Fc(t)){case"start":g[o]-=y*(n&&f?-1:1);break;case"end":g[o]+=y*(n&&f?-1:1);break}return g}async function y9(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:i,rects:o,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:y=!1,padding:g=0}=Xs(t,e),j=R$(g),x=c[y?p==="floating"?"reference":"floating":p],S=yh(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:f,rootBoundary:h,strategy:d})),N=p==="floating"?{x:r,y:a,width:o.floating.width,height:o.floating.height}:o.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),E=await(i.isElement==null?void 0:i.isElement(C))?await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1}:{x:1,y:1},_=yh(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:N,offsetParent:C,strategy:d}):N);return{top:(S.top-_.top+j.top)/E.y,bottom:(_.bottom-S.bottom+j.bottom)/E.y,left:(S.left-_.left+j.left)/E.x,right:(_.right-S.right+j.right)/E.x}}const x9=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:o}=n,c=i.filter(Boolean),d=await(o.isRTL==null?void 0:o.isRTL(t));let f=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:h,y:p}=AE(f,r,d),y=r,g={},j=0;for(let x=0;x<c.length;x++){var b;const{name:S,fn:N}=c[x],{x:C,y:E,data:_,reset:k}=await N({x:h,y:p,initialPlacement:r,placement:y,strategy:a,middlewareData:g,rects:f,platform:{...o,detectOverflow:(b=o.detectOverflow)!=null?b:y9},elements:{reference:e,floating:t}});h=C??h,p=E??p,g={...g,[S]:{...g[S],..._}},k&&j<=50&&(j++,typeof k=="object"&&(k.placement&&(y=k.placement),k.rects&&(f=k.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):k.rects),{x:h,y:p}=AE(f,y,d)),x=-1)}return{x:h,y:p,placement:y,strategy:a,middlewareData:g}},b9=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:o,elements:c,middlewareData:d}=t,{element:f,padding:h=0}=Xs(e,t)||{};if(f==null)return{};const p=R$(h),y={x:n,y:r},g=VS(a),j=WS(g),b=await o.getDimensions(f),x=g==="y",S=x?"top":"left",N=x?"bottom":"right",C=x?"clientHeight":"clientWidth",E=i.reference[j]+i.reference[g]-y[g]-i.floating[j],_=y[g]-i.reference[g],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(f));let O=k?k[C]:0;(!O||!await(o.isElement==null?void 0:o.isElement(k)))&&(O=c.floating[C]||i.floating[j]);const R=E/2-_/2,T=O/2-b[j]/2-1,F=Ui(p[S],T),L=Ui(p[N],T),$=F,Y=O-b[j]-L,H=O/2-b[j]/2+R,K=I1($,H,Y),J=!d.arrow&&Fc(a)!=null&&H!==K&&i.reference[j]/2-(H<$?F:L)-b[j]/2<0,Q=J?H<$?H-$:H-Y:0;return{[g]:y[g]+Q,data:{[g]:K,centerOffset:H-K-Q,...J&&{alignmentOffset:Q}},reset:J}}}),w9=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:i,rects:o,initialPlacement:c,platform:d,elements:f}=t,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:y,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:b=!0,...x}=Xs(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const S=Qs(a),N=cs(c),C=Qs(c)===c,E=await(d.isRTL==null?void 0:d.isRTL(f.floating)),_=y||(C||!b?[gh(c)]:f9(c)),k=j!=="none";!y&&k&&_.push(...v9(c,b,j,E));const O=[c,..._],R=await d.detectOverflow(t,x),T=[];let F=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&T.push(R[S]),p){const H=d9(a,o,E);T.push(R[H[0]],R[H[1]])}if(F=[...F,{placement:a,overflows:T}],!T.every(H=>H<=0)){var L,$;const H=(((L=i.flip)==null?void 0:L.index)||0)+1,K=O[H];if(K&&(!(p==="alignment"?N!==cs(K):!1)||F.every(D=>cs(D.placement)===N?D.overflows[0]>0:!0)))return{data:{index:H,overflows:F},reset:{placement:K}};let J=($=F.filter(Q=>Q.overflows[0]<=0).sort((Q,D)=>Q.overflows[1]-D.overflows[1])[0])==null?void 0:$.placement;if(!J)switch(g){case"bestFit":{var Y;const Q=(Y=F.filter(D=>{if(k){const B=cs(D.placement);return B===N||B==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(B=>B>0).reduce((B,Z)=>B+Z,0)]).sort((D,B)=>D[1]-B[1])[0])==null?void 0:Y[0];Q&&(J=Q);break}case"initialPlacement":J=c;break}if(a!==J)return{reset:{placement:J}}}return{}}}};function _E(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function EE(e){return o9.some(t=>e[t]>=0)}const j9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...i}=Xs(e,t);switch(a){case"referenceHidden":{const o=await r.detectOverflow(t,{...i,elementContext:"reference"}),c=_E(o,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:EE(c)}}}case"escaped":{const o=await r.detectOverflow(t,{...i,altBoundary:!0}),c=_E(o,n.floating);return{data:{escapedOffsets:c,escaped:EE(c)}}}default:return{}}}}},T$=new Set(["left","top"]);async function S9(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),o=Qs(n),c=Fc(n),d=cs(n)==="y",f=T$.has(o)?-1:1,h=i&&d?-1:1,p=Xs(t,e);let{mainAxis:y,crossAxis:g,alignmentAxis:j}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof j=="number"&&(g=c==="end"?j*-1:j),d?{x:g*h,y:y*f}:{x:y*f,y:g*h}}const N9=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:o,middlewareData:c}=t,d=await S9(t,e);return o===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:a+d.x,y:i+d.y,data:{...d,placement:o}}}}},C9=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a,platform:i}=t,{mainAxis:o=!0,crossAxis:c=!1,limiter:d={fn:S=>{let{x:N,y:C}=S;return{x:N,y:C}}},...f}=Xs(e,t),h={x:n,y:r},p=await i.detectOverflow(t,f),y=cs(Qs(a)),g=qS(y);let j=h[g],b=h[y];if(o){const S=g==="y"?"top":"left",N=g==="y"?"bottom":"right",C=j+p[S],E=j-p[N];j=I1(C,j,E)}if(c){const S=y==="y"?"top":"left",N=y==="y"?"bottom":"right",C=b+p[S],E=b-p[N];b=I1(C,b,E)}const x=d.fn({...t,[g]:j,[y]:b});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[g]:o,[y]:c}}}}}},A9=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:i,middlewareData:o}=t,{offset:c=0,mainAxis:d=!0,crossAxis:f=!0}=Xs(e,t),h={x:n,y:r},p=cs(a),y=qS(p);let g=h[y],j=h[p];const b=Xs(c,t),x=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(d){const C=y==="y"?"height":"width",E=i.reference[y]-i.floating[C]+x.mainAxis,_=i.reference[y]+i.reference[C]-x.mainAxis;g<E?g=E:g>_&&(g=_)}if(f){var S,N;const C=y==="y"?"width":"height",E=T$.has(Qs(a)),_=i.reference[p]-i.floating[C]+(E&&((S=o.offset)==null?void 0:S[p])||0)+(E?0:x.crossAxis),k=i.reference[p]+i.reference[C]+(E?0:((N=o.offset)==null?void 0:N[p])||0)-(E?x.crossAxis:0);j<_?j=_:j>k&&(j=k)}return{[y]:g,[p]:j}}}},_9=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:i,platform:o,elements:c}=t,{apply:d=()=>{},...f}=Xs(e,t),h=await o.detectOverflow(t,f),p=Qs(a),y=Fc(a),g=cs(a)==="y",{width:j,height:b}=i.floating;let x,S;p==="top"||p==="bottom"?(x=p,S=y===(await(o.isRTL==null?void 0:o.isRTL(c.floating))?"start":"end")?"left":"right"):(S=p,x=y==="end"?"top":"bottom");const N=b-h.top-h.bottom,C=j-h.left-h.right,E=Ui(b-h[x],N),_=Ui(j-h[S],C),k=!t.middlewareData.shift;let O=E,R=_;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=N),k&&!y){const F=Zr(h.left,0),L=Zr(h.right,0),$=Zr(h.top,0),Y=Zr(h.bottom,0);g?R=j-2*(F!==0||L!==0?F+L:Zr(h.left,h.right)):O=b-2*($!==0||Y!==0?$+Y:Zr(h.top,h.bottom))}await d({...t,availableWidth:R,availableHeight:O});const T=await o.getDimensions(c.floating);return j!==T.width||b!==T.height?{reset:{rects:!0}}:{}}}};function Fm(){return typeof window<"u"}function Bc(e){return I$(e)?(e.nodeName||"").toLowerCase():"#document"}function ra(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function xs(e){var t;return(t=(I$(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function I$(e){return Fm()?e instanceof Node||e instanceof ra(e).Node:!1}function Wa(e){return Fm()?e instanceof Element||e instanceof ra(e).Element:!1}function vs(e){return Fm()?e instanceof HTMLElement||e instanceof ra(e).HTMLElement:!1}function PE(e){return!Fm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ra(e).ShadowRoot}const E9=new Set(["inline","contents"]);function lf(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Va(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!E9.has(a)}const P9=new Set(["table","td","th"]);function k9(e){return P9.has(Bc(e))}const O9=[":popover-open",":modal"];function Bm(e){return O9.some(t=>{try{return e.matches(t)}catch{return!1}})}const R9=["transform","translate","scale","rotate","perspective"],T9=["transform","translate","scale","rotate","perspective","filter"],I9=["paint","layout","strict","content"];function HS(e){const t=KS(),n=Wa(e)?Va(e):e;return R9.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)||T9.some(r=>(n.willChange||"").includes(r))||I9.some(r=>(n.contain||"").includes(r))}function M9(e){let t=qi(e);for(;vs(t)&&!ic(t);){if(HS(t))return t;if(Bm(t))return null;t=qi(t)}return null}function KS(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const $9=new Set(["html","body","#document"]);function ic(e){return $9.has(Bc(e))}function Va(e){return ra(e).getComputedStyle(e)}function zm(e){return Wa(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function qi(e){if(Bc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||PE(e)&&e.host||xs(e);return PE(t)?t.host:t}function M$(e){const t=qi(e);return ic(t)?e.ownerDocument?e.ownerDocument.body:e.body:vs(t)&&lf(t)?t:M$(t)}function pd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=M$(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),o=ra(a);if(i){const c=$1(o);return t.concat(o,o.visualViewport||[],lf(a)?a:[],c&&n?pd(c):[])}return t.concat(a,pd(a,[],n))}function $1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function $$(e){const t=Va(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=vs(e),i=a?e.offsetWidth:n,o=a?e.offsetHeight:r,c=vh(n)!==i||vh(r)!==o;return c&&(n=i,r=o),{width:n,height:r,$:c}}function GS(e){return Wa(e)?e:e.contextElement}function Xl(e){const t=GS(e);if(!vs(t))return fs(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=$$(t);let o=(i?vh(n.width):n.width)/r,c=(i?vh(n.height):n.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!c||!Number.isFinite(c))&&(c=1),{x:o,y:c}}const D9=fs(0);function D$(e){const t=ra(e);return!KS()||!t.visualViewport?D9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function L9(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ra(e)?!1:t}function Oo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=GS(e);let o=fs(1);t&&(r?Wa(r)&&(o=Xl(r)):o=Xl(e));const c=L9(i,n,r)?D$(i):fs(0);let d=(a.left+c.x)/o.x,f=(a.top+c.y)/o.y,h=a.width/o.x,p=a.height/o.y;if(i){const y=ra(i),g=r&&Wa(r)?ra(r):r;let j=y,b=$1(j);for(;b&&r&&g!==j;){const x=Xl(b),S=b.getBoundingClientRect(),N=Va(b),C=S.left+(b.clientLeft+parseFloat(N.paddingLeft))*x.x,E=S.top+(b.clientTop+parseFloat(N.paddingTop))*x.y;d*=x.x,f*=x.y,h*=x.x,p*=x.y,d+=C,f+=E,j=ra(b),b=$1(j)}}return yh({width:h,height:p,x:d,y:f})}function Um(e,t){const n=zm(e).scrollLeft;return t?t.left+n:Oo(xs(e)).left+n}function L$(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Um(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function F9(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",o=xs(r),c=t?Bm(t.floating):!1;if(r===o||c&&i)return n;let d={scrollLeft:0,scrollTop:0},f=fs(1);const h=fs(0),p=vs(r);if((p||!p&&!i)&&((Bc(r)!=="body"||lf(o))&&(d=zm(r)),vs(r))){const g=Oo(r);f=Xl(r),h.x=g.x+r.clientLeft,h.y=g.y+r.clientTop}const y=o&&!p&&!i?L$(o,d):fs(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+h.x+y.x,y:n.y*f.y-d.scrollTop*f.y+h.y+y.y}}function B9(e){return Array.from(e.getClientRects())}function z9(e){const t=xs(e),n=zm(e),r=e.ownerDocument.body,a=Zr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Zr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Um(e);const c=-n.scrollTop;return Va(r).direction==="rtl"&&(o+=Zr(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:o,y:c}}const kE=25;function U9(e,t){const n=ra(e),r=xs(e),a=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,c=0,d=0;if(a){i=a.width,o=a.height;const h=KS();(!h||h&&t==="fixed")&&(c=a.offsetLeft,d=a.offsetTop)}const f=Um(r);if(f<=0){const h=r.ownerDocument,p=h.body,y=getComputedStyle(p),g=h.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,j=Math.abs(r.clientWidth-p.clientWidth-g);j<=kE&&(i-=j)}else f<=kE&&(i+=f);return{width:i,height:o,x:c,y:d}}const q9=new Set(["absolute","fixed"]);function W9(e,t){const n=Oo(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=vs(e)?Xl(e):fs(1),o=e.clientWidth*i.x,c=e.clientHeight*i.y,d=a*i.x,f=r*i.y;return{width:o,height:c,x:d,y:f}}function OE(e,t,n){let r;if(t==="viewport")r=U9(e,n);else if(t==="document")r=z9(xs(e));else if(Wa(t))r=W9(t,n);else{const a=D$(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return yh(r)}function F$(e,t){const n=qi(e);return n===t||!Wa(n)||ic(n)?!1:Va(n).position==="fixed"||F$(n,t)}function V9(e,t){const n=t.get(e);if(n)return n;let r=pd(e,[],!1).filter(c=>Wa(c)&&Bc(c)!=="body"),a=null;const i=Va(e).position==="fixed";let o=i?qi(e):e;for(;Wa(o)&&!ic(o);){const c=Va(o),d=HS(o);!d&&c.position==="fixed"&&(a=null),(i?!d&&!a:!d&&c.position==="static"&&!!a&&q9.has(a.position)||lf(o)&&!d&&F$(e,o))?r=r.filter(h=>h!==o):a=c,o=qi(o)}return t.set(e,r),r}function H9(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[...n==="clippingAncestors"?Bm(t)?[]:V9(t,this._c):[].concat(n),r],c=o[0],d=o.reduce((f,h)=>{const p=OE(t,h,a);return f.top=Zr(p.top,f.top),f.right=Ui(p.right,f.right),f.bottom=Ui(p.bottom,f.bottom),f.left=Zr(p.left,f.left),f},OE(t,c,a));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function K9(e){const{width:t,height:n}=$$(e);return{width:t,height:n}}function G9(e,t,n){const r=vs(t),a=xs(t),i=n==="fixed",o=Oo(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const d=fs(0);function f(){d.x=Um(a)}if(r||!r&&!i)if((Bc(t)!=="body"||lf(a))&&(c=zm(t)),r){const g=Oo(t,!0,i,t);d.x=g.x+t.clientLeft,d.y=g.y+t.clientTop}else a&&f();i&&!r&&a&&f();const h=a&&!r&&!i?L$(a,c):fs(0),p=o.left+c.scrollLeft-d.x-h.x,y=o.top+c.scrollTop-d.y-h.y;return{x:p,y,width:o.width,height:o.height}}function sx(e){return Va(e).position==="static"}function RE(e,t){if(!vs(e)||Va(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return xs(e)===n&&(n=n.ownerDocument.body),n}function B$(e,t){const n=ra(e);if(Bm(e))return n;if(!vs(e)){let a=qi(e);for(;a&&!ic(a);){if(Wa(a)&&!sx(a))return a;a=qi(a)}return n}let r=RE(e,t);for(;r&&k9(r)&&sx(r);)r=RE(r,t);return r&&ic(r)&&sx(r)&&!HS(r)?n:r||M9(e)||n}const Y9=async function(e){const t=this.getOffsetParent||B$,n=this.getDimensions,r=await n(e.floating);return{reference:G9(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function X9(e){return Va(e).direction==="rtl"}const Q9={convertOffsetParentRelativeRectToViewportRelativeRect:F9,getDocumentElement:xs,getClippingRect:H9,getOffsetParent:B$,getElementRects:Y9,getClientRects:B9,getDimensions:K9,getScale:Xl,isElement:Wa,isRTL:X9};function z$(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function J9(e,t){let n=null,r;const a=xs(e);function i(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function o(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),i();const f=e.getBoundingClientRect(),{left:h,top:p,width:y,height:g}=f;if(c||t(),!y||!g)return;const j=Fp(p),b=Fp(a.clientWidth-(h+y)),x=Fp(a.clientHeight-(p+g)),S=Fp(h),C={rootMargin:-j+"px "+-b+"px "+-x+"px "+-S+"px",threshold:Zr(0,Ui(1,d))||1};let E=!0;function _(k){const O=k[0].intersectionRatio;if(O!==d){if(!E)return o();O?o(!1,O):r=setTimeout(()=>{o(!1,1e-7)},1e3)}O===1&&!z$(f,e.getBoundingClientRect())&&o(),E=!1}try{n=new IntersectionObserver(_,{...C,root:a.ownerDocument})}catch{n=new IntersectionObserver(_,C)}n.observe(e)}return o(!0),i}function Z9(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=GS(e),h=a||i?[...f?pd(f):[],...pd(t)]:[];h.forEach(S=>{a&&S.addEventListener("scroll",n,{passive:!0}),i&&S.addEventListener("resize",n)});const p=f&&c?J9(f,n):null;let y=-1,g=null;o&&(g=new ResizeObserver(S=>{let[N]=S;N&&N.target===f&&g&&(g.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var C;(C=g)==null||C.observe(t)})),n()}),f&&!d&&g.observe(f),g.observe(t));let j,b=d?Oo(e):null;d&&x();function x(){const S=Oo(e);b&&!z$(b,S)&&n(),b=S,j=requestAnimationFrame(x)}return n(),()=>{var S;h.forEach(N=>{a&&N.removeEventListener("scroll",n),i&&N.removeEventListener("resize",n)}),p?.(),(S=g)==null||S.disconnect(),g=null,d&&cancelAnimationFrame(j)}}const eW=N9,tW=C9,nW=w9,rW=_9,aW=j9,TE=b9,sW=A9,iW=(e,t,n)=>{const r=new Map,a={platform:Q9,...n},i={...a.platform,_c:r};return x9(e,t,{...a,platform:i})};var oW=typeof document<"u",lW=function(){},dh=oW?v.useLayoutEffect:lW;function xh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!xh(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!xh(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function U$(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function IE(e,t){const n=U$(e);return Math.round(t*n)/n}function ix(e){const t=v.useRef(e);return dh(()=>{t.current=e}),t}function cW(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:o}={},transform:c=!0,whileElementsMounted:d,open:f}=e,[h,p]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,g]=v.useState(r);xh(y,r)||g(r);const[j,b]=v.useState(null),[x,S]=v.useState(null),N=v.useCallback(D=>{D!==k.current&&(k.current=D,b(D))},[]),C=v.useCallback(D=>{D!==O.current&&(O.current=D,S(D))},[]),E=i||j,_=o||x,k=v.useRef(null),O=v.useRef(null),R=v.useRef(h),T=d!=null,F=ix(d),L=ix(a),$=ix(f),Y=v.useCallback(()=>{if(!k.current||!O.current)return;const D={placement:t,strategy:n,middleware:y};L.current&&(D.platform=L.current),iW(k.current,O.current,D).then(B=>{const Z={...B,isPositioned:$.current!==!1};H.current&&!xh(R.current,Z)&&(R.current=Z,$c.flushSync(()=>{p(Z)}))})},[y,t,n,L,$]);dh(()=>{f===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,p(D=>({...D,isPositioned:!1})))},[f]);const H=v.useRef(!1);dh(()=>(H.current=!0,()=>{H.current=!1}),[]),dh(()=>{if(E&&(k.current=E),_&&(O.current=_),E&&_){if(F.current)return F.current(E,_,Y);Y()}},[E,_,Y,F,T]);const K=v.useMemo(()=>({reference:k,floating:O,setReference:N,setFloating:C}),[N,C]),J=v.useMemo(()=>({reference:E,floating:_}),[E,_]),Q=v.useMemo(()=>{const D={position:n,left:0,top:0};if(!J.floating)return D;const B=IE(J.floating,h.x),Z=IE(J.floating,h.y);return c?{...D,transform:"translate("+B+"px, "+Z+"px)",...U$(J.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:B,top:Z}},[n,c,J.floating,h.x,h.y]);return v.useMemo(()=>({...h,update:Y,refs:K,elements:J,floatingStyles:Q}),[h,Y,K,J,Q])}const uW=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?TE({element:r.current,padding:a}).fn(n):{}:r?TE({element:r,padding:a}).fn(n):{}}}},dW=(e,t)=>({...eW(e),options:[e,t]}),fW=(e,t)=>({...tW(e),options:[e,t]}),pW=(e,t)=>({...sW(e),options:[e,t]}),hW=(e,t)=>({...nW(e),options:[e,t]}),mW=(e,t)=>({...rW(e),options:[e,t]}),vW=(e,t)=>({...aW(e),options:[e,t]}),gW=(e,t)=>({...uW(e),options:[e,t]});var yW="Arrow",q$=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return s.jsx(Ke.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});q$.displayName=yW;var xW=q$;function qm(e){const[t,n]=v.useState(void 0);return Hn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let o,c;if("borderBoxSize"in i){const d=i.borderBoxSize,f=Array.isArray(d)?d[0]:d;o=f.inlineSize,c=f.blockSize}else o=e.offsetWidth,c=e.offsetHeight;n({width:o,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var YS="Popper",[W$,Ki]=lr(YS),[bW,V$]=W$(YS),H$=e=>{const{__scopePopper:t,children:n}=e,[r,a]=v.useState(null);return s.jsx(bW,{scope:t,anchor:r,onAnchorChange:a,children:n})};H$.displayName=YS;var K$="PopperAnchor",G$=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=V$(K$,n),o=v.useRef(null),c=vt(t,o),d=v.useRef(null);return v.useEffect(()=>{const f=d.current;d.current=r?.current||o.current,f!==d.current&&i.onAnchorChange(d.current)}),r?null:s.jsx(Ke.div,{...a,ref:c})});G$.displayName=K$;var XS="PopperContent",[wW,jW]=W$(XS),Y$=v.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:o=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:h=0,sticky:p="partial",hideWhenDetached:y=!1,updatePositionStrategy:g="optimized",onPlaced:j,...b}=e,x=V$(XS,n),[S,N]=v.useState(null),C=vt(t,ce=>N(ce)),[E,_]=v.useState(null),k=qm(E),O=k?.width??0,R=k?.height??0,T=r+(i!=="center"?"-"+i:""),F=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},L=Array.isArray(f)?f:[f],$=L.length>0,Y={padding:F,boundary:L.filter(NW),altBoundary:$},{refs:H,floatingStyles:K,placement:J,isPositioned:Q,middlewareData:D}=cW({strategy:"fixed",placement:T,whileElementsMounted:(...ce)=>Z9(...ce,{animationFrame:g==="always"}),elements:{reference:x.anchor},middleware:[dW({mainAxis:a+R,alignmentAxis:o}),d&&fW({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?pW():void 0,...Y}),d&&hW({...Y}),mW({...Y,apply:({elements:ce,rects:he,availableWidth:ie,availableHeight:ue})=>{const{width:Ae,height:ae}=he.reference,$e=ce.floating.style;$e.setProperty("--radix-popper-available-width",`${ie}px`),$e.setProperty("--radix-popper-available-height",`${ue}px`),$e.setProperty("--radix-popper-anchor-width",`${Ae}px`),$e.setProperty("--radix-popper-anchor-height",`${ae}px`)}}),E&&gW({element:E,padding:c}),CW({arrowWidth:O,arrowHeight:R}),y&&vW({strategy:"referenceHidden",...Y})]}),[B,Z]=J$(J),z=Rn(j);Hn(()=>{Q&&z?.()},[Q,z]);const M=D.arrow?.x,re=D.arrow?.y,te=D.arrow?.centerOffset!==0,[G,de]=v.useState();return Hn(()=>{S&&de(window.getComputedStyle(S).zIndex)},[S]),s.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:Q?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[D.transformOrigin?.x,D.transformOrigin?.y].join(" "),...D.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(wW,{scope:n,placedSide:B,onArrowChange:_,arrowX:M,arrowY:re,shouldHideArrow:te,children:s.jsx(Ke.div,{"data-side":B,"data-align":Z,...b,ref:C,style:{...b.style,animation:Q?void 0:"none"}})})})});Y$.displayName=XS;var X$="PopperArrow",SW={top:"bottom",right:"left",bottom:"top",left:"right"},Q$=v.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=jW(X$,r),o=SW[i.placedSide];return s.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:s.jsx(xW,{...a,ref:n,style:{...a.style,display:"block"}})})});Q$.displayName=X$;function NW(e){return e!==null}var CW=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:a}=t,o=a.arrow?.centerOffset!==0,c=o?0:e.arrowWidth,d=o?0:e.arrowHeight,[f,h]=J$(n),p={start:"0%",center:"50%",end:"100%"}[h],y=(a.arrow?.x??0)+c/2,g=(a.arrow?.y??0)+d/2;let j="",b="";return f==="bottom"?(j=o?p:`${y}px`,b=`${-d}px`):f==="top"?(j=o?p:`${y}px`,b=`${r.floating.height+d}px`):f==="right"?(j=`${-d}px`,b=o?p:`${g}px`):f==="left"&&(j=`${r.floating.width+d}px`,b=o?p:`${g}px`),{data:{x:j,y:b}}}});function J$(e){const[t,n="center"]=e.split("-");return[t,n]}var Wm=H$,cf=G$,Vm=Y$,Hm=Q$,AW=Symbol("radix.slottable");function _W(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=AW,t}var[Km]=lr("Tooltip",[Ki]),Gm=Ki(),Z$="TooltipProvider",EW=700,D1="tooltip.open",[PW,QS]=Km(Z$),eD=e=>{const{__scopeTooltip:t,delayDuration:n=EW,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=e,o=v.useRef(!0),c=v.useRef(!1),d=v.useRef(0);return v.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),s.jsx(PW,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:v.useCallback(()=>{window.clearTimeout(d.current),o.current=!1},[]),onClose:v.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:v.useCallback(f=>{c.current=f},[]),disableHoverableContent:a,children:i})};eD.displayName=Z$;var hd="Tooltip",[kW,Ym]=Km(hd),tD=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:i,disableHoverableContent:o,delayDuration:c}=e,d=QS(hd,e.__scopeTooltip),f=Gm(t),[h,p]=v.useState(null),y=Vn(),g=v.useRef(0),j=o??d.disableHoverableContent,b=c??d.delayDuration,x=v.useRef(!1),[S,N]=ia({prop:r,defaultProp:a??!1,onChange:O=>{O?(d.onOpen(),document.dispatchEvent(new CustomEvent(D1))):d.onClose(),i?.(O)},caller:hd}),C=v.useMemo(()=>S?x.current?"delayed-open":"instant-open":"closed",[S]),E=v.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x.current=!1,N(!0)},[N]),_=v.useCallback(()=>{window.clearTimeout(g.current),g.current=0,N(!1)},[N]),k=v.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{x.current=!0,N(!0),g.current=0},b)},[b,N]);return v.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),s.jsx(Wm,{...f,children:s.jsx(kW,{scope:t,contentId:y,open:S,stateAttribute:C,trigger:h,onTriggerChange:p,onTriggerEnter:v.useCallback(()=>{d.isOpenDelayedRef.current?k():E()},[d.isOpenDelayedRef,k,E]),onTriggerLeave:v.useCallback(()=>{j?_():(window.clearTimeout(g.current),g.current=0)},[_,j]),onOpen:E,onClose:_,disableHoverableContent:j,children:n})})};tD.displayName=hd;var L1="TooltipTrigger",nD=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Ym(L1,n),i=QS(L1,n),o=Gm(n),c=v.useRef(null),d=vt(t,c,a.onTriggerChange),f=v.useRef(!1),h=v.useRef(!1),p=v.useCallback(()=>f.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),s.jsx(cf,{asChild:!0,...o,children:s.jsx(Ke.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:d,onPointerMove:ke(e.onPointerMove,y=>{y.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),h.current=!0)}),onPointerLeave:ke(e.onPointerLeave,()=>{a.onTriggerLeave(),h.current=!1}),onPointerDown:ke(e.onPointerDown,()=>{a.open&&a.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:ke(e.onFocus,()=>{f.current||a.onOpen()}),onBlur:ke(e.onBlur,a.onClose),onClick:ke(e.onClick,a.onClose)})})});nD.displayName=L1;var OW="TooltipPortal",[Fge,RW]=Km(OW,{forceMount:void 0}),oc="TooltipContent",rD=v.forwardRef((e,t)=>{const n=RW(oc,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,o=Ym(oc,e.__scopeTooltip);return s.jsx(Kn,{present:r||o.open,children:o.disableHoverableContent?s.jsx(aD,{side:a,...i,ref:t}):s.jsx(TW,{side:a,...i,ref:t})})}),TW=v.forwardRef((e,t)=>{const n=Ym(oc,e.__scopeTooltip),r=QS(oc,e.__scopeTooltip),a=v.useRef(null),i=vt(t,a),[o,c]=v.useState(null),{trigger:d,onClose:f}=n,h=a.current,{onPointerInTransitChange:p}=r,y=v.useCallback(()=>{c(null),p(!1)},[p]),g=v.useCallback((j,b)=>{const x=j.currentTarget,S={x:j.clientX,y:j.clientY},N=LW(S,x.getBoundingClientRect()),C=FW(S,N),E=BW(b.getBoundingClientRect()),_=UW([...C,...E]);c(_),p(!0)},[p]);return v.useEffect(()=>()=>y(),[y]),v.useEffect(()=>{if(d&&h){const j=x=>g(x,h),b=x=>g(x,d);return d.addEventListener("pointerleave",j),h.addEventListener("pointerleave",b),()=>{d.removeEventListener("pointerleave",j),h.removeEventListener("pointerleave",b)}}},[d,h,g,y]),v.useEffect(()=>{if(o){const j=b=>{const x=b.target,S={x:b.clientX,y:b.clientY},N=d?.contains(x)||h?.contains(x),C=!zW(S,o);N?y():C&&(y(),f())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[d,h,o,f,y]),s.jsx(aD,{...e,ref:i})}),[IW,MW]=Km(hd,{isInside:!1}),$W=_W("TooltipContent"),aD=v.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...c}=e,d=Ym(oc,n),f=Gm(n),{onClose:h}=d;return v.useEffect(()=>(document.addEventListener(D1,h),()=>document.removeEventListener(D1,h)),[h]),v.useEffect(()=>{if(d.trigger){const p=y=>{y.target?.contains(d.trigger)&&h()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,h]),s.jsx(Uo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:p=>p.preventDefault(),onDismiss:h,children:s.jsxs(Vm,{"data-state":d.stateAttribute,...f,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx($W,{children:r}),s.jsx(IW,{scope:n,isInside:!0,children:s.jsx(p7,{id:d.contentId,role:"tooltip",children:a||r})})]})})});rD.displayName=oc;var sD="TooltipArrow",DW=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Gm(n);return MW(sD,n).isInside?null:s.jsx(Hm,{...a,...r,ref:t})});DW.displayName=sD;function LW(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,a,i)){case i:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function FW(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 BW(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function zW(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const c=t[i],d=t[o],f=c.x,h=c.y,p=d.x,y=d.y;h>r!=y>r&&n<(p-f)*(r-h)/(y-h)+f&&(a=!a)}return a}function UW(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),qW(t)}function qW(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const a=e[r];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var WW=eD,VW=tD,HW=nD,iD=rD;const oD=WW,lD=VW,cD=HW,JS=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(iD,{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}));JS.displayName=iD.displayName;var Xm=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(){}},KW={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},GW=class{#e=KW;#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)}},F1=new GW;function YW(e){setTimeout(e,0)}var Qm=typeof window>"u"||"Deno"in globalThis;function Fa(){}function XW(e,t){return typeof e=="function"?e(t):e}function QW(e){return typeof e=="number"&&e>=0&&e!==1/0}function JW(e,t){return Math.max(e+(t||0)-Date.now(),0)}function B1(e,t){return typeof e=="function"?e(t):e}function ZW(e,t){return typeof e=="function"?e(t):e}function ME(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:i,queryKey:o,stale:c}=e;if(o){if(r){if(t.queryHash!==ZS(o,t.options))return!1}else if(!vd(t.queryKey,o))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||a&&a!==t.state.fetchStatus||i&&!i(t))}function $E(e,t){const{exact:n,status:r,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(md(t.options.mutationKey)!==md(i))return!1}else if(!vd(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function ZS(e,t){return(t?.queryKeyHashFn||md)(e)}function md(e){return JSON.stringify(e,(t,n)=>z1(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function vd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>vd(e[n],t[n])):!1}var eV=Object.prototype.hasOwnProperty;function uD(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=DE(e)&&DE(t);if(!r&&!(z1(e)&&z1(t)))return t;const i=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),c=o.length,d=r?new Array(c):{};let f=0;for(let h=0;h<c;h++){const p=r?h:o[h],y=e[p],g=t[p];if(y===g){d[p]=y,(r?h<i:eV.call(e,p))&&f++;continue}if(y===null||g===null||typeof y!="object"||typeof g!="object"){d[p]=g;continue}const j=uD(y,g,n+1);d[p]=j,j===y&&f++}return i===c&&f===i?e:d}function DE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function z1(e){if(!LE(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!LE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function LE(e){return Object.prototype.toString.call(e)==="[object Object]"}function tV(e){return new Promise(t=>{F1.setTimeout(t,e)})}function nV(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?uD(e,t):t}function rV(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function aV(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var eN=Symbol();function dD(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===eN?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function sV(e,t,n){let r=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??=t(),r||(r=!0,a.aborted?n():a.addEventListener("abort",n,{once:!0})),a)}),e}var iV=class extends Xm{#e;#n;#t;constructor(){super(),this.#t=e=>{if(!Qm&&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"}},fD=new iV;function oV(){let e,t;const n=new Promise((a,i)=>{e=a,t=i});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}var lV=YW;function cV(){let e=[],t=0,n=c=>{c()},r=c=>{c()},a=lV;const i=c=>{t?e.push(c):a(()=>{n(c)})},o=()=>{const c=e;e=[],c.length&&a(()=>{r(()=>{c.forEach(d=>{n(d)})})})};return{batch:c=>{let d;t++;try{d=c()}finally{t--,t||o()}return d},batchCalls:c=>(...d)=>{i(()=>{c(...d)})},schedule:i,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{a=c}}}var wr=cV(),uV=class extends Xm{#e=!0;#n;#t;constructor(){super(),this.#t=e=>{if(!Qm&&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}},bh=new uV;function dV(e){return Math.min(1e3*2**e,3e4)}function pD(e){return(e??"online")==="online"?bh.isOnline():!0}var U1=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function hD(e){let t=!1,n=0,r;const a=oV(),i=()=>a.status!=="pending",o=b=>{if(!i()){const x=new U1(b);y(x),e.onCancel?.(x)}},c=()=>{t=!0},d=()=>{t=!1},f=()=>fD.isFocused()&&(e.networkMode==="always"||bh.isOnline())&&e.canRun(),h=()=>pD(e.networkMode)&&e.canRun(),p=b=>{i()||(r?.(),a.resolve(b))},y=b=>{i()||(r?.(),a.reject(b))},g=()=>new Promise(b=>{r=x=>{(i()||f())&&b(x)},e.onPause?.()}).then(()=>{r=void 0,i()||e.onContinue?.()}),j=()=>{if(i())return;let b;const x=n===0?e.initialPromise:void 0;try{b=x??e.fn()}catch(S){b=Promise.reject(S)}Promise.resolve(b).then(p).catch(S=>{if(i())return;const N=e.retry??(Qm?0:3),C=e.retryDelay??dV,E=typeof C=="function"?C(n,S):C,_=N===!0||typeof N=="number"&&n<N||typeof N=="function"&&N(n,S);if(t||!_){y(S);return}n++,e.onFail?.(n,S),tV(E).then(()=>f()?void 0:g()).then(()=>{t?y(S):j()})})};return{promise:a,status:()=>a.status,cancel:o,continue:()=>(r?.(),a),cancelRetry:c,continueRetry:d,canStart:h,start:()=>(h()?j():g().then(j),a)}}var mD=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),QW(this.gcTime)&&(this.#e=F1.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Qm?1/0:300*1e3))}clearGcTimeout(){this.#e&&(F1.clearTimeout(this.#e),this.#e=void 0)}},fV=class extends mD{#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=BE(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=BE(this.options);t.data!==void 0&&(this.setState(FE(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#t.remove(this)}setData(e,t){const n=nV(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Fa).catch(Fa):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>ZW(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===eN||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>B1(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:!JW(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#t.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(d=>d.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,r=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},a=()=>{const c=dD(this.options,t),f=(()=>{const h={client:this.#a,queryKey:this.queryKey,meta:this.meta};return r(h),h})();return this.#o=!1,this.options.persister?this.options.persister(c,f,this):c(f)},o=(()=>{const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:a};return r(c),c})();this.options.behavior?.onFetch(o,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#s({type:"fetch",meta:o.fetchOptions?.meta}),this.#r=hD({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:c=>{c instanceof U1&&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 U1){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,...pV(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...FE(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?r:void 0,r;case"error":const a=e.error;return{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),wr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#t.notify({query:this,type:"updated",action:e})})}};function pV(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:pD(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function FE(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function BE(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 zE(e){return{onFetch:(t,n)=>{const r=t.options,a=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let c={pages:[],pageParams:[]},d=0;const f=async()=>{let h=!1;const p=j=>{sV(j,()=>t.signal,()=>h=!0)},y=dD(t.options,t.fetchOptions),g=async(j,b,x)=>{if(h)return Promise.reject();if(b==null&&j.pages.length)return Promise.resolve(j);const N=(()=>{const k={client:t.client,queryKey:t.queryKey,pageParam:b,direction:x?"backward":"forward",meta:t.options.meta};return p(k),k})(),C=await y(N),{maxPages:E}=t.options,_=x?aV:rV;return{pages:_(j.pages,C,E),pageParams:_(j.pageParams,b,E)}};if(a&&i.length){const j=a==="backward",b=j?hV:UE,x={pages:i,pageParams:o},S=b(r,x);c=await g(x,S,j)}else{const j=e??i.length;do{const b=d===0?o[0]??r.initialPageParam:UE(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 UE(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 hV(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var mV=class extends mD{#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||vV(),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=hD({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(i,o)=>{this.#r({type:"failed",failureCount:i,error:o})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const r=this.state.status==="pending",a=!this.#a.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:a}),this.#t.config.onMutate&&await this.#t.config.onMutate(e,this,n);const o=await this.options.onMutate?.(e,n);o!==this.state.context&&this.#r({type:"pending",context:o,variables:e,isPaused:a})}const i=await this.#a.start();return await this.#t.config.onSuccess?.(i,e,this.state.context,this,n),await this.options.onSuccess?.(i,e,this.state.context,n),await this.#t.config.onSettled?.(i,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(i,null,e,this.state.context,n),this.#r({type:"success",data:i}),i}catch(i){try{await this.#t.config.onError?.(i,e,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onError?.(i,e,this.state.context,n)}catch(o){Promise.reject(o)}try{await this.#t.config.onSettled?.(void 0,i,this.state.variables,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,i,e,this.state.context,n)}catch(o){Promise.reject(o)}throw this.#r({type:"error",error:i}),i}finally{this.#t.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),wr.batch(()=>{this.#n.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function vV(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var gV=class extends Xm{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 mV({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=Bp(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=Bp(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=Bp(e);if(typeof t=="string"){const r=this.#n.get(t)?.find(a=>a.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Bp(e);return typeof t=="string"?this.#n.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){wr.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#n.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>$E(t,n))}findAll(e={}){return this.getAll().filter(t=>$E(e,t))}notify(e){wr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return wr.batch(()=>Promise.all(e.map(t=>t.continue().catch(Fa))))}};function Bp(e){return e.options.scope?.id}var yV=class extends Xm{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,a=t.queryHash??ZS(r,t);let i=this.get(a);return i||(i=new fV({client:e,queryKey:r,queryHash:a,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(i)),i}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){wr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>ME(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>ME(e,n)):t}notify(e){wr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){wr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){wr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},xV=class{#e;#n;#t;#a;#r;#i;#o;#s;constructor(e={}){this.#e=e.queryCache||new yV,this.#n=e.mutationCache||new gV,this.#t=e.defaultOptions||{},this.#a=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=fD.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=bh.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(B1(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=XW(t,i);if(o!==void 0)return this.#e.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return wr.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;wr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return wr.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=wr.batch(()=>this.#e.findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(Fa).catch(Fa)}invalidateQueries(e,t={}){return wr.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=wr.batch(()=>this.#e.findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let i=a.fetch(void 0,n);return n.throwOnError||(i=i.catch(Fa)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Fa)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(B1(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Fa).catch(Fa)}fetchInfiniteQuery(e){return e.behavior=zE(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Fa).catch(Fa)}ensureInfiniteQueryData(e){return e.behavior=zE(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return bh.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=>{vd(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=>{vd(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=ZS(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===eN&&(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()}},bV=v.createContext(void 0),wV=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(bV.Provider,{value:e,children:t}));function gd(){return gd=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},gd.apply(this,arguments)}var Mi;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Mi||(Mi={}));const qE="popstate";function jV(e){e===void 0&&(e={});function t(r,a){let{pathname:i,search:o,hash:c}=r.location;return q1("",{pathname:i,search:o,hash:c},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:wh(a)}return NV(t,n,null,e)}function jn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function tN(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function SV(){return Math.random().toString(36).substr(2,8)}function WE(e,t){return{usr:e.state,key:e.key,idx:t}}function q1(e,t,n,r){return n===void 0&&(n=null),gd({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?zc(t):t,{state:n,key:t&&t.key||r||SV()})}function wh(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function zc(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function NV(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:i=!1}=r,o=a.history,c=Mi.Pop,d=null,f=h();f==null&&(f=0,o.replaceState(gd({},o.state,{idx:f}),""));function h(){return(o.state||{idx:null}).idx}function p(){c=Mi.Pop;let x=h(),S=x==null?null:x-f;f=x,d&&d({action:c,location:b.location,delta:S})}function y(x,S){c=Mi.Push;let N=q1(b.location,x,S);f=h()+1;let C=WE(N,f),E=b.createHref(N);try{o.pushState(C,"",E)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;a.location.assign(E)}i&&d&&d({action:c,location:b.location,delta:1})}function g(x,S){c=Mi.Replace;let N=q1(b.location,x,S);f=h();let C=WE(N,f),E=b.createHref(N);o.replaceState(C,"",E),i&&d&&d({action:c,location:b.location,delta:0})}function j(x){let S=a.location.origin!=="null"?a.location.origin:a.location.href,N=typeof x=="string"?x:wh(x);return N=N.replace(/ $/,"%20"),jn(S,"No window.location.(origin|href) available to create URL for href: "+N),new URL(N,S)}let b={get action(){return c},get location(){return e(a,o)},listen(x){if(d)throw new Error("A history only accepts one active listener");return a.addEventListener(qE,p),d=x,()=>{a.removeEventListener(qE,p),d=null}},createHref(x){return t(a,x)},createURL:j,encodeLocation(x){let S=j(x);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:y,replace:g,go(x){return o.go(x)}};return b}var VE;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(VE||(VE={}));function CV(e,t,n){return n===void 0&&(n="/"),AV(e,t,n)}function AV(e,t,n,r){let a=typeof t=="string"?zc(t):t,i=lc(a.pathname||"/",n);if(i==null)return null;let o=vD(e);_V(o);let c=null;for(let d=0;c==null&&d<o.length;++d){let f=LV(i);c=$V(o[d],f)}return c}function vD(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let a=(i,o,c)=>{let d={relativePath:c===void 0?i.path||"":c,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};d.relativePath.startsWith("/")&&(jn(d.relativePath.startsWith(r),'Absolute route path "'+d.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),d.relativePath=d.relativePath.slice(r.length));let f=Di([r,d.relativePath]),h=n.concat(d);i.children&&i.children.length>0&&(jn(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),vD(i.children,t,h,f)),!(i.path==null&&!i.index)&&t.push({path:f,score:IV(f,i.index),routesMeta:h})};return e.forEach((i,o)=>{var c;if(i.path===""||!((c=i.path)!=null&&c.includes("?")))a(i,o);else for(let d of gD(i.path))a(i,o,d)}),t}function gD(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return a?[i,""]:[i];let o=gD(r.join("/")),c=[];return c.push(...o.map(d=>d===""?i:[i,d].join("/"))),a&&c.push(...o),c.map(d=>e.startsWith("/")&&d===""?"/":d)}function _V(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:MV(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const EV=/^:[\w-]+$/,PV=3,kV=2,OV=1,RV=10,TV=-2,HE=e=>e==="*";function IV(e,t){let n=e.split("/"),r=n.length;return n.some(HE)&&(r+=TV),t&&(r+=kV),n.filter(a=>!HE(a)).reduce((a,i)=>a+(EV.test(i)?PV:i===""?OV:RV),r)}function MV(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function $V(e,t,n){let{routesMeta:r}=e,a={},i="/",o=[];for(let c=0;c<r.length;++c){let d=r[c],f=c===r.length-1,h=i==="/"?t:t.slice(i.length)||"/",p=en({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},h),y=d.route;if(!p)return null;Object.assign(a,p.params),o.push({params:a,pathname:Di([i,p.pathname]),pathnameBase:qV(Di([i,p.pathnameBase])),route:y}),p.pathnameBase!=="/"&&(i=Di([i,p.pathnameBase]))}return o}function en(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=DV(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let i=a[0],o=i.replace(/(.)\/+$/,"$1"),c=a.slice(1);return{params:r.reduce((f,h,p)=>{let{paramName:y,isOptional:g}=h;if(y==="*"){let b=c[p]||"";o=i.slice(0,i.length-b.length).replace(/(.)\/+$/,"$1")}const j=c[p];return g&&!j?f[y]=void 0:f[y]=(j||"").replace(/%2F/g,"/"),f},{}),pathname:i,pathnameBase:o,pattern:e}}function DV(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),tN(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,c,d)=>(r.push({paramName:c,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function LV(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return tN(!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 lc(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 FV=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,BV=e=>FV.test(e);function zV(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?zc(e):e,i;if(n)if(BV(n))i=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),tN(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?i=KE(n.substring(1),"/"):i=KE(n,t)}else i=t;return{pathname:i,search:WV(r),hash:VV(a)}}function KE(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function ox(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 UV(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function nN(e,t){let n=UV(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function rN(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=zc(e):(a=gd({},e),jn(!a.pathname||!a.pathname.includes("?"),ox("?","pathname","search",a)),jn(!a.pathname||!a.pathname.includes("#"),ox("#","pathname","hash",a)),jn(!a.search||!a.search.includes("#"),ox("#","search","hash",a)));let i=e===""||a.pathname==="",o=i?"/":a.pathname,c;if(o==null)c=n;else{let p=t.length-1;if(!r&&o.startsWith("..")){let y=o.split("/");for(;y[0]==="..";)y.shift(),p-=1;a.pathname=y.join("/")}c=p>=0?t[p]:"/"}let d=zV(a,c),f=o&&o!=="/"&&o.endsWith("/"),h=(i||o===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||h)&&(d.pathname+="/"),d}const Di=e=>e.join("/").replace(/\/\/+/g,"/"),qV=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),WV=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,VV=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function HV(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const yD=["post","put","patch","delete"];new Set(yD);const KV=["get",...yD];new Set(KV);function yd(){return yd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yd.apply(this,arguments)}const Jm=v.createContext(null),xD=v.createContext(null),ti=v.createContext(null),Zm=v.createContext(null),bs=v.createContext({outlet:null,matches:[],isDataRoute:!1}),bD=v.createContext(null);function GV(e,t){let{relative:n}=t===void 0?{}:t;Uc()||jn(!1);let{basename:r,navigator:a}=v.useContext(ti),{hash:i,pathname:o,search:c}=ev(e,{relative:n}),d=o;return r!=="/"&&(d=o==="/"?r:Di([r,o])),a.createHref({pathname:d,search:c,hash:i})}function Uc(){return v.useContext(Zm)!=null}function ws(){return Uc()||jn(!1),v.useContext(Zm).location}function wD(e){v.useContext(ti).static||v.useLayoutEffect(e)}function _a(){let{isDataRoute:e}=v.useContext(bs);return e?cH():YV()}function YV(){Uc()||jn(!1);let e=v.useContext(Jm),{basename:t,future:n,navigator:r}=v.useContext(ti),{matches:a}=v.useContext(bs),{pathname:i}=ws(),o=JSON.stringify(nN(a,n.v7_relativeSplatPath)),c=v.useRef(!1);return wD(()=>{c.current=!0}),v.useCallback(function(f,h){if(h===void 0&&(h={}),!c.current)return;if(typeof f=="number"){r.go(f);return}let p=rN(f,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Di([t,p.pathname])),(h.replace?r.replace:r.push)(p,h.state,h)},[t,r,o,i,e])}const XV=v.createContext(null);function QV(e){let t=v.useContext(bs).outlet;return t&&v.createElement(XV.Provider,{value:e},t)}function Wo(){let{matches:e}=v.useContext(bs),t=e[e.length-1];return t?t.params:{}}function ev(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=v.useContext(ti),{matches:a}=v.useContext(bs),{pathname:i}=ws(),o=JSON.stringify(nN(a,r.v7_relativeSplatPath));return v.useMemo(()=>rN(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function JV(e,t){return ZV(e,t)}function ZV(e,t,n,r){Uc()||jn(!1);let{navigator:a}=v.useContext(ti),{matches:i}=v.useContext(bs),o=i[i.length-1],c=o?o.params:{};o&&o.pathname;let d=o?o.pathnameBase:"/";o&&o.route;let f=ws(),h;if(t){var p;let x=typeof t=="string"?zc(t):t;d==="/"||(p=x.pathname)!=null&&p.startsWith(d)||jn(!1),h=x}else h=f;let y=h.pathname||"/",g=y;if(d!=="/"){let x=d.replace(/^\//,"").split("/");g="/"+y.replace(/^\//,"").split("/").slice(x.length).join("/")}let j=CV(e,{pathname:g}),b=aH(j&&j.map(x=>Object.assign({},x,{params:Object.assign({},c,x.params),pathname:Di([d,a.encodeLocation?a.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?d:Di([d,a.encodeLocation?a.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),i,n,r);return t&&b?v.createElement(Zm.Provider,{value:{location:yd({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:Mi.Pop}},b):b}function eH(){let e=lH(),t=HV(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:a},n):null,null)}const tH=v.createElement(eH,null);class nH extends v.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?v.createElement(bs.Provider,{value:this.props.routeContext},v.createElement(bD.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function rH(e){let{routeContext:t,match:n,children:r}=e,a=v.useContext(Jm);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(bs.Provider,{value:t},r)}function aH(e,t,n,r){var a;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,c=(a=n)==null?void 0:a.errors;if(c!=null){let h=o.findIndex(p=>p.route.id&&c?.[p.route.id]!==void 0);h>=0||jn(!1),o=o.slice(0,Math.min(o.length,h+1))}let d=!1,f=-1;if(n&&r&&r.v7_partialHydration)for(let h=0;h<o.length;h++){let p=o[h];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(f=h),p.route.id){let{loaderData:y,errors:g}=n,j=p.route.loader&&y[p.route.id]===void 0&&(!g||g[p.route.id]===void 0);if(p.route.lazy||j){d=!0,f>=0?o=o.slice(0,f+1):o=[o[0]];break}}}return o.reduceRight((h,p,y)=>{let g,j=!1,b=null,x=null;n&&(g=c&&p.route.id?c[p.route.id]:void 0,b=p.route.errorElement||tH,d&&(f<0&&y===0?(uH("route-fallback"),j=!0,x=null):f===y&&(j=!0,x=p.route.hydrateFallbackElement||null)));let S=t.concat(o.slice(0,y+1)),N=()=>{let C;return g?C=b:j?C=x:p.route.Component?C=v.createElement(p.route.Component,null):p.route.element?C=p.route.element:C=h,v.createElement(rH,{match:p,routeContext:{outlet:h,matches:S,isDataRoute:n!=null},children:C})};return n&&(p.route.ErrorBoundary||p.route.errorElement||y===0)?v.createElement(nH,{location:n.location,revalidation:n.revalidation,component:b,error:g,children:N(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):N()},null)}var jD=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(jD||{}),SD=(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})(SD||{});function sH(e){let t=v.useContext(Jm);return t||jn(!1),t}function iH(e){let t=v.useContext(xD);return t||jn(!1),t}function oH(e){let t=v.useContext(bs);return t||jn(!1),t}function ND(e){let t=oH(),n=t.matches[t.matches.length-1];return n.route.id||jn(!1),n.route.id}function lH(){var e;let t=v.useContext(bD),n=iH(),r=ND();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function cH(){let{router:e}=sH(jD.UseNavigateStable),t=ND(SD.UseNavigateStable),n=v.useRef(!1);return wD(()=>{n.current=!0}),v.useCallback(function(a,i){i===void 0&&(i={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,yd({fromRouteId:t},i)))},[e,t])}const GE={};function uH(e,t,n){GE[e]||(GE[e]=!0)}function dH(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function CD(e){let{to:t,replace:n,state:r,relative:a}=e;Uc()||jn(!1);let{future:i,static:o}=v.useContext(ti),{matches:c}=v.useContext(bs),{pathname:d}=ws(),f=_a(),h=rN(t,nN(c,i.v7_relativeSplatPath),d,a==="path"),p=JSON.stringify(h);return v.useEffect(()=>f(JSON.parse(p),{replace:n,state:r,relative:a}),[f,p,a,n,r]),null}function YE(e){return QV(e.context)}function Zt(e){jn(!1)}function fH(e){let{basename:t="/",children:n=null,location:r,navigationType:a=Mi.Pop,navigator:i,static:o=!1,future:c}=e;Uc()&&jn(!1);let d=t.replace(/^\/*/,"/"),f=v.useMemo(()=>({basename:d,navigator:i,static:o,future:yd({v7_relativeSplatPath:!1},c)}),[d,c,i,o]);typeof r=="string"&&(r=zc(r));let{pathname:h="/",search:p="",hash:y="",state:g=null,key:j="default"}=r,b=v.useMemo(()=>{let x=lc(h,d);return x==null?null:{location:{pathname:x,search:p,hash:y,state:g,key:j},navigationType:a}},[d,h,p,y,g,j,a]);return b==null?null:v.createElement(ti.Provider,{value:f},v.createElement(Zm.Provider,{children:n,value:b}))}function pH(e){let{children:t,location:n}=e;return JV(W1(t),n)}new Promise(()=>{});function W1(e,t){t===void 0&&(t=[]);let n=[];return v.Children.forEach(e,(r,a)=>{if(!v.isValidElement(r))return;let i=[...t,a];if(r.type===v.Fragment){n.push.apply(n,W1(r.props.children,i));return}r.type!==Zt&&jn(!1),!r.props.index||!r.props.children||jn(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=W1(r.props.children,i)),n.push(o)}),n}function jh(){return jh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jh.apply(this,arguments)}function AD(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function hH(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function mH(e,t){return e.button===0&&(!t||t==="_self")&&!hH(e)}function V1(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function vH(e,t){let n=V1(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}const gH=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],yH=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],xH="6";try{window.__reactRouterVersion=xH}catch{}const bH=v.createContext({isTransitioning:!1}),wH="startTransition",XE=Im[wH];function jH(e){let{basename:t,children:n,future:r,window:a}=e,i=v.useRef();i.current==null&&(i.current=jV({window:a,v5Compat:!0}));let o=i.current,[c,d]=v.useState({action:o.action,location:o.location}),{v7_startTransition:f}=r||{},h=v.useCallback(p=>{f&&XE?XE(()=>d(p)):d(p)},[d,f]);return v.useLayoutEffect(()=>o.listen(h),[o,h]),v.useEffect(()=>dH(r),[r]),v.createElement(fH,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:o,future:r})}const SH=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",NH=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wt=v.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:i,replace:o,state:c,target:d,to:f,preventScrollReset:h,viewTransition:p}=t,y=AD(t,gH),{basename:g}=v.useContext(ti),j,b=!1;if(typeof f=="string"&&NH.test(f)&&(j=f,SH))try{let C=new URL(window.location.href),E=f.startsWith("//")?new URL(C.protocol+f):new URL(f),_=lc(E.pathname,g);E.origin===C.origin&&_!=null?f=_+E.search+E.hash:b=!0}catch{}let x=GV(f,{relative:a}),S=_H(f,{replace:o,state:c,target:d,preventScrollReset:h,relative:a,viewTransition:p});function N(C){r&&r(C),C.defaultPrevented||S(C)}return v.createElement("a",jh({},y,{href:j||x,onClick:b||i?r:N,ref:n,target:d}))}),CH=v.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:a=!1,className:i="",end:o=!1,style:c,to:d,viewTransition:f,children:h}=t,p=AD(t,yH),y=ev(d,{relative:p.relative}),g=ws(),j=v.useContext(xD),{navigator:b,basename:x}=v.useContext(ti),S=j!=null&&EH(y)&&f===!0,N=b.encodeLocation?b.encodeLocation(y).pathname:y.pathname,C=g.pathname,E=j&&j.navigation&&j.navigation.location?j.navigation.location.pathname:null;a||(C=C.toLowerCase(),E=E?E.toLowerCase():null,N=N.toLowerCase()),E&&x&&(E=lc(E,x)||E);const _=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let k=C===N||!o&&C.startsWith(N)&&C.charAt(_)==="/",O=E!=null&&(E===N||!o&&E.startsWith(N)&&E.charAt(N.length)==="/"),R={isActive:k,isPending:O,isTransitioning:S},T=k?r:void 0,F;typeof i=="function"?F=i(R):F=[i,k?"active":null,O?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let L=typeof c=="function"?c(R):c;return v.createElement(wt,jh({},p,{"aria-current":T,className:F,ref:n,style:L,to:d,viewTransition:f}),typeof h=="function"?h(R):h)});var H1;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(H1||(H1={}));var QE;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(QE||(QE={}));function AH(e){let t=v.useContext(Jm);return t||jn(!1),t}function _H(e,t){let{target:n,replace:r,state:a,preventScrollReset:i,relative:o,viewTransition:c}=t===void 0?{}:t,d=_a(),f=ws(),h=ev(e,{relative:o});return v.useCallback(p=>{if(mH(p,n)){p.preventDefault();let y=r!==void 0?r:wh(f)===wh(h);d(e,{replace:y,state:a,preventScrollReset:i,relative:o,viewTransition:c})}},[f,d,h,r,a,n,e,i,o,c])}function Vo(e){let t=v.useRef(V1(e)),n=v.useRef(!1),r=ws(),a=v.useMemo(()=>vH(r.search,n.current?null:t.current),[r.search]),i=_a(),o=v.useCallback((c,d)=>{const f=V1(typeof c=="function"?c(a):c);n.current=!0,i("?"+f,d)},[i,a]);return[a,o]}function EH(e,t){t===void 0&&(t={});let n=v.useContext(bH);n==null&&jn(!1);let{basename:r}=AH(H1.useViewTransitionState),a=ev(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=lc(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=lc(n.nextLocation.pathname,r)||n.nextLocation.pathname;return en(a.pathname,o)!=null||en(a.pathname,i)!=null}var PH=Symbol.for("react.lazy"),Sh=Im[" use ".trim().toString()];function kH(e){return typeof e=="object"&&e!==null&&"then"in e}function _D(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===PH&&"_payload"in e&&kH(e._payload)}function tv(e){const t=OH(e),n=v.forwardRef((r,a)=>{let{children:i,...o}=r;_D(i)&&typeof Sh=="function"&&(i=Sh(i._payload));const c=v.Children.toArray(i),d=c.find(TH);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}var Gi=tv("Slot");function OH(e){const t=v.forwardRef((n,r)=>{let{children:a,...i}=n;if(_D(a)&&typeof Sh=="function"&&(a=Sh(a._payload)),v.isValidElement(a)){const o=MH(a),c=IH(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Cr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var RH=Symbol("radix.slottable");function TH(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===RH}function IH(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function MH(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 lx=768;function $H(){const[e,t]=v.useState(void 0);return v.useEffect(()=>{const n=window.matchMedia(`(max-width: ${lx-1}px)`),r=()=>{t(window.innerWidth<lx)};return n.addEventListener("change",r),t(window.innerWidth<lx),()=>n.removeEventListener("change",r)},[]),!!e}const aN=qo("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"}}),le=v.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},i)=>{const o=r?Gi:"button";return s.jsx(o,{className:Se(aN({variant:t,size:n,className:e})),ref:i,...a})});le.displayName="Button";const mt=v.forwardRef(({className:e,type:t,...n},r)=>s.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}));mt.displayName="Input";var DH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],LH=DH.reduce((e,t)=>{const n=tv(`Primitive.${t}`),r=v.forwardRef((a,i)=>{const{asChild:o,...c}=a,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),FH="Separator",JE="horizontal",BH=["horizontal","vertical"],ED=v.forwardRef((e,t)=>{const{decorative:n,orientation:r=JE,...a}=e,i=zH(r)?r:JE,c=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return s.jsx(LH.div,{"data-orientation":i,...c,...a,ref:t})});ED.displayName=FH;function zH(e){return BH.includes(e)}var PD=ED;const kD=v.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>s.jsx(PD,{ref:a,decorative:n,orientation:t,className:Se("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));kD.displayName=PD.displayName;var cx="focusScope.autoFocusOnMount",ux="focusScope.autoFocusOnUnmount",ZE={bubbles:!1,cancelable:!0},UH="FocusScope",uf=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[c,d]=v.useState(null),f=Rn(a),h=Rn(i),p=v.useRef(null),y=vt(t,b=>d(b)),g=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let b=function(C){if(g.paused||!c)return;const E=C.target;c.contains(E)?p.current=E:Oi(p.current,{select:!0})},x=function(C){if(g.paused||!c)return;const E=C.relatedTarget;E!==null&&(c.contains(E)||Oi(p.current,{select:!0}))},S=function(C){if(document.activeElement===document.body)for(const _ of C)_.removedNodes.length>0&&Oi(c)};document.addEventListener("focusin",b),document.addEventListener("focusout",x);const N=new MutationObserver(S);return c&&N.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",x),N.disconnect()}}},[r,c,g.paused]),v.useEffect(()=>{if(c){tP.add(g);const b=document.activeElement;if(!c.contains(b)){const S=new CustomEvent(cx,ZE);c.addEventListener(cx,f),c.dispatchEvent(S),S.defaultPrevented||(qH(GH(OD(c)),{select:!0}),document.activeElement===b&&Oi(c))}return()=>{c.removeEventListener(cx,f),setTimeout(()=>{const S=new CustomEvent(ux,ZE);c.addEventListener(ux,h),c.dispatchEvent(S),S.defaultPrevented||Oi(b??document.body,{select:!0}),c.removeEventListener(ux,h),tP.remove(g)},0)}}},[c,f,h,g]);const j=v.useCallback(b=>{if(!n&&!r||g.paused)return;const x=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,S=document.activeElement;if(x&&S){const N=b.currentTarget,[C,E]=WH(N);C&&E?!b.shiftKey&&S===E?(b.preventDefault(),n&&Oi(C,{select:!0})):b.shiftKey&&S===C&&(b.preventDefault(),n&&Oi(E,{select:!0})):S===N&&b.preventDefault()}},[n,r,g.paused]);return s.jsx(Ke.div,{tabIndex:-1,...o,ref:y,onKeyDown:j})});uf.displayName=UH;function qH(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Oi(r,{select:t}),document.activeElement!==n)return}function WH(e){const t=OD(e),n=eP(t,e),r=eP(t.reverse(),e);return[n,r]}function OD(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function eP(e,t){for(const n of e)if(!VH(n,{upTo:t}))return n}function VH(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 HH(e){return e instanceof HTMLInputElement&&"select"in e}function Oi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&HH(e)&&t&&e.select()}}var tP=KH();function KH(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=nP(e,t),e.unshift(t)},remove(t){e=nP(e,t),e[0]?.resume()}}}function nP(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function GH(e){return e.filter(t=>t.tagName!=="A")}var dx=0;function nv(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??rP()),document.body.insertAdjacentElement("beforeend",e[1]??rP()),dx++,()=>{dx===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),dx--}},[])}function rP(){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 ls=function(){return ls=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},ls.apply(this,arguments)};function RD(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function YH(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,i;r<a;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var fh="right-scroll-bar-position",ph="width-before-scroll-bar",XH="with-scroll-bars-hidden",QH="--removed-body-scroll-bar-size";function fx(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function JH(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var ZH=typeof window<"u"?v.useLayoutEffect:v.useEffect,aP=new WeakMap;function eK(e,t){var n=JH(null,function(r){return e.forEach(function(a){return fx(a,r)})});return ZH(function(){var r=aP.get(n);if(r){var a=new Set(r),i=new Set(e),o=n.current;a.forEach(function(c){i.has(c)||fx(c,null)}),i.forEach(function(c){a.has(c)||fx(c,o)})}aP.set(n,e)},[e]),n}function tK(e){return e}function nK(e,t){t===void 0&&(t=tK);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var o=t(i,r);return n.push(o),function(){n=n.filter(function(c){return c!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(c){return i(c)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var c=n;n=[],c.forEach(i),o=n}var d=function(){var h=o;o=[],h.forEach(i)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(h){o.push(h),f()},filter:function(h){return o=o.filter(h),n}}}};return a}function rK(e){e===void 0&&(e={});var t=nK(null);return t.options=ls({async:!0,ssr:!1},e),t}var TD=function(e){var t=e.sideCar,n=RD(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return v.createElement(r,ls({},n))};TD.isSideCarExport=!0;function aK(e,t){return e.useMedium(t),TD}var ID=rK(),px=function(){},rv=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:px,onWheelCapture:px,onTouchMoveCapture:px}),a=r[0],i=r[1],o=e.forwardProps,c=e.children,d=e.className,f=e.removeScrollBar,h=e.enabled,p=e.shards,y=e.sideCar,g=e.noRelative,j=e.noIsolation,b=e.inert,x=e.allowPinchZoom,S=e.as,N=S===void 0?"div":S,C=e.gapMode,E=RD(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=y,k=eK([n,t]),O=ls(ls({},E),a);return v.createElement(v.Fragment,null,h&&v.createElement(_,{sideCar:ID,removeScrollBar:f,shards:p,noRelative:g,noIsolation:j,inert:b,setCallbacks:i,allowPinchZoom:!!x,lockRef:n,gapMode:C}),o?v.cloneElement(v.Children.only(c),ls(ls({},O),{ref:k})):v.createElement(N,ls({},O,{className:d,ref:k}),c))});rv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};rv.classNames={fullWidth:ph,zeroRight:fh};var sK=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function iK(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=sK();return t&&e.setAttribute("nonce",t),e}function oK(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function lK(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var cK=function(){var e=0,t=null;return{add:function(n){e==0&&(t=iK())&&(oK(t,n),lK(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},uK=function(){var e=cK();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},MD=function(){var e=uK(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},dK={left:0,top:0,right:0,gap:0},hx=function(e){return parseInt(e||"",10)||0},fK=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[hx(n),hx(r),hx(a)]},pK=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return dK;var t=fK(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])}},hK=MD(),Ql="data-scroll-locked",mK=function(e,t,n,r){var a=e.left,i=e.top,o=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
10
|
-
.`.concat(XH,` {
|
|
11
|
-
overflow: hidden `).concat(r,`;
|
|
12
|
-
padding-right: `).concat(c,"px ").concat(r,`;
|
|
13
|
-
}
|
|
14
|
-
body[`).concat(Ql,`] {
|
|
15
|
-
overflow: hidden `).concat(r,`;
|
|
16
|
-
overscroll-behavior: contain;
|
|
17
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
18
|
-
padding-left: `.concat(a,`px;
|
|
19
|
-
padding-top: `).concat(i,`px;
|
|
20
|
-
padding-right: `).concat(o,`px;
|
|
21
|
-
margin-left:0;
|
|
22
|
-
margin-top:0;
|
|
23
|
-
margin-right: `).concat(c,"px ").concat(r,`;
|
|
24
|
-
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.`).concat(fh,` {
|
|
28
|
-
right: `).concat(c,"px ").concat(r,`;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.`).concat(ph,` {
|
|
32
|
-
margin-right: `).concat(c,"px ").concat(r,`;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.`).concat(fh," .").concat(fh,` {
|
|
36
|
-
right: 0 `).concat(r,`;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.`).concat(ph," .").concat(ph,` {
|
|
40
|
-
margin-right: 0 `).concat(r,`;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
body[`).concat(Ql,`] {
|
|
44
|
-
`).concat(QH,": ").concat(c,`px;
|
|
45
|
-
}
|
|
46
|
-
`)},sP=function(){var e=parseInt(document.body.getAttribute(Ql)||"0",10);return isFinite(e)?e:0},vK=function(){v.useEffect(function(){return document.body.setAttribute(Ql,(sP()+1).toString()),function(){var e=sP()-1;e<=0?document.body.removeAttribute(Ql):document.body.setAttribute(Ql,e.toString())}},[])},gK=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;vK();var i=v.useMemo(function(){return pK(a)},[a]);return v.createElement(hK,{styles:mK(i,!t,a,n?"":"!important")})},K1=!1;if(typeof window<"u")try{var zp=Object.defineProperty({},"passive",{get:function(){return K1=!0,!0}});window.addEventListener("test",zp,zp),window.removeEventListener("test",zp,zp)}catch{K1=!1}var El=K1?{passive:!1}:!1,yK=function(e){return e.tagName==="TEXTAREA"},$D=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!yK(e)&&n[t]==="visible")},xK=function(e){return $D(e,"overflowY")},bK=function(e){return $D(e,"overflowX")},iP=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=DD(e,r);if(a){var i=LD(e,r),o=i[1],c=i[2];if(o>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},wK=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},jK=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},DD=function(e,t){return e==="v"?xK(t):bK(t)},LD=function(e,t){return e==="v"?wK(t):jK(t)},SK=function(e,t){return e==="h"&&t==="rtl"?-1:1},NK=function(e,t,n,r,a){var i=SK(e,window.getComputedStyle(t).direction),o=i*r,c=n.target,d=t.contains(c),f=!1,h=o>0,p=0,y=0;do{if(!c)break;var g=LD(e,c),j=g[0],b=g[1],x=g[2],S=b-x-i*j;(j||S)&&DD(e,c)&&(p+=S,y+=j);var N=c.parentNode;c=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(h&&Math.abs(p)<1||!h&&Math.abs(y)<1)&&(f=!0),f},Up=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},oP=function(e){return[e.deltaX,e.deltaY]},lP=function(e){return e&&"current"in e?e.current:e},CK=function(e,t){return e[0]===t[0]&&e[1]===t[1]},AK=function(e){return`
|
|
47
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
48
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
49
|
-
`)},_K=0,Pl=[];function EK(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),a=v.useState(_K++)[0],i=v.useState(MD)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var b=YH([e.lockRef.current],(e.shards||[]).map(lP),!0).filter(Boolean);return b.forEach(function(x){return x.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),b.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var c=v.useCallback(function(b,x){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!o.current.allowPinchZoom;var S=Up(b),N=n.current,C="deltaX"in b?b.deltaX:N[0]-S[0],E="deltaY"in b?b.deltaY:N[1]-S[1],_,k=b.target,O=Math.abs(C)>Math.abs(E)?"h":"v";if("touches"in b&&O==="h"&&k.type==="range")return!1;var R=window.getSelection(),T=R&&R.anchorNode,F=T?T===k||T.contains(k):!1;if(F)return!1;var L=iP(O,k);if(!L)return!0;if(L?_=O:(_=O==="v"?"h":"v",L=iP(O,k)),!L)return!1;if(!r.current&&"changedTouches"in b&&(C||E)&&(r.current=_),!_)return!0;var $=r.current||_;return NK($,x,b,$==="h"?C:E)},[]),d=v.useCallback(function(b){var x=b;if(!(!Pl.length||Pl[Pl.length-1]!==i)){var S="deltaY"in x?oP(x):Up(x),N=t.current.filter(function(_){return _.name===x.type&&(_.target===x.target||x.target===_.shadowParent)&&CK(_.delta,S)})[0];if(N&&N.should){x.cancelable&&x.preventDefault();return}if(!N){var C=(o.current.shards||[]).map(lP).filter(Boolean).filter(function(_){return _.contains(x.target)}),E=C.length>0?c(x,C[0]):!o.current.noIsolation;E&&x.cancelable&&x.preventDefault()}}},[]),f=v.useCallback(function(b,x,S,N){var C={name:b,delta:x,target:S,should:N,shadowParent:PK(S)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(E){return E!==C})},1)},[]),h=v.useCallback(function(b){n.current=Up(b),r.current=void 0},[]),p=v.useCallback(function(b){f(b.type,oP(b),b.target,c(b,e.lockRef.current))},[]),y=v.useCallback(function(b){f(b.type,Up(b),b.target,c(b,e.lockRef.current))},[]);v.useEffect(function(){return Pl.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:y}),document.addEventListener("wheel",d,El),document.addEventListener("touchmove",d,El),document.addEventListener("touchstart",h,El),function(){Pl=Pl.filter(function(b){return b!==i}),document.removeEventListener("wheel",d,El),document.removeEventListener("touchmove",d,El),document.removeEventListener("touchstart",h,El)}},[]);var g=e.removeScrollBar,j=e.inert;return v.createElement(v.Fragment,null,j?v.createElement(i,{styles:AK(a)}):null,g?v.createElement(gK,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function PK(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const kK=aK(ID,EK);var df=v.forwardRef(function(e,t){return v.createElement(rv,ls({},e,{ref:t,sideCar:kK}))});df.classNames=rv.classNames;var OK=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},kl=new WeakMap,qp=new WeakMap,Wp={},mx=0,FD=function(e){return e&&(e.host||FD(e.parentNode))},RK=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=FD(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})},TK=function(e,t,n,r){var a=RK(t,Array.isArray(e)?e:[e]);Wp[n]||(Wp[n]=new WeakMap);var i=Wp[n],o=[],c=new Set,d=new Set(a),f=function(p){!p||c.has(p)||(c.add(p),f(p.parentNode))};a.forEach(f);var h=function(p){!p||d.has(p)||Array.prototype.forEach.call(p.children,function(y){if(c.has(y))h(y);else try{var g=y.getAttribute(r),j=g!==null&&g!=="false",b=(kl.get(y)||0)+1,x=(i.get(y)||0)+1;kl.set(y,b),i.set(y,x),o.push(y),b===1&&j&&qp.set(y,!0),x===1&&y.setAttribute(n,"true"),j||y.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",y,S)}})};return h(t),c.clear(),mx++,function(){o.forEach(function(p){var y=kl.get(p)-1,g=i.get(p)-1;kl.set(p,y),i.set(p,g),y||(qp.has(p)||p.removeAttribute(r),qp.delete(p)),g||p.removeAttribute(n)}),mx--,mx||(kl=new WeakMap,kl=new WeakMap,qp=new WeakMap,Wp={})}},av=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=OK(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),TK(r,a,n,"aria-hidden")):function(){return null}};function IK(e){const t=MK(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(DK);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function MK(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=FK(a),c=LK(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Cr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $K=Symbol("radix.slottable");function DK(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$K}function LK(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function FK(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 sv="Dialog",[BD,zD]=lr(sv),[BK,Ha]=BD(sv),UD=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!0}=e,c=v.useRef(null),d=v.useRef(null),[f,h]=ia({prop:r,defaultProp:a??!1,onChange:i,caller:sv});return s.jsx(BK,{scope:t,triggerRef:c,contentRef:d,contentId:Vn(),titleId:Vn(),descriptionId:Vn(),open:f,onOpenChange:h,onOpenToggle:v.useCallback(()=>h(p=>!p),[h]),modal:o,children:n})};UD.displayName=sv;var qD="DialogTrigger",WD=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ha(qD,n),i=vt(t,a.triggerRef);return s.jsx(Ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":oN(a.open),...r,ref:i,onClick:ke(e.onClick,a.onOpenToggle)})});WD.displayName=qD;var sN="DialogPortal",[zK,VD]=BD(sN,{forceMount:void 0}),HD=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=Ha(sN,t);return s.jsx(zK,{scope:t,forceMount:n,children:v.Children.map(r,o=>s.jsx(Kn,{present:n||i.open,children:s.jsx(Dc,{asChild:!0,container:a,children:o})}))})};HD.displayName=sN;var Nh="DialogOverlay",KD=v.forwardRef((e,t)=>{const n=VD(Nh,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Ha(Nh,e.__scopeDialog);return i.modal?s.jsx(Kn,{present:r||i.open,children:s.jsx(qK,{...a,ref:t})}):null});KD.displayName=Nh;var UK=IK("DialogOverlay.RemoveScroll"),qK=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ha(Nh,n);return s.jsx(df,{as:UK,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(Ke.div,{"data-state":oN(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ro="DialogContent",GD=v.forwardRef((e,t)=>{const n=VD(Ro,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Ha(Ro,e.__scopeDialog);return s.jsx(Kn,{present:r||i.open,children:i.modal?s.jsx(WK,{...a,ref:t}):s.jsx(VK,{...a,ref:t})})});GD.displayName=Ro;var WK=v.forwardRef((e,t)=>{const n=Ha(Ro,e.__scopeDialog),r=v.useRef(null),a=vt(t,n.contentRef,r);return v.useEffect(()=>{const i=r.current;if(i)return av(i)},[]),s.jsx(YD,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ke(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ke(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0;(o.button===2||c)&&i.preventDefault()}),onFocusOutside:ke(e.onFocusOutside,i=>i.preventDefault())})}),VK=v.forwardRef((e,t)=>{const n=Ha(Ro,e.__scopeDialog),r=v.useRef(!1),a=v.useRef(!1);return s.jsx(YD,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;n.triggerRef.current?.contains(o)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),YD=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,c=Ha(Ro,n),d=v.useRef(null),f=vt(t,d);return nv(),s.jsxs(s.Fragment,{children:[s.jsx(uf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(Uo,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":oN(c.open),...o,ref:f,onDismiss:()=>c.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(KK,{titleId:c.titleId}),s.jsx(YK,{contentRef:d,descriptionId:c.descriptionId})]})]})}),iN="DialogTitle",XD=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ha(iN,n);return s.jsx(Ke.h2,{id:a.titleId,...r,ref:t})});XD.displayName=iN;var QD="DialogDescription",JD=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ha(QD,n);return s.jsx(Ke.p,{id:a.descriptionId,...r,ref:t})});JD.displayName=QD;var ZD="DialogClose",e3=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ha(ZD,n);return s.jsx(Ke.button,{type:"button",...r,ref:t,onClick:ke(e.onClick,()=>a.onOpenChange(!1))})});e3.displayName=ZD;function oN(e){return e?"open":"closed"}var t3="DialogTitleWarning",[HK,n3]=$U(t3,{contentName:Ro,titleName:iN,docsSlug:"dialog"}),KK=({titleId:e})=>{const t=n3(t3),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
50
|
-
|
|
51
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
52
|
-
|
|
53
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},GK="DialogDescriptionWarning",YK=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${n3(GK).contentName}}.`;return v.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},iv=UD,XK=WD,ov=HD,qc=KD,Wc=GD,ff=XD,pf=JD,lv=e3;const r3=iv,QK=ov,a3=v.forwardRef(({className:e,...t},n)=>s.jsx(qc,{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}));a3.displayName=qc.displayName;const JK=qo("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"}}),lN=v.forwardRef(({side:e="right",className:t,children:n,...r},a)=>s.jsxs(QK,{children:[s.jsx(a3,{}),s.jsxs(Wc,{ref:a,className:Se(JK({side:e}),t),...r,children:[n,s.jsxs(lv,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[s.jsx(Ys,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));lN.displayName=Wc.displayName;const s3=({className:e,...t})=>s.jsx("div",{className:Se("flex flex-col space-y-2 text-center sm:text-left",e),...t});s3.displayName="SheetHeader";const i3=v.forwardRef(({className:e,...t},n)=>s.jsx(ff,{ref:n,className:Se("text-lg font-semibold text-foreground",e),...t}));i3.displayName=ff.displayName;const ZK=v.forwardRef(({className:e,...t},n)=>s.jsx(pf,{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));ZK.displayName=pf.displayName;function cP({className:e,...t}){return s.jsx("div",{className:Se("animate-pulse rounded-md bg-muted",e),...t})}const eG="sidebar:state",tG=3600*24*7,nG="16rem",rG="18rem",aG="3rem",sG="b",o3=v.createContext(null);function hf(){const e=v.useContext(o3);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const l3=v.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:i,...o},c)=>{const d=$H(),[f,h]=v.useState(!1),[p,y]=v.useState(e),g=t??p,j=v.useCallback(N=>{const C=typeof N=="function"?N(g):N;n?n(C):y(C),document.cookie=`${eG}=${C}; path=/; max-age=${tG}`},[n,g]),b=v.useCallback(()=>d?h(N=>!N):j(N=>!N),[d,j,h]);v.useEffect(()=>{const N=C=>{C.key===sG&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),b())};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[b]);const x=g?"expanded":"collapsed",S=v.useMemo(()=>({state:x,open:g,setOpen:j,isMobile:d,openMobile:f,setOpenMobile:h,toggleSidebar:b}),[x,g,j,d,f,h,b]);return s.jsx(o3.Provider,{value:S,children:s.jsx(oD,{delayDuration:0,children:s.jsx("div",{style:{"--sidebar-width":nG,"--sidebar-width-icon":aG,...a},className:Se("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:c,...o,children:i})})})});l3.displayName="SidebarProvider";const c3=v.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:a,...i},o)=>{const{isMobile:c,state:d,openMobile:f,setOpenMobile:h}=hf();return n==="none"?s.jsx("div",{className:Se("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",r),ref:o,...i,children:a}):c?s.jsx(r3,{open:f,onOpenChange:h,...i,children:s.jsx(lN,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":rG},side:e,children:s.jsx("div",{className:"flex h-full w-full flex-col",children:a})})}):s.jsxs("div",{ref:o,className:"group peer hidden text-sidebar-foreground md:block","data-state":d,"data-collapsible":d==="collapsed"?n:"","data-variant":t,"data-side":e,children:[s.jsx("div",{className: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]")}),s.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:s.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:a})})]})});c3.displayName="Sidebar";const u3=v.forwardRef(({className:e,onClick:t,...n},r)=>{const{toggleSidebar:a}=hf();return s.jsxs(le,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:Se("h-7 w-7",e),onClick:i=>{t?.(i),a()},...n,children:[s.jsx(U7,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});u3.displayName="SidebarTrigger";const iG=v.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=hf();return s.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})});iG.displayName="SidebarRail";const oG=v.forwardRef(({className:e,...t},n)=>s.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}));oG.displayName="SidebarInset";const lG=v.forwardRef(({className:e,...t},n)=>s.jsx(mt,{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}));lG.displayName="SidebarInput";const d3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"header",className:Se("flex flex-col gap-2 p-2",e),...t}));d3.displayName="SidebarHeader";const f3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"footer",className:Se("flex flex-col gap-2 p-2",e),...t}));f3.displayName="SidebarFooter";const G1=v.forwardRef(({className:e,...t},n)=>s.jsx(kD,{ref:n,"data-sidebar":"separator",className:Se("mx-2 w-auto bg-sidebar-border",e),...t}));G1.displayName="SidebarSeparator";const p3=v.forwardRef(({className:e,...t},n)=>s.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}));p3.displayName="SidebarContent";const h3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"group",className:Se("relative flex w-full min-w-0 flex-col p-2",e),...t}));h3.displayName="SidebarGroup";const m3=v.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const a=t?Gi:"div";return s.jsx(a,{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})});m3.displayName="SidebarGroupLabel";const cG=v.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const a=t?Gi:"button";return s.jsx(a,{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})});cG.displayName="SidebarGroupAction";const v3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"group-content",className:Se("w-full text-sm",e),...t}));v3.displayName="SidebarGroupContent";const g3=v.forwardRef(({className:e,...t},n)=>s.jsx("ul",{ref:n,"data-sidebar":"menu",className:Se("flex w-full min-w-0 flex-col gap-1",e),...t}));g3.displayName="SidebarMenu";const y3=v.forwardRef(({className:e,...t},n)=>s.jsx("li",{ref:n,"data-sidebar":"menu-item",className:Se("group/menu-item relative",e),...t}));y3.displayName="SidebarMenuItem";const uG=qo("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"}}),x3=v.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:a,className:i,...o},c)=>{const d=e?Gi:"button",{isMobile:f,state:h}=hf(),p=s.jsx(d,{ref:c,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:Se(uG({variant:n,size:r}),i),...o});return a?(typeof a=="string"&&(a={children:a}),s.jsxs(lD,{children:[s.jsx(cD,{asChild:!0,children:p}),s.jsx(JS,{side:"right",align:"center",hidden:h!=="collapsed"||f,...a})]})):p});x3.displayName="SidebarMenuButton";const dG=v.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},a)=>{const i=t?Gi:"button";return s.jsx(i,{ref:a,"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})});dG.displayName="SidebarMenuAction";const fG=v.forwardRef(({className:e,...t},n)=>s.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}));fG.displayName="SidebarMenuBadge";const pG=v.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{const a=v.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return s.jsxs("div",{ref:r,"data-sidebar":"menu-skeleton",className:Se("flex h-8 items-center gap-2 rounded-md px-2",e),...n,children:[t&&s.jsx(cP,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),s.jsx(cP,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":a}})]})});pG.displayName="SidebarMenuSkeleton";const hG=v.forwardRef(({className:e,...t},n)=>s.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}));hG.displayName="SidebarMenuSub";const mG=v.forwardRef(({...e},t)=>s.jsx("li",{ref:t,...e}));mG.displayName="SidebarMenuSubItem";const vG=v.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...a},i)=>{const o=e?Gi:"a";return s.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),...a})});vG.displayName="SidebarMenuSubButton";const b3=v.forwardRef(({className:e,activeClassName:t,pendingClassName:n,to:r,...a},i)=>s.jsx(CH,{ref:i,to:r,className:({isActive:o,isPending:c})=>Se(e,o&&t,c&&n),...a}));b3.displayName="NavLink";function gG({width:e=24,height:t=24,from:n="#53afba",to:r="#76fffb",...a}){const i=`grad-${v.useId().slice(1)}`;return s.jsxs("svg",{className:"inline-block",width:e,height:t,viewBox:"0 0 1648 1648",xmlns:"http://www.w3.org/2000/svg",...a,children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:i,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[s.jsx("stop",{offset:"0%",style:{stopColor:n}}),s.jsx("stop",{offset:"100%",style:{stopColor:r}})]})}),s.jsx("path",{d:"m610 216.654c-66.158 4.092-126.119 35.849-164.917 87.346-8.408 11.16-13.344 19.191-19.983 32.513-12.431 24.946-19.521 50.434-22.11 79.487-1.665 18.687-.854 826.238.841 837.939 7.867 54.284 32.465 101.134 70.706 134.667 16.297 14.291 32.283 24.657 53.963 34.991 16.889 8.05 34.568 13.468 60.5 18.541 9.019 1.764 52.201 1.795 61.5.044 26.487-4.989 43.97-10.341 61-18.675 15.131-7.406 21.53-11.135 60.5-35.267 20.813-12.887 23.095-14.298 29.5-18.24l13-8 13-8c6.901-4.247 12.593-7.767 29.54-18.271 5.796-3.593 12.771-7.863 15.5-9.49 2.728-1.626 8.56-5.19 12.96-7.921 4.4-2.73 72.575-44.711 151.5-93.29s150.925-92.918 160-98.531c9.075-5.612 24.15-14.936 33.5-20.719s23.075-14.234 30.5-18.78c85.169-52.142 120.029-73.942 130.014-81.304 40.974-30.211 68.344-69.764 81.788-118.194 13.864-49.94 8.549-104.847-14.809-153-16.836-34.708-41.252-62.432-74.993-85.154-4.125-2.778-17.625-11.26-30-18.849s-27-16.594-32.5-20.009c-5.5-3.416-109.45-67.427-231-142.246-306.386-188.593-335.221-206.352-350-215.553-30.562-19.028-59.301-29.911-90-34.083-11.697-1.59-30.408-2.514-39.5-1.952m-10.5 77.269c-39.541 6.402-76.013 29.73-97.661 62.467-13.001 19.66-19.718 38.39-22.802 63.584-1.472 12.028-1.434 802.191.04 818.026 1.861 19.998 6.142 35.48 14.415 52.133 17.942 36.114 53.025 64.18 91.508 73.203 3.575.839 8.975 2.118 12 2.844 8.221 1.973 40.343 1.613 49.971-.56 32.301-7.289 65.233-26.686 94.817-55.849 15.26-15.042 22.884-24.803 33.571-42.979 13.939-23.706 20.949-43.36 27.745-77.792 1.004-5.086 1.428-50 1.949-206.5.465-139.686 1.001-201.809 1.777-206 .611-3.3 1.608-9.15 2.217-13 1.672-10.583 4.039-21.117 7.191-32 8.179-28.247 20.714-55.13 37.188-79.751 24.262-36.262 53.189-63.572 93.074-87.872 4.95-3.016 12.825-7.435 17.5-9.82s8.95-4.668 9.5-5.074c3.565-2.63 34.688-13.266 52.465-17.93 6.2-1.627 11.49-3.174 11.754-3.439 1.003-1.002-1.016-2.602-10.967-8.689-5.639-3.449-16.552-10.172-24.252-14.94-13.435-8.319-31.76-19.604-58.5-36.029-6.875-4.222-16.1-9.911-20.5-12.641-7.667-4.758-73.088-45.103-122.5-75.546-75.227-46.348-108.509-66.591-116.5-70.86-9.422-5.033-25.23-10.76-37.043-13.419-7.967-1.794-40.076-2.843-47.957-1.567m473.5 305.564c-5.775.685-11.625 1.491-13 1.792-1.375.3-5.2 1.088-8.5 1.749-7.914 1.587-27.103 7.461-36.5 11.174-38.797 15.33-75.171 44.925-98.829 80.41-11.24 16.86-21.329 38.407-26.167 55.888-2.443 8.825-3.85 14.608-4.866 20-.621 3.3-1.653 8.475-2.292 11.5-.846 4.008-1.345 59.624-1.837 205-.618 182.331-.824 200.361-2.399 209.5-1.629 9.459-4.196 22.506-6.744 34.279-.628 2.903-.881 5.54-.561 5.859.596.596 455.986-279.084 472.195-290.001 17.547-11.819 36.335-33.412 46.291-53.203 3.956-7.863 9.527-23.924 11.597-33.434 4.848-22.272 3.572-48.26-3.506-71.387-6.907-22.572-18.055-40.93-35.316-58.158-12.705-12.681-16.829-15.485-79.066-53.756-7.15-4.397-15.7-9.654-19-11.684-3.3-2.029-8.925-5.504-12.5-7.722-53.826-33.397-67.199-40.611-88.616-47.8-29.343-9.85-61.599-13.421-90.384-10.006m-1066.25 1048.256c3.988.189 10.513.189 14.5 0 3.988-.19.725-.346-7.25-.346s-11.238.156-7.25.346",fill:`url(#${i})`,fillRule:"evenodd"})]})}const yG=[{title:"Home",items:[{title:"Dashboard",url:"/",icon:m$}]},{title:"Lab",items:[{title:"MCP Evaluations",url:"/mcp-evaluations",icon:h$},{title:"Analyze MCP",url:"/tool-analysis",icon:v$}]},{title:"Libraries",items:[{title:"Test Cases",url:"/libraries/test-cases",icon:p$},{title:"Servers",url:"/libraries/servers",icon:f$},{title:"Agents",url:"/libraries/agents",icon:ba}]},{title:"Execution",items:[{title:"Run Evaluation",url:"/run",icon:Gl},{title:"Evaluation Results",url:"/results",icon:fd},{title:"Compare Evaluations",url:"/compare",icon:LS},{title:"MCP Analysis Results",url:"/tool-analysis-results",icon:g$},{title:"Custom Reports",url:"/markdown-reports",icon:Bl}]},{title:"Workspace",items:[{title:"Settings",url:"/settings",icon:BS}]}];function xG(e={version:null}){const t=e.version??null,{state:n}=hf(),r=n==="collapsed",a=ws(),i=v.useMemo(()=>yG,[]);return s.jsxs(c3,{collapsible:"icon",children:[s.jsx(d3,{className:`border-b border-sidebar-border py-3 ${r?"px-2":"px-4"}`,children:s.jsxs("div",{className:`flex items-center ${r?"justify-center":"gap-2.5"} overflow-hidden`,children:[s.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-sidebar-accent/50 border border-primary/60",children:s.jsx(gG,{width:22,height:22,from:"#f97316",to:"#fb923c"})}),!r&&s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{className:"text-sm font-semibold text-sidebar-foreground",children:"MCPLab"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"MCP Evaluation Lab"})]})]})}),s.jsx(p3,{children:i.map((o,c)=>s.jsxs("div",{children:[c>0&&!r&&s.jsx(G1,{className:"my-1.5"}),s.jsxs(h3,{className:r?"px-2":"px-3 py-2",children:[!r&&s.jsx(m3,{className:"px-1 pb-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground/90",children:o.title}),s.jsx(v3,{children:s.jsx(g3,{children:o.items.map(d=>s.jsx(y3,{children:s.jsx(x3,{asChild:!0,isActive:d.url==="/"?a.pathname==="/":a.pathname.startsWith(d.url),tooltip:d.title,children:s.jsxs(b3,{to:d.url,end:d.url==="/",activeClassName:"bg-sidebar-accent text-sidebar-accent-foreground",children:[s.jsx(d.icon,{className:"h-4 w-4"}),s.jsx("span",{children:d.title})]})})},d.title))})})]})]},o.title))}),s.jsxs(f3,{className:r?"px-2 py-2":"px-3 py-3",children:[s.jsx(G1,{className:"my-1.5"}),s.jsxs("div",{className:`flex ${r?"justify-center":"items-center justify-center gap-2"} w-full`,children:[s.jsxs("a",{href:"https://github.com/inspectr-hq/mcplab",target:"_blank",rel:"noreferrer",className:`inline-flex items-center rounded-md border border-sidebar-border/70 bg-sidebar-accent/20 text-sidebar-foreground/85 transition-colors hover:bg-sidebar-accent/35 hover:text-sidebar-foreground ${r?"justify-center p-2":"gap-2 px-2.5 py-1.5"}`,title:`GitHub${t?` · v${t}`:""}`,"aria-label":"GitHub repository",children:[s.jsx(F7,{className:"h-4 w-4 shrink-0"}),!r&&s.jsx("span",{className:"text-xs text-sidebar-foreground/85",children:`v${t??"unknown"}`})]}),!r&&s.jsxs("a",{href:"https://inspectr.dev",target:"_blank",rel:"noreferrer",className:"text-xs text-muted-foreground transition-colors hover:text-sidebar-foreground",children:["Built by ",s.jsx("span",{className:"text-[#00e5ff] hover:text-[#00b8d4]",children:"Inspectr"})]})]})]})]})}const w3=v.forwardRef(({...e},t)=>s.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));w3.displayName="Breadcrumb";const j3=v.forwardRef(({className:e,...t},n)=>s.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}));j3.displayName="BreadcrumbList";const S3=v.forwardRef(({className:e,...t},n)=>s.jsx("li",{ref:n,className:Se("inline-flex items-center gap-1.5",e),...t}));S3.displayName="BreadcrumbItem";const N3=v.forwardRef(({asChild:e,className:t,...n},r)=>{const a=e?Gi:"a";return s.jsx(a,{ref:r,className:Se("transition-colors hover:text-foreground",t),...n})});N3.displayName="BreadcrumbLink";const C3=v.forwardRef(({className:e,...t},n)=>s.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:Se("font-normal text-foreground",e),...t}));C3.displayName="BreadcrumbPage";const A3=({children:e,className:t,...n})=>s.jsx("li",{role:"presentation","aria-hidden":"true",className:Se("[&>svg]:size-3.5",t),...n,children:e??s.jsx(d$,{})});A3.displayName="BreadcrumbSeparator";function Fs(){return{input:0,output:0,total:0,hasInput:!1,hasOutput:!1,hasTotal:!1}}function Ml(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 Bs(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 bG(e){const t=Fs();for(const n of e)Ml(t,n);return Bs(t)}function wG(e,t){return`${e}-${t+1}`}function $l(e){const t=typeof e.config.name=="string"&&e.config.name.trim().length>0?e.config.name.trim():void 0,n=Array.isArray(e.config.servers)?e.config.servers:[],r=Array.isArray(e.config.agents)?e.config.agents:[],a=new Map,i=[],o=[];for(const p of n){if("ref"in p){const x=String(p.ref||"").trim();if(!x)continue;a.set(x,x),o.push({kind:"referenced",ref:x});continue}const y=String(p.id||p.name||"").trim();if(!y)continue;const g=y;a.set(y,g);const j=p.auth?.type==="bearer"?"bearer":p.auth?.type==="api_key"||p.auth?.type==="oauth_client_credentials"?"api-key":p.auth?.type==="oauth_authorization_code"?"oauth2":"none",b={id:g,name:String(p.name||y),transport:"streamable-http",url:p.url,authType:j,authValue:p.auth?.type==="bearer"?p.auth.token??(p.auth.env?`\${${p.auth.env}}`:void 0):p.auth?.type==="api_key"?p.auth.value:void 0,apiKeyHeaderName:p.auth?.type==="api_key"?p.auth.header_name:void 0,oauthClientId:p.auth?.type==="oauth_authorization_code"?p.auth.client_id:void 0,oauthClientSecret:p.auth?.type==="oauth_authorization_code"?p.auth.client_secret:void 0,oauthRedirectUrl:p.auth?.type==="oauth_authorization_code"?p.auth.redirect_url:void 0,oauthScope:p.auth?.type==="oauth_authorization_code"||p.auth?.type==="oauth_client_credentials"?p.auth.scope:void 0,oauthTokenUrl:p.auth?.type==="oauth_client_credentials"?p.auth.token_url:void 0,oauthClientIdEnv:p.auth?.type==="oauth_client_credentials"?p.auth.client_id_env:void 0,oauthClientSecretEnv:p.auth?.type==="oauth_client_credentials"?p.auth.client_secret_env:void 0,oauthAudience:p.auth?.type==="oauth_client_credentials"?p.auth.audience:void 0};i.push(b),o.push({kind:"inline",server:b})}const c=[],d=[];for(const p of r){if("ref"in p){const x=String(p.ref||"").trim();if(!x)continue;d.push({kind:"referenced",ref:x});continue}const y=String(p.id||p.name||"").trim();if(!y)continue;const g=y,j=p.provider==="azure_openai"?"azure":p.provider,b={id:g,name:String(p.name||y),provider:j,model:p.model,temperature:p.temperature??0,maxTokens:p.max_tokens??2048,maxTurns:p.max_turns,systemPrompt:p.system};c.push(b),d.push({kind:"inline",agent:b})}const f=[],h=[];return e.config.scenarios.forEach((p,y)=>{if("ref"in p){const b=String(p.ref||"").trim();if(!b)return;h.push({kind:"referenced",ref:b});return}const g=[];for(const b of p.eval?.tool_constraints?.required_tools??[])g.push({type:"required_tool",value:b});for(const b of p.eval?.tool_constraints?.forbidden_tools??[])g.push({type:"forbidden_tool",value:b});for(const b of p.eval?.response_assertions??[])b.type==="regex"?g.push({type:"response_contains",value:b.pattern}):g.push({type:"response_contains",value:`${b.path}${b.equals!==void 0?` == ${b.equals}`:""}`});const j={id:p.id||wG("scn",y),name:p.name||p.id||`Scenario ${y+1}`,serverIds:(()=>{if((p.servers??[]).length>0)return p.servers.map(x=>a.get(x)??x).filter(Boolean);const b=p.mcp_servers;return Array.isArray(b)?b.flatMap(x=>{if("ref"in x&&x.ref)return[String(x.ref)];if("id"in x&&x.id){const S=String(x.id);if(!a.has(S)){a.set(S,S);const N=x.auth,C=N?.type==="bearer"?"bearer":N?.type==="api_key"||N?.type==="oauth_client_credentials"?"api-key":N?.type==="oauth_authorization_code"?"oauth2":"none";i.push({id:S,name:String(x.name||S),transport:"streamable-http",url:String(x.url||""),authType:C,authValue:N?.type==="bearer"?String(N.token||"")||(N.env?`\${${N.env}}`:void 0):N?.type==="api_key"?String(N.value||""):void 0,apiKeyHeaderName:N?.type==="api_key"?String(N.header_name||""):void 0,oauthClientId:N?.type==="oauth_authorization_code"?String(N.client_id||""):void 0,oauthClientSecret:N?.type==="oauth_authorization_code"?String(N.client_secret||""):void 0,oauthRedirectUrl:N?.type==="oauth_authorization_code"?String(N.redirect_url||""):void 0,oauthScope:(N?.type==="oauth_authorization_code"||N?.type==="oauth_client_credentials")&&String(N.scope||"")||void 0,oauthTokenUrl:N?.type==="oauth_client_credentials"?String(N.token_url||""):void 0,oauthClientIdEnv:N?.type==="oauth_client_credentials"?String(N.client_id_env||""):void 0,oauthClientSecretEnv:N?.type==="oauth_client_credentials"?String(N.client_secret_env||""):void 0,oauthAudience:N?.type==="oauth_client_credentials"&&String(N.audience||"")||void 0}),o.push({kind:"inline",server:i[i.length-1]})}return[S]}return[]}):[]})(),prompt:p.prompt,snapshotEval:p.snapshot_eval?{enabled:p.snapshot_eval.enabled,baselineSnapshotId:p.snapshot_eval.baseline_snapshot_id,baselineSourceRunId:p.snapshot_eval.baseline_source_run_id,lastUpdatedAt:p.snapshot_eval.last_updated_at}:void 0,evalRules:g,extractRules:(p.extract??[]).map(b=>({name:b.name,pattern:b.regex}))};f.push(j),h.push({kind:"inline",scenario:j})}),{id:e.id,name:t||e.name,configName:t,description:e.path,loadError:e.error,loadWarnings:e.warnings,servers:i,serverEntries:o,agents:c,agentEntries:d,scenarios:f,scenarioEntries:h,runDefaults:e.config.run_defaults?.selected_agents&&e.config.run_defaults.selected_agents.length>0?{selectedAgentNames:[...e.config.run_defaults.selected_agents]}:void 0,snapshotEval:e.config.snapshot_eval?{enabled:e.config.snapshot_eval.enabled,mode:e.config.snapshot_eval.mode,baselineSnapshotId:e.config.snapshot_eval.baseline_snapshot_id,baselineSourceRunId:e.config.snapshot_eval.baseline_source_run_id,lastUpdatedAt:e.config.snapshot_eval.last_updated_at}:void 0,createdAt:e.mtime,updatedAt:e.mtime,sourcePath:e.path}}function jG(e){const t={id:"library",name:"library",path:"library",mtime:new Date(0).toISOString(),config:{servers:Object.entries(e.servers).map(([r,a])=>({id:r,name:a.name||r,transport:a.transport,url:a.url,auth:a.auth})),agents:Object.entries(e.agents).map(([r,a])=>({id:r,name:a.name||r,provider:a.provider,model:a.model,temperature:a.temperature,max_tokens:a.max_tokens,max_turns:a.max_turns,system:a.system})),scenarios:e.scenarios}},n=$l(t);return{servers:n.servers,agents:n.agents,scenarios:n.scenarios}}function uP(e){const t=new Map,n=g=>{const j=g.id,b=g.authValue?.trim()??"",x=g.apiKeyHeaderName?.trim()??"",S=g.authType==="bearer"?(()=>{if(!b)throw new Error(`Server '${j}' is missing bearer token value`);return{type:"bearer",token:b}})():g.authType==="api-key"&&!g.oauthTokenUrl?{type:"api_key",...x?{header_name:x}:{},value:(()=>{if(!b)throw new Error(`Server '${j}' is missing API key value`);return b})()}:g.authType==="api-key"?{type:"oauth_client_credentials",token_url:g.oauthTokenUrl||"",client_id_env:g.oauthClientIdEnv||"",client_secret_env:g.oauthClientSecretEnv||"",...g.oauthScope?{scope:g.oauthScope}:{},...g.oauthAudience?{audience:g.oauthAudience}:{}}:g.authType==="oauth2"?{type:"oauth_authorization_code",client_id:g.oauthClientId||"",client_secret:g.oauthClientSecret||void 0,redirect_url:g.oauthRedirectUrl||"http://localhost:6274/oauth/",scope:g.oauthScope||void 0}:void 0;return{id:j,...g.name&&g.name!==j?{name:g.name}:{},transport:"http",url:g.url||"http://localhost:3000/mcp",...S!==void 0?{auth:S}:{}}},r=e.serverEntries&&e.serverEntries.length>0?e.serverEntries:[...e.servers.map(g=>({kind:"inline",server:g}))],a=new Set,i=new Map,o=r.flatMap(g=>{if(g.kind==="referenced"){const b=String(g.ref||"").trim();return!b||a.has(b)?[]:(a.add(b),t.set(b,b),[{ref:b}])}const j=n(g.server);return t.set(g.server.id,j.id),i.set(j.id,j),[j]}),c=g=>{const j=g.id;return{id:j,...g.name&&g.name!==j?{name:g.name}:{},provider:g.provider==="azure"?"azure_openai":g.provider==="anthropic"?"anthropic":"openai",model:g.model,temperature:g.temperature,max_tokens:g.maxTokens,max_turns:g.maxTurns,system:g.systemPrompt}},d=e.agentEntries&&e.agentEntries.length>0?e.agentEntries:[...e.agents.map(g=>({kind:"inline",agent:g}))],f=new Set,h=d.flatMap(g=>{if(g.kind==="referenced"){const j=String(g.ref||"").trim();return!j||f.has(j)?[]:(f.add(j),[{ref:j}])}return[c(g.agent)]}),p=g=>{const j=g.evalRules.filter(S=>S.type==="required_tool").map(S=>S.value),b=g.evalRules.filter(S=>S.type==="forbidden_tool").map(S=>S.value),x=g.evalRules.filter(S=>S.type==="response_contains"||S.type==="response_not_contains").map(S=>({type:"regex",pattern:S.value}));return{id:g.id,name:g.name||void 0,mcp_servers:g.serverIds.length>0?g.serverIds.map(S=>{const N=t.get(S)??S;return i.get(N)??{ref:N}}):void 0,prompt:g.prompt,...g.snapshotEval?{snapshot_eval:{enabled:g.snapshotEval.enabled,baseline_snapshot_id:g.snapshotEval.baselineSnapshotId,baseline_source_run_id:g.snapshotEval.baselineSourceRunId,last_updated_at:g.snapshotEval.lastUpdatedAt}}:{},eval:{tool_constraints:{required_tools:j,forbidden_tools:b},response_assertions:x},extract:g.extractRules.map(S=>({name:S.name,from:"final_text",regex:S.pattern}))}},y=e.scenarioEntries&&e.scenarioEntries.length>0?e.scenarioEntries.map(g=>g.kind==="referenced"?{ref:g.ref}:p(g.scenario)):[...e.scenarios.map(g=>p(g))];return{name:e.configName?.trim()||void 0,servers:o,agents:h,scenarios:y,run_defaults:e.runDefaults?.selectedAgentNames&&e.runDefaults.selectedAgentNames.length>0?{selected_agents:[...e.runDefaults.selectedAgentNames]}:void 0,snapshot_eval:e.snapshotEval?{enabled:e.snapshotEval.enabled,mode:e.snapshotEval.mode,baseline_snapshot_id:e.snapshotEval.baselineSnapshotId,baseline_source_run_id:e.snapshotEval.baselineSourceRunId,last_updated_at:e.snapshotEval.lastUpdatedAt}:void 0}}function SG(e){const t=Object.fromEntries((e.servers??[]).map(r=>[r.id,(()=>{const a=r.authValue?.trim()??"",i=r.apiKeyHeaderName?.trim()??"";return{...r.name&&r.name!==r.id?{name:r.name}:{},transport:"http",url:r.url||"http://localhost:3000/mcp",auth:r.authType==="bearer"?(()=>{if(!a)throw new Error(`Server '${r.id}' is missing bearer token value`);return{type:"bearer",token:a}})():r.authType==="api-key"&&!r.oauthTokenUrl?{type:"api_key",...i?{header_name:i}:{},value:(()=>{if(!a)throw new Error(`Server '${r.id}' is missing API key value`);return a})()}:r.authType==="api-key"?{type:"oauth_client_credentials",token_url:r.oauthTokenUrl||"",client_id_env:r.oauthClientIdEnv||"",client_secret_env:r.oauthClientSecretEnv||"",...r.oauthScope?{scope:r.oauthScope}:{},...r.oauthAudience?{audience:r.oauthAudience}:{}}:r.authType==="oauth2"?{type:"oauth_authorization_code",client_id:r.oauthClientId||"",client_secret:r.oauthClientSecret||void 0,redirect_url:r.oauthRedirectUrl||"http://localhost:6274/oauth/",scope:r.oauthScope||void 0}:void 0}})()])),n=Object.fromEntries(e.agents.map(r=>[r.id,{...r.name&&r.name!==r.id?{name:r.name}:{},provider:r.provider==="azure"?"azure_openai":r.provider==="anthropic"?"anthropic":"openai",model:r.model,temperature:r.temperature,max_tokens:r.maxTokens,max_turns:r.maxTurns,system:r.systemPrompt}]));return{servers:t,agents:n,scenarios:e.scenarios.map(r=>({id:r.id,name:r.name||void 0,mcp_servers:r.serverIds.length>0?r.serverIds.map(a=>({ref:a})):void 0,prompt:r.prompt,snapshot_eval:r.snapshotEval?{enabled:r.snapshotEval.enabled,baseline_snapshot_id:r.snapshotEval.baselineSnapshotId,baseline_source_run_id:r.snapshotEval.baselineSourceRunId,last_updated_at:r.snapshotEval.lastUpdatedAt}:void 0,eval:{tool_constraints:{required_tools:r.evalRules.filter(a=>a.type==="required_tool").map(a=>a.value),forbidden_tools:r.evalRules.filter(a=>a.type==="forbidden_tool").map(a=>a.value)},response_assertions:r.evalRules.filter(a=>a.type==="response_contains"||a.type==="response_not_contains").map(a=>({type:"regex",pattern:a.value}))},extract:r.extractRules.map(a=>({name:a.name,from:"final_text",regex:a.pattern}))}))}}function NG(e,t){if(e)return`${e}::${t??""}`}function Vp(e){return e.type==="text"}function CG(e,t){if(!t)return e.tool_calls.map((a,i)=>({name:a,arguments:{},duration:e.tool_durations_ms[i]??0,timestamp:new Date().toISOString()}));const n=[],r=new Map;for(const a of t.messages)for(const i of a.content)i.type==="tool_use"?n.push({id:i.id,name:i.name,input:i.input??{},ts:a.ts}):i.type==="tool_result"&&r.set(i.tool_use_id,{durationMs:i.duration_ms,tsEnd:i.ts_end});return n.map((a,i)=>{const o=r.get(a.id);return{name:a.name,arguments:a.input,duration:o?.durationMs??e.tool_durations_ms[i]??0,timestamp:o?.tsEnd??a.ts??new Date().toISOString()}})}function AG(e,t){const n=[];if(!e)return n;let r;const a=e.messages??[];for(let i=0;i<a.length;i+=1){const o=a[i];if(o.role==="user"){const c=o.content.filter(Vp);for(const d of c)n.push({id:`user_prompt-${n.length}`,kind:"user_prompt",text:d.text,timestamp:o.ts});continue}if(o.role==="assistant"){const c=o.content.filter(h=>h.type==="tool_use");for(const h of o.content)h.type==="text"&&(n.push({id:`assistant_thought-${n.length}`,kind:"assistant_thought",text:h.text,timestamp:o.ts}),r=n.length-1);const d=a[i+1],f=d?.role==="tool";if(c.length>0&&f){const h=new Map,p=[];for(const y of d.content)y.type==="tool_result"&&(y.tool_use_id?h.set(y.tool_use_id,y):p.push(y));for(const y of c){n.push({id:`tool_call-${n.length}`,kind:"tool_call",text:dP(y.input??{}),toolName:y.name,timestamp:o.ts});const g=h.get(y.id);if(!g)continue;const j=g.content.filter(Vp).map(b=>b.text).join(`
|
|
54
|
-
`);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:j,toolName:g.name,ok:!g.is_error,durationMs:g.duration_ms,timestamp:g.ts_end??d.ts}),h.delete(y.id)}for(const y of[...h.values(),...p]){const g=y.content.filter(Vp).map(j=>j.text).join(`
|
|
55
|
-
`);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:g,toolName:y.name,ok:!y.is_error,durationMs:y.duration_ms,timestamp:y.ts_end??d.ts})}i+=1}else for(const h of c)n.push({id:`tool_call-${n.length}`,kind:"tool_call",text:dP(h.input??{}),toolName:h.name,timestamp:o.ts});continue}if(o.role==="tool")for(const c of o.content){if(c.type!=="tool_result")continue;const d=c.content.filter(Vp).map(f=>f.text).join(`
|
|
56
|
-
`);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:d,toolName:c.name,ok:!c.is_error,durationMs:c.duration_ms,timestamp:c.ts_end??o.ts})}}return typeof r=="number"&&n[r]&&(n[r]={...n[r],kind:"assistant_final"}),n}function dP(e){try{return JSON.stringify(e)}catch{return String(e)}}function fP(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 vx(e,t){if(typeof e!="number"||t<=0)return new Array(t).fill(void 0);const n=Math.floor(e/t),r=e%t;return Array.from({length:t},(a,i)=>n+(i<r?1:0))}function _G(e){const t=Fs(),n=Fs(),r=new Map;if(!e)return{assistant:null,tool:null,perTool:{}};for(const i of e.messages??[]){if(i.role!=="assistant")continue;fP(t,i.usage);const o=i.content.filter(h=>h.type==="tool_use");if(o.length===0)continue;fP(n,i.usage);const c=vx(i.usage?.input_tokens,o.length),d=vx(i.usage?.output_tokens,o.length),f=vx(i.usage?.total_tokens,o.length);for(let h=0;h<o.length;h+=1){const p=o[h].name,y=r.get(p)??Fs(),g=c[h],j=d[h],b=f[h];typeof g=="number"&&(y.input+=g,y.hasInput=!0),typeof j=="number"&&(y.output+=j,y.hasOutput=!0),typeof b=="number"&&(y.total+=b,y.hasTotal=!0),r.set(p,y)}}const a={};for(const[i,o]of Array.from(r.entries()).sort((c,d)=>c[0].localeCompare(d[0]))){const c=Bs(o);c&&(a[i]=c)}return{assistant:Bs(t),tool:Bs(n),perTool:a}}function pP(e,t=[]){const n=new Map;for(const o of t){const c=NG(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 x of c)d.set(x.run_index,x);const f=o.runs.map((x,S)=>{const N=d.get(x.run_index)??c[S],C=_G(N);return{runIndex:x.run_index,passed:x.pass,toolCalls:CG(x,N),assistantTokenUsage:C.assistant,toolTokenUsage:C.tool,toolTokenUsageByTool:C.perTool,finalAnswer:x.final_text,conversation:AG(N),duration:x.tool_durations_ms.reduce((E,_)=>E+_,0),extractedValues:Object.fromEntries(Object.entries(x.extracted).map(([E,_])=>[E,String(_??"")])),failureReasons:x.failures}}),h=Fs(),p=Fs(),y=new Map;for(const x of f){Ml(h,x.assistantTokenUsage),Ml(p,x.toolTokenUsage);for(const[S,N]of Object.entries(x.toolTokenUsageByTool??{})){const C=y.get(S)??Fs();Ml(C,N),y.set(S,C)}}const g={};for(const[x,S]of Array.from(y.entries()).sort((N,C)=>N[0].localeCompare(C[0]))){const N=Bs(S);N&&(g[x]=N)}const j=f.length===0?0:Math.round(f.reduce((x,S)=>x+S.duration,0)/f.length),b=f.length===0?0:f.reduce((x,S)=>x+S.toolCalls.length,0)/f.length;return{scenarioId:o.scenario_id,scenarioName:o.scenario_name||o.scenario_id,agentId:o.agent,agentName:o.agent,runs:f,passRate:o.pass_rate,avgToolCalls:b,avgDuration:j,assistantTokenUsage:Bs(h),toolTokenUsage:Bs(p),toolTokenUsageByTool:g}}),a=Fs(),i=Fs();for(const o of r)Ml(a,o.assistantTokenUsage),Ml(i,o.toolTokenUsage);return{id:e.metadata.run_id,configId:"",configHash:e.metadata.config_hash,timestamp:e.metadata.timestamp,runNote:e.metadata.run_note,mcpServerVersions:e.metadata.mcp_server_versions??{},scenarios:r,assistantTokenUsage:Bs(a),toolTokenUsage:Bs(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 EG(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}const rd=EG();async function dt(e,t){const n=await fetch(`${rd}${e}`,{...t,headers:{"content-type":"application/json",...t?.headers||{}}});if(!n.ok){const r=await n.text();throw new Error(`Request failed (${n.status}): ${r}`)}return await n.json()}async function PG(e,t){const n=await fetch(`${rd}${e}`,{...t,headers:{}});if(!n.ok){const r=await n.text();throw new Error(`Request failed (${n.status}): ${r}`)}return n.text()}const it={health:()=>dt("/api/health"),getSettings:()=>dt("/api/settings"),updateSettings:e=>dt("/api/settings",{method:"PUT",body:JSON.stringify(e)}),listConfigs:()=>dt("/api/evals"),createConfig:(e,t)=>dt("/api/evals",{method:"POST",body:JSON.stringify({fileName:e,config:t})}),updateConfig:(e,t,n)=>dt(`/api/evals/${e}`,{method:"PUT",body:JSON.stringify({config:t,fileName:n})}),deleteConfig:e=>dt(`/api/evals/${e}`,{method:"DELETE"}),listRuns:()=>dt("/api/runs"),listMarkdownReports:()=>dt("/api/markdown-reports").then(e=>e.items),getMarkdownReport:e=>dt(`/api/markdown-reports/content?path=${encodeURIComponent(e)}`),deleteMarkdownReport:e=>dt(`/api/markdown-reports?path=${encodeURIComponent(e)}`,{method:"DELETE"}).then(()=>{}),getRun:e=>dt(`/api/runs/${e}`),deleteRun:e=>dt(`/api/runs/${e}`,{method:"DELETE"}),updateRunNote:(e,t)=>dt(`/api/runs/${encodeURIComponent(e)}/note`,{method:"PATCH",body:JSON.stringify({runNote:t??""})}).then(()=>{}),getRunTrace:e=>dt(`/api/runs/${e}/trace`),listSnapshots:()=>dt("/api/snapshots"),createSnapshotFromRun:(e,t)=>dt("/api/snapshots",{method:"POST",body:JSON.stringify({runId:e,name:t})}),getSnapshot:e=>dt(`/api/snapshots/${e}`),compareSnapshot:(e,t)=>dt(`/api/snapshots/${e}/compare`,{method:"POST",body:JSON.stringify({runId:t})}),askResultAssistant:(e,t)=>dt(`/api/runs/${encodeURIComponent(e)}/assistant`,{method:"POST",body:JSON.stringify({messages:t})}),applyResultAssistantReport:e=>dt(`/api/runs/${encodeURIComponent(e.runId)}/assistant/apply-report`,{method:"POST",body:JSON.stringify({markdown:e.markdown,outputPath:e.outputPath,overwrite:e.overwrite})}),createResultAssistantSession:e=>dt("/api/result-assistant/sessions",{method:"POST",body:JSON.stringify({runId:e})}),getResultAssistantSession:e=>dt(`/api/result-assistant/sessions/${e}`),sendResultAssistantMessage:(e,t)=>dt(`/api/result-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t})}),approveResultAssistantToolCall:(e,t,n)=>dt(`/api/result-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify(n===void 0?{}:{argumentsOverride:n})}),denyResultAssistantToolCall:(e,t)=>dt(`/api/result-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),closeResultAssistantSession:e=>dt(`/api/result-assistant/sessions/${e}`,{method:"DELETE"}).then(()=>{}),generateSnapshotEvalBaseline:(e,t,n)=>dt("/api/snapshots/generate-eval",{method:"POST",body:JSON.stringify({runId:e,configId:t,name:n})}),updateSnapshotPolicy:(e,t)=>dt(`/api/evals/${e}/snapshot-policy`,{method:"POST",body:JSON.stringify(t)}),getLibraries:()=>dt("/api/libraries"),saveLibraries:e=>dt("/api/libraries",{method:"PUT",body:JSON.stringify(e)}),startRun:e=>dt("/api/runs",{method:"POST",body:JSON.stringify(e)}),listProviderModels:e=>dt(`/api/providers/models?provider=${encodeURIComponent(e)}`),createScenarioAssistantSession:e=>dt("/api/scenario-assistant/sessions",{method:"POST",body:JSON.stringify(e)}),getScenarioAssistantSession:e=>dt(`/api/scenario-assistant/sessions/${e}`),sendScenarioAssistantMessage:(e,t)=>dt(`/api/scenario-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t})}),approveScenarioAssistantToolCall:(e,t)=>dt(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify({})}),denyScenarioAssistantToolCall:(e,t)=>dt(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),approveAllScenarioAssistantToolCalls:e=>dt(`/api/scenario-assistant/sessions/${e}/tool-calls/approve-all`,{method:"POST",body:JSON.stringify({})}),closeScenarioAssistantSession:e=>dt(`/api/scenario-assistant/sessions/${e}`,{method:"DELETE"}),discoverToolsForAnalysis:e=>dt("/api/tool-analysis/discover-tools",{method:"POST",body:JSON.stringify(e)}),startToolAnalysis:e=>dt("/api/tool-analysis/jobs",{method:"POST",body:JSON.stringify(e)}),getToolAnalysisResult:e=>dt(`/api/tool-analysis/jobs/${e}/result`),stopToolAnalysis:e=>dt(`/api/tool-analysis/jobs/${e}/stop`,{method:"POST"}),subscribeToolAnalysisJob:(e,t)=>{const n=new EventSource(`${rd}/api/tool-analysis/jobs/${e}/events`);let r=!1;const a=()=>{r||(r=!0,n.close())},i=o=>{if(!r&&!(typeof o.data!="string"||!o.data))try{const c=JSON.parse(o.data);t(c),(c.type==="completed"||c.type==="error")&&a()}catch{}};return n.addEventListener("started",i),n.addEventListener("log",i),n.addEventListener("completed",i),n.addEventListener("error",i),n.onerror=()=>{r||(t({type:"error",ts:new Date().toISOString(),payload:{message:"SSE connection error"}}),a())},()=>a()},listToolAnalysisResults:()=>dt("/api/tool-analysis-results").then(e=>e.items),getToolAnalysisSavedResult:e=>dt(`/api/tool-analysis-results/${e}`),deleteToolAnalysisSavedResult:e=>dt(`/api/tool-analysis-results/${e}`,{method:"DELETE"}).then(()=>{}),createOAuthDebuggerSession:e=>dt("/api/oauth-debugger/sessions",{method:"POST",body:JSON.stringify(e)}),getOAuthDebuggerSession:e=>dt(`/api/oauth-debugger/sessions/${e}`),startOAuthDebuggerSession:e=>dt(`/api/oauth-debugger/sessions/${e}/start`,{method:"POST",body:JSON.stringify({})}),subscribeOAuthDebuggerSession:(e,t)=>{const n=new EventSource(`${rd}/api/oauth-debugger/sessions/${e}/events`);let r=!1;const a=()=>{r||(r=!0,n.close())},i=o=>{if(!r&&!(typeof o.data!="string"||!o.data))try{const c=JSON.parse(o.data);t(c),(c.type==="completed"||c.type==="error"||c.type==="stopped")&&a()}catch{}};return["started","step_started","step_completed","step_failed","http_request","http_response","validation","log","waiting_for_user","waiting_for_browser_callback","completed","error","stopped"].forEach(o=>n.addEventListener(o,i)),n.onerror=()=>{r||(t({type:"error",ts:new Date().toISOString(),payload:{message:"SSE connection error"}}),a())},()=>a()},submitOAuthDebuggerManualCallback:(e,t)=>dt(`/api/oauth-debugger/sessions/${e}/manual-callback`,{method:"POST",body:JSON.stringify(t)}),stopOAuthDebuggerSession:e=>dt(`/api/oauth-debugger/sessions/${e}/stop`,{method:"POST",body:JSON.stringify({})}),exportOAuthDebuggerSession:(e,t)=>t==="json"?dt(`/api/oauth-debugger/sessions/${e}/export?format=json`):PG(`/api/oauth-debugger/sessions/${e}/export?format=${t}`),stopRun:e=>dt(`/api/runs/jobs/${e}/stop`,{method:"POST"}),getRunQueue:()=>dt("/api/runs/queue"),removeQueuedRun:e=>dt(`/api/runs/queue/${e}`,{method:"DELETE"}).then(()=>{}),subscribeRunJob:(e,t)=>{const n=new EventSource(`${rd}/api/runs/jobs/${e}/events`);let r=!1;const a=()=>{r||(r=!0,n.close())},i=o=>{if(!r&&!(typeof o.data!="string"||!o.data))try{const c=JSON.parse(o.data);t(c),(c.type==="completed"||c.type==="error")&&a()}catch{}};return n.addEventListener("queued",i),n.addEventListener("started",i),n.addEventListener("log",i),n.addEventListener("completed",i),n.addEventListener("error",i),n.onerror=()=>{r||(t({type:"error",ts:new Date().toISOString(),payload:{message:"SSE connection error"}}),a())},()=>{a()}}};function kG(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 OG(e){return e||`config-${Date.now()}`}const RG={async listConfigs(){return(await it.listConfigs()).map($l)},async createConfig(e){const t=await it.createConfig(kG(e),uP(e));return $l(t)},async updateConfig(e){const t=await it.updateConfig(e.id,uP(e),OG(e.name));return $l(t)},async deleteConfig(e){await it.deleteConfig(e)},async listResults(){const t=(await it.listRuns()).map(async n=>{const[{results:r},a]=await Promise.all([it.getRun(n.runId),it.getRunTrace(n.runId)]);return pP(r,a.records)});return Promise.all(t)},async getResult(e){try{const[{results:t},n]=await Promise.all([it.getRun(e),it.getRunTrace(e)]);return pP(t,n.records)}catch{return}},async deleteResult(e){await it.deleteRun(e)},async updateRunNote(e,t){await it.updateRunNote(e,t)},async listMarkdownReports(){return it.listMarkdownReports()},async getMarkdownReport(e){return it.getMarkdownReport(e)},async deleteMarkdownReport(e){await it.deleteMarkdownReport(e)},async startRun(e){return it.startRun(e)},async stopRun(e){await it.stopRun(e)},async getRunQueue(){return it.getRunQueue()},async removeQueuedRun(e){await it.removeQueuedRun(e)},subscribeRunJob(e,t){return it.subscribeRunJob(e,t)},async listSnapshots(){return it.listSnapshots()},async createSnapshotFromRun(e,t){return it.createSnapshotFromRun(e,t)},async getSnapshot(e){try{return await it.getSnapshot(e)}catch{return}},async compareSnapshot(e,t){return it.compareSnapshot(e,t)},async askResultAssistant(e,t){return it.askResultAssistant(e,t)},async applyResultAssistantReport(e){return it.applyResultAssistantReport(e)},async createResultAssistantSession(e){return it.createResultAssistantSession(e)},async getResultAssistantSession(e){return it.getResultAssistantSession(e)},async sendResultAssistantMessage(e,t){return it.sendResultAssistantMessage(e,t)},async approveResultAssistantToolCall(e,t,n){return it.approveResultAssistantToolCall(e,t,n)},async denyResultAssistantToolCall(e,t){return it.denyResultAssistantToolCall(e,t)},async closeResultAssistantSession(e){await it.closeResultAssistantSession(e)},async generateSnapshotEvalBaseline(e,t,n){const r=await it.generateSnapshotEvalBaseline(e,t,n);return{snapshot:r.snapshot,config:$l(r.config)}},async updateSnapshotPolicy(e,t){const n=await it.updateSnapshotPolicy(e,t);return $l(n)},async getLibraries(){const e=await it.getLibraries();return jG(e)},async saveLibraries(e){await it.saveLibraries(SG(e))},async listProviderModels(e){return it.listProviderModels(e)},async getWorkspaceSettings(){return it.getSettings()},async updateWorkspaceSettings(e){return it.updateSettings(e)},async createScenarioAssistantSession(e){return it.createScenarioAssistantSession(e)},async getScenarioAssistantSession(e){return it.getScenarioAssistantSession(e)},async sendScenarioAssistantMessage(e,t){return it.sendScenarioAssistantMessage(e,t)},async approveScenarioAssistantToolCall(e,t){return it.approveScenarioAssistantToolCall(e,t)},async denyScenarioAssistantToolCall(e,t){return it.denyScenarioAssistantToolCall(e,t)},async approveAllScenarioAssistantToolCalls(e){return it.approveAllScenarioAssistantToolCalls(e)},async closeScenarioAssistantSession(e){await it.closeScenarioAssistantSession(e)},async discoverToolsForAnalysis(e){return it.discoverToolsForAnalysis(e)},async startToolAnalysis(e){return it.startToolAnalysis(e)},subscribeToolAnalysisJob(e,t){return it.subscribeToolAnalysisJob(e,t)},async getToolAnalysisResult(e){return it.getToolAnalysisResult(e)},async stopToolAnalysis(e){return it.stopToolAnalysis(e)},async listToolAnalysisResults(){return it.listToolAnalysisResults()},async getToolAnalysisSavedResult(e){return it.getToolAnalysisSavedResult(e)},async deleteToolAnalysisSavedResult(e){await it.deleteToolAnalysisSavedResult(e)},async createOAuthDebuggerSession(e){return it.createOAuthDebuggerSession(e)},async getOAuthDebuggerSession(e){return it.getOAuthDebuggerSession(e)},async startOAuthDebuggerSession(e){return it.startOAuthDebuggerSession(e)},subscribeOAuthDebuggerSession(e,t){return it.subscribeOAuthDebuggerSession(e,t)},async submitOAuthDebuggerManualCallback(e,t){return it.submitOAuthDebuggerManualCallback(e,t)},async stopOAuthDebuggerSession(e){return it.stopOAuthDebuggerSession(e)},async exportOAuthDebuggerSession(e,t){return it.exportOAuthDebuggerSession(e,t)}},_3=v.createContext(null);function TG({children:e}){const t="workspace",[n,r]=v.useState("checking"),[a,i]=v.useState(null);v.useEffect(()=>{r("checking"),it.health().then(c=>{r("connected"),i(typeof c?.version=="string"?c.version:null)}).catch(()=>{r("disconnected"),i(null)})},[t]);const o=v.useMemo(()=>RG,[]);return s.jsx(_3.Provider,{value:{mode:t,connection:n,version:a,source:o},children:e})}function Tn(){const e=v.useContext(_3);if(!e)throw new Error("useDataSource must be used within DataSourceProvider");return e}const IG=e=>{if(e==="/")return[{label:"Dashboard"}];const t=[{label:"Dashboard",to:"/"}];if(en("/mcp-evaluations/:id",e))return t.push({label:"MCP Evaluations",to:"/mcp-evaluations"},{label:"MCP Evaluation"}),t;if(en("/mcp-evaluations",e))return t.push({label:"MCP Evaluations"}),t;if(en("/settings",e))return t.push({label:"Settings"}),t;if(en("/tool-analysis",e))return t.push({label:"Analyze MCP Tools"}),t;if(en("/tool-analysis-results/:id",e)){const n=en("/tool-analysis-results/:id",e);return t.push({label:"Tool Analysis Results",to:"/tool-analysis-results"},{label:n?.params.id??"Report"}),t}if(en("/tool-analysis-results",e))return t.push({label:"Tool Analysis Results"}),t;if(en("/markdown-reports/view",e))return t.push({label:"Markdown Reports",to:"/markdown-reports"},{label:"View Report"}),t;if(en("/markdown-reports",e))return t.push({label:"Markdown Reports"}),t;if(en("/oauth-debugger",e))return t.push({label:"OAuth Debugger"}),t;if(en("/results/:id",e))return t.push({label:"Evaluation Results",to:"/results"},{label:"Result"}),t;if(en("/results",e))return t.push({label:"Evaluation Results"}),t;if(en("/run",e))return t.push({label:"Run Evaluation"}),t;if(en("/libraries/servers/:serverId",e)){const n=en("/libraries/servers/:serverId",e),r=n?.params.serverId?decodeURIComponent(n.params.serverId):"Server";return t.push({label:"Libraries",to:"/libraries/servers"},{label:"Servers",to:"/libraries/servers"},{label:r==="new"?"New Server":r}),t}if(en("/libraries/servers",e))return t.push({label:"Libraries",to:"/libraries/servers"},{label:"Servers"}),t;if(en("/libraries/agents/:agentName",e)){const n=en("/libraries/agents/:agentName",e),r=n?.params.agentName?decodeURIComponent(n.params.agentName):"Agent";return t.push({label:"Libraries",to:"/libraries/agents"},{label:"Agents",to:"/libraries/agents"},{label:r==="new"?"New Agent":r}),t}if(en("/libraries/agents",e))return t.push({label:"Libraries",to:"/libraries/agents"},{label:"Agents"}),t;if(en("/libraries/test-cases/:testCaseId",e)){const n=en("/libraries/test-cases/:testCaseId",e),r=n?.params.testCaseId?decodeURIComponent(n.params.testCaseId):"Test Case";return t.push({label:"Libraries",to:"/libraries/test-cases"},{label:"Test Cases",to:"/libraries/test-cases"},{label:r}),t}return en("/libraries/test-cases",e)?(t.push({label:"Libraries",to:"/libraries/test-cases"},{label:"Test Cases"}),t):en("/compare",e)?(t.push({label:"Compare Evaluations"}),t):(en("/compare/results",e)&&t.push({label:"Compare Evaluations",to:"/compare"},{label:"Full Result Compare"}),t)};function MG(){const e=ws(),t=new URLSearchParams(e.search).get("embed")==="1",n=IG(e.pathname),{connection:r,version:a}=Tn();return t?s.jsx("main",{className:"min-h-screen overflow-auto bg-background p-4",children:s.jsx(YE,{})}):s.jsx(l3,{children:s.jsxs("div",{className:"flex min-h-screen w-full",children:[s.jsx(xG,{version:a}),s.jsxs("div",{className:"flex flex-1 flex-col",children:[s.jsxs("header",{className:"flex h-12 items-center gap-2 border-b bg-card px-4",children:[s.jsx(u3,{}),s.jsx(w3,{children:s.jsx(j3,{children:n.map((i,o)=>{const c=o===n.length-1;return s.jsxs(v.Fragment,{children:[s.jsx(S3,{children:i.to&&!c?s.jsx(N3,{asChild:!0,children:s.jsx(wt,{to:i.to,children:i.label})}):s.jsx(C3,{children:i.label})}),!c&&s.jsx(A3,{})]},`${i.label}-${o}`)})})}),s.jsx("div",{className:"ml-auto flex items-center gap-2",children:s.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border px-2.5 py-1",children:[s.jsx("span",{className:`h-2 w-2 rounded-full ${r==="connected"?"bg-emerald-500":r==="checking"?"bg-amber-400":"bg-rose-500"}`,"aria-hidden":"true"}),s.jsx("span",{className:`text-xs ${r==="connected"?"text-emerald-700":r==="checking"?"text-muted-foreground":"text-destructive"}`,children:r})]})})]}),s.jsx("main",{className:"flex-1 overflow-auto p-6",children:s.jsx(YE,{})})]})]})})}const E3=v.createContext(null);function $G({children:e}){const{source:t}=Tn(),[n,r]=v.useState([]),[a,i]=v.useState(!0),o=v.useCallback(async()=>{i(!0);try{const y=await t.listConfigs();r(y)}finally{i(!1)}},[t]);v.useEffect(()=>{o()},[o]);const c=v.useCallback(y=>n.find(g=>g.id===y),[n]),d=v.useCallback(async y=>{const g=await t.createConfig(y);return r(j=>[...j,g]),g},[t]),f=v.useCallback(async(y,g)=>{const j=await t.updateConfig({...g,id:y});return r(b=>b.map(x=>x.id===y?j:x)),j},[t]),h=v.useCallback(async y=>{await t.deleteConfig(y),r(g=>g.filter(j=>j.id!==y))},[t]),p=v.useCallback(async y=>{const g=n.find(x=>x.id===y);if(!g)throw new Error("Config not found");const j={...structuredClone(g),id:`cfg-${Date.now()}`,name:`${g.name} (Copy)`,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()},b=await t.createConfig(j);return r(x=>[...x,b]),b},[n,t]);return s.jsx(E3.Provider,{value:{configs:n,loading:a,getConfig:c,addConfig:d,updateConfig:f,deleteConfig:h,cloneConfig:p,reload:o},children:e})}function mf(){const e=v.useContext(E3);if(!e)throw new Error("useConfigs must be used within ConfigProvider");return e}const P3=v.createContext(null);function DG({children:e}){const{source:t}=Tn(),[n,r]=v.useState({servers:[],agents:[],scenarios:[]}),[a,i]=v.useState(!0),o=v.useCallback(async()=>{i(!0);try{const f=await t.getLibraries();r(f)}finally{i(!1)}},[t]);v.useEffect(()=>{o()},[t]),v.useEffect(()=>{const f=()=>{o()};return window.addEventListener("focus",f),()=>{window.removeEventListener("focus",f)}},[t]);const c=v.useCallback(async f=>{r(f),await t.saveLibraries(f)},[t]),d=v.useMemo(()=>({...n,loading:a,setServers:async f=>c({...n,servers:f}),setAgents:async f=>c({...n,agents:f}),setScenarios:async f=>c({...n,scenarios:f}),reload:o}),[n,a,o,c]);return s.jsx(P3.Provider,{value:d,children:e})}function Ka(){const e=v.useContext(P3);if(!e)throw new Error("useLibraries must be used within LibraryProvider");return e}const qe=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Se("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));qe.displayName="Card";const St=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Se("flex flex-col space-y-1.5 p-6",e),...t}));St.displayName="CardHeader";const Nt=v.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:Se("text-2xl font-semibold leading-none tracking-tight",e),...t}));Nt.displayName="CardTitle";const Ws=v.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));Ws.displayName="CardDescription";const We=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Se("p-6 pt-0",e),...t}));We.displayName="CardContent";const LG=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Se("flex items-center p-6 pt-0",e),...t}));LG.displayName="CardFooter";const $r=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:n,className:Se("w-full caption-bottom text-sm",e),...t})}));$r.displayName="Table";const Dr=v.forwardRef(({className:e,...t},n)=>s.jsx("thead",{ref:n,className:Se("[&_tr]:border-b",e),...t}));Dr.displayName="TableHeader";const Lr=v.forwardRef(({className:e,...t},n)=>s.jsx("tbody",{ref:n,className:Se("[&_tr:last-child]:border-0",e),...t}));Lr.displayName="TableBody";const FG=v.forwardRef(({className:e,...t},n)=>s.jsx("tfoot",{ref:n,className:Se("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));FG.displayName="TableFooter";const Mt=v.forwardRef(({className:e,...t},n)=>s.jsx("tr",{ref:n,className:Se("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));Mt.displayName="TableRow";const tt=v.forwardRef(({className:e,...t},n)=>s.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}));tt.displayName="TableHead";const ze=v.forwardRef(({className:e,...t},n)=>s.jsx("td",{ref:n,className:Se("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));ze.displayName="TableCell";const BG=v.forwardRef(({className:e,...t},n)=>s.jsx("caption",{ref:n,className:Se("mt-4 text-sm text-muted-foreground",e),...t}));BG.displayName="TableCaption";function is({title:e,value:t,subtitle:n,icon:r,trend:a}){return s.jsx(qe,{children:s.jsx(We,{className:"p-4",children:s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:e}),s.jsx("p",{className:"text-2xl font-bold",children:t}),n&&s.jsxs("p",{className:`text-xs ${a==="up"?"text-success":a==="down"?"text-destructive":"text-muted-foreground"}`,children:[a==="up"&&"↑ ",a==="down"&&"↓ ",n]})]}),s.jsx("div",{className:"rounded-lg bg-primary/10 p-2",children:s.jsx(r,{className:"h-4 w-4 text-primary"})})]})})})}const zG=qo("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Je({className:e,variant:t,asChild:n,...r}){const a=n?Gi:"div";return s.jsx(a,{className:Se(zG({variant:t}),e),...r})}function zs({rate:e,className:t}){const n=Math.round(e*100),r=n>=80?"default":n>=50?"secondary":"destructive";return s.jsxs(Je,{variant:r,className:`font-mono text-xs ${n>=80?"bg-success/15 text-success hover:bg-success/20 border-0":n>=50?"bg-warning/15 text-warning hover:bg-warning/20 border-0":"bg-destructive/15 text-destructive hover:bg-destructive/20 border-0"} ${t??""}`,children:[n,"%"]})}var gx,hP;function Br(){if(hP)return gx;hP=1;var e=Array.isArray;return gx=e,gx}var yx,mP;function k3(){if(mP)return yx;mP=1;var e=typeof Ip=="object"&&Ip&&Ip.Object===Object&&Ip;return yx=e,yx}var xx,vP;function js(){if(vP)return xx;vP=1;var e=k3(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return xx=n,xx}var bx,gP;function vf(){if(gP)return bx;gP=1;var e=js(),t=e.Symbol;return bx=t,bx}var wx,yP;function UG(){if(yP)return wx;yP=1;var e=vf(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,a=e?e.toStringTag:void 0;function i(o){var c=n.call(o,a),d=o[a];try{o[a]=void 0;var f=!0}catch{}var h=r.call(o);return f&&(c?o[a]=d:delete o[a]),h}return wx=i,wx}var jx,xP;function qG(){if(xP)return jx;xP=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return jx=n,jx}var Sx,bP;function ni(){if(bP)return Sx;bP=1;var e=vf(),t=UG(),n=qG(),r="[object Null]",a="[object Undefined]",i=e?e.toStringTag:void 0;function o(c){return c==null?c===void 0?a:r:i&&i in Object(c)?t(c):n(c)}return Sx=o,Sx}var Nx,wP;function ri(){if(wP)return Nx;wP=1;function e(t){return t!=null&&typeof t=="object"}return Nx=e,Nx}var Cx,jP;function Vc(){if(jP)return Cx;jP=1;var e=ni(),t=ri(),n="[object Symbol]";function r(a){return typeof a=="symbol"||t(a)&&e(a)==n}return Cx=r,Cx}var Ax,SP;function cN(){if(SP)return Ax;SP=1;var e=Br(),t=Vc(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function a(i,o){if(e(i))return!1;var c=typeof i;return c=="number"||c=="symbol"||c=="boolean"||i==null||t(i)?!0:r.test(i)||!n.test(i)||o!=null&&i in Object(o)}return Ax=a,Ax}var _x,NP;function Yi(){if(NP)return _x;NP=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return _x=e,_x}var Ex,CP;function uN(){if(CP)return Ex;CP=1;var e=ni(),t=Yi(),n="[object AsyncFunction]",r="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function o(c){if(!t(c))return!1;var d=e(c);return d==r||d==a||d==n||d==i}return Ex=o,Ex}var Px,AP;function WG(){if(AP)return Px;AP=1;var e=js(),t=e["__core-js_shared__"];return Px=t,Px}var kx,_P;function VG(){if(_P)return kx;_P=1;var e=WG(),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 kx=n,kx}var Ox,EP;function O3(){if(EP)return Ox;EP=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 Ox=n,Ox}var Rx,PP;function HG(){if(PP)return Rx;PP=1;var e=uN(),t=VG(),n=Yi(),r=O3(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,c=Object.prototype,d=o.toString,f=c.hasOwnProperty,h=RegExp("^"+d.call(f).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(y){if(!n(y)||t(y))return!1;var g=e(y)?h:i;return g.test(r(y))}return Rx=p,Rx}var Tx,kP;function KG(){if(kP)return Tx;kP=1;function e(t,n){return t?.[n]}return Tx=e,Tx}var Ix,OP;function Ho(){if(OP)return Ix;OP=1;var e=HG(),t=KG();function n(r,a){var i=t(r,a);return e(i)?i:void 0}return Ix=n,Ix}var Mx,RP;function cv(){if(RP)return Mx;RP=1;var e=Ho(),t=e(Object,"create");return Mx=t,Mx}var $x,TP;function GG(){if(TP)return $x;TP=1;var e=cv();function t(){this.__data__=e?e(null):{},this.size=0}return $x=t,$x}var Dx,IP;function YG(){if(IP)return Dx;IP=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return Dx=e,Dx}var Lx,MP;function XG(){if(MP)return Lx;MP=1;var e=cv(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function a(i){var o=this.__data__;if(e){var c=o[i];return c===t?void 0:c}return r.call(o,i)?o[i]:void 0}return Lx=a,Lx}var Fx,$P;function QG(){if($P)return Fx;$P=1;var e=cv(),t=Object.prototype,n=t.hasOwnProperty;function r(a){var i=this.__data__;return e?i[a]!==void 0:n.call(i,a)}return Fx=r,Fx}var Bx,DP;function JG(){if(DP)return Bx;DP=1;var e=cv(),t="__lodash_hash_undefined__";function n(r,a){var i=this.__data__;return this.size+=this.has(r)?0:1,i[r]=e&&a===void 0?t:a,this}return Bx=n,Bx}var zx,LP;function ZG(){if(LP)return zx;LP=1;var e=GG(),t=YG(),n=XG(),r=QG(),a=JG();function i(o){var c=-1,d=o==null?0:o.length;for(this.clear();++c<d;){var f=o[c];this.set(f[0],f[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=a,zx=i,zx}var Ux,FP;function eY(){if(FP)return Ux;FP=1;function e(){this.__data__=[],this.size=0}return Ux=e,Ux}var qx,BP;function dN(){if(BP)return qx;BP=1;function e(t,n){return t===n||t!==t&&n!==n}return qx=e,qx}var Wx,zP;function uv(){if(zP)return Wx;zP=1;var e=dN();function t(n,r){for(var a=n.length;a--;)if(e(n[a][0],r))return a;return-1}return Wx=t,Wx}var Vx,UP;function tY(){if(UP)return Vx;UP=1;var e=uv(),t=Array.prototype,n=t.splice;function r(a){var i=this.__data__,o=e(i,a);if(o<0)return!1;var c=i.length-1;return o==c?i.pop():n.call(i,o,1),--this.size,!0}return Vx=r,Vx}var Hx,qP;function nY(){if(qP)return Hx;qP=1;var e=uv();function t(n){var r=this.__data__,a=e(r,n);return a<0?void 0:r[a][1]}return Hx=t,Hx}var Kx,WP;function rY(){if(WP)return Kx;WP=1;var e=uv();function t(n){return e(this.__data__,n)>-1}return Kx=t,Kx}var Gx,VP;function aY(){if(VP)return Gx;VP=1;var e=uv();function t(n,r){var a=this.__data__,i=e(a,n);return i<0?(++this.size,a.push([n,r])):a[i][1]=r,this}return Gx=t,Gx}var Yx,HP;function dv(){if(HP)return Yx;HP=1;var e=eY(),t=tY(),n=nY(),r=rY(),a=aY();function i(o){var c=-1,d=o==null?0:o.length;for(this.clear();++c<d;){var f=o[c];this.set(f[0],f[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=a,Yx=i,Yx}var Xx,KP;function fN(){if(KP)return Xx;KP=1;var e=Ho(),t=js(),n=e(t,"Map");return Xx=n,Xx}var Qx,GP;function sY(){if(GP)return Qx;GP=1;var e=ZG(),t=dv(),n=fN();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return Qx=r,Qx}var Jx,YP;function iY(){if(YP)return Jx;YP=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return Jx=e,Jx}var Zx,XP;function fv(){if(XP)return Zx;XP=1;var e=iY();function t(n,r){var a=n.__data__;return e(r)?a[typeof r=="string"?"string":"hash"]:a.map}return Zx=t,Zx}var eb,QP;function oY(){if(QP)return eb;QP=1;var e=fv();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return eb=t,eb}var tb,JP;function lY(){if(JP)return tb;JP=1;var e=fv();function t(n){return e(this,n).get(n)}return tb=t,tb}var nb,ZP;function cY(){if(ZP)return nb;ZP=1;var e=fv();function t(n){return e(this,n).has(n)}return nb=t,nb}var rb,ek;function uY(){if(ek)return rb;ek=1;var e=fv();function t(n,r){var a=e(this,n),i=a.size;return a.set(n,r),this.size+=a.size==i?0:1,this}return rb=t,rb}var ab,tk;function pN(){if(tk)return ab;tk=1;var e=sY(),t=oY(),n=lY(),r=cY(),a=uY();function i(o){var c=-1,d=o==null?0:o.length;for(this.clear();++c<d;){var f=o[c];this.set(f[0],f[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=a,ab=i,ab}var sb,nk;function R3(){if(nk)return sb;nk=1;var e=pN(),t="Expected a function";function n(r,a){if(typeof r!="function"||a!=null&&typeof a!="function")throw new TypeError(t);var i=function(){var o=arguments,c=a?a.apply(this,o):o[0],d=i.cache;if(d.has(c))return d.get(c);var f=r.apply(this,o);return i.cache=d.set(c,f)||d,f};return i.cache=new(n.Cache||e),i}return n.Cache=e,sb=n,sb}var ib,rk;function dY(){if(rk)return ib;rk=1;var e=R3(),t=500;function n(r){var a=e(r,function(o){return i.size===t&&i.clear(),o}),i=a.cache;return a}return ib=n,ib}var ob,ak;function fY(){if(ak)return ob;ak=1;var e=dY(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(t,function(o,c,d,f){i.push(d?f.replace(n,"$1"):c||o)}),i});return ob=r,ob}var lb,sk;function hN(){if(sk)return lb;sk=1;function e(t,n){for(var r=-1,a=t==null?0:t.length,i=Array(a);++r<a;)i[r]=n(t[r],r,t);return i}return lb=e,lb}var cb,ik;function pY(){if(ik)return cb;ik=1;var e=vf(),t=hN(),n=Br(),r=Vc(),a=e?e.prototype:void 0,i=a?a.toString:void 0;function o(c){if(typeof c=="string")return c;if(n(c))return t(c,o)+"";if(r(c))return i?i.call(c):"";var d=c+"";return d=="0"&&1/c==-1/0?"-0":d}return cb=o,cb}var ub,ok;function T3(){if(ok)return ub;ok=1;var e=pY();function t(n){return n==null?"":e(n)}return ub=t,ub}var db,lk;function I3(){if(lk)return db;lk=1;var e=Br(),t=cN(),n=fY(),r=T3();function a(i,o){return e(i)?i:t(i,o)?[i]:n(r(i))}return db=a,db}var fb,ck;function pv(){if(ck)return fb;ck=1;var e=Vc();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return fb=t,fb}var pb,uk;function mN(){if(uk)return pb;uk=1;var e=I3(),t=pv();function n(r,a){a=e(a,r);for(var i=0,o=a.length;r!=null&&i<o;)r=r[t(a[i++])];return i&&i==o?r:void 0}return pb=n,pb}var hb,dk;function M3(){if(dk)return hb;dk=1;var e=mN();function t(n,r,a){var i=n==null?void 0:e(n,r);return i===void 0?a:i}return hb=t,hb}var hY=M3();const aa=Yt(hY);var mb,fk;function mY(){if(fk)return mb;fk=1;function e(t){return t==null}return mb=e,mb}var vY=mY();const Ct=Yt(vY);var vb,pk;function gY(){if(pk)return vb;pk=1;var e=ni(),t=Br(),n=ri(),r="[object String]";function a(i){return typeof i=="string"||!t(i)&&n(i)&&e(i)==r}return vb=a,vb}var yY=gY();const To=Yt(yY);var xY=uN();const jt=Yt(xY);var bY=Yi();const Hc=Yt(bY);var gb={exports:{}},Ht={};var hk;function wY(){if(hk)return Ht;hk=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),j;j=Symbol.for("react.module.reference");function b(x){if(typeof x=="object"&&x!==null){var S=x.$$typeof;switch(S){case e:switch(x=x.type,x){case n:case a:case r:case f:case h:return x;default:switch(x=x&&x.$$typeof,x){case c:case o:case d:case y:case p:case i:return x;default:return S}}case t:return S}}}return Ht.ContextConsumer=o,Ht.ContextProvider=i,Ht.Element=e,Ht.ForwardRef=d,Ht.Fragment=n,Ht.Lazy=y,Ht.Memo=p,Ht.Portal=t,Ht.Profiler=a,Ht.StrictMode=r,Ht.Suspense=f,Ht.SuspenseList=h,Ht.isAsyncMode=function(){return!1},Ht.isConcurrentMode=function(){return!1},Ht.isContextConsumer=function(x){return b(x)===o},Ht.isContextProvider=function(x){return b(x)===i},Ht.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===e},Ht.isForwardRef=function(x){return b(x)===d},Ht.isFragment=function(x){return b(x)===n},Ht.isLazy=function(x){return b(x)===y},Ht.isMemo=function(x){return b(x)===p},Ht.isPortal=function(x){return b(x)===t},Ht.isProfiler=function(x){return b(x)===a},Ht.isStrictMode=function(x){return b(x)===r},Ht.isSuspense=function(x){return b(x)===f},Ht.isSuspenseList=function(x){return b(x)===h},Ht.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===n||x===a||x===r||x===f||x===h||x===g||typeof x=="object"&&x!==null&&(x.$$typeof===y||x.$$typeof===p||x.$$typeof===i||x.$$typeof===o||x.$$typeof===d||x.$$typeof===j||x.getModuleId!==void 0)},Ht.typeOf=b,Ht}var mk;function jY(){return mk||(mk=1,gb.exports=wY()),gb.exports}var SY=jY(),yb,vk;function $3(){if(vk)return yb;vk=1;var e=ni(),t=ri(),n="[object Number]";function r(a){return typeof a=="number"||t(a)&&e(a)==n}return yb=r,yb}var xb,gk;function NY(){if(gk)return xb;gk=1;var e=$3();function t(n){return e(n)&&n!=+n}return xb=t,xb}var CY=NY();const gf=Yt(CY);var AY=$3();const _Y=Yt(AY);var jr=function(t){return t===0?0:t>0?1:-1},So=function(t){return To(t)&&t.indexOf("%")===t.length-1},Ue=function(t){return _Y(t)&&!gf(t)},EY=function(t){return Ct(t)},Wn=function(t){return Ue(t)||To(t)},PY=0,Kc=function(t){var n=++PY;return"".concat(t||"").concat(n)},Sr=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ue(t)&&!To(t))return r;var i;if(So(t)){var o=t.indexOf("%");i=n*parseFloat(t.slice(0,o))/100}else i=+t;return gf(i)&&(i=r),a&&i>n&&(i=n),i},Dl=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},kY=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},a=0;a<n;a++)if(!r[t[a]])r[t[a]]=!0;else return!0;return!1},ea=function(t,n){return Ue(t)&&Ue(n)?function(r){return t+r*(n-t)}:function(){return n}};function Ch(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):aa(r,t))===n})}var OY=function(t,n){return Ue(t)&&Ue(n)?t-n:To(t)&&To(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function Jl(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 Y1(e){"@babel/helpers - typeof";return Y1=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},Y1(e)}var RY=["viewBox","children"],TY=["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"],yk=["points","pathLength"],bb={svg:RY,polygon:yk,polyline:yk},vN=["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"],Ah=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(v.isValidElement(t)&&(r=t.props),!Hc(r))return null;var a={};return Object.keys(r).forEach(function(i){vN.includes(i)&&(a[i]=n||function(o){return r[i](r,o)})}),a},IY=function(t,n,r){return function(a){return t(n,r,a),null}},Io=function(t,n,r){if(!Hc(t)||Y1(t)!=="object")return null;var a=null;return Object.keys(t).forEach(function(i){var o=t[i];vN.includes(i)&&typeof o=="function"&&(a||(a={}),a[i]=IY(o,n,r))}),a},MY=["children"],$Y=["children"];function xk(e,t){if(e==null)return{};var n=DY(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function DY(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function X1(e){"@babel/helpers - typeof";return X1=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},X1(e)}var bk={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"},Vs=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},wk=null,wb=null,gN=function e(t){if(t===wk&&Array.isArray(wb))return wb;var n=[];return v.Children.forEach(t,function(r){Ct(r)||(SY.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),wb=n,wk=t,n};function sa(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(a){return Vs(a)}):r=[Vs(t)],gN(e).forEach(function(a){var i=aa(a,"type.displayName")||aa(a,"type.name");r.indexOf(i)!==-1&&n.push(a)}),n}function Jr(e,t){var n=sa(e,t);return n&&n[0]}var jk=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,a=n.height;return!(!Ue(r)||r<=0||!Ue(a)||a<=0)},LY=["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"],FY=function(t){return t&&t.type&&To(t.type)&&LY.indexOf(t.type)>=0},BY=function(t){return t&&X1(t)==="object"&&"clipDot"in t},zY=function(t,n,r,a){var i,o=(i=bb?.[a])!==null&&i!==void 0?i:[];return n.startsWith("data-")||!jt(t)&&(a&&o.includes(n)||TY.includes(n))||r&&vN.includes(n)},gt=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(v.isValidElement(t)&&(a=t.props),!Hc(a))return null;var i={};return Object.keys(a).forEach(function(o){var c;zY((c=a)===null||c===void 0?void 0:c[o],o,n,r)&&(i[o]=a[o])}),i},Q1=function e(t,n){if(t===n)return!0;var r=v.Children.count(t);if(r!==v.Children.count(n))return!1;if(r===0)return!0;if(r===1)return Sk(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var a=0;a<r;a++){var i=t[a],o=n[a];if(Array.isArray(i)||Array.isArray(o)){if(!e(i,o))return!1}else if(!Sk(i,o))return!1}return!0},Sk=function(t,n){if(Ct(t)&&Ct(n))return!0;if(!Ct(t)&&!Ct(n)){var r=t.props||{},a=r.children,i=xk(r,MY),o=n.props||{},c=o.children,d=xk(o,$Y);return a&&c?Jl(i,d)&&Q1(a,c):!a&&!c?Jl(i,d):!1}return!1},Nk=function(t,n){var r=[],a={};return gN(t).forEach(function(i,o){if(FY(i))r.push(i);else if(i){var c=Vs(i.type),d=n[c]||{},f=d.handler,h=d.once;if(f&&(!h||!a[c])){var p=f(i,c,o);r.push(p),a[c]=!0}}}),r},UY=function(t){var n=t&&t.type;return n&&bk[n]?bk[n]:null},qY=function(t,n){return gN(n).indexOf(t)},WY=["children","width","height","viewBox","className","style","title","desc"];function J1(){return J1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},J1.apply(this,arguments)}function VY(e,t){if(e==null)return{};var n=HY(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function HY(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 Z1(e){var t=e.children,n=e.width,r=e.height,a=e.viewBox,i=e.className,o=e.style,c=e.title,d=e.desc,f=VY(e,WY),h=a||{width:n,height:r,x:0,y:0},p=At("recharts-surface",i);return U.createElement("svg",J1({},gt(f,!0,"svg"),{className:p,width:n,height:r,style:o,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),U.createElement("title",null,c),U.createElement("desc",null,d),t)}var KY=["children","className"];function ej(){return ej=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ej.apply(this,arguments)}function GY(e,t){if(e==null)return{};var n=YY(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function YY(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var zt=U.forwardRef(function(e,t){var n=e.children,r=e.className,a=GY(e,KY),i=At("recharts-layer",r);return U.createElement("g",ej({className:i},gt(a,!0),{ref:t}),n)}),Hs=function(t,n){for(var r=arguments.length,a=new Array(r>2?r-2:0),i=2;i<r;i++)a[i-2]=arguments[i]},jb,Ck;function XY(){if(Ck)return jb;Ck=1;function e(t,n,r){var a=-1,i=t.length;n<0&&(n=-n>i?0:i+n),r=r>i?i:r,r<0&&(r+=i),i=n>r?0:r-n>>>0,n>>>=0;for(var o=Array(i);++a<i;)o[a]=t[a+n];return o}return jb=e,jb}var Sb,Ak;function QY(){if(Ak)return Sb;Ak=1;var e=XY();function t(n,r,a){var i=n.length;return a=a===void 0?i:a,!r&&a>=i?n:e(n,r,a)}return Sb=t,Sb}var Nb,_k;function D3(){if(_k)return Nb;_k=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",a=t+n+r,i="\\ufe0e\\ufe0f",o="\\u200d",c=RegExp("["+o+e+a+i+"]");function d(f){return c.test(f)}return Nb=d,Nb}var Cb,Ek;function JY(){if(Ek)return Cb;Ek=1;function e(t){return t.split("")}return Cb=e,Cb}var Ab,Pk;function ZY(){if(Pk)return Ab;Pk=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",a=t+n+r,i="\\ufe0e\\ufe0f",o="["+e+"]",c="["+a+"]",d="\\ud83c[\\udffb-\\udfff]",f="(?:"+c+"|"+d+")",h="[^"+e+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",y="[\\ud800-\\udbff][\\udc00-\\udfff]",g="\\u200d",j=f+"?",b="["+i+"]?",x="(?:"+g+"(?:"+[h,p,y].join("|")+")"+b+j+")*",S=b+j+x,N="(?:"+[h+c+"?",c,p,y,o].join("|")+")",C=RegExp(d+"(?="+d+")|"+N+S,"g");function E(_){return _.match(C)||[]}return Ab=E,Ab}var _b,kk;function eX(){if(kk)return _b;kk=1;var e=JY(),t=D3(),n=ZY();function r(a){return t(a)?n(a):e(a)}return _b=r,_b}var Eb,Ok;function tX(){if(Ok)return Eb;Ok=1;var e=QY(),t=D3(),n=eX(),r=T3();function a(i){return function(o){o=r(o);var c=t(o)?n(o):void 0,d=c?c[0]:o.charAt(0),f=c?e(c,1).join(""):o.slice(1);return d[i]()+f}}return Eb=a,Eb}var Pb,Rk;function nX(){if(Rk)return Pb;Rk=1;var e=tX(),t=e("toUpperCase");return Pb=t,Pb}var rX=nX();const hv=Yt(rX);function ln(e){return function(){return e}}const L3=Math.cos,_h=Math.sin,Ga=Math.sqrt,Eh=Math.PI,mv=2*Eh,tj=Math.PI,nj=2*tj,bo=1e-6,aX=nj-bo;function F3(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function sX(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return F3;const n=10**t;return function(r){this._+=r[0];for(let a=1,i=r.length;a<i;++a)this._+=Math.round(arguments[a]*n)/n+r[a]}}class iX{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?F3:sX(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,a){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+a}`}bezierCurveTo(t,n,r,a,i,o){this._append`C${+t},${+n},${+r},${+a},${this._x1=+i},${this._y1=+o}`}arcTo(t,n,r,a,i){if(t=+t,n=+n,r=+r,a=+a,i=+i,i<0)throw new Error(`negative radius: ${i}`);let o=this._x1,c=this._y1,d=r-t,f=a-n,h=o-t,p=c-n,y=h*h+p*p;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(y>bo)if(!(Math.abs(p*d-f*h)>bo)||!i)this._append`L${this._x1=t},${this._y1=n}`;else{let g=r-o,j=a-c,b=d*d+f*f,x=g*g+j*j,S=Math.sqrt(b),N=Math.sqrt(y),C=i*Math.tan((tj-Math.acos((b+y-x)/(2*S*N)))/2),E=C/N,_=C/S;Math.abs(E-1)>bo&&this._append`L${t+E*h},${n+E*p}`,this._append`A${i},${i},0,0,${+(p*g>h*j)},${this._x1=t+_*d},${this._y1=n+_*f}`}}arc(t,n,r,a,i,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let c=r*Math.cos(a),d=r*Math.sin(a),f=t+c,h=n+d,p=1^o,y=o?a-i:i-a;this._x1===null?this._append`M${f},${h}`:(Math.abs(this._x1-f)>bo||Math.abs(this._y1-h)>bo)&&this._append`L${f},${h}`,r&&(y<0&&(y=y%nj+nj),y>aX?this._append`A${r},${r},0,1,${p},${t-c},${n-d}A${r},${r},0,1,${p},${this._x1=f},${this._y1=h}`:y>bo&&this._append`A${r},${r},0,${+(y>=tj)},${p},${this._x1=t+r*Math.cos(i)},${this._y1=n+r*Math.sin(i)}`)}rect(t,n,r,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+a}h${-r}Z`}toString(){return this._}}function yN(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 iX(t)}function xN(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function B3(e){this._context=e}B3.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 vv(e){return new B3(e)}function z3(e){return e[0]}function U3(e){return e[1]}function q3(e,t){var n=ln(!0),r=null,a=vv,i=null,o=yN(c);e=typeof e=="function"?e:e===void 0?z3:ln(e),t=typeof t=="function"?t:t===void 0?U3:ln(t);function c(d){var f,h=(d=xN(d)).length,p,y=!1,g;for(r==null&&(i=a(g=o())),f=0;f<=h;++f)!(f<h&&n(p=d[f],f,d))===y&&((y=!y)?i.lineStart():i.lineEnd()),y&&i.point(+e(p,f,d),+t(p,f,d));if(g)return i=null,g+""||null}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:ln(+d),c):e},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:ln(+d),c):t},c.defined=function(d){return arguments.length?(n=typeof d=="function"?d:ln(!!d),c):n},c.curve=function(d){return arguments.length?(a=d,r!=null&&(i=a(r)),c):a},c.context=function(d){return arguments.length?(d==null?r=i=null:i=a(r=d),c):r},c}function Hp(e,t,n){var r=null,a=ln(!0),i=null,o=vv,c=null,d=yN(f);e=typeof e=="function"?e:e===void 0?z3:ln(+e),t=typeof t=="function"?t:ln(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?U3:ln(+n);function f(p){var y,g,j,b=(p=xN(p)).length,x,S=!1,N,C=new Array(b),E=new Array(b);for(i==null&&(c=o(N=d())),y=0;y<=b;++y){if(!(y<b&&a(x=p[y],y,p))===S)if(S=!S)g=y,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),j=y-1;j>=g;--j)c.point(C[j],E[j]);c.lineEnd(),c.areaEnd()}S&&(C[y]=+e(x,y,p),E[y]=+t(x,y,p),c.point(r?+r(x,y,p):C[y],n?+n(x,y,p):E[y]))}if(N)return c=null,N+""||null}function h(){return q3().defined(a).curve(o).context(i)}return f.x=function(p){return arguments.length?(e=typeof p=="function"?p:ln(+p),r=null,f):e},f.x0=function(p){return arguments.length?(e=typeof p=="function"?p:ln(+p),f):e},f.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:ln(+p),f):r},f.y=function(p){return arguments.length?(t=typeof p=="function"?p:ln(+p),n=null,f):t},f.y0=function(p){return arguments.length?(t=typeof p=="function"?p:ln(+p),f):t},f.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:ln(+p),f):n},f.lineX0=f.lineY0=function(){return h().x(e).y(t)},f.lineY1=function(){return h().x(e).y(n)},f.lineX1=function(){return h().x(r).y(t)},f.defined=function(p){return arguments.length?(a=typeof p=="function"?p:ln(!!p),f):a},f.curve=function(p){return arguments.length?(o=p,i!=null&&(c=o(i)),f):o},f.context=function(p){return arguments.length?(p==null?i=c=null:c=o(i=p),f):i},f}class W3{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 oX(e){return new W3(e,!0)}function lX(e){return new W3(e,!1)}const bN={draw(e,t){const n=Ga(t/Eh);e.moveTo(n,0),e.arc(0,0,n,0,mv)}},cX={draw(e,t){const n=Ga(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()}},V3=Ga(1/3),uX=V3*2,dX={draw(e,t){const n=Ga(t/uX),r=n*V3;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},fX={draw(e,t){const n=Ga(t),r=-n/2;e.rect(r,r,n,n)}},pX=.8908130915292852,H3=_h(Eh/10)/_h(7*Eh/10),hX=_h(mv/10)*H3,mX=-L3(mv/10)*H3,vX={draw(e,t){const n=Ga(t*pX),r=hX*n,a=mX*n;e.moveTo(0,-n),e.lineTo(r,a);for(let i=1;i<5;++i){const o=mv*i/5,c=L3(o),d=_h(o);e.lineTo(d*n,-c*n),e.lineTo(c*r-d*a,d*r+c*a)}e.closePath()}},kb=Ga(3),gX={draw(e,t){const n=-Ga(t/(kb*3));e.moveTo(0,n*2),e.lineTo(-kb*n,-n),e.lineTo(kb*n,-n),e.closePath()}},ma=-.5,va=Ga(3)/2,rj=1/Ga(12),yX=(rj/2+1)*3,xX={draw(e,t){const n=Ga(t/yX),r=n/2,a=n*rj,i=r,o=n*rj+n,c=-i,d=o;e.moveTo(r,a),e.lineTo(i,o),e.lineTo(c,d),e.lineTo(ma*r-va*a,va*r+ma*a),e.lineTo(ma*i-va*o,va*i+ma*o),e.lineTo(ma*c-va*d,va*c+ma*d),e.lineTo(ma*r+va*a,ma*a-va*r),e.lineTo(ma*i+va*o,ma*o-va*i),e.lineTo(ma*c+va*d,ma*d-va*c),e.closePath()}};function bX(e,t){let n=null,r=yN(a);e=typeof e=="function"?e:ln(e||bN),t=typeof t=="function"?t:ln(t===void 0?64:+t);function a(){let i;if(n||(n=i=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:ln(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:ln(+i),a):t},a.context=function(i){return arguments.length?(n=i??null,a):n},a}function Ph(){}function kh(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 K3(e){this._context=e}K3.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:kh(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:kh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function wX(e){return new K3(e)}function G3(e){this._context=e}G3.prototype={areaStart:Ph,areaEnd:Ph,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:kh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function jX(e){return new G3(e)}function Y3(e){this._context=e}Y3.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:kh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function SX(e){return new Y3(e)}function X3(e){this._context=e}X3.prototype={areaStart:Ph,areaEnd:Ph,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 NX(e){return new X3(e)}function Tk(e){return e<0?-1:1}function Ik(e,t,n){var r=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(r||a<0&&-0),o=(n-e._y1)/(a||r<0&&-0),c=(i*a+o*r)/(r+a);return(Tk(i)+Tk(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(c))||0}function Mk(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Ob(e,t,n){var r=e._x0,a=e._y0,i=e._x1,o=e._y1,c=(i-r)/3;e._context.bezierCurveTo(r+c,a+c*t,i-c,o-c*n,i,o)}function Oh(e){this._context=e}Oh.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:Ob(this,this._t0,Mk(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,Ob(this,Mk(this,n=Ik(this,e,t)),n);break;default:Ob(this,this._t0,n=Ik(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Q3(e){this._context=new J3(e)}(Q3.prototype=Object.create(Oh.prototype)).point=function(e,t){Oh.prototype.point.call(this,t,e)};function J3(e){this._context=e}J3.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,a,i){this._context.bezierCurveTo(t,e,r,n,i,a)}};function CX(e){return new Oh(e)}function AX(e){return new Q3(e)}function Z3(e){this._context=e}Z3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=$k(e),a=$k(t),i=0,o=1;o<n;++i,++o)this._context.bezierCurveTo(r[0][i],a[0][i],r[1][i],a[1][i],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function $k(e){var t,n=e.length-1,r,a=new Array(n),i=new Array(n),o=new Array(n);for(a[0]=0,i[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)a[t]=1,i[t]=4,o[t]=4*e[t]+2*e[t+1];for(a[n-1]=2,i[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=a[t]/i[t-1],i[t]-=r,o[t]-=r*o[t-1];for(a[n-1]=o[n-1]/i[n-1],t=n-2;t>=0;--t)a[t]=(o[t]-a[t+1])/i[t];for(i[n-1]=(e[n]+a[n-1])/2,t=0;t<n-1;++t)i[t]=2*e[t+1]-a[t+1];return[a,i]}function _X(e){return new Z3(e)}function gv(e,t){this._context=e,this._t=t}gv.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 EX(e){return new gv(e,.5)}function PX(e){return new gv(e,0)}function kX(e){return new gv(e,1)}function cc(e,t){if((o=e.length)>1)for(var n=1,r,a,i=e[t[0]],o,c=i.length;n<o;++n)for(a=i,i=e[t[n]],r=0;r<c;++r)i[r][1]+=i[r][0]=isNaN(a[r][1])?a[r][0]:a[r][1]}function aj(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function OX(e,t){return e[t]}function RX(e){const t=[];return t.key=e,t}function TX(){var e=ln([]),t=aj,n=cc,r=OX;function a(i){var o=Array.from(e.apply(this,arguments),RX),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=xN(t(o));c<d;++c)o[h[c]].index=c;return n(o,h),o}return a.keys=function(i){return arguments.length?(e=typeof i=="function"?i:ln(Array.from(i)),a):e},a.value=function(i){return arguments.length?(r=typeof i=="function"?i:ln(+i),a):r},a.order=function(i){return arguments.length?(t=i==null?aj:typeof i=="function"?i:ln(Array.from(i)),a):t},a.offset=function(i){return arguments.length?(n=i??cc,a):n},a}function IX(e,t){if((r=e.length)>0){for(var n,r,a=0,i=e[0].length,o;a<i;++a){for(o=n=0;n<r;++n)o+=e[n][a][1]||0;if(o)for(n=0;n<r;++n)e[n][a][1]/=o}cc(e,t)}}function MX(e,t){if((a=e.length)>0){for(var n=0,r=e[t[0]],a,i=r.length;n<i;++n){for(var o=0,c=0;o<a;++o)c+=e[o][n][1]||0;r[n][1]+=r[n][0]=-c/2}cc(e,t)}}function $X(e,t){if(!(!((o=e.length)>0)||!((i=(a=e[t[0]]).length)>0))){for(var n=0,r=1,a,i,o;r<i;++r){for(var c=0,d=0,f=0;c<o;++c){for(var h=e[t[c]],p=h[r][1]||0,y=h[r-1][1]||0,g=(p-y)/2,j=0;j<c;++j){var b=e[t[j]],x=b[r][1]||0,S=b[r-1][1]||0;g+=x-S}d+=p,f+=g*p}a[r-1][1]+=a[r-1][0]=n,d&&(n-=f/d)}a[r-1][1]+=a[r-1][0]=n,cc(e,t)}}function xd(e){"@babel/helpers - typeof";return xd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xd(e)}var DX=["type","size","sizeType"];function sj(){return sj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sj.apply(this,arguments)}function Dk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Lk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Dk(Object(n),!0).forEach(function(r){LX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LX(e,t,n){return t=FX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FX(e){var t=BX(e,"string");return xd(t)=="symbol"?t:t+""}function BX(e,t){if(xd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(xd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zX(e,t){if(e==null)return{};var n=UX(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function UX(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 e5={symbolCircle:bN,symbolCross:cX,symbolDiamond:dX,symbolSquare:fX,symbolStar:vX,symbolTriangle:gX,symbolWye:xX},qX=Math.PI/180,WX=function(t){var n="symbol".concat(hv(t));return e5[n]||bN},VX=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*qX;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},HX=function(t,n){e5["symbol".concat(hv(t))]=n},wN=function(t){var n=t.type,r=n===void 0?"circle":n,a=t.size,i=a===void 0?64:a,o=t.sizeType,c=o===void 0?"area":o,d=zX(t,DX),f=Lk(Lk({},d),{},{type:r,size:i,sizeType:c}),h=function(){var x=WX(r),S=bX().type(x).size(VX(i,c,r));return S()},p=f.className,y=f.cx,g=f.cy,j=gt(f,!0);return y===+y&&g===+g&&i===+i?U.createElement("path",sj({},j,{className:At("recharts-symbols",p),transform:"translate(".concat(y,", ").concat(g,")"),d:h()})):null};wN.registerSymbol=HX;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 ij(){return ij=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ij.apply(this,arguments)}function Fk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function KX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Fk(Object(n),!0).forEach(function(r){bd(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function GX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function YX(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,n5(r.key),r)}}function XX(e,t,n){return t&&YX(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function QX(e,t,n){return t=Rh(t),JX(e,t5()?Reflect.construct(t,n||[],Rh(e).constructor):t.apply(e,n))}function JX(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 ZX(e)}function ZX(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(t5=function(){return!!e})()}function Rh(e){return Rh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Rh(e)}function eQ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&oj(e,t)}function oj(e,t){return oj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},oj(e,t)}function bd(e,t,n){return t=n5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n5(e){var t=tQ(e,"string");return uc(t)=="symbol"?t:t+""}function tQ(e,t){if(uc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(uc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ga=32,jN=(function(e){function t(){return GX(this,t),QX(this,t,arguments)}return eQ(t,e),XX(t,[{key:"renderIcon",value:function(r){var a=this.props.inactiveColor,i=ga/2,o=ga/6,c=ga/3,d=r.inactive?a:r.color;if(r.type==="plainline")return U.createElement("line",{strokeWidth:4,fill:"none",stroke:d,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:i,x2:ga,y2:i,className:"recharts-legend-icon"});if(r.type==="line")return U.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(ga,"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 U.createElement("path",{stroke:"none",fill:d,d:"M0,".concat(ga/8,"h").concat(ga,"v").concat(ga*3/4,"h").concat(-ga,"z"),className:"recharts-legend-icon"});if(U.isValidElement(r.legendIcon)){var f=KX({},r);return delete f.legendIcon,U.cloneElement(r.legendIcon,f)}return U.createElement(wN,{fill:d,cx:i,cy:i,size:ga,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,a=this.props,i=a.payload,o=a.iconSize,c=a.layout,d=a.formatter,f=a.inactiveColor,h={x:0,y:0,width:ga,height:ga},p={display:c==="horizontal"?"inline-block":"block",marginRight:10},y={display:"inline-block",verticalAlign:"middle",marginRight:4};return i.map(function(g,j){var b=g.formatter||d,x=At(bd(bd({"recharts-legend-item":!0},"legend-item-".concat(j),!0),"inactive",g.inactive));if(g.type==="none")return null;var S=jt(g.value)?null:g.value;Hs(!jt(g.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var N=g.inactive?f:g.color;return U.createElement("li",ij({className:x,style:p,key:"legend-item-".concat(j)},Io(r.props,g,j)),U.createElement(Z1,{width:o,height:o,viewBox:h,style:y},r.renderIcon(g)),U.createElement("span",{className:"recharts-legend-item-text",style:{color:N}},b?b(S,g,j):S))})}},{key:"render",value:function(){var r=this.props,a=r.payload,i=r.layout,o=r.align;if(!a||!a.length)return null;var c={padding:0,margin:0,textAlign:i==="horizontal"?o:"left"};return U.createElement("ul",{className:"recharts-default-legend",style:c},this.renderItems())}}])})(v.PureComponent);bd(jN,"displayName","Legend");bd(jN,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Rb,Bk;function nQ(){if(Bk)return Rb;Bk=1;var e=dv();function t(){this.__data__=new e,this.size=0}return Rb=t,Rb}var Tb,zk;function rQ(){if(zk)return Tb;zk=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return Tb=e,Tb}var Ib,Uk;function aQ(){if(Uk)return Ib;Uk=1;function e(t){return this.__data__.get(t)}return Ib=e,Ib}var Mb,qk;function sQ(){if(qk)return Mb;qk=1;function e(t){return this.__data__.has(t)}return Mb=e,Mb}var $b,Wk;function iQ(){if(Wk)return $b;Wk=1;var e=dv(),t=fN(),n=pN(),r=200;function a(i,o){var c=this.__data__;if(c instanceof e){var d=c.__data__;if(!t||d.length<r-1)return d.push([i,o]),this.size=++c.size,this;c=this.__data__=new n(d)}return c.set(i,o),this.size=c.size,this}return $b=a,$b}var Db,Vk;function r5(){if(Vk)return Db;Vk=1;var e=dv(),t=nQ(),n=rQ(),r=aQ(),a=sQ(),i=iQ();function o(c){var d=this.__data__=new e(c);this.size=d.size}return o.prototype.clear=t,o.prototype.delete=n,o.prototype.get=r,o.prototype.has=a,o.prototype.set=i,Db=o,Db}var Lb,Hk;function oQ(){if(Hk)return Lb;Hk=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return Lb=t,Lb}var Fb,Kk;function lQ(){if(Kk)return Fb;Kk=1;function e(t){return this.__data__.has(t)}return Fb=e,Fb}var Bb,Gk;function a5(){if(Gk)return Bb;Gk=1;var e=pN(),t=oQ(),n=lQ();function r(a){var i=-1,o=a==null?0:a.length;for(this.__data__=new e;++i<o;)this.add(a[i])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,Bb=r,Bb}var zb,Yk;function s5(){if(Yk)return zb;Yk=1;function e(t,n){for(var r=-1,a=t==null?0:t.length;++r<a;)if(n(t[r],r,t))return!0;return!1}return zb=e,zb}var Ub,Xk;function i5(){if(Xk)return Ub;Xk=1;function e(t,n){return t.has(n)}return Ub=e,Ub}var qb,Qk;function o5(){if(Qk)return qb;Qk=1;var e=a5(),t=s5(),n=i5(),r=1,a=2;function i(o,c,d,f,h,p){var y=d&r,g=o.length,j=c.length;if(g!=j&&!(y&&j>g))return!1;var b=p.get(o),x=p.get(c);if(b&&x)return b==c&&x==o;var S=-1,N=!0,C=d&a?new e:void 0;for(p.set(o,c),p.set(c,o);++S<g;){var E=o[S],_=c[S];if(f)var k=y?f(_,E,S,c,o,p):f(E,_,S,o,c,p);if(k!==void 0){if(k)continue;N=!1;break}if(C){if(!t(c,function(O,R){if(!n(C,R)&&(E===O||h(E,O,d,f,p)))return C.push(R)})){N=!1;break}}else if(!(E===_||h(E,_,d,f,p))){N=!1;break}}return p.delete(o),p.delete(c),N}return qb=i,qb}var Wb,Jk;function cQ(){if(Jk)return Wb;Jk=1;var e=js(),t=e.Uint8Array;return Wb=t,Wb}var Vb,Zk;function uQ(){if(Zk)return Vb;Zk=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(a,i){r[++n]=[i,a]}),r}return Vb=e,Vb}var Hb,eO;function SN(){if(eO)return Hb;eO=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(a){r[++n]=a}),r}return Hb=e,Hb}var Kb,tO;function dQ(){if(tO)return Kb;tO=1;var e=vf(),t=cQ(),n=dN(),r=o5(),a=uQ(),i=SN(),o=1,c=2,d="[object Boolean]",f="[object Date]",h="[object Error]",p="[object Map]",y="[object Number]",g="[object RegExp]",j="[object Set]",b="[object String]",x="[object Symbol]",S="[object ArrayBuffer]",N="[object DataView]",C=e?e.prototype:void 0,E=C?C.valueOf:void 0;function _(k,O,R,T,F,L,$){switch(R){case N:if(k.byteLength!=O.byteLength||k.byteOffset!=O.byteOffset)return!1;k=k.buffer,O=O.buffer;case S:return!(k.byteLength!=O.byteLength||!L(new t(k),new t(O)));case d:case f:case y:return n(+k,+O);case h:return k.name==O.name&&k.message==O.message;case g:case b:return k==O+"";case p:var Y=a;case j:var H=T&o;if(Y||(Y=i),k.size!=O.size&&!H)return!1;var K=$.get(k);if(K)return K==O;T|=c,$.set(k,O);var J=r(Y(k),Y(O),T,F,L,$);return $.delete(k),J;case x:if(E)return E.call(k)==E.call(O)}return!1}return Kb=_,Kb}var Gb,nO;function l5(){if(nO)return Gb;nO=1;function e(t,n){for(var r=-1,a=n.length,i=t.length;++r<a;)t[i+r]=n[r];return t}return Gb=e,Gb}var Yb,rO;function fQ(){if(rO)return Yb;rO=1;var e=l5(),t=Br();function n(r,a,i){var o=a(r);return t(r)?o:e(o,i(r))}return Yb=n,Yb}var Xb,aO;function pQ(){if(aO)return Xb;aO=1;function e(t,n){for(var r=-1,a=t==null?0:t.length,i=0,o=[];++r<a;){var c=t[r];n(c,r,t)&&(o[i++]=c)}return o}return Xb=e,Xb}var Qb,sO;function hQ(){if(sO)return Qb;sO=1;function e(){return[]}return Qb=e,Qb}var Jb,iO;function mQ(){if(iO)return Jb;iO=1;var e=pQ(),t=hQ(),n=Object.prototype,r=n.propertyIsEnumerable,a=Object.getOwnPropertySymbols,i=a?function(o){return o==null?[]:(o=Object(o),e(a(o),function(c){return r.call(o,c)}))}:t;return Jb=i,Jb}var Zb,oO;function vQ(){if(oO)return Zb;oO=1;function e(t,n){for(var r=-1,a=Array(t);++r<t;)a[r]=n(r);return a}return Zb=e,Zb}var e0,lO;function gQ(){if(lO)return e0;lO=1;var e=ni(),t=ri(),n="[object Arguments]";function r(a){return t(a)&&e(a)==n}return e0=r,e0}var t0,cO;function NN(){if(cO)return t0;cO=1;var e=gQ(),t=ri(),n=Object.prototype,r=n.hasOwnProperty,a=n.propertyIsEnumerable,i=e((function(){return arguments})())?e:function(o){return t(o)&&r.call(o,"callee")&&!a.call(o,"callee")};return t0=i,t0}var Qu={exports:{}},n0,uO;function yQ(){if(uO)return n0;uO=1;function e(){return!1}return n0=e,n0}Qu.exports;var dO;function c5(){return dO||(dO=1,(function(e,t){var n=js(),r=yQ(),a=t&&!t.nodeType&&t,i=a&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===a,c=o?n.Buffer:void 0,d=c?c.isBuffer:void 0,f=d||r;e.exports=f})(Qu,Qu.exports)),Qu.exports}var r0,fO;function CN(){if(fO)return r0;fO=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,a){var i=typeof r;return a=a??e,!!a&&(i=="number"||i!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<a}return r0=n,r0}var a0,pO;function AN(){if(pO)return a0;pO=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return a0=t,a0}var s0,hO;function xQ(){if(hO)return s0;hO=1;var e=ni(),t=AN(),n=ri(),r="[object Arguments]",a="[object Array]",i="[object Boolean]",o="[object Date]",c="[object Error]",d="[object Function]",f="[object Map]",h="[object Number]",p="[object Object]",y="[object RegExp]",g="[object Set]",j="[object String]",b="[object WeakMap]",x="[object ArrayBuffer]",S="[object DataView]",N="[object Float32Array]",C="[object Float64Array]",E="[object Int8Array]",_="[object Int16Array]",k="[object Int32Array]",O="[object Uint8Array]",R="[object Uint8ClampedArray]",T="[object Uint16Array]",F="[object Uint32Array]",L={};L[N]=L[C]=L[E]=L[_]=L[k]=L[O]=L[R]=L[T]=L[F]=!0,L[r]=L[a]=L[x]=L[i]=L[S]=L[o]=L[c]=L[d]=L[f]=L[h]=L[p]=L[y]=L[g]=L[j]=L[b]=!1;function $(Y){return n(Y)&&t(Y.length)&&!!L[e(Y)]}return s0=$,s0}var i0,mO;function u5(){if(mO)return i0;mO=1;function e(t){return function(n){return t(n)}}return i0=e,i0}var Ju={exports:{}};Ju.exports;var vO;function bQ(){return vO||(vO=1,(function(e,t){var n=k3(),r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===r,o=i&&n.process,c=(function(){try{var d=a&&a.require&&a.require("util").types;return d||o&&o.binding&&o.binding("util")}catch{}})();e.exports=c})(Ju,Ju.exports)),Ju.exports}var o0,gO;function d5(){if(gO)return o0;gO=1;var e=xQ(),t=u5(),n=bQ(),r=n&&n.isTypedArray,a=r?t(r):e;return o0=a,o0}var l0,yO;function wQ(){if(yO)return l0;yO=1;var e=vQ(),t=NN(),n=Br(),r=c5(),a=CN(),i=d5(),o=Object.prototype,c=o.hasOwnProperty;function d(f,h){var p=n(f),y=!p&&t(f),g=!p&&!y&&r(f),j=!p&&!y&&!g&&i(f),b=p||y||g||j,x=b?e(f.length,String):[],S=x.length;for(var N in f)(h||c.call(f,N))&&!(b&&(N=="length"||g&&(N=="offset"||N=="parent")||j&&(N=="buffer"||N=="byteLength"||N=="byteOffset")||a(N,S)))&&x.push(N);return x}return l0=d,l0}var c0,xO;function jQ(){if(xO)return c0;xO=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,a=typeof r=="function"&&r.prototype||e;return n===a}return c0=t,c0}var u0,bO;function f5(){if(bO)return u0;bO=1;function e(t,n){return function(r){return t(n(r))}}return u0=e,u0}var d0,wO;function SQ(){if(wO)return d0;wO=1;var e=f5(),t=e(Object.keys,Object);return d0=t,d0}var f0,jO;function NQ(){if(jO)return f0;jO=1;var e=jQ(),t=SQ(),n=Object.prototype,r=n.hasOwnProperty;function a(i){if(!e(i))return t(i);var o=[];for(var c in Object(i))r.call(i,c)&&c!="constructor"&&o.push(c);return o}return f0=a,f0}var p0,SO;function yf(){if(SO)return p0;SO=1;var e=uN(),t=AN();function n(r){return r!=null&&t(r.length)&&!e(r)}return p0=n,p0}var h0,NO;function yv(){if(NO)return h0;NO=1;var e=wQ(),t=NQ(),n=yf();function r(a){return n(a)?e(a):t(a)}return h0=r,h0}var m0,CO;function CQ(){if(CO)return m0;CO=1;var e=fQ(),t=mQ(),n=yv();function r(a){return e(a,n,t)}return m0=r,m0}var v0,AO;function AQ(){if(AO)return v0;AO=1;var e=CQ(),t=1,n=Object.prototype,r=n.hasOwnProperty;function a(i,o,c,d,f,h){var p=c&t,y=e(i),g=y.length,j=e(o),b=j.length;if(g!=b&&!p)return!1;for(var x=g;x--;){var S=y[x];if(!(p?S in o:r.call(o,S)))return!1}var N=h.get(i),C=h.get(o);if(N&&C)return N==o&&C==i;var E=!0;h.set(i,o),h.set(o,i);for(var _=p;++x<g;){S=y[x];var k=i[S],O=o[S];if(d)var R=p?d(O,k,S,o,i,h):d(k,O,S,i,o,h);if(!(R===void 0?k===O||f(k,O,c,d,h):R)){E=!1;break}_||(_=S=="constructor")}if(E&&!_){var T=i.constructor,F=o.constructor;T!=F&&"constructor"in i&&"constructor"in o&&!(typeof T=="function"&&T instanceof T&&typeof F=="function"&&F instanceof F)&&(E=!1)}return h.delete(i),h.delete(o),E}return v0=a,v0}var g0,_O;function _Q(){if(_O)return g0;_O=1;var e=Ho(),t=js(),n=e(t,"DataView");return g0=n,g0}var y0,EO;function EQ(){if(EO)return y0;EO=1;var e=Ho(),t=js(),n=e(t,"Promise");return y0=n,y0}var x0,PO;function p5(){if(PO)return x0;PO=1;var e=Ho(),t=js(),n=e(t,"Set");return x0=n,x0}var b0,kO;function PQ(){if(kO)return b0;kO=1;var e=Ho(),t=js(),n=e(t,"WeakMap");return b0=n,b0}var w0,OO;function kQ(){if(OO)return w0;OO=1;var e=_Q(),t=fN(),n=EQ(),r=p5(),a=PQ(),i=ni(),o=O3(),c="[object Map]",d="[object Object]",f="[object Promise]",h="[object Set]",p="[object WeakMap]",y="[object DataView]",g=o(e),j=o(t),b=o(n),x=o(r),S=o(a),N=i;return(e&&N(new e(new ArrayBuffer(1)))!=y||t&&N(new t)!=c||n&&N(n.resolve())!=f||r&&N(new r)!=h||a&&N(new a)!=p)&&(N=function(C){var E=i(C),_=E==d?C.constructor:void 0,k=_?o(_):"";if(k)switch(k){case g:return y;case j:return c;case b:return f;case x:return h;case S:return p}return E}),w0=N,w0}var j0,RO;function OQ(){if(RO)return j0;RO=1;var e=r5(),t=o5(),n=dQ(),r=AQ(),a=kQ(),i=Br(),o=c5(),c=d5(),d=1,f="[object Arguments]",h="[object Array]",p="[object Object]",y=Object.prototype,g=y.hasOwnProperty;function j(b,x,S,N,C,E){var _=i(b),k=i(x),O=_?h:a(b),R=k?h:a(x);O=O==f?p:O,R=R==f?p:R;var T=O==p,F=R==p,L=O==R;if(L&&o(b)){if(!o(x))return!1;_=!0,T=!1}if(L&&!T)return E||(E=new e),_||c(b)?t(b,x,S,N,C,E):n(b,x,O,S,N,C,E);if(!(S&d)){var $=T&&g.call(b,"__wrapped__"),Y=F&&g.call(x,"__wrapped__");if($||Y){var H=$?b.value():b,K=Y?x.value():x;return E||(E=new e),C(H,K,S,N,E)}}return L?(E||(E=new e),r(b,x,S,N,C,E)):!1}return j0=j,j0}var S0,TO;function _N(){if(TO)return S0;TO=1;var e=OQ(),t=ri();function n(r,a,i,o,c){return r===a?!0:r==null||a==null||!t(r)&&!t(a)?r!==r&&a!==a:e(r,a,i,o,n,c)}return S0=n,S0}var N0,IO;function RQ(){if(IO)return N0;IO=1;var e=r5(),t=_N(),n=1,r=2;function a(i,o,c,d){var f=c.length,h=f,p=!d;if(i==null)return!h;for(i=Object(i);f--;){var y=c[f];if(p&&y[2]?y[1]!==i[y[0]]:!(y[0]in i))return!1}for(;++f<h;){y=c[f];var g=y[0],j=i[g],b=y[1];if(p&&y[2]){if(j===void 0&&!(g in i))return!1}else{var x=new e;if(d)var S=d(j,b,g,i,o,x);if(!(S===void 0?t(b,j,n|r,d,x):S))return!1}}return!0}return N0=a,N0}var C0,MO;function h5(){if(MO)return C0;MO=1;var e=Yi();function t(n){return n===n&&!e(n)}return C0=t,C0}var A0,$O;function TQ(){if($O)return A0;$O=1;var e=h5(),t=yv();function n(r){for(var a=t(r),i=a.length;i--;){var o=a[i],c=r[o];a[i]=[o,c,e(c)]}return a}return A0=n,A0}var _0,DO;function m5(){if(DO)return _0;DO=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return _0=e,_0}var E0,LO;function IQ(){if(LO)return E0;LO=1;var e=RQ(),t=TQ(),n=m5();function r(a){var i=t(a);return i.length==1&&i[0][2]?n(i[0][0],i[0][1]):function(o){return o===a||e(o,a,i)}}return E0=r,E0}var P0,FO;function MQ(){if(FO)return P0;FO=1;function e(t,n){return t!=null&&n in Object(t)}return P0=e,P0}var k0,BO;function $Q(){if(BO)return k0;BO=1;var e=I3(),t=NN(),n=Br(),r=CN(),a=AN(),i=pv();function o(c,d,f){d=e(d,c);for(var h=-1,p=d.length,y=!1;++h<p;){var g=i(d[h]);if(!(y=c!=null&&f(c,g)))break;c=c[g]}return y||++h!=p?y:(p=c==null?0:c.length,!!p&&a(p)&&r(g,p)&&(n(c)||t(c)))}return k0=o,k0}var O0,zO;function DQ(){if(zO)return O0;zO=1;var e=MQ(),t=$Q();function n(r,a){return r!=null&&t(r,a,e)}return O0=n,O0}var R0,UO;function LQ(){if(UO)return R0;UO=1;var e=_N(),t=M3(),n=DQ(),r=cN(),a=h5(),i=m5(),o=pv(),c=1,d=2;function f(h,p){return r(h)&&a(p)?i(o(h),p):function(y){var g=t(y,h);return g===void 0&&g===p?n(y,h):e(p,g,c|d)}}return R0=f,R0}var T0,qO;function Gc(){if(qO)return T0;qO=1;function e(t){return t}return T0=e,T0}var I0,WO;function FQ(){if(WO)return I0;WO=1;function e(t){return function(n){return n?.[t]}}return I0=e,I0}var M0,VO;function BQ(){if(VO)return M0;VO=1;var e=mN();function t(n){return function(r){return e(r,n)}}return M0=t,M0}var $0,HO;function zQ(){if(HO)return $0;HO=1;var e=FQ(),t=BQ(),n=cN(),r=pv();function a(i){return n(i)?e(r(i)):t(i)}return $0=a,$0}var D0,KO;function Ss(){if(KO)return D0;KO=1;var e=IQ(),t=LQ(),n=Gc(),r=Br(),a=zQ();function i(o){return typeof o=="function"?o:o==null?n:typeof o=="object"?r(o)?t(o[0],o[1]):e(o):a(o)}return D0=i,D0}var L0,GO;function v5(){if(GO)return L0;GO=1;function e(t,n,r,a){for(var i=t.length,o=r+(a?1:-1);a?o--:++o<i;)if(n(t[o],o,t))return o;return-1}return L0=e,L0}var F0,YO;function UQ(){if(YO)return F0;YO=1;function e(t){return t!==t}return F0=e,F0}var B0,XO;function qQ(){if(XO)return B0;XO=1;function e(t,n,r){for(var a=r-1,i=t.length;++a<i;)if(t[a]===n)return a;return-1}return B0=e,B0}var z0,QO;function WQ(){if(QO)return z0;QO=1;var e=v5(),t=UQ(),n=qQ();function r(a,i,o){return i===i?n(a,i,o):e(a,t,o)}return z0=r,z0}var U0,JO;function VQ(){if(JO)return U0;JO=1;var e=WQ();function t(n,r){var a=n==null?0:n.length;return!!a&&e(n,r,0)>-1}return U0=t,U0}var q0,ZO;function HQ(){if(ZO)return q0;ZO=1;function e(t,n,r){for(var a=-1,i=t==null?0:t.length;++a<i;)if(r(n,t[a]))return!0;return!1}return q0=e,q0}var W0,eR;function KQ(){if(eR)return W0;eR=1;function e(){}return W0=e,W0}var V0,tR;function GQ(){if(tR)return V0;tR=1;var e=p5(),t=KQ(),n=SN(),r=1/0,a=e&&1/n(new e([,-0]))[1]==r?function(i){return new e(i)}:t;return V0=a,V0}var H0,nR;function YQ(){if(nR)return H0;nR=1;var e=a5(),t=VQ(),n=HQ(),r=i5(),a=GQ(),i=SN(),o=200;function c(d,f,h){var p=-1,y=t,g=d.length,j=!0,b=[],x=b;if(h)j=!1,y=n;else if(g>=o){var S=f?null:a(d);if(S)return i(S);j=!1,y=r,x=new e}else x=f?[]:b;e:for(;++p<g;){var N=d[p],C=f?f(N):N;if(N=h||N!==0?N:0,j&&C===C){for(var E=x.length;E--;)if(x[E]===C)continue e;f&&x.push(C),b.push(N)}else y(x,C,h)||(x!==b&&x.push(C),b.push(N))}return b}return H0=c,H0}var K0,rR;function XQ(){if(rR)return K0;rR=1;var e=Ss(),t=YQ();function n(r,a){return r&&r.length?t(r,e(a,2)):[]}return K0=n,K0}var QQ=XQ();const aR=Yt(QQ);function g5(e,t,n){return t===!0?aR(e,n):jt(t)?aR(e,t):e}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)}var JQ=["ref"];function sR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function $s(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sR(Object(n),!0).forEach(function(r){xv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ZQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iR(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,x5(r.key),r)}}function eJ(e,t,n){return t&&iR(e.prototype,t),n&&iR(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function tJ(e,t,n){return t=Th(t),nJ(e,y5()?Reflect.construct(t,n||[],Th(e).constructor):t.apply(e,n))}function nJ(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 rJ(e)}function rJ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(y5=function(){return!!e})()}function Th(e){return Th=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Th(e)}function aJ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lj(e,t)}function lj(e,t){return lj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},lj(e,t)}function xv(e,t,n){return t=x5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x5(e){var t=sJ(e,"string");return dc(t)=="symbol"?t:t+""}function sJ(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 iJ(e,t){if(e==null)return{};var n=oJ(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function oJ(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 lJ(e){return e.value}function cJ(e,t){if(U.isValidElement(e))return U.cloneElement(e,t);if(typeof e=="function")return U.createElement(e,t);t.ref;var n=iJ(t,JQ);return U.createElement(jN,n)}var oR=1,_o=(function(e){function t(){var n;ZQ(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=tJ(this,t,[].concat(a)),xv(n,"lastBoundingBox",{width:-1,height:-1}),n}return aJ(t,e),eJ(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,a=this.getBBox();a?(Math.abs(a.width-this.lastBoundingBox.width)>oR||Math.abs(a.height-this.lastBoundingBox.height)>oR)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,r&&r(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?$s({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var a=this.props,i=a.layout,o=a.align,c=a.verticalAlign,d=a.margin,f=a.chartWidth,h=a.chartHeight,p,y;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&i==="vertical"){var g=this.getBBoxSnapshot();p={left:((f||0)-g.width)/2}}else p=o==="right"?{right:d&&d.right||0}:{left:d&&d.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(c==="middle"){var j=this.getBBoxSnapshot();y={top:((h||0)-j.height)/2}}else y=c==="bottom"?{bottom:d&&d.bottom||0}:{top:d&&d.top||0};return $s($s({},p),y)}},{key:"render",value:function(){var r=this,a=this.props,i=a.content,o=a.width,c=a.height,d=a.wrapperStyle,f=a.payloadUniqBy,h=a.payload,p=$s($s({position:"absolute",width:o||"auto",height:c||"auto"},this.getDefaultPosition(d)),d);return U.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(g){r.wrapperNode=g}},cJ(i,$s($s({},this.props),{},{payload:g5(h,f,lJ)})))}}],[{key:"getWithHeight",value:function(r,a){var i=$s($s({},this.defaultProps),r.props),o=i.layout;return o==="vertical"&&Ue(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||a}:null}}])})(v.PureComponent);xv(_o,"displayName","Legend");xv(_o,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var G0,lR;function uJ(){if(lR)return G0;lR=1;var e=vf(),t=NN(),n=Br(),r=e?e.isConcatSpreadable:void 0;function a(i){return n(i)||t(i)||!!(r&&i&&i[r])}return G0=a,G0}var Y0,cR;function b5(){if(cR)return Y0;cR=1;var e=l5(),t=uJ();function n(r,a,i,o,c){var d=-1,f=r.length;for(i||(i=t),c||(c=[]);++d<f;){var h=r[d];a>0&&i(h)?a>1?n(h,a-1,i,o,c):e(c,h):o||(c[c.length]=h)}return c}return Y0=n,Y0}var X0,uR;function dJ(){if(uR)return X0;uR=1;function e(t){return function(n,r,a){for(var i=-1,o=Object(n),c=a(n),d=c.length;d--;){var f=c[t?d:++i];if(r(o[f],f,o)===!1)break}return n}}return X0=e,X0}var Q0,dR;function fJ(){if(dR)return Q0;dR=1;var e=dJ(),t=e();return Q0=t,Q0}var J0,fR;function w5(){if(fR)return J0;fR=1;var e=fJ(),t=yv();function n(r,a){return r&&e(r,a,t)}return J0=n,J0}var Z0,pR;function pJ(){if(pR)return Z0;pR=1;var e=yf();function t(n,r){return function(a,i){if(a==null)return a;if(!e(a))return n(a,i);for(var o=a.length,c=r?o:-1,d=Object(a);(r?c--:++c<o)&&i(d[c],c,d)!==!1;);return a}}return Z0=t,Z0}var ew,hR;function EN(){if(hR)return ew;hR=1;var e=w5(),t=pJ(),n=t(e);return ew=n,ew}var tw,mR;function j5(){if(mR)return tw;mR=1;var e=EN(),t=yf();function n(r,a){var i=-1,o=t(r)?Array(r.length):[];return e(r,function(c,d,f){o[++i]=a(c,d,f)}),o}return tw=n,tw}var nw,vR;function hJ(){if(vR)return nw;vR=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return nw=e,nw}var rw,gR;function mJ(){if(gR)return rw;gR=1;var e=Vc();function t(n,r){if(n!==r){var a=n!==void 0,i=n===null,o=n===n,c=e(n),d=r!==void 0,f=r===null,h=r===r,p=e(r);if(!f&&!p&&!c&&n>r||c&&d&&h&&!f&&!p||i&&d&&h||!a&&h||!o)return 1;if(!i&&!c&&!p&&n<r||p&&a&&o&&!i&&!c||f&&a&&o||!d&&o||!h)return-1}return 0}return rw=t,rw}var aw,yR;function vJ(){if(yR)return aw;yR=1;var e=mJ();function t(n,r,a){for(var i=-1,o=n.criteria,c=r.criteria,d=o.length,f=a.length;++i<d;){var h=e(o[i],c[i]);if(h){if(i>=f)return h;var p=a[i];return h*(p=="desc"?-1:1)}}return n.index-r.index}return aw=t,aw}var sw,xR;function gJ(){if(xR)return sw;xR=1;var e=hN(),t=mN(),n=Ss(),r=j5(),a=hJ(),i=u5(),o=vJ(),c=Gc(),d=Br();function f(h,p,y){p.length?p=e(p,function(b){return d(b)?function(x){return t(x,b.length===1?b[0]:b)}:b}):p=[c];var g=-1;p=e(p,i(n));var j=r(h,function(b,x,S){var N=e(p,function(C){return C(b)});return{criteria:N,index:++g,value:b}});return a(j,function(b,x){return o(b,x,y)})}return sw=f,sw}var iw,bR;function yJ(){if(bR)return iw;bR=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 iw=e,iw}var ow,wR;function xJ(){if(wR)return ow;wR=1;var e=yJ(),t=Math.max;function n(r,a,i){return a=t(a===void 0?r.length-1:a,0),function(){for(var o=arguments,c=-1,d=t(o.length-a,0),f=Array(d);++c<d;)f[c]=o[a+c];c=-1;for(var h=Array(a+1);++c<a;)h[c]=o[c];return h[a]=i(f),e(r,this,h)}}return ow=n,ow}var lw,jR;function bJ(){if(jR)return lw;jR=1;function e(t){return function(){return t}}return lw=e,lw}var cw,SR;function S5(){if(SR)return cw;SR=1;var e=Ho(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return cw=t,cw}var uw,NR;function wJ(){if(NR)return uw;NR=1;var e=bJ(),t=S5(),n=Gc(),r=t?function(a,i){return t(a,"toString",{configurable:!0,enumerable:!1,value:e(i),writable:!0})}:n;return uw=r,uw}var dw,CR;function jJ(){if(CR)return dw;CR=1;var e=800,t=16,n=Date.now;function r(a){var i=0,o=0;return function(){var c=n(),d=t-(c-o);if(o=c,d>0){if(++i>=e)return arguments[0]}else i=0;return a.apply(void 0,arguments)}}return dw=r,dw}var fw,AR;function SJ(){if(AR)return fw;AR=1;var e=wJ(),t=jJ(),n=t(e);return fw=n,fw}var pw,_R;function NJ(){if(_R)return pw;_R=1;var e=Gc(),t=xJ(),n=SJ();function r(a,i){return n(t(a,i,e),a+"")}return pw=r,pw}var hw,ER;function bv(){if(ER)return hw;ER=1;var e=dN(),t=yf(),n=CN(),r=Yi();function a(i,o,c){if(!r(c))return!1;var d=typeof o;return(d=="number"?t(c)&&n(o,c.length):d=="string"&&o in c)?e(c[o],i):!1}return hw=a,hw}var mw,PR;function CJ(){if(PR)return mw;PR=1;var e=b5(),t=gJ(),n=NJ(),r=bv(),a=n(function(i,o){if(i==null)return[];var c=o.length;return c>1&&r(i,o[0],o[1])?o=[]:c>2&&r(o[0],o[1],o[2])&&(o=[o[0]]),t(i,e(o,1),[])});return mw=a,mw}var AJ=CJ();const PN=Yt(AJ);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 cj(){return cj=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},cj.apply(this,arguments)}function _J(e,t){return OJ(e)||kJ(e,t)||PJ(e,t)||EJ()}function EJ(){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 PJ(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 kJ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function OJ(e){if(Array.isArray(e))return e}function OR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function vw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OR(Object(n),!0).forEach(function(r){RJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function RJ(e,t,n){return t=TJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TJ(e){var t=IJ(e,"string");return wd(t)=="symbol"?t:t+""}function IJ(e,t){if(wd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(wd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function MJ(e){return Array.isArray(e)&&Wn(e[0])&&Wn(e[1])?e.join(" ~ "):e}var $J=function(t){var n=t.separator,r=n===void 0?" : ":n,a=t.contentStyle,i=a===void 0?{}:a,o=t.itemStyle,c=o===void 0?{}:o,d=t.labelStyle,f=d===void 0?{}:d,h=t.payload,p=t.formatter,y=t.itemSorter,g=t.wrapperClassName,j=t.labelClassName,b=t.label,x=t.labelFormatter,S=t.accessibilityLayer,N=S===void 0?!1:S,C=function(){if(h&&h.length){var $={padding:0,margin:0},Y=(y?PN(h,y):h).map(function(H,K){if(H.type==="none")return null;var J=vw({display:"block",paddingTop:4,paddingBottom:4,color:H.color||"#000"},c),Q=H.formatter||p||MJ,D=H.value,B=H.name,Z=D,z=B;if(Q&&Z!=null&&z!=null){var M=Q(D,B,H,K,h);if(Array.isArray(M)){var re=_J(M,2);Z=re[0],z=re[1]}else Z=M}return U.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(K),style:J},Wn(z)?U.createElement("span",{className:"recharts-tooltip-item-name"},z):null,Wn(z)?U.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,U.createElement("span",{className:"recharts-tooltip-item-value"},Z),U.createElement("span",{className:"recharts-tooltip-item-unit"},H.unit||""))});return U.createElement("ul",{className:"recharts-tooltip-item-list",style:$},Y)}return null},E=vw({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),_=vw({margin:0},f),k=!Ct(b),O=k?b:"",R=At("recharts-default-tooltip",g),T=At("recharts-tooltip-label",j);k&&x&&h!==void 0&&h!==null&&(O=x(b,h));var F=N?{role:"status","aria-live":"assertive"}:{};return U.createElement("div",cj({className:R,style:E},F),U.createElement("p",{className:T,style:_},U.isValidElement(O)?O:"".concat(O)),C())};function jd(e){"@babel/helpers - typeof";return jd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jd(e)}function Kp(e,t,n){return t=DJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DJ(e){var t=LJ(e,"string");return jd(t)=="symbol"?t:t+""}function LJ(e,t){if(jd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(jd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Lu="recharts-tooltip-wrapper",FJ={visibility:"hidden"};function BJ(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return At(Lu,Kp(Kp(Kp(Kp({},"".concat(Lu,"-right"),Ue(n)&&t&&Ue(t.x)&&n>=t.x),"".concat(Lu,"-left"),Ue(n)&&t&&Ue(t.x)&&n<t.x),"".concat(Lu,"-bottom"),Ue(r)&&t&&Ue(t.y)&&r>=t.y),"".concat(Lu,"-top"),Ue(r)&&t&&Ue(t.y)&&r<t.y))}function RR(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,a=e.offsetTopLeft,i=e.position,o=e.reverseDirection,c=e.tooltipDimension,d=e.viewBox,f=e.viewBoxDimension;if(i&&Ue(i[r]))return i[r];var h=n[r]-c-a,p=n[r]+a;if(t[r])return o[r]?h:p;if(o[r]){var y=h,g=d[r];return y<g?Math.max(p,d[r]):Math.max(h,d[r])}var j=p+c,b=d[r]+f;return j>b?Math.max(h,d[r]):Math.max(p,d[r])}function zJ(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function UJ(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,a=e.position,i=e.reverseDirection,o=e.tooltipBox,c=e.useTranslate3d,d=e.viewBox,f,h,p;return o.height>0&&o.width>0&&n?(h=RR({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:o.width,viewBox:d,viewBoxDimension:d.width}),p=RR({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:o.height,viewBox:d,viewBoxDimension:d.height}),f=zJ({translateX:h,translateY:p,useTranslate3d:c})):f=FJ,{cssProperties:f,cssClasses:BJ({translateX:h,translateY:p,coordinate:n})}}function fc(e){"@babel/helpers - typeof";return fc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fc(e)}function TR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function IR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TR(Object(n),!0).forEach(function(r){dj(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WJ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,C5(r.key),r)}}function VJ(e,t,n){return t&&WJ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function HJ(e,t,n){return t=Ih(t),KJ(e,N5()?Reflect.construct(t,n||[],Ih(e).constructor):t.apply(e,n))}function KJ(e,t){if(t&&(fc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return GJ(e)}function GJ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function N5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(N5=function(){return!!e})()}function Ih(e){return Ih=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ih(e)}function YJ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&uj(e,t)}function uj(e,t){return uj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},uj(e,t)}function dj(e,t,n){return t=C5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C5(e){var t=XJ(e,"string");return fc(t)=="symbol"?t:t+""}function XJ(e,t){if(fc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(fc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var MR=1,QJ=(function(e){function t(){var n;qJ(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=HJ(this,t,[].concat(a)),dj(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),dj(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 YJ(t,e),VJ(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>MR||Math.abs(r.height-this.state.lastBoundingBox.height)>MR)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,c=a.animationDuration,d=a.animationEasing,f=a.children,h=a.coordinate,p=a.hasPayload,y=a.isAnimationActive,g=a.offset,j=a.position,b=a.reverseDirection,x=a.useTranslate3d,S=a.viewBox,N=a.wrapperStyle,C=UJ({allowEscapeViewBox:o,coordinate:h,offsetTopLeft:g,position:j,reverseDirection:b,tooltipBox:this.state.lastBoundingBox,useTranslate3d:x,viewBox:S}),E=C.cssClasses,_=C.cssProperties,k=IR(IR({transition:y&&i?"transform ".concat(c,"ms ").concat(d):void 0},_),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&p?"visible":"hidden",position:"absolute",top:0,left:0},N);return U.createElement("div",{tabIndex:-1,className:E,style:k,ref:function(R){r.wrapperNode=R}},f)}}])})(v.PureComponent),JJ=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Ko={isSsr:JJ()};function pc(e){"@babel/helpers - typeof";return pc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pc(e)}function $R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function DR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$R(Object(n),!0).forEach(function(r){kN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$R(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ZJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function eZ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_5(r.key),r)}}function tZ(e,t,n){return t&&eZ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function nZ(e,t,n){return t=Mh(t),rZ(e,A5()?Reflect.construct(t,n||[],Mh(e).constructor):t.apply(e,n))}function rZ(e,t){if(t&&(pc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return aZ(e)}function aZ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function A5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(A5=function(){return!!e})()}function Mh(e){return Mh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Mh(e)}function sZ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fj(e,t)}function fj(e,t){return fj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},fj(e,t)}function kN(e,t,n){return t=_5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _5(e){var t=iZ(e,"string");return pc(t)=="symbol"?t:t+""}function iZ(e,t){if(pc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(pc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function oZ(e){return e.dataKey}function lZ(e,t){return U.isValidElement(e)?U.cloneElement(e,t):typeof e=="function"?U.createElement(e,t):U.createElement($J,t)}var Mr=(function(e){function t(){return ZJ(this,t),nZ(this,t,arguments)}return sZ(t,e),tZ(t,[{key:"render",value:function(){var r=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,c=a.animationDuration,d=a.animationEasing,f=a.content,h=a.coordinate,p=a.filterNull,y=a.isAnimationActive,g=a.offset,j=a.payload,b=a.payloadUniqBy,x=a.position,S=a.reverseDirection,N=a.useTranslate3d,C=a.viewBox,E=a.wrapperStyle,_=j??[];p&&_.length&&(_=g5(j.filter(function(O){return O.value!=null&&(O.hide!==!0||r.props.includeHidden)}),b,oZ));var k=_.length>0;return U.createElement(QJ,{allowEscapeViewBox:o,animationDuration:c,animationEasing:d,isAnimationActive:y,active:i,coordinate:h,hasPayload:k,offset:g,position:x,reverseDirection:S,useTranslate3d:N,viewBox:C,wrapperStyle:E},lZ(f,DR(DR({},this.props),{},{payload:_})))}}])})(v.PureComponent);kN(Mr,"displayName","Tooltip");kN(Mr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Ko.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 gw,LR;function cZ(){if(LR)return gw;LR=1;var e=js(),t=function(){return e.Date.now()};return gw=t,gw}var yw,FR;function uZ(){if(FR)return yw;FR=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return yw=t,yw}var xw,BR;function dZ(){if(BR)return xw;BR=1;var e=uZ(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return xw=n,xw}var bw,zR;function E5(){if(zR)return bw;zR=1;var e=dZ(),t=Yi(),n=Vc(),r=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,c=parseInt;function d(f){if(typeof f=="number")return f;if(n(f))return r;if(t(f)){var h=typeof f.valueOf=="function"?f.valueOf():f;f=t(h)?h+"":h}if(typeof f!="string")return f===0?f:+f;f=e(f);var p=i.test(f);return p||o.test(f)?c(f.slice(2),p?2:8):a.test(f)?r:+f}return bw=d,bw}var ww,UR;function fZ(){if(UR)return ww;UR=1;var e=Yi(),t=cZ(),n=E5(),r="Expected a function",a=Math.max,i=Math.min;function o(c,d,f){var h,p,y,g,j,b,x=0,S=!1,N=!1,C=!0;if(typeof c!="function")throw new TypeError(r);d=n(d)||0,e(f)&&(S=!!f.leading,N="maxWait"in f,y=N?a(n(f.maxWait)||0,d):y,C="trailing"in f?!!f.trailing:C);function E(Y){var H=h,K=p;return h=p=void 0,x=Y,g=c.apply(K,H),g}function _(Y){return x=Y,j=setTimeout(R,d),S?E(Y):g}function k(Y){var H=Y-b,K=Y-x,J=d-H;return N?i(J,y-K):J}function O(Y){var H=Y-b,K=Y-x;return b===void 0||H>=d||H<0||N&&K>=y}function R(){var Y=t();if(O(Y))return T(Y);j=setTimeout(R,k(Y))}function T(Y){return j=void 0,C&&h?E(Y):(h=p=void 0,g)}function F(){j!==void 0&&clearTimeout(j),x=0,h=b=p=j=void 0}function L(){return j===void 0?g:T(t())}function $(){var Y=t(),H=O(Y);if(h=arguments,p=this,b=Y,H){if(j===void 0)return _(b);if(N)return clearTimeout(j),j=setTimeout(R,d),E(b)}return j===void 0&&(j=setTimeout(R,d)),g}return $.cancel=F,$.flush=L,$}return ww=o,ww}var jw,qR;function pZ(){if(qR)return jw;qR=1;var e=fZ(),t=Yi(),n="Expected a function";function r(a,i,o){var c=!0,d=!0;if(typeof a!="function")throw new TypeError(n);return t(o)&&(c="leading"in o?!!o.leading:c,d="trailing"in o?!!o.trailing:d),e(a,i,{leading:c,maxWait:i,trailing:d})}return jw=r,jw}var hZ=pZ();const P5=Yt(hZ);function Sd(e){"@babel/helpers - typeof";return Sd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sd(e)}function WR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Gp(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){mZ(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 mZ(e,t,n){return t=vZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vZ(e){var t=gZ(e,"string");return Sd(t)=="symbol"?t:t+""}function gZ(e,t){if(Sd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Sd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yZ(e,t){return jZ(e)||wZ(e,t)||bZ(e,t)||xZ()}function xZ(){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 bZ(e,t){if(e){if(typeof e=="string")return VR(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 VR(e,t)}}function VR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function wZ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function jZ(e){if(Array.isArray(e))return e}var $h=v.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,a=r===void 0?{width:-1,height:-1}:r,i=e.width,o=i===void 0?"100%":i,c=e.height,d=c===void 0?"100%":c,f=e.minWidth,h=f===void 0?0:f,p=e.minHeight,y=e.maxHeight,g=e.children,j=e.debounce,b=j===void 0?0:j,x=e.id,S=e.className,N=e.onResize,C=e.style,E=C===void 0?{}:C,_=v.useRef(null),k=v.useRef();k.current=N,v.useImperativeHandle(t,function(){return Object.defineProperty(_.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),_.current},configurable:!0})});var O=v.useState({containerWidth:a.width,containerHeight:a.height}),R=yZ(O,2),T=R[0],F=R[1],L=v.useCallback(function(Y,H){F(function(K){var J=Math.round(Y),Q=Math.round(H);return K.containerWidth===J&&K.containerHeight===Q?K:{containerWidth:J,containerHeight:Q}})},[]);v.useEffect(function(){var Y=function(B){var Z,z=B[0].contentRect,M=z.width,re=z.height;L(M,re),(Z=k.current)===null||Z===void 0||Z.call(k,M,re)};b>0&&(Y=P5(Y,b,{trailing:!0,leading:!1}));var H=new ResizeObserver(Y),K=_.current.getBoundingClientRect(),J=K.width,Q=K.height;return L(J,Q),H.observe(_.current),function(){H.disconnect()}},[L,b]);var $=v.useMemo(function(){var Y=T.containerWidth,H=T.containerHeight;if(Y<0||H<0)return null;Hs(So(o)||So(d),`The width(%s) and height(%s) are both fixed numbers,
|
|
62
|
-
maybe you don't need to use a ResponsiveContainer.`,o,d),Hs(!n||n>0,"The aspect(%s) must be greater than zero.",n);var K=So(o)?Y:o,J=So(d)?H:d;n&&n>0&&(K?J=K/n:J&&(K=J*n),y&&J>y&&(J=y)),Hs(K>0||J>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.`,K,J,o,d,h,p,n);var Q=!Array.isArray(g)&&Vs(g.type).endsWith("Chart");return U.Children.map(g,function(D){return U.isValidElement(D)?v.cloneElement(D,Gp({width:K,height:J},Q?{style:Gp({height:"100%",width:"100%",maxHeight:J,maxWidth:K},D.props.style)}:{})):D})},[n,g,d,y,p,h,T,o]);return U.createElement("div",{id:x?"".concat(x):void 0,className:At("recharts-responsive-container",S),style:Gp(Gp({},E),{},{width:o,height:d,minWidth:h,minHeight:p,maxHeight:y}),ref:_},$)}),wv=function(t){return null};wv.displayName="Cell";function Nd(e){"@babel/helpers - typeof";return Nd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nd(e)}function HR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function pj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HR(Object(n),!0).forEach(function(r){SZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function SZ(e,t,n){return t=NZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NZ(e){var t=CZ(e,"string");return Nd(t)=="symbol"?t:t+""}function CZ(e,t){if(Nd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Nd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ol={widthCache:{},cacheCount:0},AZ=2e3,_Z={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},KR="recharts_measurement_span";function EZ(e){var t=pj({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var ad=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Ko.isSsr)return{width:0,height:0};var r=EZ(n),a=JSON.stringify({text:t,copyStyle:r});if(Ol.widthCache[a])return Ol.widthCache[a];try{var i=document.getElementById(KR);i||(i=document.createElement("span"),i.setAttribute("id",KR),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=pj(pj({},_Z),r);Object.assign(i.style,o),i.textContent="".concat(t);var c=i.getBoundingClientRect(),d={width:c.width,height:c.height};return Ol.widthCache[a]=d,++Ol.cacheCount>AZ&&(Ol.cacheCount=0,Ol.widthCache={}),d}catch{return{width:0,height:0}}},PZ=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Cd(e){"@babel/helpers - typeof";return Cd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cd(e)}function Dh(e,t){return TZ(e)||RZ(e,t)||OZ(e,t)||kZ()}function kZ(){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 OZ(e,t){if(e){if(typeof e=="string")return GR(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return GR(e,t)}}function GR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function RZ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;d=!1}else for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function TZ(e){if(Array.isArray(e))return e}function IZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function YR(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,$Z(r.key),r)}}function MZ(e,t,n){return t&&YR(e.prototype,t),n&&YR(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function $Z(e){var t=DZ(e,"string");return Cd(t)=="symbol"?t:t+""}function DZ(e,t){if(Cd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Cd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var XR=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,QR=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,LZ=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,FZ=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,k5={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},BZ=Object.keys(k5),zl="NaN";function zZ(e,t){return e*k5[t]}var Yp=(function(){function e(t,n){IZ(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!LZ.test(n)&&(this.num=NaN,this.unit=""),BZ.includes(n)&&(this.num=zZ(t,n),this.unit="px")}return MZ(e,[{key:"add",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num/n.num,this.unit||n.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(n){var r,a=(r=FZ.exec(n))!==null&&r!==void 0?r:[],i=Dh(a,3),o=i[1],c=i[2];return new e(parseFloat(o),c??"")}}])})();function O5(e){if(e.includes(zl))return zl;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=XR.exec(t))!==null&&n!==void 0?n:[],a=Dh(r,4),i=a[1],o=a[2],c=a[3],d=Yp.parse(i??""),f=Yp.parse(c??""),h=o==="*"?d.multiply(f):d.divide(f);if(h.isNaN())return zl;t=t.replace(XR,h.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var p,y=(p=QR.exec(t))!==null&&p!==void 0?p:[],g=Dh(y,4),j=g[1],b=g[2],x=g[3],S=Yp.parse(j??""),N=Yp.parse(x??""),C=b==="+"?S.add(N):S.subtract(N);if(C.isNaN())return zl;t=t.replace(QR,C.toString())}return t}var JR=/\(([^()]*)\)/;function UZ(e){for(var t=e;t.includes("(");){var n=JR.exec(t),r=Dh(n,2),a=r[1];t=t.replace(JR,O5(a))}return t}function qZ(e){var t=e.replace(/\s+/g,"");return t=UZ(t),t=O5(t),t}function WZ(e){try{return qZ(e)}catch{return zl}}function Sw(e){var t=WZ(e.slice(5,-1));return t===zl?"":t}var VZ=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],HZ=["dx","dy","angle","className","breakAll"];function hj(){return hj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hj.apply(this,arguments)}function ZR(e,t){if(e==null)return{};var n=KZ(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function KZ(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 eT(e,t){return QZ(e)||XZ(e,t)||YZ(e,t)||GZ()}function GZ(){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 YZ(e,t){if(e){if(typeof e=="string")return tT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tT(e,t)}}function tT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function XZ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;d=!1}else for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function QZ(e){if(Array.isArray(e))return e}var R5=/[ \f\n\r\t\v\u2028\u2029]+/,T5=function(t){var n=t.children,r=t.breakAll,a=t.style;try{var i=[];Ct(n)||(r?i=n.toString().split(""):i=n.toString().split(R5));var o=i.map(function(d){return{word:d,width:ad(d,a).width}}),c=r?0:ad(" ",a).width;return{wordsWithComputedWidth:o,spaceWidth:c}}catch{return null}},JZ=function(t,n,r,a,i){var o=t.maxLines,c=t.children,d=t.style,f=t.breakAll,h=Ue(o),p=c,y=function(){var K=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return K.reduce(function(J,Q){var D=Q.word,B=Q.width,Z=J[J.length-1];if(Z&&(a==null||i||Z.width+B+r<Number(a)))Z.words.push(D),Z.width+=B+r;else{var z={words:[D],width:B};J.push(z)}return J},[])},g=y(n),j=function(K){return K.reduce(function(J,Q){return J.width>Q.width?J:Q})};if(!h)return g;for(var b="…",x=function(K){var J=p.slice(0,K),Q=T5({breakAll:f,style:d,children:J+b}).wordsWithComputedWidth,D=y(Q),B=D.length>o||j(D).width>Number(a);return[B,D]},S=0,N=p.length-1,C=0,E;S<=N&&C<=p.length-1;){var _=Math.floor((S+N)/2),k=_-1,O=x(k),R=eT(O,2),T=R[0],F=R[1],L=x(_),$=eT(L,1),Y=$[0];if(!T&&!Y&&(S=_+1),T&&Y&&(N=_-1),!T&&Y){E=F;break}C++}return E||g},nT=function(t){var n=Ct(t)?[]:t.toString().split(R5);return[{words:n}]},ZZ=function(t){var n=t.width,r=t.scaleToFit,a=t.children,i=t.style,o=t.breakAll,c=t.maxLines;if((n||r)&&!Ko.isSsr){var d,f,h=T5({breakAll:o,children:a,style:i});if(h){var p=h.wordsWithComputedWidth,y=h.spaceWidth;d=p,f=y}else return nT(a);return JZ({breakAll:o,children:a,maxLines:c,style:i},d,f,n,r)}return nT(a)},rT="#808080",Mo=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,i=a===void 0?0:a,o=t.lineHeight,c=o===void 0?"1em":o,d=t.capHeight,f=d===void 0?"0.71em":d,h=t.scaleToFit,p=h===void 0?!1:h,y=t.textAnchor,g=y===void 0?"start":y,j=t.verticalAnchor,b=j===void 0?"end":j,x=t.fill,S=x===void 0?rT:x,N=ZR(t,VZ),C=v.useMemo(function(){return ZZ({breakAll:N.breakAll,children:N.children,maxLines:N.maxLines,scaleToFit:p,style:N.style,width:N.width})},[N.breakAll,N.children,N.maxLines,p,N.style,N.width]),E=N.dx,_=N.dy,k=N.angle,O=N.className,R=N.breakAll,T=ZR(N,HZ);if(!Wn(r)||!Wn(i))return null;var F=r+(Ue(E)?E:0),L=i+(Ue(_)?_:0),$;switch(b){case"start":$=Sw("calc(".concat(f,")"));break;case"middle":$=Sw("calc(".concat((C.length-1)/2," * -").concat(c," + (").concat(f," / 2))"));break;default:$=Sw("calc(".concat(C.length-1," * -").concat(c,")"));break}var Y=[];if(p){var H=C[0].width,K=N.width;Y.push("scale(".concat((Ue(K)?K/H:1)/H,")"))}return k&&Y.push("rotate(".concat(k,", ").concat(F,", ").concat(L,")")),Y.length&&(T.transform=Y.join(" ")),U.createElement("text",hj({},gt(T,!0),{x:F,y:L,className:At("recharts-text",O),textAnchor:g,fill:S.includes("url")?rT:S}),C.map(function(J,Q){var D=J.words.join(R?"":" ");return U.createElement("tspan",{x:F,dy:Q===0?$:c,key:"".concat(D,"-").concat(Q)},D)}))};function Li(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function eee(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ON(e){let t,n,r;e.length!==2?(t=Li,n=(c,d)=>Li(e(c),d),r=(c,d)=>e(c)-d):(t=e===Li||e===eee?e:tee,n=e,r=e);function a(c,d,f=0,h=c.length){if(f<h){if(t(d,d)!==0)return h;do{const p=f+h>>>1;n(c[p],d)<0?f=p+1:h=p}while(f<h)}return f}function i(c,d,f=0,h=c.length){if(f<h){if(t(d,d)!==0)return h;do{const p=f+h>>>1;n(c[p],d)<=0?f=p+1:h=p}while(f<h)}return f}function o(c,d,f=0,h=c.length){const p=a(c,d,f,h-1);return p>f&&r(c[p-1],d)>-r(c[p],d)?p-1:p}return{left:a,center:o,right:i}}function tee(){return 0}function I5(e){return e===null?NaN:+e}function*nee(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const ree=ON(Li),xf=ree.right;ON(I5).center;class aT extends Map{constructor(t,n=iee){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,a]of t)this.set(r,a)}get(t){return super.get(sT(this,t))}has(t){return super.has(sT(this,t))}set(t,n){return super.set(aee(this,t),n)}delete(t){return super.delete(see(this,t))}}function sT({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function aee({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function see({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function iee(e){return e!==null&&typeof e=="object"?e.valueOf():e}function oee(e=Li){if(e===Li)return M5;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 M5(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const lee=Math.sqrt(50),cee=Math.sqrt(10),uee=Math.sqrt(2);function Lh(e,t,n){const r=(t-e)/Math.max(0,n),a=Math.floor(Math.log10(r)),i=r/Math.pow(10,a),o=i>=lee?10:i>=cee?5:i>=uee?2:1;let c,d,f;return a<0?(f=Math.pow(10,-a)/o,c=Math.round(e*f),d=Math.round(t*f),c/f<e&&++c,d/f>t&&--d,f=-f):(f=Math.pow(10,a)*o,c=Math.round(e/f),d=Math.round(t/f),c*f<e&&++c,d*f>t&&--d),d<c&&.5<=n&&n<2?Lh(e,t,n*2):[c,d,f]}function mj(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[a,i,o]=r?Lh(t,e,n):Lh(e,t,n);if(!(i>=a))return[];const c=i-a+1,d=new Array(c);if(r)if(o<0)for(let f=0;f<c;++f)d[f]=(i-f)/-o;else for(let f=0;f<c;++f)d[f]=(i-f)*o;else if(o<0)for(let f=0;f<c;++f)d[f]=(a+f)/-o;else for(let f=0;f<c;++f)d[f]=(a+f)*o;return d}function vj(e,t,n){return t=+t,e=+e,n=+n,Lh(e,t,n)[2]}function gj(e,t,n){t=+t,e=+e,n=+n;const r=t<e,a=r?vj(t,e,n):vj(e,t,n);return(r?-1:1)*(a<0?1/-a:a)}function iT(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function oT(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function $5(e,t,n=0,r=1/0,a){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(a=a===void 0?M5:oee(a);r>n;){if(r-n>600){const d=r-n+1,f=t-n+1,h=Math.log(d),p=.5*Math.exp(2*h/3),y=.5*Math.sqrt(h*p*(d-p)/d)*(f-d/2<0?-1:1),g=Math.max(n,Math.floor(t-f*p/d+y)),j=Math.min(r,Math.floor(t+(d-f)*p/d+y));$5(e,t,g,j,a)}const i=e[t];let o=n,c=r;for(Fu(e,n,t),a(e[r],i)>0&&Fu(e,n,r);o<c;){for(Fu(e,o,c),++o,--c;a(e[o],i)<0;)++o;for(;a(e[c],i)>0;)--c}a(e[n],i)===0?Fu(e,n,c):(++c,Fu(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function Fu(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function dee(e,t,n){if(e=Float64Array.from(nee(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return oT(e);if(t>=1)return iT(e);var r,a=(r-1)*t,i=Math.floor(a),o=iT($5(e,i).subarray(0,i+1)),c=oT(e.subarray(i+1));return o+(c-o)*(a-i)}}function fee(e,t,n=I5){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,a=(r-1)*t,i=Math.floor(a),o=+n(e[i],i,e),c=+n(e[i+1],i+1,e);return o+(c-o)*(a-i)}}function pee(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(a);++r<a;)i[r]=e+r*n;return i}function Ea(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function ai(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 yj=Symbol("implicit");function RN(){var e=new aT,t=[],n=[],r=yj;function a(i){let o=e.get(i);if(o===void 0){if(r!==yj)return r;e.set(i,o=t.push(i)-1)}return n[o%n.length]}return a.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new aT;for(const o of i)e.has(o)||e.set(o,t.push(o)-1);return a},a.range=function(i){return arguments.length?(n=Array.from(i),a):n.slice()},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return RN(t,n).unknown(r)},Ea.apply(a,arguments),a}function Ad(){var e=RN().unknown(void 0),t=e.domain,n=e.range,r=0,a=1,i,o,c=!1,d=0,f=0,h=.5;delete e.unknown;function p(){var y=t().length,g=a<r,j=g?a:r,b=g?r:a;i=(b-j)/Math.max(1,y-d+f*2),c&&(i=Math.floor(i)),j+=(b-j-i*(y-d))*h,o=i*(1-d),c&&(j=Math.round(j),o=Math.round(o));var x=pee(y).map(function(S){return j+i*S});return n(g?x.reverse():x)}return e.domain=function(y){return arguments.length?(t(y),p()):t()},e.range=function(y){return arguments.length?([r,a]=y,r=+r,a=+a,p()):[r,a]},e.rangeRound=function(y){return[r,a]=y,r=+r,a=+a,c=!0,p()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(y){return arguments.length?(c=!!y,p()):c},e.padding=function(y){return arguments.length?(d=Math.min(1,f=+y),p()):d},e.paddingInner=function(y){return arguments.length?(d=Math.min(1,y),p()):d},e.paddingOuter=function(y){return arguments.length?(f=+y,p()):f},e.align=function(y){return arguments.length?(h=Math.max(0,Math.min(1,y)),p()):h},e.copy=function(){return Ad(t(),[r,a]).round(c).paddingInner(d).paddingOuter(f).align(h)},Ea.apply(p(),arguments)}function D5(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return D5(t())},e}function sd(){return D5(Ad.apply(null,arguments).paddingInner(1))}function TN(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function L5(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function bf(){}var _d=.7,Fh=1/_d,Zl="\\s*([+-]?\\d+)\\s*",Ed="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ps="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",hee=/^#([0-9a-f]{3,8})$/,mee=new RegExp(`^rgb\\(${Zl},${Zl},${Zl}\\)$`),vee=new RegExp(`^rgb\\(${ps},${ps},${ps}\\)$`),gee=new RegExp(`^rgba\\(${Zl},${Zl},${Zl},${Ed}\\)$`),yee=new RegExp(`^rgba\\(${ps},${ps},${ps},${Ed}\\)$`),xee=new RegExp(`^hsl\\(${Ed},${ps},${ps}\\)$`),bee=new RegExp(`^hsla\\(${Ed},${ps},${ps},${Ed}\\)$`),lT={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};TN(bf,Pd,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:cT,formatHex:cT,formatHex8:wee,formatHsl:jee,formatRgb:uT,toString:uT});function cT(){return this.rgb().formatHex()}function wee(){return this.rgb().formatHex8()}function jee(){return F5(this).formatHsl()}function uT(){return this.rgb().formatRgb()}function Pd(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=hee.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?dT(t):n===3?new Fr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Xp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Xp(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=mee.exec(e))?new Fr(t[1],t[2],t[3],1):(t=vee.exec(e))?new Fr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=gee.exec(e))?Xp(t[1],t[2],t[3],t[4]):(t=yee.exec(e))?Xp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=xee.exec(e))?hT(t[1],t[2]/100,t[3]/100,1):(t=bee.exec(e))?hT(t[1],t[2]/100,t[3]/100,t[4]):lT.hasOwnProperty(e)?dT(lT[e]):e==="transparent"?new Fr(NaN,NaN,NaN,0):null}function dT(e){return new Fr(e>>16&255,e>>8&255,e&255,1)}function Xp(e,t,n,r){return r<=0&&(e=t=n=NaN),new Fr(e,t,n,r)}function See(e){return e instanceof bf||(e=Pd(e)),e?(e=e.rgb(),new Fr(e.r,e.g,e.b,e.opacity)):new Fr}function xj(e,t,n,r){return arguments.length===1?See(e):new Fr(e,t,n,r??1)}function Fr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}TN(Fr,xj,L5(bf,{brighter(e){return e=e==null?Fh:Math.pow(Fh,e),new Fr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?_d:Math.pow(_d,e),new Fr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Fr(Eo(this.r),Eo(this.g),Eo(this.b),Bh(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:fT,formatHex:fT,formatHex8:Nee,formatRgb:pT,toString:pT}));function fT(){return`#${No(this.r)}${No(this.g)}${No(this.b)}`}function Nee(){return`#${No(this.r)}${No(this.g)}${No(this.b)}${No((isNaN(this.opacity)?1:this.opacity)*255)}`}function pT(){const e=Bh(this.opacity);return`${e===1?"rgb(":"rgba("}${Eo(this.r)}, ${Eo(this.g)}, ${Eo(this.b)}${e===1?")":`, ${e})`}`}function Bh(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Eo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function No(e){return e=Eo(e),(e<16?"0":"")+e.toString(16)}function hT(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ua(e,t,n,r)}function F5(e){if(e instanceof Ua)return new Ua(e.h,e.s,e.l,e.opacity);if(e instanceof bf||(e=Pd(e)),!e)return new Ua;if(e instanceof Ua)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),i=Math.max(t,n,r),o=NaN,c=i-a,d=(i+a)/2;return c?(t===i?o=(n-r)/c+(n<r)*6:n===i?o=(r-t)/c+2:o=(t-n)/c+4,c/=d<.5?i+a:2-i-a,o*=60):c=d>0&&d<1?0:o,new Ua(o,c,d,e.opacity)}function Cee(e,t,n,r){return arguments.length===1?F5(e):new Ua(e,t,n,r??1)}function Ua(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}TN(Ua,Cee,L5(bf,{brighter(e){return e=e==null?Fh:Math.pow(Fh,e),new Ua(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?_d:Math.pow(_d,e),new Ua(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new Fr(Nw(e>=240?e-240:e+120,a,r),Nw(e,a,r),Nw(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Ua(mT(this.h),Qp(this.s),Qp(this.l),Bh(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=Bh(this.opacity);return`${e===1?"hsl(":"hsla("}${mT(this.h)}, ${Qp(this.s)*100}%, ${Qp(this.l)*100}%${e===1?")":`, ${e})`}`}}));function mT(e){return e=(e||0)%360,e<0?e+360:e}function Qp(e){return Math.max(0,Math.min(1,e||0))}function Nw(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 IN=e=>()=>e;function Aee(e,t){return function(n){return e+n*t}}function _ee(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 Eee(e){return(e=+e)==1?B5:function(t,n){return n-t?_ee(t,n,e):IN(isNaN(t)?n:t)}}function B5(e,t){var n=t-e;return n?Aee(e,n):IN(isNaN(e)?t:e)}const vT=(function e(t){var n=Eee(t);function r(a,i){var o=n((a=xj(a)).r,(i=xj(i)).r),c=n(a.g,i.g),d=n(a.b,i.b),f=B5(a.opacity,i.opacity);return function(h){return a.r=o(h),a.g=c(h),a.b=d(h),a.opacity=f(h),a+""}}return r.gamma=e,r})(1);function Pee(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(i){for(a=0;a<n;++a)r[a]=e[a]*(1-i)+t[a]*i;return r}}function kee(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Oee(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,a=new Array(r),i=new Array(n),o;for(o=0;o<r;++o)a[o]=Yc(e[o],t[o]);for(;o<n;++o)i[o]=t[o];return function(c){for(o=0;o<r;++o)i[o]=a[o](c);return i}}function Ree(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function zh(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Tee(e,t){var n={},r={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=Yc(e[a],t[a]):r[a]=t[a];return function(i){for(a in n)r[a]=n[a](i);return r}}var bj=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Cw=new RegExp(bj.source,"g");function Iee(e){return function(){return e}}function Mee(e){return function(t){return e(t)+""}}function $ee(e,t){var n=bj.lastIndex=Cw.lastIndex=0,r,a,i,o=-1,c=[],d=[];for(e=e+"",t=t+"";(r=bj.exec(e))&&(a=Cw.exec(t));)(i=a.index)>n&&(i=t.slice(n,i),c[o]?c[o]+=i:c[++o]=i),(r=r[0])===(a=a[0])?c[o]?c[o]+=a:c[++o]=a:(c[++o]=null,d.push({i:o,x:zh(r,a)})),n=Cw.lastIndex;return n<t.length&&(i=t.slice(n),c[o]?c[o]+=i:c[++o]=i),c.length<2?d[0]?Mee(d[0].x):Iee(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 Yc(e,t){var n=typeof t,r;return t==null||n==="boolean"?IN(t):(n==="number"?zh:n==="string"?(r=Pd(t))?(t=r,vT):$ee:t instanceof Pd?vT:t instanceof Date?Ree:kee(t)?Pee:Array.isArray(t)?Oee:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Tee:zh)(e,t)}function MN(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Dee(e,t){t===void 0&&(t=e,e=Yc);for(var n=0,r=t.length-1,a=t[0],i=new Array(r<0?0:r);n<r;)i[n]=e(a,a=t[++n]);return function(o){var c=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return i[c](o-c)}}function Lee(e){return function(){return e}}function Uh(e){return+e}var gT=[0,1];function Nr(e){return e}function wj(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Lee(isNaN(t)?NaN:.5)}function Fee(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Bee(e,t,n){var r=e[0],a=e[1],i=t[0],o=t[1];return a<r?(r=wj(a,r),i=n(o,i)):(r=wj(r,a),i=n(i,o)),function(c){return i(r(c))}}function zee(e,t,n){var r=Math.min(e.length,t.length)-1,a=new Array(r),i=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)a[o]=wj(e[o],e[o+1]),i[o]=n(t[o],t[o+1]);return function(c){var d=xf(e,c,1,r)-1;return i[d](a[d](c))}}function wf(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function jv(){var e=gT,t=gT,n=Yc,r,a,i,o=Nr,c,d,f;function h(){var y=Math.min(e.length,t.length);return o!==Nr&&(o=Fee(e[0],e[y-1])),c=y>2?zee:Bee,d=f=null,p}function p(y){return y==null||isNaN(y=+y)?i:(d||(d=c(e.map(r),t,n)))(r(o(y)))}return p.invert=function(y){return o(a((f||(f=c(t,e.map(r),zh)))(y)))},p.domain=function(y){return arguments.length?(e=Array.from(y,Uh),h()):e.slice()},p.range=function(y){return arguments.length?(t=Array.from(y),h()):t.slice()},p.rangeRound=function(y){return t=Array.from(y),n=MN,h()},p.clamp=function(y){return arguments.length?(o=y?!0:Nr,h()):o!==Nr},p.interpolate=function(y){return arguments.length?(n=y,h()):n},p.unknown=function(y){return arguments.length?(i=y,p):i},function(y,g){return r=y,a=g,h()}}function $N(){return jv()(Nr,Nr)}function Uee(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function qh(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 hc(e){return e=qh(Math.abs(e)),e?e[1]:NaN}function qee(e,t){return function(n,r){for(var a=n.length,i=[],o=0,c=e[0],d=0;a>0&&c>0&&(d+c+1>r&&(c=Math.max(1,r-d)),i.push(n.substring(a-=c,a+c)),!((d+=c+1)>r));)c=e[o=(o+1)%e.length];return i.reverse().join(t)}}function Wee(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Vee=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function kd(e){if(!(t=Vee.exec(e)))throw new Error("invalid format: "+e);var t;return new DN({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]})}kd.prototype=DN.prototype;function DN(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+""}DN.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 Hee(e){e:for(var t=e.length,n=1,r=-1,a;n<t;++n)switch(e[n]){case".":r=a=n;break;case"0":r===0&&(r=n),a=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(a+1):e}var Wh;function Kee(e,t){var n=qh(e,t);if(!n)return Wh=void 0,e.toPrecision(t);var r=n[0],a=n[1],i=a-(Wh=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=r.length;return i===o?r:i>o?r+new Array(i-o+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+qh(e,Math.max(0,t+i-1))[0]}function yT(e,t){var n=qh(e,t);if(!n)return e+"";var r=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+r:r.length>a+1?r.slice(0,a+1)+"."+r.slice(a+1):r+new Array(a-r.length+2).join("0")}const xT={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Uee,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)=>yT(e*100,t),r:yT,s:Kee,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function bT(e){return e}var wT=Array.prototype.map,jT=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Gee(e){var t=e.grouping===void 0||e.thousands===void 0?bT:qee(wT.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?bT:Wee(wT.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function f(p,y){p=kd(p);var g=p.fill,j=p.align,b=p.sign,x=p.symbol,S=p.zero,N=p.width,C=p.comma,E=p.precision,_=p.trim,k=p.type;k==="n"?(C=!0,k="g"):xT[k]||(E===void 0&&(E=12),_=!0,k="g"),(S||g==="0"&&j==="=")&&(S=!0,g="0",j="=");var O=(y&&y.prefix!==void 0?y.prefix:"")+(x==="$"?n:x==="#"&&/[boxX]/.test(k)?"0"+k.toLowerCase():""),R=(x==="$"?r:/[%p]/.test(k)?o:"")+(y&&y.suffix!==void 0?y.suffix:""),T=xT[k],F=/[defgprs%]/.test(k);E=E===void 0?6:/[gprs]/.test(k)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function L($){var Y=O,H=R,K,J,Q;if(k==="c")H=T($)+H,$="";else{$=+$;var D=$<0||1/$<0;if($=isNaN($)?d:T(Math.abs($),E),_&&($=Hee($)),D&&+$==0&&b!=="+"&&(D=!1),Y=(D?b==="("?b:c:b==="-"||b==="("?"":b)+Y,H=(k==="s"&&!isNaN($)&&Wh!==void 0?jT[8+Wh/3]:"")+H+(D&&b==="("?")":""),F){for(K=-1,J=$.length;++K<J;)if(Q=$.charCodeAt(K),48>Q||Q>57){H=(Q===46?a+$.slice(K+1):$.slice(K))+H,$=$.slice(0,K);break}}}C&&!S&&($=t($,1/0));var B=Y.length+$.length+H.length,Z=B<N?new Array(N-B+1).join(g):"";switch(C&&S&&($=t(Z+$,Z.length?N-H.length:1/0),Z=""),j){case"<":$=Y+$+H+Z;break;case"=":$=Y+Z+$+H;break;case"^":$=Z.slice(0,B=Z.length>>1)+Y+$+H+Z.slice(B);break;default:$=Z+Y+$+H;break}return i($)}return L.toString=function(){return p+""},L}function h(p,y){var g=Math.max(-8,Math.min(8,Math.floor(hc(y)/3)))*3,j=Math.pow(10,-g),b=f((p=kd(p),p.type="f",p),{suffix:jT[8+g/3]});return function(x){return b(j*x)}}return{format:f,formatPrefix:h}}var Jp,LN,z5;Yee({thousands:",",grouping:[3],currency:["$",""]});function Yee(e){return Jp=Gee(e),LN=Jp.format,z5=Jp.formatPrefix,Jp}function Xee(e){return Math.max(0,-hc(Math.abs(e)))}function Qee(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(hc(t)/3)))*3-hc(Math.abs(e)))}function Jee(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,hc(t)-hc(e))+1}function U5(e,t,n,r){var a=gj(e,t,n),i;switch(r=kd(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(i=Qee(a,o))&&(r.precision=i),z5(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=Jee(a,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=Xee(a))&&(r.precision=i-(r.type==="%")*2);break}}return LN(r)}function Xi(e){var t=e.domain;return e.ticks=function(n){var r=t();return mj(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var a=t();return U5(a[0],a[a.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),a=0,i=r.length-1,o=r[a],c=r[i],d,f,h=10;for(c<o&&(f=o,o=c,c=f,f=a,a=i,i=f);h-- >0;){if(f=vj(o,c,n),f===d)return r[a]=o,r[i]=c,t(r);if(f>0)o=Math.floor(o/f)*f,c=Math.ceil(c/f)*f;else if(f<0)o=Math.ceil(o*f)/f,c=Math.floor(c*f)/f;else break;d=f}return e},e}function Vh(){var e=$N();return e.copy=function(){return wf(e,Vh())},Ea.apply(e,arguments),Xi(e)}function q5(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,Uh),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return q5(e).unknown(t)},e=arguments.length?Array.from(e,Uh):[0,1],Xi(n)}function W5(e,t){e=e.slice();var n=0,r=e.length-1,a=e[n],i=e[r],o;return i<a&&(o=n,n=r,r=o,o=a,a=i,i=o),e[n]=t.floor(a),e[r]=t.ceil(i),e}function ST(e){return Math.log(e)}function NT(e){return Math.exp(e)}function Zee(e){return-Math.log(-e)}function ete(e){return-Math.exp(-e)}function tte(e){return isFinite(e)?+("1e"+e):e<0?0:e}function nte(e){return e===10?tte:e===Math.E?Math.exp:t=>Math.pow(e,t)}function rte(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 CT(e){return(t,n)=>-e(-t,n)}function FN(e){const t=e(ST,NT),n=t.domain;let r=10,a,i;function o(){return a=rte(r),i=nte(r),n()[0]<0?(a=CT(a),i=CT(i),e(Zee,ete)):e(ST,NT),t}return t.base=function(c){return arguments.length?(r=+c,o()):r},t.domain=function(c){return arguments.length?(n(c),o()):n()},t.ticks=c=>{const d=n();let f=d[0],h=d[d.length-1];const p=h<f;p&&([f,h]=[h,f]);let y=a(f),g=a(h),j,b;const x=c==null?10:+c;let S=[];if(!(r%1)&&g-y<x){if(y=Math.floor(y),g=Math.ceil(g),f>0){for(;y<=g;++y)for(j=1;j<r;++j)if(b=y<0?j/i(-y):j*i(y),!(b<f)){if(b>h)break;S.push(b)}}else for(;y<=g;++y)for(j=r-1;j>=1;--j)if(b=y>0?j/i(-y):j*i(y),!(b<f)){if(b>h)break;S.push(b)}S.length*2<x&&(S=mj(f,h,x))}else S=mj(y,g,Math.min(g-y,x)).map(i);return p?S.reverse():S},t.tickFormat=(c,d)=>{if(c==null&&(c=10),d==null&&(d=r===10?"s":","),typeof d!="function"&&(!(r%1)&&(d=kd(d)).precision==null&&(d.trim=!0),d=LN(d)),c===1/0)return d;const f=Math.max(1,r*c/t.ticks().length);return h=>{let p=h/i(Math.round(a(h)));return p*r<r-.5&&(p*=r),p<=f?d(h):""}},t.nice=()=>n(W5(n(),{floor:c=>i(Math.floor(a(c))),ceil:c=>i(Math.ceil(a(c)))})),t}function V5(){const e=FN(jv()).domain([1,10]);return e.copy=()=>wf(e,V5()).base(e.base()),Ea.apply(e,arguments),e}function AT(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function _T(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function BN(e){var t=1,n=e(AT(t),_T(t));return n.constant=function(r){return arguments.length?e(AT(t=+r),_T(t)):t},Xi(n)}function H5(){var e=BN(jv());return e.copy=function(){return wf(e,H5()).constant(e.constant())},Ea.apply(e,arguments)}function ET(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function ate(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function ste(e){return e<0?-e*e:e*e}function zN(e){var t=e(Nr,Nr),n=1;function r(){return n===1?e(Nr,Nr):n===.5?e(ate,ste):e(ET(n),ET(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,r()):n},Xi(t)}function UN(){var e=zN(jv());return e.copy=function(){return wf(e,UN()).exponent(e.exponent())},Ea.apply(e,arguments),e}function ite(){return UN.apply(null,arguments).exponent(.5)}function PT(e){return Math.sign(e)*e*e}function ote(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function K5(){var e=$N(),t=[0,1],n=!1,r;function a(i){var o=ote(e(i));return isNaN(o)?r:n?Math.round(o):o}return a.invert=function(i){return e.invert(PT(i))},a.domain=function(i){return arguments.length?(e.domain(i),a):e.domain()},a.range=function(i){return arguments.length?(e.range((t=Array.from(i,Uh)).map(PT)),a):t.slice()},a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(n=!!i,a):n},a.clamp=function(i){return arguments.length?(e.clamp(i),a):e.clamp()},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return K5(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Ea.apply(a,arguments),Xi(a)}function G5(){var e=[],t=[],n=[],r;function a(){var o=0,c=Math.max(1,t.length);for(n=new Array(c-1);++o<c;)n[o-1]=fee(e,o/c);return i}function i(o){return o==null||isNaN(o=+o)?r:t[xf(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(Li),a()},i.range=function(o){return arguments.length?(t=Array.from(o),a()):t.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.quantiles=function(){return n.slice()},i.copy=function(){return G5().domain(e).range(t).unknown(r)},Ea.apply(i,arguments)}function Y5(){var e=0,t=1,n=1,r=[.5],a=[0,1],i;function o(d){return d!=null&&d<=d?a[xf(r,d,0,n)]:i}function c(){var d=-1;for(r=new Array(n);++d<n;)r[d]=((d+1)*t-(d-n)*e)/(n+1);return o}return o.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,c()):[e,t]},o.range=function(d){return arguments.length?(n=(a=Array.from(d)).length-1,c()):a.slice()},o.invertExtent=function(d){var f=a.indexOf(d);return f<0?[NaN,NaN]:f<1?[e,r[0]]:f>=n?[r[n-1],t]:[r[f-1],r[f]]},o.unknown=function(d){return arguments.length&&(i=d),o},o.thresholds=function(){return r.slice()},o.copy=function(){return Y5().domain([e,t]).range(a).unknown(i)},Ea.apply(Xi(o),arguments)}function X5(){var e=[.5],t=[0,1],n,r=1;function a(i){return i!=null&&i<=i?t[xf(e,i,0,r)]:n}return a.domain=function(i){return arguments.length?(e=Array.from(i),r=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(i){return arguments.length?(t=Array.from(i),r=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(i){var o=t.indexOf(i);return[e[o-1],e[o]]},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return X5().domain(e).range(t).unknown(n)},Ea.apply(a,arguments)}const Aw=new Date,_w=new Date;function Gn(e,t,n,r){function a(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(e(i=new Date(+i)),i),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=i=>{const o=a(i),c=a.ceil(i);return i-o<c-i?o:c},a.offset=(i,o)=>(t(i=new Date(+i),o==null?1:Math.floor(o)),i),a.range=(i,o,c)=>{const d=[];if(i=a.ceil(i),c=c==null?1:Math.floor(c),!(i<o)||!(c>0))return d;let f;do d.push(f=new Date(+i)),t(i,c),e(i);while(f<i&&i<o);return d},a.filter=i=>Gn(o=>{if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},(o,c)=>{if(o>=o)if(c<0)for(;++c<=0;)for(;t(o,-1),!i(o););else for(;--c>=0;)for(;t(o,1),!i(o););}),n&&(a.count=(i,o)=>(Aw.setTime(+i),_w.setTime(+o),e(Aw),e(_w),Math.floor(n(Aw,_w))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(r?o=>r(o)%i===0:o=>a.count(0,o)%i===0):a)),a}const Hh=Gn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Hh.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Gn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Hh);Hh.range;const Us=1e3,wa=Us*60,qs=wa*60,Js=qs*24,qN=Js*7,kT=Js*30,Ew=Js*365,Co=Gn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Us)},(e,t)=>(t-e)/Us,e=>e.getUTCSeconds());Co.range;const WN=Gn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Us)},(e,t)=>{e.setTime(+e+t*wa)},(e,t)=>(t-e)/wa,e=>e.getMinutes());WN.range;const VN=Gn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*wa)},(e,t)=>(t-e)/wa,e=>e.getUTCMinutes());VN.range;const HN=Gn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Us-e.getMinutes()*wa)},(e,t)=>{e.setTime(+e+t*qs)},(e,t)=>(t-e)/qs,e=>e.getHours());HN.range;const KN=Gn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*qs)},(e,t)=>(t-e)/qs,e=>e.getUTCHours());KN.range;const jf=Gn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*wa)/Js,e=>e.getDate()-1);jf.range;const Sv=Gn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Js,e=>e.getUTCDate()-1);Sv.range;const Q5=Gn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Js,e=>Math.floor(e/Js));Q5.range;function Go(e){return Gn(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*wa)/qN)}const Nv=Go(0),Kh=Go(1),lte=Go(2),cte=Go(3),mc=Go(4),ute=Go(5),dte=Go(6);Nv.range;Kh.range;lte.range;cte.range;mc.range;ute.range;dte.range;function Yo(e){return Gn(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/qN)}const Cv=Yo(0),Gh=Yo(1),fte=Yo(2),pte=Yo(3),vc=Yo(4),hte=Yo(5),mte=Yo(6);Cv.range;Gh.range;fte.range;pte.range;vc.range;hte.range;mte.range;const GN=Gn(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());GN.range;const YN=Gn(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());YN.range;const Zs=Gn(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Zs.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Gn(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Zs.range;const ei=Gn(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ei.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Gn(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});ei.range;function J5(e,t,n,r,a,i){const o=[[Co,1,Us],[Co,5,5*Us],[Co,15,15*Us],[Co,30,30*Us],[i,1,wa],[i,5,5*wa],[i,15,15*wa],[i,30,30*wa],[a,1,qs],[a,3,3*qs],[a,6,6*qs],[a,12,12*qs],[r,1,Js],[r,2,2*Js],[n,1,qN],[t,1,kT],[t,3,3*kT],[e,1,Ew]];function c(f,h,p){const y=h<f;y&&([f,h]=[h,f]);const g=p&&typeof p.range=="function"?p:d(f,h,p),j=g?g.range(f,+h+1):[];return y?j.reverse():j}function d(f,h,p){const y=Math.abs(h-f)/p,g=ON(([,,x])=>x).right(o,y);if(g===o.length)return e.every(gj(f/Ew,h/Ew,p));if(g===0)return Hh.every(Math.max(gj(f,h,p),1));const[j,b]=o[y/o[g-1][2]<o[g][2]/y?g-1:g];return j.every(b)}return[c,d]}const[vte,gte]=J5(ei,YN,Cv,Q5,KN,VN),[yte,xte]=J5(Zs,GN,Nv,jf,HN,WN);function Pw(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function kw(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 Bu(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function bte(e){var t=e.dateTime,n=e.date,r=e.time,a=e.periods,i=e.days,o=e.shortDays,c=e.months,d=e.shortMonths,f=zu(a),h=Uu(a),p=zu(i),y=Uu(i),g=zu(o),j=Uu(o),b=zu(c),x=Uu(c),S=zu(d),N=Uu(d),C={a:Q,A:D,b:B,B:Z,c:null,d:$T,e:$T,f:qte,g:Zte,G:tne,H:Bte,I:zte,j:Ute,L:Z5,m:Wte,M:Vte,p:z,q:M,Q:FT,s:BT,S:Hte,u:Kte,U:Gte,V:Yte,w:Xte,W:Qte,x:null,X:null,y:Jte,Y:ene,Z:nne,"%":LT},E={a:re,A:te,b:G,B:de,c:null,d:DT,e:DT,f:ine,g:vne,G:yne,H:rne,I:ane,j:sne,L:tL,m:one,M:lne,p:ce,q:he,Q:FT,s:BT,S:cne,u:une,U:dne,V:fne,w:pne,W:hne,x:null,X:null,y:mne,Y:gne,Z:xne,"%":LT},_={a:F,A:L,b:$,B:Y,c:H,d:IT,e:IT,f:$te,g:TT,G:RT,H:MT,I:MT,j:Rte,L:Mte,m:Ote,M:Tte,p:T,q:kte,Q:Lte,s:Fte,S:Ite,u:Cte,U:Ate,V:_te,w:Nte,W:Ete,x:K,X:J,y:TT,Y:RT,Z:Pte,"%":Dte};C.x=k(n,C),C.X=k(r,C),C.c=k(t,C),E.x=k(n,E),E.X=k(r,E),E.c=k(t,E);function k(ie,ue){return function(Ae){var ae=[],$e=-1,W=0,ve=ie.length,oe,be,Ie;for(Ae instanceof Date||(Ae=new Date(+Ae));++$e<ve;)ie.charCodeAt($e)===37&&(ae.push(ie.slice(W,$e)),(be=OT[oe=ie.charAt(++$e)])!=null?oe=ie.charAt(++$e):be=oe==="e"?" ":"0",(Ie=ue[oe])&&(oe=Ie(Ae,be)),ae.push(oe),W=$e+1);return ae.push(ie.slice(W,$e)),ae.join("")}}function O(ie,ue){return function(Ae){var ae=Bu(1900,void 0,1),$e=R(ae,ie,Ae+="",0),W,ve;if($e!=Ae.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(ue&&!("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?(W=kw(Bu(ae.y,0,1)),ve=W.getUTCDay(),W=ve>4||ve===0?Gh.ceil(W):Gh(W),W=Sv.offset(W,(ae.V-1)*7),ae.y=W.getUTCFullYear(),ae.m=W.getUTCMonth(),ae.d=W.getUTCDate()+(ae.w+6)%7):(W=Pw(Bu(ae.y,0,1)),ve=W.getDay(),W=ve>4||ve===0?Kh.ceil(W):Kh(W),W=jf.offset(W,(ae.V-1)*7),ae.y=W.getFullYear(),ae.m=W.getMonth(),ae.d=W.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),ve="Z"in ae?kw(Bu(ae.y,0,1)).getUTCDay():Pw(Bu(ae.y,0,1)).getDay(),ae.m=0,ae.d="W"in ae?(ae.w+6)%7+ae.W*7-(ve+5)%7:ae.w+ae.U*7-(ve+6)%7);return"Z"in ae?(ae.H+=ae.Z/100|0,ae.M+=ae.Z%100,kw(ae)):Pw(ae)}}function R(ie,ue,Ae,ae){for(var $e=0,W=ue.length,ve=Ae.length,oe,be;$e<W;){if(ae>=ve)return-1;if(oe=ue.charCodeAt($e++),oe===37){if(oe=ue.charAt($e++),be=_[oe in OT?ue.charAt($e++):oe],!be||(ae=be(ie,Ae,ae))<0)return-1}else if(oe!=Ae.charCodeAt(ae++))return-1}return ae}function T(ie,ue,Ae){var ae=f.exec(ue.slice(Ae));return ae?(ie.p=h.get(ae[0].toLowerCase()),Ae+ae[0].length):-1}function F(ie,ue,Ae){var ae=g.exec(ue.slice(Ae));return ae?(ie.w=j.get(ae[0].toLowerCase()),Ae+ae[0].length):-1}function L(ie,ue,Ae){var ae=p.exec(ue.slice(Ae));return ae?(ie.w=y.get(ae[0].toLowerCase()),Ae+ae[0].length):-1}function $(ie,ue,Ae){var ae=S.exec(ue.slice(Ae));return ae?(ie.m=N.get(ae[0].toLowerCase()),Ae+ae[0].length):-1}function Y(ie,ue,Ae){var ae=b.exec(ue.slice(Ae));return ae?(ie.m=x.get(ae[0].toLowerCase()),Ae+ae[0].length):-1}function H(ie,ue,Ae){return R(ie,t,ue,Ae)}function K(ie,ue,Ae){return R(ie,n,ue,Ae)}function J(ie,ue,Ae){return R(ie,r,ue,Ae)}function Q(ie){return o[ie.getDay()]}function D(ie){return i[ie.getDay()]}function B(ie){return d[ie.getMonth()]}function Z(ie){return c[ie.getMonth()]}function z(ie){return a[+(ie.getHours()>=12)]}function M(ie){return 1+~~(ie.getMonth()/3)}function re(ie){return o[ie.getUTCDay()]}function te(ie){return i[ie.getUTCDay()]}function G(ie){return d[ie.getUTCMonth()]}function de(ie){return c[ie.getUTCMonth()]}function ce(ie){return a[+(ie.getUTCHours()>=12)]}function he(ie){return 1+~~(ie.getUTCMonth()/3)}return{format:function(ie){var ue=k(ie+="",C);return ue.toString=function(){return ie},ue},parse:function(ie){var ue=O(ie+="",!1);return ue.toString=function(){return ie},ue},utcFormat:function(ie){var ue=k(ie+="",E);return ue.toString=function(){return ie},ue},utcParse:function(ie){var ue=O(ie+="",!0);return ue.toString=function(){return ie},ue}}}var OT={"-":"",_:" ",0:"0"},nr=/^\s*\d+/,wte=/^%/,jte=/[\\^$*+?|[\]().{}]/g;function Ut(e,t,n){var r=e<0?"-":"",a=(r?-e:e)+"",i=a.length;return r+(i<n?new Array(n-i+1).join(t)+a:a)}function Ste(e){return e.replace(jte,"\\$&")}function zu(e){return new RegExp("^(?:"+e.map(Ste).join("|")+")","i")}function Uu(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Nte(e,t,n){var r=nr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Cte(e,t,n){var r=nr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Ate(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function _te(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Ete(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function RT(e,t,n){var r=nr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function TT(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Pte(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 kte(e,t,n){var r=nr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Ote(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function IT(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Rte(e,t,n){var r=nr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function MT(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Tte(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Ite(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Mte(e,t,n){var r=nr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function $te(e,t,n){var r=nr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Dte(e,t,n){var r=wte.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Lte(e,t,n){var r=nr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Fte(e,t,n){var r=nr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function $T(e,t){return Ut(e.getDate(),t,2)}function Bte(e,t){return Ut(e.getHours(),t,2)}function zte(e,t){return Ut(e.getHours()%12||12,t,2)}function Ute(e,t){return Ut(1+jf.count(Zs(e),e),t,3)}function Z5(e,t){return Ut(e.getMilliseconds(),t,3)}function qte(e,t){return Z5(e,t)+"000"}function Wte(e,t){return Ut(e.getMonth()+1,t,2)}function Vte(e,t){return Ut(e.getMinutes(),t,2)}function Hte(e,t){return Ut(e.getSeconds(),t,2)}function Kte(e){var t=e.getDay();return t===0?7:t}function Gte(e,t){return Ut(Nv.count(Zs(e)-1,e),t,2)}function eL(e){var t=e.getDay();return t>=4||t===0?mc(e):mc.ceil(e)}function Yte(e,t){return e=eL(e),Ut(mc.count(Zs(e),e)+(Zs(e).getDay()===4),t,2)}function Xte(e){return e.getDay()}function Qte(e,t){return Ut(Kh.count(Zs(e)-1,e),t,2)}function Jte(e,t){return Ut(e.getFullYear()%100,t,2)}function Zte(e,t){return e=eL(e),Ut(e.getFullYear()%100,t,2)}function ene(e,t){return Ut(e.getFullYear()%1e4,t,4)}function tne(e,t){var n=e.getDay();return e=n>=4||n===0?mc(e):mc.ceil(e),Ut(e.getFullYear()%1e4,t,4)}function nne(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ut(t/60|0,"0",2)+Ut(t%60,"0",2)}function DT(e,t){return Ut(e.getUTCDate(),t,2)}function rne(e,t){return Ut(e.getUTCHours(),t,2)}function ane(e,t){return Ut(e.getUTCHours()%12||12,t,2)}function sne(e,t){return Ut(1+Sv.count(ei(e),e),t,3)}function tL(e,t){return Ut(e.getUTCMilliseconds(),t,3)}function ine(e,t){return tL(e,t)+"000"}function one(e,t){return Ut(e.getUTCMonth()+1,t,2)}function lne(e,t){return Ut(e.getUTCMinutes(),t,2)}function cne(e,t){return Ut(e.getUTCSeconds(),t,2)}function une(e){var t=e.getUTCDay();return t===0?7:t}function dne(e,t){return Ut(Cv.count(ei(e)-1,e),t,2)}function nL(e){var t=e.getUTCDay();return t>=4||t===0?vc(e):vc.ceil(e)}function fne(e,t){return e=nL(e),Ut(vc.count(ei(e),e)+(ei(e).getUTCDay()===4),t,2)}function pne(e){return e.getUTCDay()}function hne(e,t){return Ut(Gh.count(ei(e)-1,e),t,2)}function mne(e,t){return Ut(e.getUTCFullYear()%100,t,2)}function vne(e,t){return e=nL(e),Ut(e.getUTCFullYear()%100,t,2)}function gne(e,t){return Ut(e.getUTCFullYear()%1e4,t,4)}function yne(e,t){var n=e.getUTCDay();return e=n>=4||n===0?vc(e):vc.ceil(e),Ut(e.getUTCFullYear()%1e4,t,4)}function xne(){return"+0000"}function LT(){return"%"}function FT(e){return+e}function BT(e){return Math.floor(+e/1e3)}var Rl,rL,aL;bne({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 bne(e){return Rl=bte(e),rL=Rl.format,Rl.parse,aL=Rl.utcFormat,Rl.utcParse,Rl}function wne(e){return new Date(e)}function jne(e){return e instanceof Date?+e:+new Date(+e)}function XN(e,t,n,r,a,i,o,c,d,f){var h=$N(),p=h.invert,y=h.domain,g=f(".%L"),j=f(":%S"),b=f("%I:%M"),x=f("%I %p"),S=f("%a %d"),N=f("%b %d"),C=f("%B"),E=f("%Y");function _(k){return(d(k)<k?g:c(k)<k?j:o(k)<k?b:i(k)<k?x:r(k)<k?a(k)<k?S:N:n(k)<k?C:E)(k)}return h.invert=function(k){return new Date(p(k))},h.domain=function(k){return arguments.length?y(Array.from(k,jne)):y().map(wne)},h.ticks=function(k){var O=y();return e(O[0],O[O.length-1],k??10)},h.tickFormat=function(k,O){return O==null?_:f(O)},h.nice=function(k){var O=y();return(!k||typeof k.range!="function")&&(k=t(O[0],O[O.length-1],k??10)),k?y(W5(O,k)):h},h.copy=function(){return wf(h,XN(e,t,n,r,a,i,o,c,d,f))},h}function Sne(){return Ea.apply(XN(yte,xte,Zs,GN,Nv,jf,HN,WN,Co,rL).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Nne(){return Ea.apply(XN(vte,gte,ei,YN,Cv,Sv,KN,VN,Co,aL).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Av(){var e=0,t=1,n,r,a,i,o=Nr,c=!1,d;function f(p){return p==null||isNaN(p=+p)?d:o(a===0?.5:(p=(i(p)-n)*a,c?Math.max(0,Math.min(1,p)):p))}f.domain=function(p){return arguments.length?([e,t]=p,n=i(e=+e),r=i(t=+t),a=n===r?0:1/(r-n),f):[e,t]},f.clamp=function(p){return arguments.length?(c=!!p,f):c},f.interpolator=function(p){return arguments.length?(o=p,f):o};function h(p){return function(y){var g,j;return arguments.length?([g,j]=y,o=p(g,j),f):[o(0),o(1)]}}return f.range=h(Yc),f.rangeRound=h(MN),f.unknown=function(p){return arguments.length?(d=p,f):d},function(p){return i=p,n=p(e),r=p(t),a=n===r?0:1/(r-n),f}}function Qi(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function sL(){var e=Xi(Av()(Nr));return e.copy=function(){return Qi(e,sL())},ai.apply(e,arguments)}function iL(){var e=FN(Av()).domain([1,10]);return e.copy=function(){return Qi(e,iL()).base(e.base())},ai.apply(e,arguments)}function oL(){var e=BN(Av());return e.copy=function(){return Qi(e,oL()).constant(e.constant())},ai.apply(e,arguments)}function QN(){var e=zN(Av());return e.copy=function(){return Qi(e,QN()).exponent(e.exponent())},ai.apply(e,arguments)}function Cne(){return QN.apply(null,arguments).exponent(.5)}function lL(){var e=[],t=Nr;function n(r){if(r!=null&&!isNaN(r=+r))return t((xf(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let a of r)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(Li),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,a)=>t(a/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(a,i)=>dee(e,i/r))},n.copy=function(){return lL(t).domain(e)},ai.apply(n,arguments)}function _v(){var e=0,t=.5,n=1,r=1,a,i,o,c,d,f=Nr,h,p=!1,y;function g(b){return isNaN(b=+b)?y:(b=.5+((b=+h(b))-i)*(r*b<r*i?c:d),f(p?Math.max(0,Math.min(1,b)):b))}g.domain=function(b){return arguments.length?([e,t,n]=b,a=h(e=+e),i=h(t=+t),o=h(n=+n),c=a===i?0:.5/(i-a),d=i===o?0:.5/(o-i),r=i<a?-1:1,g):[e,t,n]},g.clamp=function(b){return arguments.length?(p=!!b,g):p},g.interpolator=function(b){return arguments.length?(f=b,g):f};function j(b){return function(x){var S,N,C;return arguments.length?([S,N,C]=x,f=Dee(b,[S,N,C]),g):[f(0),f(.5),f(1)]}}return g.range=j(Yc),g.rangeRound=j(MN),g.unknown=function(b){return arguments.length?(y=b,g):y},function(b){return h=b,a=b(e),i=b(t),o=b(n),c=a===i?0:.5/(i-a),d=i===o?0:.5/(o-i),r=i<a?-1:1,g}}function cL(){var e=Xi(_v()(Nr));return e.copy=function(){return Qi(e,cL())},ai.apply(e,arguments)}function uL(){var e=FN(_v()).domain([.1,1,10]);return e.copy=function(){return Qi(e,uL()).base(e.base())},ai.apply(e,arguments)}function dL(){var e=BN(_v());return e.copy=function(){return Qi(e,dL()).constant(e.constant())},ai.apply(e,arguments)}function JN(){var e=zN(_v());return e.copy=function(){return Qi(e,JN()).exponent(e.exponent())},ai.apply(e,arguments)}function Ane(){return JN.apply(null,arguments).exponent(.5)}const zT=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Ad,scaleDiverging:cL,scaleDivergingLog:uL,scaleDivergingPow:JN,scaleDivergingSqrt:Ane,scaleDivergingSymlog:dL,scaleIdentity:q5,scaleImplicit:yj,scaleLinear:Vh,scaleLog:V5,scaleOrdinal:RN,scalePoint:sd,scalePow:UN,scaleQuantile:G5,scaleQuantize:Y5,scaleRadial:K5,scaleSequential:sL,scaleSequentialLog:iL,scaleSequentialPow:QN,scaleSequentialQuantile:lL,scaleSequentialSqrt:Cne,scaleSequentialSymlog:oL,scaleSqrt:ite,scaleSymlog:H5,scaleThreshold:X5,scaleTime:Sne,scaleUtc:Nne,tickFormat:U5},Symbol.toStringTag,{value:"Module"}));var Ow,UT;function Ev(){if(UT)return Ow;UT=1;var e=Vc();function t(n,r,a){for(var i=-1,o=n.length;++i<o;){var c=n[i],d=r(c);if(d!=null&&(f===void 0?d===d&&!e(d):a(d,f)))var f=d,h=c}return h}return Ow=t,Ow}var Rw,qT;function fL(){if(qT)return Rw;qT=1;function e(t,n){return t>n}return Rw=e,Rw}var Tw,WT;function _ne(){if(WT)return Tw;WT=1;var e=Ev(),t=fL(),n=Gc();function r(a){return a&&a.length?e(a,n,t):void 0}return Tw=r,Tw}var Ene=_ne();const Pv=Yt(Ene);var Iw,VT;function pL(){if(VT)return Iw;VT=1;function e(t,n){return t<n}return Iw=e,Iw}var Mw,HT;function Pne(){if(HT)return Mw;HT=1;var e=Ev(),t=pL(),n=Gc();function r(a){return a&&a.length?e(a,n,t):void 0}return Mw=r,Mw}var kne=Pne();const kv=Yt(kne);var $w,KT;function One(){if(KT)return $w;KT=1;var e=hN(),t=Ss(),n=j5(),r=Br();function a(i,o){var c=r(i)?e:n;return c(i,t(o,3))}return $w=a,$w}var Dw,GT;function Rne(){if(GT)return Dw;GT=1;var e=b5(),t=One();function n(r,a){return e(t(r,a),1)}return Dw=n,Dw}var Tne=Rne();const Ine=Yt(Tne);var Lw,YT;function Mne(){if(YT)return Lw;YT=1;var e=_N();function t(n,r){return e(n,r)}return Lw=t,Lw}var $ne=Mne();const Sf=Yt($ne);var Xc=1e9,Dne={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},eC,xn=!0,Aa="[DecimalError] ",Po=Aa+"Invalid argument: ",ZN=Aa+"Exponent out of range: ",Qc=Math.floor,wo=Math.pow,Lne=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ta,er=1e7,gn=7,hL=9007199254740991,Yh=Qc(hL/gn),Ze={};Ze.absoluteValue=Ze.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Ze.comparedTo=Ze.cmp=function(e){var t,n,r,a,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(r=i.d.length,a=e.d.length,t=0,n=r<a?r:a;t<n;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return r===a?0:r>a^i.s<0?1:-1};Ze.decimalPlaces=Ze.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*gn;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Ze.dividedBy=Ze.div=function(e){return Ks(this,new this.constructor(e))};Ze.dividedToIntegerBy=Ze.idiv=function(e){var t=this,n=t.constructor;return rn(Ks(t,new n(e),0,1),n.precision)};Ze.equals=Ze.eq=function(e){return!this.cmp(e)};Ze.exponent=function(){return $n(this)};Ze.greaterThan=Ze.gt=function(e){return this.cmp(e)>0};Ze.greaterThanOrEqualTo=Ze.gte=function(e){return this.cmp(e)>=0};Ze.isInteger=Ze.isint=function(){return this.e>this.d.length-2};Ze.isNegative=Ze.isneg=function(){return this.s<0};Ze.isPositive=Ze.ispos=function(){return this.s>0};Ze.isZero=function(){return this.s===0};Ze.lessThan=Ze.lt=function(e){return this.cmp(e)<0};Ze.lessThanOrEqualTo=Ze.lte=function(e){return this.cmp(e)<1};Ze.logarithm=Ze.log=function(e){var t,n=this,r=n.constructor,a=r.precision,i=a+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(ta))throw Error(Aa+"NaN");if(n.s<1)throw Error(Aa+(n.s?"NaN":"-Infinity"));return n.eq(ta)?new r(0):(xn=!1,t=Ks(Od(n,i),Od(e,i),i),xn=!0,rn(t,a))};Ze.minus=Ze.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?gL(t,e):mL(t,(e.s=-e.s,e))};Ze.modulo=Ze.mod=function(e){var t,n=this,r=n.constructor,a=r.precision;if(e=new r(e),!e.s)throw Error(Aa+"NaN");return n.s?(xn=!1,t=Ks(n,e,0,1).times(e),xn=!0,n.minus(t)):rn(new r(n),a)};Ze.naturalExponential=Ze.exp=function(){return vL(this)};Ze.naturalLogarithm=Ze.ln=function(){return Od(this)};Ze.negated=Ze.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Ze.plus=Ze.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?mL(t,e):gL(t,(e.s=-e.s,e))};Ze.precision=Ze.sd=function(e){var t,n,r,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Po+e);if(t=$n(a)+1,r=a.d.length-1,n=r*gn+1,r=a.d[r],r){for(;r%10==0;r/=10)n--;for(r=a.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Ze.squareRoot=Ze.sqrt=function(){var e,t,n,r,a,i,o,c=this,d=c.constructor;if(c.s<1){if(!c.s)return new d(0);throw Error(Aa+"NaN")}for(e=$n(c),xn=!1,a=Math.sqrt(+c),a==0||a==1/0?(t=us(c.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=Qc((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new d(t)):r=new d(a.toString()),n=d.precision,a=o=n+3;;)if(i=r,r=i.plus(Ks(c,i,o+2)).times(.5),us(i.d).slice(0,o)===(t=us(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),a==o&&t=="4999"){if(rn(i,n+1,0),i.times(i).eq(c)){r=i;break}}else if(t!="9999")break;o+=4}return xn=!0,rn(r,n)};Ze.times=Ze.mul=function(e){var t,n,r,a,i,o,c,d,f,h=this,p=h.constructor,y=h.d,g=(e=new p(e)).d;if(!h.s||!e.s)return new p(0);for(e.s*=h.s,n=h.e+e.e,d=y.length,f=g.length,d<f&&(i=y,y=g,g=i,o=d,d=f,f=o),i=[],o=d+f,r=o;r--;)i.push(0);for(r=f;--r>=0;){for(t=0,a=d+r;a>r;)c=i[a]+g[r]*y[a-r-1]+t,i[a--]=c%er|0,t=c/er|0;i[a]=(i[a]+t)%er|0}for(;!i[--o];)i.pop();return t?++n:i.shift(),e.d=i,e.e=n,xn?rn(e,p.precision):e};Ze.toDecimalPlaces=Ze.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(gs(e,0,Xc),t===void 0?t=r.rounding:gs(t,0,8),rn(n,e+$n(n)+1,t))};Ze.toExponential=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=$o(r,!0):(gs(e,0,Xc),t===void 0?t=a.rounding:gs(t,0,8),r=rn(new a(r),e+1,t),n=$o(r,!0,e+1)),n};Ze.toFixed=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?$o(a):(gs(e,0,Xc),t===void 0?t=i.rounding:gs(t,0,8),r=rn(new i(a),e+$n(a)+1,t),n=$o(r.abs(),!1,e+$n(r)+1),a.isneg()&&!a.isZero()?"-"+n:n)};Ze.toInteger=Ze.toint=function(){var e=this,t=e.constructor;return rn(new t(e),$n(e)+1,t.rounding)};Ze.toNumber=function(){return+this};Ze.toPower=Ze.pow=function(e){var t,n,r,a,i,o,c=this,d=c.constructor,f=12,h=+(e=new d(e));if(!e.s)return new d(ta);if(c=new d(c),!c.s){if(e.s<1)throw Error(Aa+"Infinity");return c}if(c.eq(ta))return c;if(r=d.precision,e.eq(ta))return rn(c,r);if(t=e.e,n=e.d.length-1,o=t>=n,i=c.s,o){if((n=h<0?-h:h)<=hL){for(a=new d(ta),t=Math.ceil(r/gn+4),xn=!1;n%2&&(a=a.times(c),QT(a.d,t)),n=Qc(n/2),n!==0;)c=c.times(c),QT(c.d,t);return xn=!0,e.s<0?new d(ta).div(a):rn(a,r)}}else if(i<0)throw Error(Aa+"NaN");return i=i<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,xn=!1,a=e.times(Od(c,r+f)),xn=!0,a=vL(a),a.s=i,a};Ze.toPrecision=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?(n=$n(a),r=$o(a,n<=i.toExpNeg||n>=i.toExpPos)):(gs(e,1,Xc),t===void 0?t=i.rounding:gs(t,0,8),a=rn(new i(a),e,t),n=$n(a),r=$o(a,e<=n||n<=i.toExpNeg,e)),r};Ze.toSignificantDigits=Ze.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(gs(e,1,Xc),t===void 0?t=r.rounding:gs(t,0,8)),rn(new r(n),e,t)};Ze.toString=Ze.valueOf=Ze.val=Ze.toJSON=Ze[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=$n(e),n=e.constructor;return $o(e,t<=n.toExpNeg||t>=n.toExpPos)};function mL(e,t){var n,r,a,i,o,c,d,f,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s||(t=new h(e)),xn?rn(t,p):t;if(d=e.d,f=t.d,o=e.e,a=t.e,d=d.slice(),i=o-a,i){for(i<0?(r=d,i=-i,c=f.length):(r=f,a=o,c=d.length),o=Math.ceil(p/gn),c=o>c?o+1:c+1,i>c&&(i=c,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(c=d.length,i=f.length,c-i<0&&(i=c,r=f,f=d,d=r),n=0;i;)n=(d[--i]=d[i]+f[i]+n)/er|0,d[i]%=er;for(n&&(d.unshift(n),++a),c=d.length;d[--c]==0;)d.pop();return t.d=d,t.e=a,xn?rn(t,p):t}function gs(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Po+e)}function us(e){var t,n,r,a=e.length-1,i="",o=e[0];if(a>0){for(i+=o,t=1;t<a;t++)r=e[t]+"",n=gn-r.length,n&&(i+=Ri(n)),i+=r;o=e[t],r=o+"",n=gn-r.length,n&&(i+=Ri(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var Ks=(function(){function e(r,a){var i,o=0,c=r.length;for(r=r.slice();c--;)i=r[c]*a+o,r[c]=i%er|0,o=i/er|0;return o&&r.unshift(o),r}function t(r,a,i,o){var c,d;if(i!=o)d=i>o?1:-1;else for(c=d=0;c<i;c++)if(r[c]!=a[c]){d=r[c]>a[c]?1:-1;break}return d}function n(r,a,i){for(var o=0;i--;)r[i]-=o,o=r[i]<a[i]?1:0,r[i]=o*er+r[i]-a[i];for(;!r[0]&&r.length>1;)r.shift()}return function(r,a,i,o){var c,d,f,h,p,y,g,j,b,x,S,N,C,E,_,k,O,R,T=r.constructor,F=r.s==a.s?1:-1,L=r.d,$=a.d;if(!r.s)return new T(r);if(!a.s)throw Error(Aa+"Division by zero");for(d=r.e-a.e,O=$.length,_=L.length,g=new T(F),j=g.d=[],f=0;$[f]==(L[f]||0);)++f;if($[f]>(L[f]||0)&&--d,i==null?N=i=T.precision:o?N=i+($n(r)-$n(a))+1:N=i,N<0)return new T(0);if(N=N/gn+2|0,f=0,O==1)for(h=0,$=$[0],N++;(f<_||h)&&N--;f++)C=h*er+(L[f]||0),j[f]=C/$|0,h=C%$|0;else{for(h=er/($[0]+1)|0,h>1&&($=e($,h),L=e(L,h),O=$.length,_=L.length),E=O,b=L.slice(0,O),x=b.length;x<O;)b[x++]=0;R=$.slice(),R.unshift(0),k=$[0],$[1]>=er/2&&++k;do h=0,c=t($,b,O,x),c<0?(S=b[0],O!=x&&(S=S*er+(b[1]||0)),h=S/k|0,h>1?(h>=er&&(h=er-1),p=e($,h),y=p.length,x=b.length,c=t(p,b,y,x),c==1&&(h--,n(p,O<y?R:$,y))):(h==0&&(c=h=1),p=$.slice()),y=p.length,y<x&&p.unshift(0),n(b,p,x),c==-1&&(x=b.length,c=t($,b,O,x),c<1&&(h++,n(b,O<x?R:$,x))),x=b.length):c===0&&(h++,b=[0]),j[f++]=h,c&&b[0]?b[x++]=L[E]||0:(b=[L[E]],x=1);while((E++<_||b[0]!==void 0)&&N--)}return j[0]||j.shift(),g.e=d,rn(g,o?i+$n(g)+1:i)}})();function vL(e,t){var n,r,a,i,o,c,d=0,f=0,h=e.constructor,p=h.precision;if($n(e)>16)throw Error(ZN+$n(e));if(!e.s)return new h(ta);for(xn=!1,c=p,o=new h(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(r=Math.log(wo(2,f))/Math.LN10*2+5|0,c+=r,n=a=i=new h(ta),h.precision=c;;){if(a=rn(a.times(e),c),n=n.times(++d),o=i.plus(Ks(a,n,c)),us(o.d).slice(0,c)===us(i.d).slice(0,c)){for(;f--;)i=rn(i.times(i),c);return h.precision=p,t==null?(xn=!0,rn(i,p)):i}i=o}}function $n(e){for(var t=e.e*gn,n=e.d[0];n>=10;n/=10)t++;return t}function Fw(e,t,n){if(t>e.LN10.sd())throw xn=!0,n&&(e.precision=n),Error(Aa+"LN10 precision limit exceeded");return rn(new e(e.LN10),t)}function Ri(e){for(var t="";e--;)t+="0";return t}function Od(e,t){var n,r,a,i,o,c,d,f,h,p=1,y=10,g=e,j=g.d,b=g.constructor,x=b.precision;if(g.s<1)throw Error(Aa+(g.s?"NaN":"-Infinity"));if(g.eq(ta))return new b(0);if(t==null?(xn=!1,f=x):f=t,g.eq(10))return t==null&&(xn=!0),Fw(b,f);if(f+=y,b.precision=f,n=us(j),r=n.charAt(0),i=$n(g),Math.abs(i)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=us(g.d),r=n.charAt(0),p++;i=$n(g),r>1?(g=new b("0."+n),i++):g=new b(r+"."+n.slice(1))}else return d=Fw(b,f+2,x).times(i+""),g=Od(new b(r+"."+n.slice(1)),f-y).plus(d),b.precision=x,t==null?(xn=!0,rn(g,x)):g;for(c=o=g=Ks(g.minus(ta),g.plus(ta),f),h=rn(g.times(g),f),a=3;;){if(o=rn(o.times(h),f),d=c.plus(Ks(o,new b(a),f)),us(d.d).slice(0,f)===us(c.d).slice(0,f))return c=c.times(2),i!==0&&(c=c.plus(Fw(b,f+2,x).times(i+""))),c=Ks(c,new b(p),f),b.precision=x,t==null?(xn=!0,rn(c,x)):c;c=d,a+=2}}function XT(e,t){var n,r,a;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(r,a),t){if(a-=r,n=n-r-1,e.e=Qc(n/gn),e.d=[],r=(n+1)%gn,n<0&&(r+=gn),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=gn;r<a;)e.d.push(+t.slice(r,r+=gn));t=t.slice(r),r=gn-t.length}else r-=a;for(;r--;)t+="0";if(e.d.push(+t),xn&&(e.e>Yh||e.e<-Yh))throw Error(ZN+n)}else e.s=0,e.e=0,e.d=[0];return e}function rn(e,t,n){var r,a,i,o,c,d,f,h,p=e.d;for(o=1,i=p[0];i>=10;i/=10)o++;if(r=t-o,r<0)r+=gn,a=t,f=p[h=0];else{if(h=Math.ceil((r+1)/gn),i=p.length,h>=i)return e;for(f=i=p[h],o=1;i>=10;i/=10)o++;r%=gn,a=r-gn+o}if(n!==void 0&&(i=wo(10,o-a-1),c=f/i%10|0,d=t<0||p[h+1]!==void 0||f%i,d=n<4?(c||d)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||d||n==6&&(r>0?a>0?f/wo(10,o-a):0:p[h-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return d?(i=$n(e),p.length=1,t=t-i-1,p[0]=wo(10,(gn-t%gn)%gn),e.e=Qc(-t/gn)||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=wo(10,gn-r),p[h]=a>0?(f/wo(10,o-a)%wo(10,a)|0)*i:0),d)for(;;)if(h==0){(p[0]+=i)==er&&(p[0]=1,++e.e);break}else{if(p[h]+=i,p[h]!=er)break;p[h--]=0,i=1}for(r=p.length;p[--r]===0;)p.pop();if(xn&&(e.e>Yh||e.e<-Yh))throw Error(ZN+$n(e));return e}function gL(e,t){var n,r,a,i,o,c,d,f,h,p,y=e.constructor,g=y.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new y(e),xn?rn(t,g):t;if(d=e.d,p=t.d,r=t.e,f=e.e,d=d.slice(),o=f-r,o){for(h=o<0,h?(n=d,o=-o,c=p.length):(n=p,r=f,c=d.length),a=Math.max(Math.ceil(g/gn),c)+2,o>a&&(o=a,n.length=1),n.reverse(),a=o;a--;)n.push(0);n.reverse()}else{for(a=d.length,c=p.length,h=a<c,h&&(c=a),a=0;a<c;a++)if(d[a]!=p[a]){h=d[a]<p[a];break}o=0}for(h&&(n=d,d=p,p=n,t.s=-t.s),c=d.length,a=p.length-c;a>0;--a)d[c++]=0;for(a=p.length;a>o;){if(d[--a]<p[a]){for(i=a;i&&d[--i]===0;)d[i]=er-1;--d[i],d[a]+=er}d[a]-=p[a]}for(;d[--c]===0;)d.pop();for(;d[0]===0;d.shift())--r;return d[0]?(t.d=d,t.e=r,xn?rn(t,g):t):new y(0)}function $o(e,t,n){var r,a=$n(e),i=us(e.d),o=i.length;return t?(n&&(r=n-o)>0?i=i.charAt(0)+"."+i.slice(1)+Ri(r):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+Ri(-a-1)+i,n&&(r=n-o)>0&&(i+=Ri(r))):a>=o?(i+=Ri(a+1-o),n&&(r=n-a-1)>0&&(i=i+"."+Ri(r))):((r=a+1)<o&&(i=i.slice(0,r)+"."+i.slice(r)),n&&(r=n-o)>0&&(a+1===o&&(i+="."),i+=Ri(r))),e.s<0?"-"+i:i}function QT(e,t){if(e.length>t)return e.length=t,!0}function yL(e){var t,n,r;function a(i){var o=this;if(!(o instanceof a))return new a(i);if(o.constructor=a,i instanceof a){o.s=i.s,o.e=i.e,o.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(Po+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 XT(o,i.toString())}else if(typeof i!="string")throw Error(Po+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,Lne.test(i))XT(o,i);else throw Error(Po+i)}if(a.prototype=Ze,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=yL,a.config=a.set=Fne,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return a.config(e),a}function Fne(e){if(!e||typeof e!="object")throw Error(Aa+"Object expected");var t,n,r,a=["precision",1,Xc,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<a.length;t+=3)if((r=e[n=a[t]])!==void 0)if(Qc(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(Po+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Po+n+": "+r);return this}var eC=yL(Dne);ta=new eC(1);const Jt=eC;function Bne(e){return Wne(e)||qne(e)||Une(e)||zne()}function zne(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
68
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Une(e,t){if(e){if(typeof e=="string")return jj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jj(e,t)}}function qne(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Wne(e){if(Array.isArray(e))return jj(e)}function jj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Vne=function(t){return t},xL={},bL=function(t){return t===xL},JT=function(t){return function n(){return arguments.length===0||arguments.length===1&&bL(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},Hne=function e(t,n){return t===1?n:JT(function(){for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];var o=a.filter(function(c){return c!==xL}).length;return o>=t?n.apply(void 0,a):e(t-o,JT(function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];var h=a.map(function(p){return bL(p)?d.shift():p});return n.apply(void 0,Bne(h).concat(d))}))})},Ov=function(t){return Hne(t.length,t)},Sj=function(t,n){for(var r=[],a=t;a<n;++a)r[a-t]=a;return r},Kne=Ov(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),Gne=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return Vne;var a=n.reverse(),i=a[0],o=a.slice(1);return function(){return o.reduce(function(c,d){return d(c)},i.apply(void 0,arguments))}},Nj=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},wL=function(t){var n=null,r=null;return function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return n&&i.every(function(c,d){return c===n[d]})||(n=i,r=t.apply(void 0,i)),r}};function Yne(e){var t;return e===0?t=1:t=Math.floor(new Jt(e).abs().log(10).toNumber())+1,t}function Xne(e,t,n){for(var r=new Jt(e),a=0,i=[];r.lt(t)&&a<1e5;)i.push(r.toNumber()),r=r.add(n),a++;return i}var Qne=Ov(function(e,t,n){var r=+e,a=+t;return r+n*(a-r)}),Jne=Ov(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),Zne=Ov(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const Rv={rangeStep:Xne,getDigitCount:Yne,interpolateNumber:Qne,uninterpolateNumber:Jne,uninterpolateTruncation:Zne};function Cj(e){return nre(e)||tre(e)||jL(e)||ere()}function ere(){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 tre(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function nre(e){if(Array.isArray(e))return Aj(e)}function Rd(e,t){return sre(e)||are(e,t)||jL(e,t)||rre()}function rre(){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 jL(e,t){if(e){if(typeof e=="string")return Aj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Aj(e,t)}}function Aj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function are(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,a=!1,i=void 0;try{for(var o=e[Symbol.iterator](),c;!(r=(c=o.next()).done)&&(n.push(c.value),!(t&&n.length===t));r=!0);}catch(d){a=!0,i=d}finally{try{!r&&o.return!=null&&o.return()}finally{if(a)throw i}}return n}}function sre(e){if(Array.isArray(e))return e}function SL(e){var t=Rd(e,2),n=t[0],r=t[1],a=n,i=r;return n>r&&(a=r,i=n),[a,i]}function NL(e,t,n){if(e.lte(0))return new Jt(0);var r=Rv.getDigitCount(e.toNumber()),a=new Jt(10).pow(r),i=e.div(a),o=r!==1?.05:.1,c=new Jt(Math.ceil(i.div(o).toNumber())).add(n).mul(o),d=c.mul(a);return t?d:new Jt(Math.ceil(d))}function ire(e,t,n){var r=1,a=new Jt(e);if(!a.isint()&&n){var i=Math.abs(e);i<1?(r=new Jt(10).pow(Rv.getDigitCount(e)-1),a=new Jt(Math.floor(a.div(r).toNumber())).mul(r)):i>1&&(a=new Jt(Math.floor(e)))}else e===0?a=new Jt(Math.floor((t-1)/2)):n||(a=new Jt(Math.floor(e)));var o=Math.floor((t-1)/2),c=Gne(Kne(function(d){return a.add(new Jt(d-o).mul(r)).toNumber()}),Sj);return c(0,t)}function CL(e,t,n,r){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new Jt(0),tickMin:new Jt(0),tickMax:new Jt(0)};var i=NL(new Jt(t).sub(e).div(n-1),r,a),o;e<=0&&t>=0?o=new Jt(0):(o=new Jt(e).add(t).div(2),o=o.sub(new Jt(o).mod(i)));var c=Math.ceil(o.sub(e).div(i).toNumber()),d=Math.ceil(new Jt(t).sub(o).div(i).toNumber()),f=c+d+1;return f>n?CL(e,t,n,r,a+1):(f<n&&(d=t>0?d+(n-f):d,c=t>0?c:c+(n-f)),{step:i,tickMin:o.sub(new Jt(c).mul(i)),tickMax:o.add(new Jt(d).mul(i))})}function ore(e){var t=Rd(e,2),n=t[0],r=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(a,2),c=SL([n,r]),d=Rd(c,2),f=d[0],h=d[1];if(f===-1/0||h===1/0){var p=h===1/0?[f].concat(Cj(Sj(0,a-1).map(function(){return 1/0}))):[].concat(Cj(Sj(0,a-1).map(function(){return-1/0})),[h]);return n>r?Nj(p):p}if(f===h)return ire(f,a,i);var y=CL(f,h,o,i),g=y.step,j=y.tickMin,b=y.tickMax,x=Rv.rangeStep(j,b.add(new Jt(.1).mul(g)),g);return n>r?Nj(x):x}function lre(e,t){var n=Rd(e,2),r=n[0],a=n[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=SL([r,a]),c=Rd(o,2),d=c[0],f=c[1];if(d===-1/0||f===1/0)return[r,a];if(d===f)return[d];var h=Math.max(t,2),p=NL(new Jt(f).sub(d).div(h-1),i,0),y=[].concat(Cj(Rv.rangeStep(new Jt(d),new Jt(f).sub(new Jt(.99).mul(p)),p)),[f]);return r>a?Nj(y):y}var cre=wL(ore),ure=wL(lre),dre="Invariant failed";function Do(e,t){throw new Error(dre)}var fre=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];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 Xh(){return Xh=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},Xh.apply(this,arguments)}function pre(e,t){return gre(e)||vre(e,t)||mre(e,t)||hre()}function hre(){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 mre(e,t){if(e){if(typeof e=="string")return ZT(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 ZT(e,t)}}function ZT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function vre(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function gre(e){if(Array.isArray(e))return e}function yre(e,t){if(e==null)return{};var n=xre(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function xre(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 bre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wre(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,EL(r.key),r)}}function jre(e,t,n){return t&&wre(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Sre(e,t,n){return t=Qh(t),Nre(e,AL()?Reflect.construct(t,n||[],Qh(e).constructor):t.apply(e,n))}function Nre(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 Cre(e)}function Cre(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function AL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(AL=function(){return!!e})()}function Qh(e){return Qh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Qh(e)}function Are(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_j(e,t)}function _j(e,t){return _j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},_j(e,t)}function _L(e,t,n){return t=EL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EL(e){var t=_re(e,"string");return gc(t)=="symbol"?t:t+""}function _re(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 Nf=(function(e){function t(){return bre(this,t),Sre(this,t,arguments)}return Are(t,e),jre(t,[{key:"render",value:function(){var r=this.props,a=r.offset,i=r.layout,o=r.width,c=r.dataKey,d=r.data,f=r.dataPointFormatter,h=r.xAxis,p=r.yAxis,y=yre(r,fre),g=gt(y,!1);this.props.direction==="x"&&h.type!=="number"&&Do();var j=d.map(function(b){var x=f(b,c),S=x.x,N=x.y,C=x.value,E=x.errorVal;if(!E)return null;var _=[],k,O;if(Array.isArray(E)){var R=pre(E,2);k=R[0],O=R[1]}else k=O=E;if(i==="vertical"){var T=h.scale,F=N+a,L=F+o,$=F-o,Y=T(C-k),H=T(C+O);_.push({x1:H,y1:L,x2:H,y2:$}),_.push({x1:Y,y1:F,x2:H,y2:F}),_.push({x1:Y,y1:L,x2:Y,y2:$})}else if(i==="horizontal"){var K=p.scale,J=S+a,Q=J-o,D=J+o,B=K(C-k),Z=K(C+O);_.push({x1:Q,y1:Z,x2:D,y2:Z}),_.push({x1:J,y1:B,x2:J,y2:Z}),_.push({x1:Q,y1:B,x2:D,y2:B})}return U.createElement(zt,Xh({className:"recharts-errorBar",key:"bar-".concat(_.map(function(z){return"".concat(z.x1,"-").concat(z.x2,"-").concat(z.y1,"-").concat(z.y2)}))},g),_.map(function(z){return U.createElement("line",Xh({},z,{key:"line-".concat(z.x1,"-").concat(z.x2,"-").concat(z.y1,"-").concat(z.y2)}))}))});return U.createElement(zt,{className:"recharts-errorBars"},j)}}])})(U.Component);_L(Nf,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});_L(Nf,"displayName","ErrorBar");function Td(e){"@babel/helpers - typeof";return Td=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Td(e)}function e2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function mo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?e2(Object(n),!0).forEach(function(r){Ere(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ere(e,t,n){return t=Pre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pre(e){var t=kre(e,"string");return Td(t)=="symbol"?t:t+""}function kre(e,t){if(Td(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Td(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var PL=function(t){var n=t.children,r=t.formattedGraphicalItems,a=t.legendWidth,i=t.legendContent,o=Jr(n,_o);if(!o)return null;var c=_o.defaultProps,d=c!==void 0?mo(mo({},c),o.props):{},f;return o.props&&o.props.payload?f=o.props&&o.props.payload:i==="children"?f=(r||[]).reduce(function(h,p){var y=p.item,g=p.props,j=g.sectors||g.data||[];return h.concat(j.map(function(b){return{type:o.props.iconType||y.props.legendType,value:b.name,color:b.fill,payload:b}}))},[]):f=(r||[]).map(function(h){var p=h.item,y=p.type.defaultProps,g=y!==void 0?mo(mo({},y),p.props):{},j=g.dataKey,b=g.name,x=g.legendType,S=g.hide;return{inactive:S,dataKey:j,type:d.iconType||x||"square",color:tC(p),value:b||j,payload:g}}),mo(mo(mo({},d),_o.getWithHeight(o,a)),{},{payload:f,item:o})};function Id(e){"@babel/helpers - typeof";return Id=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Id(e)}function t2(e){return Ire(e)||Tre(e)||Rre(e)||Ore()}function Ore(){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 Rre(e,t){if(e){if(typeof e=="string")return Ej(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ej(e,t)}}function Tre(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ire(e){if(Array.isArray(e))return Ej(e)}function Ej(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function n2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function _n(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?n2(Object(n),!0).forEach(function(r){ec(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):n2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ec(e,t,n){return t=Mre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mre(e){var t=$re(e,"string");return Id(t)=="symbol"?t:t+""}function $re(e,t){if(Id(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Id(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qn(e,t,n){return Ct(e)||Ct(t)?n:Wn(t)?aa(e,t,n):jt(t)?t(e):n}function id(e,t,n,r){var a=Ine(e,function(c){return qn(c,t)});if(n==="number"){var i=a.filter(function(c){return Ue(c)||parseFloat(c)});return i.length?[kv(i),Pv(i)]:[1/0,-1/0]}var o=r?a.filter(function(c){return!Ct(c)}):a;return o.map(function(c){return Wn(c)||c instanceof Date?c:""})}var Dre=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,c=(n=r?.length)!==null&&n!==void 0?n:0;if(c<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var d=i.range,f=0;f<c;f++){var h=f>0?a[f-1].coordinate:a[c-1].coordinate,p=a[f].coordinate,y=f>=c-1?a[0].coordinate:a[f+1].coordinate,g=void 0;if(jr(p-h)!==jr(y-p)){var j=[];if(jr(y-p)===jr(d[1]-d[0])){g=y;var b=p+d[1]-d[0];j[0]=Math.min(b,(b+h)/2),j[1]=Math.max(b,(b+h)/2)}else{g=h;var x=y+d[1]-d[0];j[0]=Math.min(p,(x+p)/2),j[1]=Math.max(p,(x+p)/2)}var S=[Math.min(p,(g+p)/2),Math.max(p,(g+p)/2)];if(t>S[0]&&t<=S[1]||t>=j[0]&&t<=j[1]){o=a[f].index;break}}else{var N=Math.min(h,y),C=Math.max(h,y);if(t>(N+p)/2&&t<=(C+p)/2){o=a[f].index;break}}}else for(var E=0;E<c;E++)if(E===0&&t<=(r[E].coordinate+r[E+1].coordinate)/2||E>0&&E<c-1&&t>(r[E].coordinate+r[E-1].coordinate)/2&&t<=(r[E].coordinate+r[E+1].coordinate)/2||E===c-1&&t>(r[E].coordinate+r[E-1].coordinate)/2){o=r[E].index;break}return o},tC=function(t){var n,r=t,a=r.type.displayName,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?_n(_n({},t.type.defaultProps),t.props):t.props,o=i.stroke,c=i.fill,d;switch(a){case"Line":d=o;break;case"Area":case"Radar":d=o&&o!=="none"?o:c;break;default:d=c;break}return d},Lre=function(t){var n=t.barSize,r=t.totalSize,a=t.stackGroups,i=a===void 0?{}:a;if(!i)return{};for(var o={},c=Object.keys(i),d=0,f=c.length;d<f;d++)for(var h=i[c[d]].stackGroups,p=Object.keys(h),y=0,g=p.length;y<g;y++){var j=h[p[y]],b=j.items,x=j.cateAxisId,S=b.filter(function(O){return Vs(O.type).indexOf("Bar")>=0});if(S&&S.length){var N=S[0].type.defaultProps,C=N!==void 0?_n(_n({},N),S[0].props):S[0].props,E=C.barSize,_=C[x];o[_]||(o[_]=[]);var k=Ct(E)?n:E;o[_].push({item:S[0],stackList:S.slice(1),barSize:Ct(k)?void 0:Sr(k,r,0)})}}return o},Fre=function(t){var n=t.barGap,r=t.barCategoryGap,a=t.bandSize,i=t.sizeList,o=i===void 0?[]:i,c=t.maxBarSize,d=o.length;if(d<1)return null;var f=Sr(n,a,0,!0),h,p=[];if(o[0].barSize===+o[0].barSize){var y=!1,g=a/d,j=o.reduce(function(E,_){return E+_.barSize||0},0);j+=(d-1)*f,j>=a&&(j-=(d-1)*f,f=0),j>=a&&g>0&&(y=!0,g*=.9,j=d*g);var b=(a-j)/2>>0,x={offset:b-f,size:0};h=o.reduce(function(E,_){var k={item:_.item,position:{offset:x.offset+x.size+f,size:y?g:_.barSize}},O=[].concat(t2(E),[k]);return x=O[O.length-1].position,_.stackList&&_.stackList.length&&_.stackList.forEach(function(R){O.push({item:R,position:x})}),O},p)}else{var S=Sr(r,a,0,!0);a-2*S-(d-1)*f<=0&&(f=0);var N=(a-2*S-(d-1)*f)/d;N>1&&(N>>=0);var C=c===+c?Math.min(N,c):N;h=o.reduce(function(E,_,k){var O=[].concat(t2(E),[{item:_.item,position:{offset:S+(N+f)*k+(N-C)/2,size:C}}]);return _.stackList&&_.stackList.length&&_.stackList.forEach(function(R){O.push({item:R,position:O[O.length-1].position})}),O},p)}return h},Bre=function(t,n,r,a){var i=r.children,o=r.width,c=r.margin,d=o-(c.left||0)-(c.right||0),f=PL({children:i,legendWidth:d});if(f){var h=a||{},p=h.width,y=h.height,g=f.align,j=f.verticalAlign,b=f.layout;if((b==="vertical"||b==="horizontal"&&j==="middle")&&g!=="center"&&Ue(t[g]))return _n(_n({},t),{},ec({},g,t[g]+(p||0)));if((b==="horizontal"||b==="vertical"&&g==="center")&&j!=="middle"&&Ue(t[j]))return _n(_n({},t),{},ec({},j,t[j]+(y||0)))}return t},zre=function(t,n,r){return Ct(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},kL=function(t,n,r,a,i){var o=n.props.children,c=sa(o,Nf).filter(function(f){return zre(a,i,f.props.direction)});if(c&&c.length){var d=c.map(function(f){return f.props.dataKey});return t.reduce(function(f,h){var p=qn(h,r);if(Ct(p))return f;var y=Array.isArray(p)?[kv(p),Pv(p)]:[p,p],g=d.reduce(function(j,b){var x=qn(h,b,0),S=y[0]-Math.abs(Array.isArray(x)?x[0]:x),N=y[1]+Math.abs(Array.isArray(x)?x[1]:x);return[Math.min(S,j[0]),Math.max(N,j[1])]},[1/0,-1/0]);return[Math.min(g[0],f[0]),Math.max(g[1],f[1])]},[1/0,-1/0])}return null},Ure=function(t,n,r,a,i){var o=n.map(function(c){return kL(t,c,r,i,a)}).filter(function(c){return!Ct(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},OL=function(t,n,r,a,i){var o=n.map(function(d){var f=d.props.dataKey;return r==="number"&&f&&kL(t,d,f,a)||id(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},[])},RL=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},Ao=function(t,n,r){if(!t)return null;var a=t.scale,i=t.duplicateDomain,o=t.type,c=t.range,d=t.realScaleType==="scaleBand"?a.bandwidth()/2:2,f=(n||r)&&o==="category"&&a.bandwidth?a.bandwidth()/d:0;if(f=t.axisType==="angleAxis"&&c?.length>=2?jr(c[0]-c[1])*2*f:f,n&&(t.ticks||t.niceTicks)){var h=(t.ticks||t.niceTicks).map(function(p){var y=i?i.indexOf(p):p;return{coordinate:a(y)+f,value:p,offset:f}});return h.filter(function(p){return!gf(p.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(p,y){return{coordinate:a(p)+f,value:p,index:y,offset:f}}):a.ticks&&!r?a.ticks(t.tickCount).map(function(p){return{coordinate:a(p)+f,value:p,offset:f}}):a.domain().map(function(p,y){return{coordinate:a(p)+f,value:i?i[p]:p,index:y,offset:f}})},Bw=new WeakMap,Zp=function(t,n){if(typeof n!="function")return t;Bw.has(t)||Bw.set(t,new WeakMap);var r=Bw.get(t);if(r.has(n))return r.get(n);var a=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,a),a},TL=function(t,n,r){var a=t.scale,i=t.type,o=t.layout,c=t.axisType;if(a==="auto")return o==="radial"&&c==="radiusAxis"?{scale:Ad(),realScaleType:"band"}:o==="radial"&&c==="angleAxis"?{scale:Vh(),realScaleType:"linear"}:i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:sd(),realScaleType:"point"}:i==="category"?{scale:Ad(),realScaleType:"band"}:{scale:Vh(),realScaleType:"linear"};if(To(a)){var d="scale".concat(hv(a));return{scale:(zT[d]||sd)(),realScaleType:zT[d]?d:"point"}}return jt(a)?{scale:a}:{scale:sd(),realScaleType:"point"}},r2=1e-4,IL=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,a=t.range(),i=Math.min(a[0],a[1])-r2,o=Math.max(a[0],a[1])+r2,c=t(n[0]),d=t(n[r-1]);(c<i||c>o||d<i||d>o)&&t.domain([n[0],n[r-1]])}},qre=function(t,n){if(!t)return null;for(var r=0,a=t.length;r<a;r++)if(t[r].item===n)return t[r].position;return null},Wre=function(t,n){if(!n||n.length!==2||!Ue(n[0])||!Ue(n[1]))return t;var r=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]),i=[t[0],t[1]];return(!Ue(t[0])||t[0]<r)&&(i[0]=r),(!Ue(t[1])||t[1]>a)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]<r&&(i[1]=r),i},Vre=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r<a;++r)for(var i=0,o=0,c=0;c<n;++c){var d=gf(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])}},Hre=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r<a;++r)for(var i=0,o=0;o<n;++o){var c=gf(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)}},Kre={sign:Vre,expand:IX,none:cc,silhouette:MX,wiggle:$X,positive:Hre},Gre=function(t,n,r){var a=n.map(function(c){return c.props.dataKey}),i=Kre[r],o=TX().keys(a).value(function(c,d){return+qn(c,d,0)}).order(aj).offset(i);return o(t)},Yre=function(t,n,r,a,i,o){if(!t)return null;var c=o?n.reverse():n,d={},f=c.reduce(function(p,y){var g,j=(g=y.type)!==null&&g!==void 0&&g.defaultProps?_n(_n({},y.type.defaultProps),y.props):y.props,b=j.stackId,x=j.hide;if(x)return p;var S=j[r],N=p[S]||{hasStack:!1,stackGroups:{}};if(Wn(b)){var C=N.stackGroups[b]||{numericAxisId:r,cateAxisId:a,items:[]};C.items.push(y),N.hasStack=!0,N.stackGroups[b]=C}else N.stackGroups[Kc("_stackId_")]={numericAxisId:r,cateAxisId:a,items:[y]};return _n(_n({},p),{},ec({},S,N))},d),h={};return Object.keys(f).reduce(function(p,y){var g=f[y];if(g.hasStack){var j={};g.stackGroups=Object.keys(g.stackGroups).reduce(function(b,x){var S=g.stackGroups[x];return _n(_n({},b),{},ec({},x,{numericAxisId:r,cateAxisId:a,items:S.items,stackedData:Gre(t,S.items,i)}))},j)}return _n(_n({},p),{},ec({},y,g))},h)},ML=function(t,n){var r=n.realScaleType,a=n.type,i=n.tickCount,o=n.originalDomain,c=n.allowDecimals,d=r||n.scale;if(d!=="auto"&&d!=="linear")return null;if(i&&a==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var f=t.domain();if(!f.length)return null;var h=cre(f,i,c);return t.domain([kv(h),Pv(h)]),{niceTicks:h}}if(i&&a==="number"){var p=t.domain(),y=ure(p,i,c);return{niceTicks:y}}return null};function a2(e){var t=e.axis,n=e.ticks,r=e.bandSize,a=e.entry,i=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ct(a[t.dataKey])){var c=Ch(n,"value",a[t.dataKey]);if(c)return c.coordinate+r/2}return n[i]?n[i].coordinate+r/2:null}var d=qn(a,Ct(o)?t.dataKey:o);return Ct(d)?null:t.scale(d)}var s2=function(t){var n=t.axis,r=t.ticks,a=t.offset,i=t.bandSize,o=t.entry,c=t.index;if(n.type==="category")return r[c]?r[c].coordinate+a:null;var d=qn(o,n.dataKey,n.domain[c]);return Ct(d)?null:n.scale(d)-i/2+a},Xre=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var a=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return a<=0&&i>=0?0:i<0?i:a}return r[0]},Qre=function(t,n){var r,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?_n(_n({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(Wn(i)){var o=n[i];if(o){var c=o.items.indexOf(t);return c>=0?o.stackedData[c]:null}}return null},Jre=function(t){return t.reduce(function(n,r){return[kv(r.concat([n[0]]).filter(Ue)),Pv(r.concat([n[1]]).filter(Ue))]},[1/0,-1/0])},$L=function(t,n,r){return Object.keys(t).reduce(function(a,i){var o=t[i],c=o.stackedData,d=c.reduce(function(f,h){var p=Jre(h.slice(n,r+1));return[Math.min(f[0],p[0]),Math.max(f[1],p[1])]},[1/0,-1/0]);return[Math.min(d[0],a[0]),Math.max(d[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},i2=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,o2=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Pj=function(t,n,r){if(jt(t))return t(n,r);if(!Array.isArray(t))return n;var a=[];if(Ue(t[0]))a[0]=r?t[0]:Math.min(t[0],n[0]);else if(i2.test(t[0])){var i=+i2.exec(t[0])[1];a[0]=n[0]-i}else jt(t[0])?a[0]=t[0](n[0]):a[0]=n[0];if(Ue(t[1]))a[1]=r?t[1]:Math.max(t[1],n[1]);else if(o2.test(t[1])){var o=+o2.exec(t[1])[1];a[1]=n[1]+o}else jt(t[1])?a[1]=t[1](n[1]):a[1]=n[1];return a},Jh=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!r||a>0)return a}if(t&&n&&n.length>=2){for(var i=PN(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},l2=function(t,n,r){return!t||!t.length||Sf(t,aa(r,"type.defaultProps.domain"))?n:t},DL=function(t,n){var r=t.type.defaultProps?_n(_n({},t.type.defaultProps),t.props):t.props,a=r.dataKey,i=r.name,o=r.unit,c=r.formatter,d=r.tooltipType,f=r.chartType,h=r.hide;return _n(_n({},gt(t,!1)),{},{dataKey:a,unit:o,formatter:c,name:i||a,color:tC(t),value:qn(n,a),type:d,payload:n,chartType:f,hide:h})};function Md(e){"@babel/helpers - typeof";return Md=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Md(e)}function c2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ds(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?c2(Object(n),!0).forEach(function(r){LL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LL(e,t,n){return t=Zre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zre(e){var t=eae(e,"string");return Md(t)=="symbol"?t:t+""}function eae(e,t){if(Md(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Md(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tae(e,t){return sae(e)||aae(e,t)||rae(e,t)||nae()}function nae(){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 rae(e,t){if(e){if(typeof e=="string")return u2(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 u2(e,t)}}function u2(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 aae(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function sae(e){if(Array.isArray(e))return e}var Zh=Math.PI/180,iae=function(t){return t*180/Math.PI},dn=function(t,n,r,a){return{x:t+Math.cos(-Zh*a)*r,y:n+Math.sin(-Zh*a)*r}},FL=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},oae=function(t,n,r,a,i){var o=t.width,c=t.height,d=t.startAngle,f=t.endAngle,h=Sr(t.cx,o,o/2),p=Sr(t.cy,c,c/2),y=FL(o,c,r),g=Sr(t.innerRadius,y,0),j=Sr(t.outerRadius,y,y*.8),b=Object.keys(n);return b.reduce(function(x,S){var N=n[S],C=N.domain,E=N.reversed,_;if(Ct(N.range))a==="angleAxis"?_=[d,f]:a==="radiusAxis"&&(_=[g,j]),E&&(_=[_[1],_[0]]);else{_=N.range;var k=_,O=tae(k,2);d=O[0],f=O[1]}var R=TL(N,i),T=R.realScaleType,F=R.scale;F.domain(C).range(_),IL(F);var L=ML(F,Ds(Ds({},N),{},{realScaleType:T})),$=Ds(Ds(Ds({},N),L),{},{range:_,radius:j,realScaleType:T,scale:F,cx:h,cy:p,innerRadius:g,outerRadius:j,startAngle:d,endAngle:f});return Ds(Ds({},x),{},LL({},S,$))},{})},lae=function(t,n){var r=t.x,a=t.y,i=n.x,o=n.y;return Math.sqrt(Math.pow(r-i,2)+Math.pow(a-o,2))},cae=function(t,n){var r=t.x,a=t.y,i=n.cx,o=n.cy,c=lae({x:r,y:a},{x:i,y:o});if(c<=0)return{radius:c};var d=(r-i)/c,f=Math.acos(d);return a>o&&(f=2*Math.PI-f),{radius:c,angle:iae(f),angleInRadian:f}},uae=function(t){var n=t.startAngle,r=t.endAngle,a=Math.floor(n/360),i=Math.floor(r/360),o=Math.min(a,i);return{startAngle:n-o*360,endAngle:r-o*360}},dae=function(t,n){var r=n.startAngle,a=n.endAngle,i=Math.floor(r/360),o=Math.floor(a/360),c=Math.min(i,o);return t+c*360},d2=function(t,n){var r=t.x,a=t.y,i=cae({x:r,y:a},n),o=i.radius,c=i.angle,d=n.innerRadius,f=n.outerRadius;if(o<d||o>f)return!1;if(o===0)return!0;var h=uae(n),p=h.startAngle,y=h.endAngle,g=c,j;if(p<=y){for(;g>y;)g-=360;for(;g<p;)g+=360;j=g>=p&&g<=y}else{for(;g>p;)g-=360;for(;g<y;)g+=360;j=g>=y&&g<=p}return j?Ds(Ds({},n),{},{radius:o,angle:dae(g,n)}):null},BL=function(t){return!v.isValidElement(t)&&!jt(t)&&typeof t!="boolean"?t.className:""};function $d(e){"@babel/helpers - typeof";return $d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$d(e)}var fae=["offset"];function pae(e){return gae(e)||vae(e)||mae(e)||hae()}function hae(){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 mae(e,t){if(e){if(typeof e=="string")return kj(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 kj(e,t)}}function vae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function gae(e){if(Array.isArray(e))return kj(e)}function kj(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 yae(e,t){if(e==null)return{};var n=xae(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function xae(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function f2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Un(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?f2(Object(n),!0).forEach(function(r){bae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bae(e,t,n){return t=wae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wae(e){var t=jae(e,"string");return $d(t)=="symbol"?t:t+""}function jae(e,t){if($d(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if($d(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function 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 Sae=function(t){var n=t.value,r=t.formatter,a=Ct(t.children)?n:t.children;return jt(r)?r(a):a},Nae=function(t,n){var r=jr(n-t),a=Math.min(Math.abs(n-t),360);return r*a},Cae=function(t,n,r){var a=t.position,i=t.viewBox,o=t.offset,c=t.className,d=i,f=d.cx,h=d.cy,p=d.innerRadius,y=d.outerRadius,g=d.startAngle,j=d.endAngle,b=d.clockWise,x=(p+y)/2,S=Nae(g,j),N=S>=0?1:-1,C,E;a==="insideStart"?(C=g+N*o,E=b):a==="insideEnd"?(C=j-N*o,E=!b):a==="end"&&(C=j+N*o,E=b),E=S<=0?E:!E;var _=dn(f,h,x,C),k=dn(f,h,x,C+(E?1:-1)*359),O="M".concat(_.x,",").concat(_.y,`
|
|
75
|
-
A`).concat(x,",").concat(x,",0,1,").concat(E?0:1,`,
|
|
76
|
-
`).concat(k.x,",").concat(k.y),R=Ct(t.id)?Kc("recharts-radial-line-"):t.id;return U.createElement("text",Dd({},r,{dominantBaseline:"central",className:At("recharts-radial-bar-label",c)}),U.createElement("defs",null,U.createElement("path",{id:R,d:O})),U.createElement("textPath",{xlinkHref:"#".concat(R)},n))},Aae=function(t){var n=t.viewBox,r=t.offset,a=t.position,i=n,o=i.cx,c=i.cy,d=i.innerRadius,f=i.outerRadius,h=i.startAngle,p=i.endAngle,y=(h+p)/2;if(a==="outside"){var g=dn(o,c,f+r,y),j=g.x,b=g.y;return{x:j,y:b,textAnchor:j>=o?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"end"};var x=(d+f)/2,S=dn(o,c,x,y),N=S.x,C=S.y;return{x:N,y:C,textAnchor:"middle",verticalAnchor:"middle"}},_ae=function(t){var n=t.viewBox,r=t.parentViewBox,a=t.offset,i=t.position,o=n,c=o.x,d=o.y,f=o.width,h=o.height,p=h>=0?1:-1,y=p*a,g=p>0?"end":"start",j=p>0?"start":"end",b=f>=0?1:-1,x=b*a,S=b>0?"end":"start",N=b>0?"start":"end";if(i==="top"){var C={x:c+f/2,y:d-p*a,textAnchor:"middle",verticalAnchor:g};return Un(Un({},C),r?{height:Math.max(d-r.y,0),width:f}:{})}if(i==="bottom"){var E={x:c+f/2,y:d+h+y,textAnchor:"middle",verticalAnchor:j};return Un(Un({},E),r?{height:Math.max(r.y+r.height-(d+h),0),width:f}:{})}if(i==="left"){var _={x:c-x,y:d+h/2,textAnchor:S,verticalAnchor:"middle"};return Un(Un({},_),r?{width:Math.max(_.x-r.x,0),height:h}:{})}if(i==="right"){var k={x:c+f+x,y:d+h/2,textAnchor:N,verticalAnchor:"middle"};return Un(Un({},k),r?{width:Math.max(r.x+r.width-k.x,0),height:h}:{})}var O=r?{width:f,height:h}:{};return i==="insideLeft"?Un({x:c+x,y:d+h/2,textAnchor:N,verticalAnchor:"middle"},O):i==="insideRight"?Un({x:c+f-x,y:d+h/2,textAnchor:S,verticalAnchor:"middle"},O):i==="insideTop"?Un({x:c+f/2,y:d+y,textAnchor:"middle",verticalAnchor:j},O):i==="insideBottom"?Un({x:c+f/2,y:d+h-y,textAnchor:"middle",verticalAnchor:g},O):i==="insideTopLeft"?Un({x:c+x,y:d+y,textAnchor:N,verticalAnchor:j},O):i==="insideTopRight"?Un({x:c+f-x,y:d+y,textAnchor:S,verticalAnchor:j},O):i==="insideBottomLeft"?Un({x:c+x,y:d+h-y,textAnchor:N,verticalAnchor:g},O):i==="insideBottomRight"?Un({x:c+f-x,y:d+h-y,textAnchor:S,verticalAnchor:g},O):Hc(i)&&(Ue(i.x)||So(i.x))&&(Ue(i.y)||So(i.y))?Un({x:c+Sr(i.x,f),y:d+Sr(i.y,h),textAnchor:"end",verticalAnchor:"end"},O):Un({x:c+f/2,y:d+h/2,textAnchor:"middle",verticalAnchor:"middle"},O)},Eae=function(t){return"cx"in t&&Ue(t.cx)};function tr(e){var t=e.offset,n=t===void 0?5:t,r=yae(e,fae),a=Un({offset:n},r),i=a.viewBox,o=a.position,c=a.value,d=a.children,f=a.content,h=a.className,p=h===void 0?"":h,y=a.textBreakAll;if(!i||Ct(c)&&Ct(d)&&!v.isValidElement(f)&&!jt(f))return null;if(v.isValidElement(f))return v.cloneElement(f,a);var g;if(jt(f)){if(g=v.createElement(f,a),v.isValidElement(g))return g}else g=Sae(a);var j=Eae(i),b=gt(a,!0);if(j&&(o==="insideStart"||o==="insideEnd"||o==="end"))return Cae(a,g,b);var x=j?Aae(a):_ae(a);return U.createElement(Mo,Dd({className:At("recharts-label",p)},b,x,{breakAll:y}),g)}tr.displayName="Label";var zL=function(t){var n=t.cx,r=t.cy,a=t.angle,i=t.startAngle,o=t.endAngle,c=t.r,d=t.radius,f=t.innerRadius,h=t.outerRadius,p=t.x,y=t.y,g=t.top,j=t.left,b=t.width,x=t.height,S=t.clockWise,N=t.labelViewBox;if(N)return N;if(Ue(b)&&Ue(x)){if(Ue(p)&&Ue(y))return{x:p,y,width:b,height:x};if(Ue(g)&&Ue(j))return{x:g,y:j,width:b,height:x}}return Ue(p)&&Ue(y)?{x:p,y,width:0,height:0}:Ue(n)&&Ue(r)?{cx:n,cy:r,startAngle:i||a||0,endAngle:o||a||0,innerRadius:f||0,outerRadius:h||d||c||0,clockWise:S}:t.viewBox?t.viewBox:{}},Pae=function(t,n){return t?t===!0?U.createElement(tr,{key:"label-implicit",viewBox:n}):Wn(t)?U.createElement(tr,{key:"label-implicit",viewBox:n,value:t}):v.isValidElement(t)?t.type===tr?v.cloneElement(t,{key:"label-implicit",viewBox:n}):U.createElement(tr,{key:"label-implicit",content:t,viewBox:n}):jt(t)?U.createElement(tr,{key:"label-implicit",content:t,viewBox:n}):Hc(t)?U.createElement(tr,Dd({viewBox:n},t,{key:"label-implicit"})):null:null},kae=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var a=t.children,i=zL(t),o=sa(a,tr).map(function(d,f){return v.cloneElement(d,{viewBox:n||i,key:"label-".concat(f)})});if(!r)return o;var c=Pae(t.label,n||i);return[c].concat(pae(o))};tr.parseViewBox=zL;tr.renderCallByParent=kae;var zw,p2;function Oae(){if(p2)return zw;p2=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return zw=e,zw}var Rae=Oae();const Tae=Yt(Rae);function Ld(e){"@babel/helpers - typeof";return Ld=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ld(e)}var Iae=["valueAccessor"],Mae=["data","dataKey","clockWise","id","textBreakAll"];function $ae(e){return Bae(e)||Fae(e)||Lae(e)||Dae()}function Dae(){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 Lae(e,t){if(e){if(typeof e=="string")return Oj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Oj(e,t)}}function Fae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Bae(e){if(Array.isArray(e))return Oj(e)}function Oj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function em(){return em=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},em.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(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function m2(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){zae(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 zae(e,t,n){return t=Uae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uae(e){var t=qae(e,"string");return Ld(t)=="symbol"?t:t+""}function qae(e,t){if(Ld(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ld(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function v2(e,t){if(e==null)return{};var n=Wae(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Wae(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 Vae=function(t){return Array.isArray(t.value)?Tae(t.value):t.value};function Gs(e){var t=e.valueAccessor,n=t===void 0?Vae:t,r=v2(e,Iae),a=r.data,i=r.dataKey,o=r.clockWise,c=r.id,d=r.textBreakAll,f=v2(r,Mae);return!a||!a.length?null:U.createElement(zt,{className:"recharts-label-list"},a.map(function(h,p){var y=Ct(i)?n(h,p):qn(h&&h.payload,i),g=Ct(c)?{}:{id:"".concat(c,"-").concat(p)};return U.createElement(tr,em({},gt(h,!0),f,g,{parentViewBox:h.parentViewBox,value:y,textBreakAll:d,viewBox:tr.parseViewBox(Ct(o)?h:m2(m2({},h),{},{clockWise:o})),key:"label-".concat(p),index:p}))}))}Gs.displayName="LabelList";function Hae(e,t){return e?e===!0?U.createElement(Gs,{key:"labelList-implicit",data:t}):U.isValidElement(e)||jt(e)?U.createElement(Gs,{key:"labelList-implicit",data:t,content:e}):Hc(e)?U.createElement(Gs,em({data:t},e,{key:"labelList-implicit"})):null:null}function Kae(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,a=sa(r,Gs).map(function(o,c){return v.cloneElement(o,{data:t,key:"labelList-".concat(c)})});if(!n)return a;var i=Hae(e.label,t);return[i].concat($ae(a))}Gs.renderCallByParent=Kae;function Fd(e){"@babel/helpers - typeof";return Fd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fd(e)}function Rj(){return Rj=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},Rj.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(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function y2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?g2(Object(n),!0).forEach(function(r){Gae(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 Gae(e,t,n){return t=Yae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yae(e){var t=Xae(e,"string");return Fd(t)=="symbol"?t:t+""}function Xae(e,t){if(Fd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Fd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Qae=function(t,n){var r=jr(n-t),a=Math.min(Math.abs(n-t),359.999);return r*a},eh=function(t){var n=t.cx,r=t.cy,a=t.radius,i=t.angle,o=t.sign,c=t.isExternal,d=t.cornerRadius,f=t.cornerIsExternal,h=d*(c?1:-1)+a,p=Math.asin(d/h)/Zh,y=f?i:i+o*p,g=dn(n,r,h,y),j=dn(n,r,a,y),b=f?i-o*p:i,x=dn(n,r,h*Math.cos(p*Zh),b);return{center:g,circleTangency:j,lineTangency:x,theta:p}},UL=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.startAngle,c=t.endAngle,d=Qae(o,c),f=o+d,h=dn(n,r,i,o),p=dn(n,r,i,f),y="M ".concat(h.x,",").concat(h.y,`
|
|
78
|
-
A `).concat(i,",").concat(i,`,0,
|
|
79
|
-
`).concat(+(Math.abs(d)>180),",").concat(+(o>f),`,
|
|
80
|
-
`).concat(p.x,",").concat(p.y,`
|
|
81
|
-
`);if(a>0){var g=dn(n,r,a,o),j=dn(n,r,a,f);y+="L ".concat(j.x,",").concat(j.y,`
|
|
82
|
-
A `).concat(a,",").concat(a,`,0,
|
|
83
|
-
`).concat(+(Math.abs(d)>180),",").concat(+(o<=f),`,
|
|
84
|
-
`).concat(g.x,",").concat(g.y," Z")}else y+="L ".concat(n,",").concat(r," Z");return y},Jae=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.cornerRadius,c=t.forceCornerRadius,d=t.cornerIsExternal,f=t.startAngle,h=t.endAngle,p=jr(h-f),y=eh({cx:n,cy:r,radius:i,angle:f,sign:p,cornerRadius:o,cornerIsExternal:d}),g=y.circleTangency,j=y.lineTangency,b=y.theta,x=eh({cx:n,cy:r,radius:i,angle:h,sign:-p,cornerRadius:o,cornerIsExternal:d}),S=x.circleTangency,N=x.lineTangency,C=x.theta,E=d?Math.abs(f-h):Math.abs(f-h)-b-C;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
|
-
`):UL({cx:n,cy:r,innerRadius:a,outerRadius:i,startAngle:f,endAngle:h});var _="M ".concat(j.x,",").concat(j.y,`
|
|
88
|
-
A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(g.x,",").concat(g.y,`
|
|
89
|
-
A`).concat(i,",").concat(i,",0,").concat(+(E>180),",").concat(+(p<0),",").concat(S.x,",").concat(S.y,`
|
|
90
|
-
A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(N.x,",").concat(N.y,`
|
|
91
|
-
`);if(a>0){var k=eh({cx:n,cy:r,radius:a,angle:f,sign:p,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),O=k.circleTangency,R=k.lineTangency,T=k.theta,F=eh({cx:n,cy:r,radius:a,angle:h,sign:-p,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),L=F.circleTangency,$=F.lineTangency,Y=F.theta,H=d?Math.abs(f-h):Math.abs(f-h)-T-Y;if(H<0&&o===0)return"".concat(_,"L").concat(n,",").concat(r,"Z");_+="L".concat($.x,",").concat($.y,`
|
|
92
|
-
A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(L.x,",").concat(L.y,`
|
|
93
|
-
A`).concat(a,",").concat(a,",0,").concat(+(H>180),",").concat(+(p>0),",").concat(O.x,",").concat(O.y,`
|
|
94
|
-
A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(R.x,",").concat(R.y,"Z")}else _+="L".concat(n,",").concat(r,"Z");return _},Zae={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},qL=function(t){var n=y2(y2({},Zae),t),r=n.cx,a=n.cy,i=n.innerRadius,o=n.outerRadius,c=n.cornerRadius,d=n.forceCornerRadius,f=n.cornerIsExternal,h=n.startAngle,p=n.endAngle,y=n.className;if(o<i||h===p)return null;var g=At("recharts-sector",y),j=o-i,b=Sr(c,j,0,!0),x;return b>0&&Math.abs(h-p)<360?x=Jae({cx:r,cy:a,innerRadius:i,outerRadius:o,cornerRadius:Math.min(b,j/2),forceCornerRadius:d,cornerIsExternal:f,startAngle:h,endAngle:p}):x=UL({cx:r,cy:a,innerRadius:i,outerRadius:o,startAngle:h,endAngle:p}),U.createElement("path",Rj({},gt(n,!0),{className:g,d:x,role:"img"}))};function Bd(e){"@babel/helpers - typeof";return Bd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bd(e)}function Tj(){return Tj=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},Tj.apply(this,arguments)}function x2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function b2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?x2(Object(n),!0).forEach(function(r){ese(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ese(e,t,n){return t=tse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tse(e){var t=nse(e,"string");return Bd(t)=="symbol"?t:t+""}function nse(e,t){if(Bd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Bd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var w2={curveBasisClosed:jX,curveBasisOpen:SX,curveBasis:wX,curveBumpX:oX,curveBumpY:lX,curveLinearClosed:NX,curveLinear:vv,curveMonotoneX:CX,curveMonotoneY:AX,curveNatural:_X,curveStep:EX,curveStepAfter:kX,curveStepBefore:PX},th=function(t){return t.x===+t.x&&t.y===+t.y},qu=function(t){return t.x},Wu=function(t){return t.y},rse=function(t,n){if(jt(t))return t;var r="curve".concat(hv(t));return(r==="curveMonotone"||r==="curveBump")&&n?w2["".concat(r).concat(n==="vertical"?"Y":"X")]:w2[r]||vv},ase=function(t){var n=t.type,r=n===void 0?"linear":n,a=t.points,i=a===void 0?[]:a,o=t.baseLine,c=t.layout,d=t.connectNulls,f=d===void 0?!1:d,h=rse(r,c),p=f?i.filter(function(b){return th(b)}):i,y;if(Array.isArray(o)){var g=f?o.filter(function(b){return th(b)}):o,j=p.map(function(b,x){return b2(b2({},b),{},{base:g[x]})});return c==="vertical"?y=Hp().y(Wu).x1(qu).x0(function(b){return b.base.x}):y=Hp().x(qu).y1(Wu).y0(function(b){return b.base.y}),y.defined(th).curve(h),y(j)}return c==="vertical"&&Ue(o)?y=Hp().y(Wu).x1(qu).x0(o):Ue(o)?y=Hp().x(qu).y1(Wu).y0(o):y=q3().x(qu).y(Wu),y.defined(th).curve(h),y(p)},tm=function(t){var n=t.className,r=t.points,a=t.path,i=t.pathRef;if((!r||!r.length)&&!a)return null;var o=r&&r.length?ase(t):a;return v.createElement("path",Tj({},gt(t,!1),Ah(t),{className:At("recharts-curve",n),d:o,ref:i}))},Uw={exports:{}},qw,j2;function sse(){if(j2)return qw;j2=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return qw=e,qw}var Ww,S2;function ise(){if(S2)return Ww;S2=1;var e=sse();function t(){}function n(){}return n.resetWarningCache=t,Ww=function(){function r(o,c,d,f,h,p){if(p!==e){var y=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw y.name="Invariant Violation",y}}r.isRequired=r;function a(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Ww}var N2;function ose(){return N2||(N2=1,Uw.exports=ise()()),Uw.exports}var lse=ose();const Kt=Yt(lse),{getOwnPropertyNames:cse,getOwnPropertySymbols:use}=Object,{hasOwnProperty:dse}=Object.prototype;function Vw(e,t){return function(r,a,i){return e(r,a,i)&&t(r,a,i)}}function nh(e){return function(n,r,a){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,a);const{cache:i}=a,o=i.get(n),c=i.get(r);if(o&&c)return o===r&&c===n;i.set(n,r),i.set(r,n);const d=e(n,r,a);return i.delete(n),i.delete(r),d}}function fse(e){return e?.[Symbol.toStringTag]}function C2(e){return cse(e).concat(use(e))}const pse=Object.hasOwn||((e,t)=>dse.call(e,t));function Xo(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const hse="__v",mse="__o",vse="_owner",{getOwnPropertyDescriptor:A2,keys:_2}=Object;function gse(e,t){return e.byteLength===t.byteLength&&nm(new Uint8Array(e),new Uint8Array(t))}function yse(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 xse(e,t){return e.byteLength===t.byteLength&&nm(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function bse(e,t){return Xo(e.getTime(),t.getTime())}function wse(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function jse(e,t){return e===t}function E2(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const a=new Array(r),i=e.entries();let o,c,d=0;for(;(o=i.next())&&!o.done;){const f=t.entries();let h=!1,p=0;for(;(c=f.next())&&!c.done;){if(a[p]){p++;continue}const y=o.value,g=c.value;if(n.equals(y[0],g[0],d,p,e,t,n)&&n.equals(y[1],g[1],y[0],g[0],e,t,n)){h=a[p]=!0;break}p++}if(!h)return!1;d++}return!0}const Sse=Xo;function Nse(e,t,n){const r=_2(e);let a=r.length;if(_2(t).length!==a)return!1;for(;a-- >0;)if(!WL(e,t,n,r[a]))return!1;return!0}function Vu(e,t,n){const r=C2(e);let a=r.length;if(C2(t).length!==a)return!1;let i,o,c;for(;a-- >0;)if(i=r[a],!WL(e,t,n,i)||(o=A2(e,i),c=A2(t,i),(o||c)&&(!o||!c||o.configurable!==c.configurable||o.enumerable!==c.enumerable||o.writable!==c.writable)))return!1;return!0}function Cse(e,t){return Xo(e.valueOf(),t.valueOf())}function Ase(e,t){return e.source===t.source&&e.flags===t.flags}function P2(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const a=new Array(r),i=e.values();let o,c;for(;(o=i.next())&&!o.done;){const d=t.values();let f=!1,h=0;for(;(c=d.next())&&!c.done;){if(!a[h]&&n.equals(o.value,c.value,o.value,c.value,e,t,n)){f=a[h]=!0;break}h++}if(!f)return!1}return!0}function nm(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 _se(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 WL(e,t,n,r){return(r===vse||r===mse||r===hse)&&(e.$$typeof||t.$$typeof)?!0:pse(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const Ese="[object ArrayBuffer]",Pse="[object Arguments]",kse="[object Boolean]",Ose="[object DataView]",Rse="[object Date]",Tse="[object Error]",Ise="[object Map]",Mse="[object Number]",$se="[object Object]",Dse="[object RegExp]",Lse="[object Set]",Fse="[object String]",Bse={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},zse="[object URL]",Use=Object.prototype.toString;function qse({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:a,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:c,areObjectsEqual:d,arePrimitiveWrappersEqual:f,areRegExpsEqual:h,areSetsEqual:p,areTypedArraysEqual:y,areUrlsEqual:g,unknownTagComparators:j}){return function(x,S,N){if(x===S)return!0;if(x==null||S==null)return!1;const C=typeof x;if(C!==typeof S)return!1;if(C!=="object")return C==="number"?c(x,S,N):C==="function"?i(x,S,N):!1;const E=x.constructor;if(E!==S.constructor)return!1;if(E===Object)return d(x,S,N);if(Array.isArray(x))return t(x,S,N);if(E===Date)return r(x,S,N);if(E===RegExp)return h(x,S,N);if(E===Map)return o(x,S,N);if(E===Set)return p(x,S,N);const _=Use.call(x);if(_===Rse)return r(x,S,N);if(_===Dse)return h(x,S,N);if(_===Ise)return o(x,S,N);if(_===Lse)return p(x,S,N);if(_===$se)return typeof x.then!="function"&&typeof S.then!="function"&&d(x,S,N);if(_===zse)return g(x,S,N);if(_===Tse)return a(x,S,N);if(_===Pse)return d(x,S,N);if(Bse[_])return y(x,S,N);if(_===Ese)return e(x,S,N);if(_===Ose)return n(x,S,N);if(_===kse||_===Mse||_===Fse)return f(x,S,N);if(j){let k=j[_];if(!k){const O=fse(x);O&&(k=j[O])}if(k)return k(x,S,N)}return!1}}function Wse({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:gse,areArraysEqual:n?Vu:yse,areDataViewsEqual:xse,areDatesEqual:bse,areErrorsEqual:wse,areFunctionsEqual:jse,areMapsEqual:n?Vw(E2,Vu):E2,areNumbersEqual:Sse,areObjectsEqual:n?Vu:Nse,arePrimitiveWrappersEqual:Cse,areRegExpsEqual:Ase,areSetsEqual:n?Vw(P2,Vu):P2,areTypedArraysEqual:n?Vw(nm,Vu):nm,areUrlsEqual:_se,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const a=nh(r.areArraysEqual),i=nh(r.areMapsEqual),o=nh(r.areObjectsEqual),c=nh(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:c})}return r}function Vse(e){return function(t,n,r,a,i,o,c){return e(t,n,c)}}function Hse({circular:e,comparator:t,createState:n,equals:r,strict:a}){if(n)return function(c,d){const{cache:f=e?new WeakMap:void 0,meta:h}=n();return t(c,d,{cache:f,equals:r,meta:h,strict:a})};if(e)return function(c,d){return t(c,d,{cache:new WeakMap,equals:r,meta:void 0,strict:a})};const i={cache:void 0,equals:r,meta:void 0,strict:a};return function(c,d){return t(c,d,i)}}const Kse=Ji();Ji({strict:!0});Ji({circular:!0});Ji({circular:!0,strict:!0});Ji({createInternalComparator:()=>Xo});Ji({strict:!0,createInternalComparator:()=>Xo});Ji({circular:!0,createInternalComparator:()=>Xo});Ji({circular:!0,createInternalComparator:()=>Xo,strict:!0});function Ji(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:a=!1}=e,i=Wse(e),o=qse(i),c=n?n(o):Vse(o);return Hse({circular:t,comparator:o,createState:r,equals:c,strict:a})}function Gse(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function k2(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function a(i){n<0&&(n=i),i-n>t?(e(i),n=-1):Gse(a)};requestAnimationFrame(r)}function Ij(e){"@babel/helpers - typeof";return Ij=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},Ij(e)}function Yse(e){return Zse(e)||Jse(e)||Qse(e)||Xse()}function Xse(){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 Qse(e,t){if(e){if(typeof e=="string")return O2(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 O2(e,t)}}function O2(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 Jse(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Zse(e){if(Array.isArray(e))return e}function eie(){var e={},t=function(){return null},n=!1,r=function a(i){if(!n){if(Array.isArray(i)){if(!i.length)return;var o=i,c=Yse(o),d=c[0],f=c.slice(1);if(typeof d=="number"){k2(a.bind(null,f),d);return}a(d),k2(a.bind(null,f));return}Ij(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 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 R2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function T2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?R2(Object(n),!0).forEach(function(r){VL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function VL(e,t,n){return t=tie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tie(e){var t=nie(e,"string");return zd(t)==="symbol"?t:String(t)}function nie(e,t){if(zd(e)!=="object"||e===null)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 rie=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,a){return r.filter(function(i){return a.includes(i)})})},aie=function(t){return t},sie=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},od=function(t,n){return Object.keys(n).reduce(function(r,a){return T2(T2({},r),{},VL({},a,t(a,n[a])))},{})},I2=function(t,n,r){return t.map(function(a){return"".concat(sie(a)," ").concat(n,"ms ").concat(r)}).join(",")};function iie(e,t){return cie(e)||lie(e,t)||HL(e,t)||oie()}function oie(){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 lie(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function cie(e){if(Array.isArray(e))return e}function uie(e){return pie(e)||fie(e)||HL(e)||die()}function die(){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 HL(e,t){if(e){if(typeof e=="string")return Mj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Mj(e,t)}}function fie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function pie(e){if(Array.isArray(e))return Mj(e)}function Mj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var rm=1e-4,KL=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},GL=function(t,n){return t.map(function(r,a){return r*Math.pow(n,a)}).reduce(function(r,a){return r+a})},M2=function(t,n){return function(r){var a=KL(t,n);return GL(a,r)}},hie=function(t,n){return function(r){var a=KL(t,n),i=[].concat(uie(a.map(function(o,c){return o*c}).slice(1)),[0]);return GL(i,r)}},$2=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0],i=n[1],o=n[2],c=n[3];if(n.length===1)switch(n[0]){case"linear":a=0,i=0,o=1,c=1;break;case"ease":a=.25,i=.1,o=.25,c=1;break;case"ease-in":a=.42,i=0,o=1,c=1;break;case"ease-out":a=.42,i=0,o=.58,c=1;break;case"ease-in-out":a=0,i=0,o=.58,c=1;break;default:{var d=n[0].split("(");if(d[0]==="cubic-bezier"&&d[1].split(")")[0].split(",").length===4){var f=d[1].split(")")[0].split(",").map(function(x){return parseFloat(x)}),h=iie(f,4);a=h[0],i=h[1],o=h[2],c=h[3]}}}var p=M2(a,o),y=M2(i,c),g=hie(a,o),j=function(S){return S>1?1:S<0?0:S},b=function(S){for(var N=S>1?1:S,C=N,E=0;E<8;++E){var _=p(C)-N,k=g(C);if(Math.abs(_-N)<rm||k<rm)return y(C);C=j(C-_/k)}return y(C)};return b.isStepper=!1,b},mie=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,a=t.damping,i=a===void 0?8:a,o=t.dt,c=o===void 0?17:o,d=function(h,p,y){var g=-(h-p)*r,j=y*i,b=y+(g-j)*c/1e3,x=y*c/1e3+h;return Math.abs(x-p)<rm&&Math.abs(b)<rm?[p,0]:[x,b]};return d.isStepper=!0,d.dt=c,d},vie=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0];if(typeof a=="string")switch(a){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return $2(a);case"spring":return mie();default:if(a.split("(")[0]==="cubic-bezier")return $2(a)}return typeof a=="function"?a:null};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 D2(e){return xie(e)||yie(e)||YL(e)||gie()}function gie(){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 yie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function xie(e){if(Array.isArray(e))return Dj(e)}function L2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ir(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?L2(Object(n),!0).forEach(function(r){$j(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 $j(e,t,n){return t=bie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bie(e){var t=wie(e,"string");return Ud(t)==="symbol"?t:String(t)}function wie(e,t){if(Ud(e)!=="object"||e===null)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 jie(e,t){return Cie(e)||Nie(e,t)||YL(e,t)||Sie()}function Sie(){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 YL(e,t){if(e){if(typeof e=="string")return Dj(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 Dj(e,t)}}function Dj(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 Nie(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function Cie(e){if(Array.isArray(e))return e}var am=function(t,n,r){return t+(n-t)*r},Lj=function(t){var n=t.from,r=t.to;return n!==r},Aie=function e(t,n,r){var a=od(function(i,o){if(Lj(o)){var c=t(o.from,o.to,o.velocity),d=jie(c,2),f=d[0],h=d[1];return ir(ir({},o),{},{from:f,velocity:h})}return o},n);return r<1?od(function(i,o){return Lj(o)?ir(ir({},o),{},{velocity:am(o.velocity,a[i].velocity,r),from:am(o.from,a[i].from,r)}):o},n):e(t,a,r-1)};const _ie=(function(e,t,n,r,a){var i=rie(e,t),o=i.reduce(function(x,S){return ir(ir({},x),{},$j({},S,[e[S],t[S]]))},{}),c=i.reduce(function(x,S){return ir(ir({},x),{},$j({},S,{from:e[S],velocity:0,to:t[S]}))},{}),d=-1,f,h,p=function(){return null},y=function(){return od(function(S,N){return N.from},c)},g=function(){return!Object.values(c).filter(Lj).length},j=function(S){f||(f=S);var N=S-f,C=N/n.dt;c=Aie(n,c,C),a(ir(ir(ir({},e),t),y())),f=S,g()||(d=requestAnimationFrame(p))},b=function(S){h||(h=S);var N=(S-h)/r,C=od(function(_,k){return am.apply(void 0,D2(k).concat([n(N)]))},o);if(a(ir(ir(ir({},e),t),C)),N<1)d=requestAnimationFrame(p);else{var E=od(function(_,k){return am.apply(void 0,D2(k).concat([n(1)]))},o);a(ir(ir(ir({},e),t),E))}};return p=n.isStepper?j:b,function(){return requestAnimationFrame(p),function(){cancelAnimationFrame(d)}}});function 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)}var Eie=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function Pie(e,t){if(e==null)return{};var n=kie(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function kie(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function Hw(e){return Iie(e)||Tie(e)||Rie(e)||Oie()}function Oie(){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 Rie(e,t){if(e){if(typeof e=="string")return Fj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fj(e,t)}}function Tie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Iie(e){if(Array.isArray(e))return Fj(e)}function Fj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function F2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Da(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?F2(Object(n),!0).forEach(function(r){Zu(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Zu(e,t,n){return t=XL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $ie(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,XL(r.key),r)}}function Die(e,t,n){return t&&$ie(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function XL(e){var t=Lie(e,"string");return yc(t)==="symbol"?t:String(t)}function Lie(e,t){if(yc(e)!=="object"||e===null)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(t==="string"?String:Number)(e)}function Fie(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bj(e,t)}function Bj(e,t){return Bj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Bj(e,t)}function Bie(e){var t=zie();return function(){var r=sm(e),a;if(t){var i=sm(this).constructor;a=Reflect.construct(r,arguments,i)}else a=r.apply(this,arguments);return zj(this,a)}}function zj(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 Uj(e)}function Uj(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zie(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function sm(e){return sm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},sm(e)}var ys=(function(e){Fie(n,e);var t=Bie(n);function n(r,a){var i;Mie(this,n),i=t.call(this,r,a);var o=i.props,c=o.isActive,d=o.attributeName,f=o.from,h=o.to,p=o.steps,y=o.children,g=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind(Uj(i)),i.changeStyle=i.changeStyle.bind(Uj(i)),!c||g<=0)return i.state={style:{}},typeof y=="function"&&(i.state={style:h}),zj(i);if(p&&p.length)i.state={style:p[0].style};else if(f){if(typeof y=="function")return i.state={style:f},zj(i);i.state={style:d?Zu({},d,f):f}}else i.state={style:{}};return i}return Die(n,[{key:"componentDidMount",value:function(){var a=this.props,i=a.isActive,o=a.canBegin;this.mounted=!0,!(!i||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var i=this.props,o=i.isActive,c=i.canBegin,d=i.attributeName,f=i.shouldReAnimate,h=i.to,p=i.from,y=this.state.style;if(c){if(!o){var g={style:d?Zu({},d,h):h};this.state&&y&&(d&&y[d]!==h||!d&&y!==h)&&this.setState(g);return}if(!(Kse(a.to,h)&&a.canBegin&&a.isActive)){var j=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var b=j||f?p:a.to;if(this.state&&y){var x={style:d?Zu({},d,b):b};(d&&y[d]!==b||!d&&y!==b)&&this.setState(x)}this.runAnimation(Da(Da({},this.props),{},{from:b,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var i=this,o=a.from,c=a.to,d=a.duration,f=a.easing,h=a.begin,p=a.onAnimationEnd,y=a.onAnimationStart,g=_ie(o,c,vie(f),d,this.changeStyle),j=function(){i.stopJSAnimation=g()};this.manager.start([y,h,j,d,p])}},{key:"runStepAnimation",value:function(a){var i=this,o=a.steps,c=a.begin,d=a.onAnimationStart,f=o[0],h=f.style,p=f.duration,y=p===void 0?0:p,g=function(b,x,S){if(S===0)return b;var N=x.duration,C=x.easing,E=C===void 0?"ease":C,_=x.style,k=x.properties,O=x.onAnimationEnd,R=S>0?o[S-1]:x,T=k||Object.keys(_);if(typeof E=="function"||E==="spring")return[].concat(Hw(b),[i.runJSAnimation.bind(i,{from:R.style,to:_,duration:N,easing:E}),N]);var F=I2(T,N,E),L=Da(Da(Da({},R.style),_),{},{transition:F});return[].concat(Hw(b),[L,N,O]).filter(aie)};return this.manager.start([d].concat(Hw(o.reduce(g,[h,Math.max(y,c)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=eie());var i=a.begin,o=a.duration,c=a.attributeName,d=a.to,f=a.easing,h=a.onAnimationStart,p=a.onAnimationEnd,y=a.steps,g=a.children,j=this.manager;if(this.unSubscribe=j.subscribe(this.handleStyleChange),typeof f=="function"||typeof g=="function"||f==="spring"){this.runJSAnimation(a);return}if(y.length>1){this.runStepAnimation(a);return}var b=c?Zu({},c,d):d,x=I2(Object.keys(b),o,f);j.start([h,i,Da(Da({},b),{},{transition:x}),o,p])}},{key:"render",value:function(){var a=this.props,i=a.children;a.begin;var o=a.duration;a.attributeName,a.easing;var c=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var d=Pie(a,Eie),f=v.Children.count(i),h=this.state.style;if(typeof i=="function")return i(h);if(!c||f===0||o<=0)return i;var p=function(g){var j=g.props,b=j.style,x=b===void 0?{}:b,S=j.className,N=v.cloneElement(g,Da(Da({},d),{},{style:Da(Da({},x),h),className:S}));return N};return f===1?p(v.Children.only(i)):U.createElement("div",null,v.Children.map(i,function(y){return p(y)}))}}]),n})(v.PureComponent);ys.displayName="Animate";ys.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};ys.propTypes={from:Kt.oneOfType([Kt.object,Kt.string]),to:Kt.oneOfType([Kt.object,Kt.string]),attributeName:Kt.string,duration:Kt.number,begin:Kt.number,easing:Kt.oneOfType([Kt.string,Kt.func]),steps:Kt.arrayOf(Kt.shape({duration:Kt.number.isRequired,style:Kt.object.isRequired,easing:Kt.oneOfType([Kt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Kt.func]),properties:Kt.arrayOf("string"),onAnimationEnd:Kt.func})),children:Kt.oneOfType([Kt.node,Kt.func]),isActive:Kt.bool,canBegin:Kt.bool,onAnimationEnd:Kt.func,shouldReAnimate:Kt.bool,onAnimationStart:Kt.func,onAnimationReStart:Kt.func};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 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 Uie(e,t){return Hie(e)||Vie(e,t)||Wie(e,t)||qie()}function qie(){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 Wie(e,t){if(e){if(typeof e=="string")return B2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return B2(e,t)}}function B2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Vie(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function Hie(e){if(Array.isArray(e))return e}function z2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function U2(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){Kie(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 Kie(e,t,n){return t=Gie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gie(e){var t=Yie(e,"string");return qd(t)=="symbol"?t:t+""}function Yie(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 q2=function(t,n,r,a,i){var o=Math.min(Math.abs(r)/2,Math.abs(a)/2),c=a>=0?1:-1,d=r>=0?1:-1,f=a>=0&&r>=0||a<0&&r<0?1:0,h;if(o>0&&i instanceof Array){for(var p=[0,0,0,0],y=0,g=4;y<g;y++)p[y]=i[y]>o?o:i[y];h="M".concat(t,",").concat(n+c*p[0]),p[0]>0&&(h+="A ".concat(p[0],",").concat(p[0],",0,0,").concat(f,",").concat(t+d*p[0],",").concat(n)),h+="L ".concat(t+r-d*p[1],",").concat(n),p[1]>0&&(h+="A ".concat(p[1],",").concat(p[1],",0,0,").concat(f,`,
|
|
102
|
-
`).concat(t+r,",").concat(n+c*p[1])),h+="L ".concat(t+r,",").concat(n+a-c*p[2]),p[2]>0&&(h+="A ".concat(p[2],",").concat(p[2],",0,0,").concat(f,`,
|
|
103
|
-
`).concat(t+r-d*p[2],",").concat(n+a)),h+="L ".concat(t+d*p[3],",").concat(n+a),p[3]>0&&(h+="A ".concat(p[3],",").concat(p[3],",0,0,").concat(f,`,
|
|
104
|
-
`).concat(t,",").concat(n+a-c*p[3])),h+="Z"}else if(o>0&&i===+i&&i>0){var j=Math.min(o,i);h="M ".concat(t,",").concat(n+c*j,`
|
|
105
|
-
A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+d*j,",").concat(n,`
|
|
106
|
-
L `).concat(t+r-d*j,",").concat(n,`
|
|
107
|
-
A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+r,",").concat(n+c*j,`
|
|
108
|
-
L `).concat(t+r,",").concat(n+a-c*j,`
|
|
109
|
-
A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+r-d*j,",").concat(n+a,`
|
|
110
|
-
L `).concat(t+d*j,",").concat(n+a,`
|
|
111
|
-
A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t,",").concat(n+a-c*j," Z")}else h="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(a," h ").concat(-r," Z");return h},Xie=function(t,n){if(!t||!n)return!1;var r=t.x,a=t.y,i=n.x,o=n.y,c=n.width,d=n.height;if(Math.abs(c)>0&&Math.abs(d)>0){var f=Math.min(i,i+c),h=Math.max(i,i+c),p=Math.min(o,o+d),y=Math.max(o,o+d);return r>=f&&r<=h&&a>=p&&a<=y}return!1},Qie={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},nC=function(t){var n=U2(U2({},Qie),t),r=v.useRef(),a=v.useState(-1),i=Uie(a,2),o=i[0],c=i[1];v.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var E=r.current.getTotalLength();E&&c(E)}catch{}},[]);var d=n.x,f=n.y,h=n.width,p=n.height,y=n.radius,g=n.className,j=n.animationEasing,b=n.animationDuration,x=n.animationBegin,S=n.isAnimationActive,N=n.isUpdateAnimationActive;if(d!==+d||f!==+f||h!==+h||p!==+p||h===0||p===0)return null;var C=At("recharts-rectangle",g);return N?U.createElement(ys,{canBegin:o>0,from:{width:h,height:p,x:d,y:f},to:{width:h,height:p,x:d,y:f},duration:b,animationEasing:j,isActive:N},function(E){var _=E.width,k=E.height,O=E.x,R=E.y;return U.createElement(ys,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:b,isActive:S,easing:j},U.createElement("path",im({},gt(n,!0),{className:C,d:q2(O,R,_,k,y),ref:r})))}):U.createElement("path",im({},gt(n,!0),{className:C,d:q2(d,f,h,p,y)}))},Jie=["points","className","baseLinePoints","connectNulls"];function Ul(){return Ul=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},Ul.apply(this,arguments)}function Zie(e,t){if(e==null)return{};var n=eoe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function eoe(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 W2(e){return aoe(e)||roe(e)||noe(e)||toe()}function toe(){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 noe(e,t){if(e){if(typeof e=="string")return qj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qj(e,t)}}function roe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function aoe(e){if(Array.isArray(e))return qj(e)}function qj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var V2=function(t){return t&&t.x===+t.x&&t.y===+t.y},soe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){V2(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),V2(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},ld=function(t,n){var r=soe(t);n&&(r=[r.reduce(function(i,o){return[].concat(W2(i),W2(o))},[])]);var a=r.map(function(i){return i.reduce(function(o,c,d){return"".concat(o).concat(d===0?"M":"L").concat(c.x,",").concat(c.y)},"")}).join("");return r.length===1?"".concat(a,"Z"):a},ioe=function(t,n,r){var a=ld(t,r);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(ld(n.reverse(),r).slice(1))},ooe=function(t){var n=t.points,r=t.className,a=t.baseLinePoints,i=t.connectNulls,o=Zie(t,Jie);if(!n||!n.length)return null;var c=At("recharts-polygon",r);if(a&&a.length){var d=o.stroke&&o.stroke!=="none",f=ioe(n,a,i);return U.createElement("g",{className:c},U.createElement("path",Ul({},gt(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:f})),d?U.createElement("path",Ul({},gt(o,!0),{fill:"none",d:ld(n,i)})):null,d?U.createElement("path",Ul({},gt(o,!0),{fill:"none",d:ld(a,i)})):null)}var h=ld(n,i);return U.createElement("path",Ul({},gt(o,!0),{fill:h.slice(-1)==="Z"?o.fill:"none",className:c,d:h}))};function Wj(){return Wj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wj.apply(this,arguments)}var Tv=function(t){var n=t.cx,r=t.cy,a=t.r,i=t.className,o=At("recharts-dot",i);return n===+n&&r===+r&&a===+a?v.createElement("circle",Wj({},gt(t,!1),Ah(t),{className:o,cx:n,cy:r,r:a})):null};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)}var loe=["x","y","top","left","width","height","className"];function Vj(){return Vj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vj.apply(this,arguments)}function H2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function coe(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){uoe(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 uoe(e,t,n){return t=doe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function doe(e){var t=foe(e,"string");return Wd(t)=="symbol"?t:t+""}function foe(e,t){if(Wd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Wd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function poe(e,t){if(e==null)return{};var n=hoe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function hoe(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 moe=function(t,n,r,a,i,o){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(o,",").concat(n,"h").concat(r)},voe=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,i=a===void 0?0:a,o=t.top,c=o===void 0?0:o,d=t.left,f=d===void 0?0:d,h=t.width,p=h===void 0?0:h,y=t.height,g=y===void 0?0:y,j=t.className,b=poe(t,loe),x=coe({x:r,y:i,top:c,left:f,width:p,height:g},b);return!Ue(r)||!Ue(i)||!Ue(p)||!Ue(g)||!Ue(c)||!Ue(f)?null:U.createElement("path",Vj({},gt(x,!0),{className:At("recharts-cross",j),d:moe(r,i,p,g,c,f)}))},Kw,K2;function goe(){if(K2)return Kw;K2=1;var e=Ev(),t=fL(),n=Ss();function r(a,i){return a&&a.length?e(a,n(i,2),t):void 0}return Kw=r,Kw}var yoe=goe();const xoe=Yt(yoe);var Gw,G2;function boe(){if(G2)return Gw;G2=1;var e=Ev(),t=Ss(),n=pL();function r(a,i){return a&&a.length?e(a,t(i,2),n):void 0}return Gw=r,Gw}var woe=boe();const joe=Yt(woe);var Soe=["cx","cy","angle","ticks","axisLine"],Noe=["ticks","tick","angle","tickFormatter","stroke"];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 cd(){return cd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cd.apply(this,arguments)}function Y2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function vo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Y2(Object(n),!0).forEach(function(r){Iv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function X2(e,t){if(e==null)return{};var n=Coe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Coe(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 Aoe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Q2(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,JL(r.key),r)}}function _oe(e,t,n){return t&&Q2(e.prototype,t),n&&Q2(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Eoe(e,t,n){return t=om(t),Poe(e,QL()?Reflect.construct(t,n||[],om(e).constructor):t.apply(e,n))}function Poe(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 koe(e)}function koe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function QL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(QL=function(){return!!e})()}function om(e){return om=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},om(e)}function Ooe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hj(e,t)}function Hj(e,t){return Hj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Hj(e,t)}function Iv(e,t,n){return t=JL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JL(e){var t=Roe(e,"string");return xc(t)=="symbol"?t:t+""}function Roe(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(t==="string"?String:Number)(e)}var Mv=(function(e){function t(){return Aoe(this,t),Eoe(this,t,arguments)}return Ooe(t,e),_oe(t,[{key:"getTickValueCoord",value:function(r){var a=r.coordinate,i=this.props,o=i.angle,c=i.cx,d=i.cy;return dn(c,d,a,o)}},{key:"getTickTextAnchor",value:function(){var r=this.props.orientation,a;switch(r){case"left":a="end";break;case"right":a="start";break;default:a="middle";break}return a}},{key:"getViewBox",value:function(){var r=this.props,a=r.cx,i=r.cy,o=r.angle,c=r.ticks,d=xoe(c,function(h){return h.coordinate||0}),f=joe(c,function(h){return h.coordinate||0});return{cx:a,cy:i,startAngle:o,endAngle:o,innerRadius:f.coordinate||0,outerRadius:d.coordinate||0}}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.cx,i=r.cy,o=r.angle,c=r.ticks,d=r.axisLine,f=X2(r,Soe),h=c.reduce(function(j,b){return[Math.min(j[0],b.coordinate),Math.max(j[1],b.coordinate)]},[1/0,-1/0]),p=dn(a,i,h[0],o),y=dn(a,i,h[1],o),g=vo(vo(vo({},gt(f,!1)),{},{fill:"none"},gt(d,!1)),{},{x1:p.x,y1:p.y,x2:y.x,y2:y.y});return U.createElement("line",cd({className:"recharts-polar-radius-axis-line"},g))}},{key:"renderTicks",value:function(){var r=this,a=this.props,i=a.ticks,o=a.tick,c=a.angle,d=a.tickFormatter,f=a.stroke,h=X2(a,Noe),p=this.getTickTextAnchor(),y=gt(h,!1),g=gt(o,!1),j=i.map(function(b,x){var S=r.getTickValueCoord(b),N=vo(vo(vo(vo({textAnchor:p,transform:"rotate(".concat(90-c,", ").concat(S.x,", ").concat(S.y,")")},y),{},{stroke:"none",fill:f},g),{},{index:x},S),{},{payload:b});return U.createElement(zt,cd({className:At("recharts-polar-radius-axis-tick",BL(o)),key:"tick-".concat(b.coordinate)},Io(r.props,b,x)),t.renderTickItem(o,N,d?d(b.value,x):b.value))});return U.createElement(zt,{className:"recharts-polar-radius-axis-ticks"},j)}},{key:"render",value:function(){var r=this.props,a=r.ticks,i=r.axisLine,o=r.tick;return!a||!a.length?null:U.createElement(zt,{className:At("recharts-polar-radius-axis",this.props.className)},i&&this.renderAxisLine(),o&&this.renderTicks(),tr.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,a,i){var o;return U.isValidElement(r)?o=U.cloneElement(r,a):jt(r)?o=r(a):o=U.createElement(Mo,cd({},a,{className:"recharts-polar-radius-axis-tick-value"}),i),o}}])})(v.PureComponent);Iv(Mv,"displayName","PolarRadiusAxis");Iv(Mv,"axisType","radiusAxis");Iv(Mv,"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 bc(e){"@babel/helpers - typeof";return bc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bc(e)}function jo(){return jo=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},jo.apply(this,arguments)}function J2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function go(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?J2(Object(n),!0).forEach(function(r){$v(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Toe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Z2(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,e4(r.key),r)}}function Ioe(e,t,n){return t&&Z2(e.prototype,t),n&&Z2(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Moe(e,t,n){return t=lm(t),$oe(e,ZL()?Reflect.construct(t,n||[],lm(e).constructor):t.apply(e,n))}function $oe(e,t){if(t&&(bc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Doe(e)}function Doe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ZL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ZL=function(){return!!e})()}function lm(e){return lm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},lm(e)}function Loe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Kj(e,t)}function Kj(e,t){return Kj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Kj(e,t)}function $v(e,t,n){return t=e4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function e4(e){var t=Foe(e,"string");return bc(t)=="symbol"?t:t+""}function Foe(e,t){if(bc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(bc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Boe=Math.PI/180,eI=1e-5,Dv=(function(e){function t(){return Toe(this,t),Moe(this,t,arguments)}return Loe(t,e),Ioe(t,[{key:"getTickLineCoord",value:function(r){var a=this.props,i=a.cx,o=a.cy,c=a.radius,d=a.orientation,f=a.tickSize,h=f||8,p=dn(i,o,c,r.coordinate),y=dn(i,o,c+(d==="inner"?-1:1)*h,r.coordinate);return{x1:p.x,y1:p.y,x2:y.x,y2:y.y}}},{key:"getTickTextAnchor",value:function(r){var a=this.props.orientation,i=Math.cos(-r.coordinate*Boe),o;return i>eI?o=a==="outer"?"start":"end":i<-eI?o=a==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.cx,i=r.cy,o=r.radius,c=r.axisLine,d=r.axisLineType,f=go(go({},gt(this.props,!1)),{},{fill:"none"},gt(c,!1));if(d==="circle")return U.createElement(Tv,jo({className:"recharts-polar-angle-axis-line"},f,{cx:a,cy:i,r:o}));var h=this.props.ticks,p=h.map(function(y){return dn(a,i,o,y.coordinate)});return U.createElement(ooe,jo({className:"recharts-polar-angle-axis-line"},f,{points:p}))}},{key:"renderTicks",value:function(){var r=this,a=this.props,i=a.ticks,o=a.tick,c=a.tickLine,d=a.tickFormatter,f=a.stroke,h=gt(this.props,!1),p=gt(o,!1),y=go(go({},h),{},{fill:"none"},gt(c,!1)),g=i.map(function(j,b){var x=r.getTickLineCoord(j),S=r.getTickTextAnchor(j),N=go(go(go({textAnchor:S},h),{},{stroke:"none",fill:f},p),{},{index:b,payload:j,x:x.x2,y:x.y2});return U.createElement(zt,jo({className:At("recharts-polar-angle-axis-tick",BL(o)),key:"tick-".concat(j.coordinate)},Io(r.props,j,b)),c&&U.createElement("line",jo({className:"recharts-polar-angle-axis-tick-line"},y,x)),o&&t.renderTickItem(o,N,d?d(j.value,b):j.value))});return U.createElement(zt,{className:"recharts-polar-angle-axis-ticks"},g)}},{key:"render",value:function(){var r=this.props,a=r.ticks,i=r.radius,o=r.axisLine;return i<=0||!a||!a.length?null:U.createElement(zt,{className:At("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,a,i){var o;return U.isValidElement(r)?o=U.cloneElement(r,a):jt(r)?o=r(a):o=U.createElement(Mo,jo({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])})(v.PureComponent);$v(Dv,"displayName","PolarAngleAxis");$v(Dv,"axisType","angleAxis");$v(Dv,"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 Yw,tI;function zoe(){if(tI)return Yw;tI=1;var e=f5(),t=e(Object.getPrototypeOf,Object);return Yw=t,Yw}var Xw,nI;function Uoe(){if(nI)return Xw;nI=1;var e=ni(),t=zoe(),n=ri(),r="[object Object]",a=Function.prototype,i=Object.prototype,o=a.toString,c=i.hasOwnProperty,d=o.call(Object);function f(h){if(!n(h)||e(h)!=r)return!1;var p=t(h);if(p===null)return!0;var y=c.call(p,"constructor")&&p.constructor;return typeof y=="function"&&y instanceof y&&o.call(y)==d}return Xw=f,Xw}var qoe=Uoe();const Woe=Yt(qoe);var Qw,rI;function Voe(){if(rI)return Qw;rI=1;var e=ni(),t=ri(),n="[object Boolean]";function r(a){return a===!0||a===!1||t(a)&&e(a)==n}return Qw=r,Qw}var Hoe=Voe();const Koe=Yt(Hoe);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 cm(){return cm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cm.apply(this,arguments)}function Goe(e,t){return Joe(e)||Qoe(e,t)||Xoe(e,t)||Yoe()}function Yoe(){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 Xoe(e,t){if(e){if(typeof e=="string")return aI(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 aI(e,t)}}function aI(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 Qoe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function Joe(e){if(Array.isArray(e))return e}function sI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function iI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sI(Object(n),!0).forEach(function(r){Zoe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Zoe(e,t,n){return t=ele(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ele(e){var t=tle(e,"string");return Vd(t)=="symbol"?t:t+""}function tle(e,t){if(Vd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Vd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var oI=function(t,n,r,a,i){var o=r-a,c;return c="M ".concat(t,",").concat(n),c+="L ".concat(t+r,",").concat(n),c+="L ".concat(t+r-o/2,",").concat(n+i),c+="L ".concat(t+r-o/2-a,",").concat(n+i),c+="L ".concat(t,",").concat(n," Z"),c},nle={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},rle=function(t){var n=iI(iI({},nle),t),r=v.useRef(),a=v.useState(-1),i=Goe(a,2),o=i[0],c=i[1];v.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var C=r.current.getTotalLength();C&&c(C)}catch{}},[]);var d=n.x,f=n.y,h=n.upperWidth,p=n.lowerWidth,y=n.height,g=n.className,j=n.animationEasing,b=n.animationDuration,x=n.animationBegin,S=n.isUpdateAnimationActive;if(d!==+d||f!==+f||h!==+h||p!==+p||y!==+y||h===0&&p===0||y===0)return null;var N=At("recharts-trapezoid",g);return S?U.createElement(ys,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:y,x:d,y:f},to:{upperWidth:h,lowerWidth:p,height:y,x:d,y:f},duration:b,animationEasing:j,isActive:S},function(C){var E=C.upperWidth,_=C.lowerWidth,k=C.height,O=C.x,R=C.y;return U.createElement(ys,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:b,easing:j},U.createElement("path",cm({},gt(n,!0),{className:N,d:oI(O,R,E,_,k),ref:r})))}):U.createElement("g",null,U.createElement("path",cm({},gt(n,!0),{className:N,d:oI(d,f,h,p,y)})))},ale=["option","shapeType","propTransformer","activeClassName","isActive"];function Hd(e){"@babel/helpers - typeof";return Hd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hd(e)}function sle(e,t){if(e==null)return{};var n=ile(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ile(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 lI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function um(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lI(Object(n),!0).forEach(function(r){ole(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ole(e,t,n){return t=lle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lle(e){var t=cle(e,"string");return Hd(t)=="symbol"?t:t+""}function cle(e,t){if(Hd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Hd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ule(e,t){return um(um({},t),e)}function dle(e,t){return e==="symbols"}function cI(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return U.createElement(nC,n);case"trapezoid":return U.createElement(rle,n);case"sector":return U.createElement(qL,n);case"symbols":if(dle(t))return U.createElement(wN,n);break;default:return null}}function fle(e){return v.isValidElement(e)?e.props:e}function t4(e){var t=e.option,n=e.shapeType,r=e.propTransformer,a=r===void 0?ule:r,i=e.activeClassName,o=i===void 0?"recharts-active-shape":i,c=e.isActive,d=sle(e,ale),f;if(v.isValidElement(t))f=v.cloneElement(t,um(um({},d),fle(t)));else if(jt(t))f=t(d);else if(Woe(t)&&!Koe(t)){var h=a(t,d);f=U.createElement(cI,{shapeType:n,elementProps:h})}else{var p=d;f=U.createElement(cI,{shapeType:n,elementProps:p})}return c?U.createElement(zt,{className:o},f):f}function Lv(e,t){return t!=null&&"trapezoids"in e.props}function Fv(e,t){return t!=null&&"sectors"in e.props}function Kd(e,t){return t!=null&&"points"in e.props}function ple(e,t){var n,r,a=e.x===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.x)||e.x===t.x,i=e.y===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.y)||e.y===t.y;return a&&i}function hle(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function mle(e,t){var n=e.x===t.x,r=e.y===t.y,a=e.z===t.z;return n&&r&&a}function vle(e,t){var n;return Lv(e,t)?n=ple:Fv(e,t)?n=hle:Kd(e,t)&&(n=mle),n}function gle(e,t){var n;return Lv(e,t)?n="trapezoids":Fv(e,t)?n="sectors":Kd(e,t)&&(n="points"),n}function yle(e,t){if(Lv(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(Fv(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 Kd(e,t)?t.payload:{}}function xle(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,a=gle(n,t),i=yle(n,t),o=r.filter(function(d,f){var h=Sf(i,d),p=n.props[a].filter(function(j){var b=vle(n,t);return b(j,t)}),y=n.props[a].indexOf(p[p.length-1]),g=f===y;return h&&g}),c=r.indexOf(o[o.length-1]);return c}var hh;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 ql(){return ql=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},ql.apply(this,arguments)}function uI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function on(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uI(Object(n),!0).forEach(function(r){xa(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ble(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r4(r.key),r)}}function wle(e,t,n){return t&&dI(e.prototype,t),n&&dI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function jle(e,t,n){return t=dm(t),Sle(e,n4()?Reflect.construct(t,n||[],dm(e).constructor):t.apply(e,n))}function Sle(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 Nle(e)}function Nle(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function n4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(n4=function(){return!!e})()}function dm(e){return dm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},dm(e)}function Cle(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gj(e,t)}function Gj(e,t){return Gj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Gj(e,t)}function xa(e,t,n){return t=r4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r4(e){var t=Ale(e,"string");return wc(t)=="symbol"?t:t+""}function Ale(e,t){if(wc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(wc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var si=(function(e){function t(n){var r;return ble(this,t),r=jle(this,t,[n]),xa(r,"pieRef",null),xa(r,"sectorRefs",[]),xa(r,"id",Kc("recharts-pie-")),xa(r,"handleAnimationEnd",function(){var a=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),jt(a)&&a()}),xa(r,"handleAnimationStart",function(){var a=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),jt(a)&&a()}),r.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},r}return Cle(t,e),wle(t,[{key:"isActiveIndex",value:function(r){var a=this.props.activeIndex;return Array.isArray(a)?a.indexOf(r)!==-1:r===a}},{key:"hasActiveIndex",value:function(){var r=this.props.activeIndex;return Array.isArray(r)?r.length!==0:r||r===0}},{key:"renderLabels",value:function(r){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.label,c=i.labelLine,d=i.dataKey,f=i.valueKey,h=gt(this.props,!1),p=gt(o,!1),y=gt(c,!1),g=o&&o.offsetRadius||20,j=r.map(function(b,x){var S=(b.startAngle+b.endAngle)/2,N=dn(b.cx,b.cy,b.outerRadius+g,S),C=on(on(on(on({},h),b),{},{stroke:"none"},p),{},{index:x,textAnchor:t.getTextAnchor(N.x,b.cx)},N),E=on(on(on(on({},h),b),{},{fill:"none",stroke:b.fill},y),{},{index:x,points:[dn(b.cx,b.cy,b.outerRadius,S),N]}),_=d;return Ct(d)&&Ct(f)?_="value":Ct(d)&&(_=f),U.createElement(zt,{key:"label-".concat(b.startAngle,"-").concat(b.endAngle,"-").concat(b.midAngle,"-").concat(x)},c&&t.renderLabelLineItem(c,E,"line"),t.renderLabelItem(o,C,qn(b,_)))});return U.createElement(zt,{className:"recharts-pie-labels"},j)}},{key:"renderSectorsStatically",value:function(r){var a=this,i=this.props,o=i.activeShape,c=i.blendStroke,d=i.inactiveShape;return r.map(function(f,h){if(f?.startAngle===0&&f?.endAngle===0&&r.length!==1)return null;var p=a.isActiveIndex(h),y=d&&a.hasActiveIndex()?d:null,g=p?o:y,j=on(on({},f),{},{stroke:c?f.fill:f.stroke,tabIndex:-1});return U.createElement(zt,ql({ref:function(x){x&&!a.sectorRefs.includes(x)&&a.sectorRefs.push(x)},tabIndex:-1,className:"recharts-pie-sector"},Io(a.props,f,h),{key:"sector-".concat(f?.startAngle,"-").concat(f?.endAngle,"-").concat(f.midAngle,"-").concat(h)}),U.createElement(t4,ql({option:g,isActive:p,shapeType:"sector"},j)))})}},{key:"renderSectorsWithAnimation",value:function(){var r=this,a=this.props,i=a.sectors,o=a.isAnimationActive,c=a.animationBegin,d=a.animationDuration,f=a.animationEasing,h=a.animationId,p=this.state,y=p.prevSectors,g=p.prevIsAnimationActive;return U.createElement(ys,{begin:c,duration:d,isActive:o,easing:f,from:{t:0},to:{t:1},key:"pie-".concat(h,"-").concat(g),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(j){var b=j.t,x=[],S=i&&i[0],N=S.startAngle;return i.forEach(function(C,E){var _=y&&y[E],k=E>0?aa(C,"paddingAngle",0):0;if(_){var O=ea(_.endAngle-_.startAngle,C.endAngle-C.startAngle),R=on(on({},C),{},{startAngle:N+k,endAngle:N+O(b)+k});x.push(R),N=R.endAngle}else{var T=C.endAngle,F=C.startAngle,L=ea(0,T-F),$=L(b),Y=on(on({},C),{},{startAngle:N+k,endAngle:N+$+k});x.push(Y),N=Y.endAngle}}),U.createElement(zt,null,r.renderSectorsStatically(x))})}},{key:"attachKeyboardHandlers",value:function(r){var a=this;r.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var o=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[o].focus(),a.setState({sectorToFocus:o});break}case"ArrowRight":{var c=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[c].focus(),a.setState({sectorToFocus:c});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,a=r.sectors,i=r.isAnimationActive,o=this.state.prevSectors;return i&&a&&a.length&&(!o||!Sf(o,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,a=this.props,i=a.hide,o=a.sectors,c=a.className,d=a.label,f=a.cx,h=a.cy,p=a.innerRadius,y=a.outerRadius,g=a.isAnimationActive,j=this.state.isAnimationFinished;if(i||!o||!o.length||!Ue(f)||!Ue(h)||!Ue(p)||!Ue(y))return null;var b=At("recharts-pie",c);return U.createElement(zt,{tabIndex:this.props.rootTabIndex,className:b,ref:function(S){r.pieRef=S}},this.renderSectors(),d&&this.renderLabels(o),tr.renderCallByParent(this.props,null,!1),(!g||j)&&Gs.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return a.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:r.sectors!==a.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,a){return r>a?"start":r<a?"end":"middle"}},{key:"renderLabelLineItem",value:function(r,a,i){if(U.isValidElement(r))return U.cloneElement(r,a);if(jt(r))return r(a);var o=At("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return U.createElement(tm,ql({},a,{key:i,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(r,a,i){if(U.isValidElement(r))return U.cloneElement(r,a);var o=i;if(jt(r)&&(o=r(a),U.isValidElement(o)))return o;var c=At("recharts-pie-label-text",typeof r!="boolean"&&!jt(r)?r.className:"");return U.createElement(Mo,ql({},a,{alignmentBaseline:"middle",className:c}),o)}}])})(v.PureComponent);hh=si;xa(si,"displayName","Pie");xa(si,"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:!Ko.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});xa(si,"parseDeltaAngle",function(e,t){var n=jr(t-e),r=Math.min(Math.abs(t-e),360);return n*r});xa(si,"getRealPieData",function(e){var t=e.data,n=e.children,r=gt(e,!1),a=sa(n,wv);return t&&t.length?t.map(function(i,o){return on(on(on({payload:i},r),i),a&&a[o]&&a[o].props)}):a&&a.length?a.map(function(i){return on(on({},r),i.props)}):[]});xa(si,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,a=t.width,i=t.height,o=FL(a,i),c=r+Sr(e.cx,a,a/2),d=n+Sr(e.cy,i,i/2),f=Sr(e.innerRadius,o,0),h=Sr(e.outerRadius,o,o*.8),p=e.maxRadius||Math.sqrt(a*a+i*i)/2;return{cx:c,cy:d,innerRadius:f,outerRadius:h,maxRadius:p}});xa(si,"getComposedData",function(e){var t=e.item,n=e.offset,r=t.type.defaultProps!==void 0?on(on({},t.type.defaultProps),t.props):t.props,a=hh.getRealPieData(r);if(!a||!a.length)return null;var i=r.cornerRadius,o=r.startAngle,c=r.endAngle,d=r.paddingAngle,f=r.dataKey,h=r.nameKey,p=r.valueKey,y=r.tooltipType,g=Math.abs(r.minAngle),j=hh.parseCoordinateOfPie(r,n),b=hh.parseDeltaAngle(o,c),x=Math.abs(b),S=f;Ct(f)&&Ct(p)?(Hs(!1,`Use "dataKey" to specify the value of pie,
|
|
114
|
-
the props "valueKey" will be deprecated in 1.1.0`),S="value"):Ct(f)&&(Hs(!1,`Use "dataKey" to specify the value of pie,
|
|
115
|
-
the props "valueKey" will be deprecated in 1.1.0`),S=p);var N=a.filter(function(R){return qn(R,S,0)!==0}).length,C=(x>=360?N:N-1)*d,E=x-N*g-C,_=a.reduce(function(R,T){var F=qn(T,S,0);return R+(Ue(F)?F:0)},0),k;if(_>0){var O;k=a.map(function(R,T){var F=qn(R,S,0),L=qn(R,h,T),$=(Ue(F)?F:0)/_,Y;T?Y=O.endAngle+jr(b)*d*(F!==0?1:0):Y=o;var H=Y+jr(b)*((F!==0?g:0)+$*E),K=(Y+H)/2,J=(j.innerRadius+j.outerRadius)/2,Q=[{name:L,value:F,payload:R,dataKey:S,type:y}],D=dn(j.cx,j.cy,J,K);return O=on(on(on({percent:$,cornerRadius:i,name:L,tooltipPayload:Q,midAngle:K,middleRadius:J,tooltipPosition:D},R),j),{},{value:qn(R,S),startAngle:Y,endAngle:H,payload:R,paddingAngle:jr(b)*d}),O})}return on(on({},j),{},{sectors:k,data:a})});var Jw,fI;function _le(){if(fI)return Jw;fI=1;var e=Math.ceil,t=Math.max;function n(r,a,i,o){for(var c=-1,d=t(e((a-r)/(i||1)),0),f=Array(d);d--;)f[o?d:++c]=r,r+=i;return f}return Jw=n,Jw}var Zw,pI;function a4(){if(pI)return Zw;pI=1;var e=E5(),t=1/0,n=17976931348623157e292;function r(a){if(!a)return a===0?a:0;if(a=e(a),a===t||a===-t){var i=a<0?-1:1;return i*n}return a===a?a:0}return Zw=r,Zw}var e1,hI;function Ele(){if(hI)return e1;hI=1;var e=_le(),t=bv(),n=a4();function r(a){return function(i,o,c){return c&&typeof c!="number"&&t(i,o,c)&&(o=c=void 0),i=n(i),o===void 0?(o=i,i=0):o=n(o),c=c===void 0?i<o?1:-1:n(c),e(i,o,c,a)}}return e1=r,e1}var t1,mI;function Ple(){if(mI)return t1;mI=1;var e=Ele(),t=e();return t1=t,t1}var kle=Ple();const fm=Yt(kle);function Gd(e){"@babel/helpers - typeof";return Gd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gd(e)}function vI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function 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){s4(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 s4(e,t,n){return t=Ole(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ole(e){var t=Rle(e,"string");return Gd(t)=="symbol"?t:t+""}function Rle(e,t){if(Gd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Gd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Tle=["Webkit","Moz","O","ms"],Ile=function(t,n){var r=t.replace(/(\w)/,function(i){return i.toUpperCase()}),a=Tle.reduce(function(i,o){return gI(gI({},i),{},s4({},o+r,n))},{});return a[t]=n,a};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 pm(){return pm=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},pm.apply(this,arguments)}function yI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function n1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yI(Object(n),!0).forEach(function(r){Qr(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,o4(r.key),r)}}function $le(e,t,n){return t&&xI(e.prototype,t),n&&xI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Dle(e,t,n){return t=hm(t),Lle(e,i4()?Reflect.construct(t,n||[],hm(e).constructor):t.apply(e,n))}function Lle(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 Fle(e)}function Fle(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(i4=function(){return!!e})()}function hm(e){return hm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},hm(e)}function Ble(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yj(e,t)}function Yj(e,t){return Yj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Yj(e,t)}function Qr(e,t,n){return t=o4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o4(e){var t=zle(e,"string");return jc(t)=="symbol"?t:t+""}function zle(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 Ule=function(t){var n=t.data,r=t.startIndex,a=t.endIndex,i=t.x,o=t.width,c=t.travellerWidth;if(!n||!n.length)return{};var d=n.length,f=sd().domain(fm(0,d)).range([i,i+o-c]),h=f.domain().map(function(p){return f(p)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:f(r),endX:f(a),scale:f,scaleValues:h}},bI=function(t){return t.changedTouches&&!!t.changedTouches.length},Sc=(function(e){function t(n){var r;return Mle(this,t),r=Dle(this,t,[n]),Qr(r,"handleDrag",function(a){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(a):r.state.isSlideMoving&&r.handleSlideDrag(a)}),Qr(r,"handleTouchMove",function(a){a.changedTouches!=null&&a.changedTouches.length>0&&r.handleDrag(a.changedTouches[0])}),Qr(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=r.props,i=a.endIndex,o=a.onDragEnd,c=a.startIndex;o?.({endIndex:i,startIndex:c})}),r.detachDragEndListener()}),Qr(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Qr(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Qr(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Qr(r,"handleSlideDragStart",function(a){var i=bI(a)?a.changedTouches[0]:a;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return Ble(t,e),$le(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var a=r.startX,i=r.endX,o=this.state.scaleValues,c=this.props,d=c.gap,f=c.data,h=f.length-1,p=Math.min(a,i),y=Math.max(a,i),g=t.getIndexInRange(o,p),j=t.getIndexInRange(o,y);return{startIndex:g-g%d,endIndex:j===h?h:j-j%d}}},{key:"getTextOfTick",value:function(r){var a=this.props,i=a.data,o=a.tickFormatter,c=a.dataKey,d=qn(i[r],c,r);return jt(o)?o(d,r):d}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var a=this.state,i=a.slideMoveStartX,o=a.startX,c=a.endX,d=this.props,f=d.x,h=d.width,p=d.travellerWidth,y=d.startIndex,g=d.endIndex,j=d.onChange,b=r.pageX-i;b>0?b=Math.min(b,f+h-p-c,f+h-p-o):b<0&&(b=Math.max(b,f-o,f-c));var x=this.getIndex({startX:o+b,endX:c+b});(x.startIndex!==y||x.endIndex!==g)&&j&&j(x),this.setState({startX:o+b,endX:c+b,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,a){var i=bI(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var a=this.state,i=a.brushMoveStartX,o=a.movingTravellerId,c=a.endX,d=a.startX,f=this.state[o],h=this.props,p=h.x,y=h.width,g=h.travellerWidth,j=h.onChange,b=h.gap,x=h.data,S={startX:this.state.startX,endX:this.state.endX},N=r.pageX-i;N>0?N=Math.min(N,p+y-g-f):N<0&&(N=Math.max(N,p-f)),S[o]=f+N;var C=this.getIndex(S),E=C.startIndex,_=C.endIndex,k=function(){var R=x.length-1;return o==="startX"&&(c>d?E%b===0:_%b===0)||c<d&&_===R||o==="endX"&&(c>d?_%b===0:E%b===0)||c>d&&_===R};this.setState(Qr(Qr({},o,f+N),"brushMoveStartX",r.pageX),function(){j&&k()&&j(C)})}},{key:"handleTravellerMoveKeyboard",value:function(r,a){var i=this,o=this.state,c=o.scaleValues,d=o.startX,f=o.endX,h=this.state[a],p=c.indexOf(h);if(p!==-1){var y=p+r;if(!(y===-1||y>=c.length)){var g=c[y];a==="startX"&&g>=f||a==="endX"&&g<=d||this.setState(Qr({},a,g),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,a=r.x,i=r.y,o=r.width,c=r.height,d=r.fill,f=r.stroke;return U.createElement("rect",{stroke:f,fill:d,x:a,y:i,width:o,height:c})}},{key:"renderPanorama",value:function(){var r=this.props,a=r.x,i=r.y,o=r.width,c=r.height,d=r.data,f=r.children,h=r.padding,p=v.Children.only(f);return p?U.cloneElement(p,{x:a,y:i,width:o,height:c,margin:h,compact:!0,data:d}):null}},{key:"renderTravellerLayer",value:function(r,a){var i,o,c=this,d=this.props,f=d.y,h=d.travellerWidth,p=d.height,y=d.traveller,g=d.ariaLabel,j=d.data,b=d.startIndex,x=d.endIndex,S=Math.max(r,this.props.x),N=n1(n1({},gt(this.props,!1)),{},{x:S,y:f,width:h,height:p}),C=g||"Min value: ".concat((i=j[b])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=j[x])===null||o===void 0?void 0:o.name);return U.createElement(zt,{tabIndex:0,role:"slider","aria-label":C,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(_){["ArrowLeft","ArrowRight"].includes(_.key)&&(_.preventDefault(),_.stopPropagation(),c.handleTravellerMoveKeyboard(_.key==="ArrowRight"?1:-1,a))},onFocus:function(){c.setState({isTravellerFocused:!0})},onBlur:function(){c.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(y,N))}},{key:"renderSlide",value:function(r,a){var i=this.props,o=i.y,c=i.height,d=i.stroke,f=i.travellerWidth,h=Math.min(r,a)+f,p=Math.max(Math.abs(a-r)-f,0);return U.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:d,fillOpacity:.2,x:h,y:o,width:p,height:c})}},{key:"renderText",value:function(){var r=this.props,a=r.startIndex,i=r.endIndex,o=r.y,c=r.height,d=r.travellerWidth,f=r.stroke,h=this.state,p=h.startX,y=h.endX,g=5,j={pointerEvents:"none",fill:f};return U.createElement(zt,{className:"recharts-brush-texts"},U.createElement(Mo,pm({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,y)-g,y:o+c/2},j),this.getTextOfTick(a)),U.createElement(Mo,pm({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,y)+d+g,y:o+c/2},j),this.getTextOfTick(i)))}},{key:"render",value:function(){var r=this.props,a=r.data,i=r.className,o=r.children,c=r.x,d=r.y,f=r.width,h=r.height,p=r.alwaysShowText,y=this.state,g=y.startX,j=y.endX,b=y.isTextActive,x=y.isSlideMoving,S=y.isTravellerMoving,N=y.isTravellerFocused;if(!a||!a.length||!Ue(c)||!Ue(d)||!Ue(f)||!Ue(h)||f<=0||h<=0)return null;var C=At("recharts-brush",i),E=U.Children.count(o)===1,_=Ile("userSelect","none");return U.createElement(zt,{className:C,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:_},this.renderBackground(),E&&this.renderPanorama(),this.renderSlide(g,j),this.renderTravellerLayer(g,"startX"),this.renderTravellerLayer(j,"endX"),(b||x||S||N||p)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var a=r.x,i=r.y,o=r.width,c=r.height,d=r.stroke,f=Math.floor(i+c/2)-1;return U.createElement(U.Fragment,null,U.createElement("rect",{x:a,y:i,width:o,height:c,fill:d,stroke:"none"}),U.createElement("line",{x1:a+1,y1:f,x2:a+o-1,y2:f,fill:"none",stroke:"#fff"}),U.createElement("line",{x1:a+1,y1:f+2,x2:a+o-1,y2:f+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,a){var i;return U.isValidElement(r)?i=U.cloneElement(r,a):jt(r)?i=r(a):i=t.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(r,a){var i=r.data,o=r.width,c=r.x,d=r.travellerWidth,f=r.updateId,h=r.startIndex,p=r.endIndex;if(i!==a.prevData||f!==a.prevUpdateId)return n1({prevData:i,prevTravellerWidth:d,prevUpdateId:f,prevX:c,prevWidth:o},i&&i.length?Ule({data:i,width:o,x:c,travellerWidth:d,startIndex:h,endIndex:p}):{scale:null,scaleValues:null});if(a.scale&&(o!==a.prevWidth||c!==a.prevX||d!==a.prevTravellerWidth)){a.scale.range([c,c+o-d]);var y=a.scale.domain().map(function(g){return a.scale(g)});return{prevData:i,prevTravellerWidth:d,prevUpdateId:f,prevX:c,prevWidth:o,startX:a.scale(r.startIndex),endX:a.scale(r.endIndex),scaleValues:y}}return null}},{key:"getIndexInRange",value:function(r,a){for(var i=r.length,o=0,c=i-1;c-o>1;){var d=Math.floor((o+c)/2);r[d]>a?c=d:o=d}return a>=r[c]?c:o}}])})(v.PureComponent);Qr(Sc,"displayName","Brush");Qr(Sc,"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 r1,wI;function qle(){if(wI)return r1;wI=1;var e=EN();function t(n,r){var a;return e(n,function(i,o,c){return a=r(i,o,c),!a}),!!a}return r1=t,r1}var a1,jI;function Wle(){if(jI)return a1;jI=1;var e=s5(),t=Ss(),n=qle(),r=Br(),a=bv();function i(o,c,d){var f=r(o)?e:n;return d&&a(o,c,d)&&(c=void 0),f(o,t(c,3))}return a1=i,a1}var Vle=Wle();const Hle=Yt(Vle);var hs=function(t,n){var r=t.alwaysShow,a=t.ifOverflow;return r&&(a="extendDomain"),a===n},s1,SI;function Kle(){if(SI)return s1;SI=1;var e=S5();function t(n,r,a){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):n[r]=a}return s1=t,s1}var i1,NI;function Gle(){if(NI)return i1;NI=1;var e=Kle(),t=w5(),n=Ss();function r(a,i){var o={};return i=n(i,3),t(a,function(c,d,f){e(o,d,i(c,d,f))}),o}return i1=r,i1}var Yle=Gle();const Xle=Yt(Yle);var o1,CI;function Qle(){if(CI)return o1;CI=1;function e(t,n){for(var r=-1,a=t==null?0:t.length;++r<a;)if(!n(t[r],r,t))return!1;return!0}return o1=e,o1}var l1,AI;function Jle(){if(AI)return l1;AI=1;var e=EN();function t(n,r){var a=!0;return e(n,function(i,o,c){return a=!!r(i,o,c),a}),a}return l1=t,l1}var c1,_I;function Zle(){if(_I)return c1;_I=1;var e=Qle(),t=Jle(),n=Ss(),r=Br(),a=bv();function i(o,c,d){var f=r(o)?e:t;return d&&a(o,c,d)&&(c=void 0),f(o,n(c,3))}return c1=i,c1}var ece=Zle();const tce=Yt(ece);var nce=["x","y"];function Yd(e){"@babel/helpers - typeof";return Yd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yd(e)}function Xj(){return Xj=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},Xj.apply(this,arguments)}function EI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Hu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EI(Object(n),!0).forEach(function(r){rce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rce(e,t,n){return t=ace(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ace(e){var t=sce(e,"string");return Yd(t)=="symbol"?t:t+""}function sce(e,t){if(Yd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Yd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ice(e,t){if(e==null)return{};var n=oce(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function oce(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 lce(e,t){var n=e.x,r=e.y,a=ice(e,nce),i="".concat(n),o=parseInt(i,10),c="".concat(r),d=parseInt(c,10),f="".concat(t.height||a.height),h=parseInt(f,10),p="".concat(t.width||a.width),y=parseInt(p,10);return Hu(Hu(Hu(Hu(Hu({},t),a),o?{x:o}:{}),d?{y:d}:{}),{},{height:h,width:y,name:t.name,radius:t.radius})}function PI(e){return U.createElement(t4,Xj({shapeType:"rectangle",propTransformer:lce,activeClassName:"recharts-active-bar"},e))}var cce=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,a){if(typeof t=="number")return t;var i=Ue(r)||EY(r);return i?t(r,a):(i||Do(),n)}},uce=["value","background"],l4;function Nc(e){"@babel/helpers - typeof";return Nc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nc(e)}function dce(e,t){if(e==null)return{};var n=fce(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function fce(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 mm(){return mm=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},mm.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(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Mn(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){$i(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 pce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u4(r.key),r)}}function hce(e,t,n){return t&&OI(e.prototype,t),n&&OI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function mce(e,t,n){return t=vm(t),vce(e,c4()?Reflect.construct(t,n||[],vm(e).constructor):t.apply(e,n))}function vce(e,t){if(t&&(Nc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gce(e)}function gce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(c4=function(){return!!e})()}function vm(e){return vm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},vm(e)}function yce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qj(e,t)}function Qj(e,t){return Qj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Qj(e,t)}function $i(e,t,n){return t=u4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u4(e){var t=xce(e,"string");return Nc(t)=="symbol"?t:t+""}function xce(e,t){if(Nc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Nc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Qo=(function(e){function t(){var n;pce(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=mce(this,t,[].concat(a)),$i(n,"state",{isAnimationFinished:!1}),$i(n,"id",Kc("recharts-bar-")),$i(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),$i(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return yce(t,e),hce(t,[{key:"renderRectanglesStatically",value:function(r){var a=this,i=this.props,o=i.shape,c=i.dataKey,d=i.activeIndex,f=i.activeBar,h=gt(this.props,!1);return r&&r.map(function(p,y){var g=y===d,j=g?f:o,b=Mn(Mn(Mn({},h),p),{},{isActive:g,option:j,index:y,dataKey:c,onAnimationStart:a.handleAnimationStart,onAnimationEnd:a.handleAnimationEnd});return U.createElement(zt,mm({className:"recharts-bar-rectangle"},Io(a.props,p,y),{key:"rectangle-".concat(p?.x,"-").concat(p?.y,"-").concat(p?.value,"-").concat(y)}),U.createElement(PI,b))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,a=this.props,i=a.data,o=a.layout,c=a.isAnimationActive,d=a.animationBegin,f=a.animationDuration,h=a.animationEasing,p=a.animationId,y=this.state.prevData;return U.createElement(ys,{begin:d,duration:f,isActive:c,easing:h,from:{t:0},to:{t:1},key:"bar-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(g){var j=g.t,b=i.map(function(x,S){var N=y&&y[S];if(N){var C=ea(N.x,x.x),E=ea(N.y,x.y),_=ea(N.width,x.width),k=ea(N.height,x.height);return Mn(Mn({},x),{},{x:C(j),y:E(j),width:_(j),height:k(j)})}if(o==="horizontal"){var O=ea(0,x.height),R=O(j);return Mn(Mn({},x),{},{y:x.y+x.height-R,height:R})}var T=ea(0,x.width),F=T(j);return Mn(Mn({},x),{},{width:F})});return U.createElement(zt,null,r.renderRectanglesStatically(b))})}},{key:"renderRectangles",value:function(){var r=this.props,a=r.data,i=r.isAnimationActive,o=this.state.prevData;return i&&a&&a.length&&(!o||!Sf(o,a))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(a)}},{key:"renderBackground",value:function(){var r=this,a=this.props,i=a.data,o=a.dataKey,c=a.activeIndex,d=gt(this.props.background,!1);return i.map(function(f,h){f.value;var p=f.background,y=dce(f,uce);if(!p)return null;var g=Mn(Mn(Mn(Mn(Mn({},y),{},{fill:"#eee"},p),d),Io(r.props,f,h)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:h,className:"recharts-bar-background-rectangle"});return U.createElement(PI,mm({key:"background-bar-".concat(h),option:r.props.background,isActive:h===c},g))})}},{key:"renderErrorBar",value:function(r,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.data,c=i.xAxis,d=i.yAxis,f=i.layout,h=i.children,p=sa(h,Nf);if(!p)return null;var y=f==="vertical"?o[0].height/2:o[0].width/2,g=function(x,S){var N=Array.isArray(x.value)?x.value[1]:x.value;return{x:x.x,y:x.y,value:N,errorVal:qn(x,S)}},j={clipPath:r?"url(#clipPath-".concat(a,")"):null};return U.createElement(zt,j,p.map(function(b){return U.cloneElement(b,{key:"error-bar-".concat(a,"-").concat(b.props.dataKey),data:o,xAxis:c,yAxis:d,layout:f,offset:y,dataPointFormatter:g})}))}},{key:"render",value:function(){var r=this.props,a=r.hide,i=r.data,o=r.className,c=r.xAxis,d=r.yAxis,f=r.left,h=r.top,p=r.width,y=r.height,g=r.isAnimationActive,j=r.background,b=r.id;if(a||!i||!i.length)return null;var x=this.state.isAnimationFinished,S=At("recharts-bar",o),N=c&&c.allowDataOverflow,C=d&&d.allowDataOverflow,E=N||C,_=Ct(b)?this.id:b;return U.createElement(zt,{className:S},N||C?U.createElement("defs",null,U.createElement("clipPath",{id:"clipPath-".concat(_)},U.createElement("rect",{x:N?f:f-p/2,y:C?h:h-y/2,width:N?p:p*2,height:C?y:y*2}))):null,U.createElement(zt,{className:"recharts-bar-rectangles",clipPath:E?"url(#clipPath-".concat(_,")"):null},j?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(E,_),(!g||x)&&Gs.renderCallByParent(this.props,i))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:a.curData}:r.data!==a.curData?{curData:r.data}:null}}])})(v.PureComponent);l4=Qo;$i(Qo,"displayName","Bar");$i(Qo,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!Ko.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});$i(Qo,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,a=e.bandSize,i=e.xAxis,o=e.yAxis,c=e.xAxisTicks,d=e.yAxisTicks,f=e.stackedData,h=e.dataStartIndex,p=e.displayedData,y=e.offset,g=qre(r,n);if(!g)return null;var j=t.layout,b=n.type.defaultProps,x=b!==void 0?Mn(Mn({},b),n.props):n.props,S=x.dataKey,N=x.children,C=x.minPointSize,E=j==="horizontal"?o:i,_=f?E.scale.domain():null,k=Xre({numericAxis:E}),O=sa(N,wv),R=p.map(function(T,F){var L,$,Y,H,K,J;f?L=Wre(f[h+F],_):(L=qn(T,S),Array.isArray(L)||(L=[k,L]));var Q=cce(C,l4.defaultProps.minPointSize)(L[1],F);if(j==="horizontal"){var D,B=[o.scale(L[0]),o.scale(L[1])],Z=B[0],z=B[1];$=s2({axis:i,ticks:c,bandSize:a,offset:g.offset,entry:T,index:F}),Y=(D=z??Z)!==null&&D!==void 0?D:void 0,H=g.size;var M=Z-z;if(K=Number.isNaN(M)?0:M,J={x:$,y:o.y,width:H,height:o.height},Math.abs(Q)>0&&Math.abs(K)<Math.abs(Q)){var re=jr(K||Q)*(Math.abs(Q)-Math.abs(K));Y-=re,K+=re}}else{var te=[i.scale(L[0]),i.scale(L[1])],G=te[0],de=te[1];if($=G,Y=s2({axis:o,ticks:d,bandSize:a,offset:g.offset,entry:T,index:F}),H=de-G,K=g.size,J={x:i.x,y:Y,width:i.width,height:K},Math.abs(Q)>0&&Math.abs(H)<Math.abs(Q)){var ce=jr(H||Q)*(Math.abs(Q)-Math.abs(H));H+=ce}}return Mn(Mn(Mn({},T),{},{x:$,y:Y,width:H,height:K,value:f?L:L[1],payload:T,background:J},O&&O[F]&&O[F].props),{},{tooltipPayload:[DL(n,T)],tooltipPosition:{x:$+H/2,y:Y+K/2}})});return Mn({data:R,layout:j},y)});function Xd(e){"@babel/helpers - typeof";return Xd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xd(e)}function bce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function RI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,d4(r.key),r)}}function wce(e,t,n){return t&&RI(e.prototype,t),n&&RI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function TI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ba(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TI(Object(n),!0).forEach(function(r){Bv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bv(e,t,n){return t=d4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d4(e){var t=jce(e,"string");return Xd(t)=="symbol"?t:t+""}function jce(e,t){if(Xd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Xd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var f4=function(t,n,r,a,i){var o=t.width,c=t.height,d=t.layout,f=t.children,h=Object.keys(n),p={left:r.left,leftMirror:r.left,right:o-r.right,rightMirror:o-r.right,top:r.top,topMirror:r.top,bottom:c-r.bottom,bottomMirror:c-r.bottom},y=!!Jr(f,Qo);return h.reduce(function(g,j){var b=n[j],x=b.orientation,S=b.domain,N=b.padding,C=N===void 0?{}:N,E=b.mirror,_=b.reversed,k="".concat(x).concat(E?"Mirror":""),O,R,T,F,L;if(b.type==="number"&&(b.padding==="gap"||b.padding==="no-gap")){var $=S[1]-S[0],Y=1/0,H=b.categoricalDomain.sort(OY);if(H.forEach(function(te,G){G>0&&(Y=Math.min((te||0)-(H[G-1]||0),Y))}),Number.isFinite(Y)){var K=Y/$,J=b.layout==="vertical"?r.height:r.width;if(b.padding==="gap"&&(O=K*J/2),b.padding==="no-gap"){var Q=Sr(t.barCategoryGap,K*J),D=K*J/2;O=D-Q-(D-Q)/J*Q}}}a==="xAxis"?R=[r.left+(C.left||0)+(O||0),r.left+r.width-(C.right||0)-(O||0)]:a==="yAxis"?R=d==="horizontal"?[r.top+r.height-(C.bottom||0),r.top+(C.top||0)]:[r.top+(C.top||0)+(O||0),r.top+r.height-(C.bottom||0)-(O||0)]:R=b.range,_&&(R=[R[1],R[0]]);var B=TL(b,i,y),Z=B.scale,z=B.realScaleType;Z.domain(S).range(R),IL(Z);var M=ML(Z,Ba(Ba({},b),{},{realScaleType:z}));a==="xAxis"?(L=x==="top"&&!E||x==="bottom"&&E,T=r.left,F=p[k]-L*b.height):a==="yAxis"&&(L=x==="left"&&!E||x==="right"&&E,T=p[k]-L*b.width,F=r.top);var re=Ba(Ba(Ba({},b),M),{},{realScaleType:z,x:T,y:F,scale:Z,width:a==="xAxis"?r.width:b.width,height:a==="yAxis"?r.height:b.height});return re.bandSize=Jh(re,M),!b.hide&&a==="xAxis"?p[k]+=(L?-1:1)*re.height:b.hide||(p[k]+=(L?-1:1)*re.width),Ba(Ba({},g),{},Bv({},j,re))},{})},p4=function(t,n){var r=t.x,a=t.y,i=n.x,o=n.y;return{x:Math.min(r,i),y:Math.min(a,o),width:Math.abs(i-r),height:Math.abs(o-a)}},Sce=function(t){var n=t.x1,r=t.y1,a=t.x2,i=t.y2;return p4({x:n,y:r},{x:a,y:i})},h4=(function(){function e(t){bce(this,e),this.scale=t}return wce(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.bandAware,i=r.position;if(n!==void 0){if(i)switch(i){case"start":return this.scale(n);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+o}case"end":{var c=this.bandwidth?this.bandwidth():0;return this.scale(n)+c}default:return this.scale(n)}if(a){var d=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+d}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),a=r[0],i=r[r.length-1];return a<=i?n>=a&&n<=i:n>=i&&n<=a}}],[{key:"create",value:function(n){return new e(n)}}])})();Bv(h4,"EPS",1e-4);var rC=function(t){var n=Object.keys(t).reduce(function(r,a){return Ba(Ba({},r),{},Bv({},a,h4.create(t[a])))},{});return Ba(Ba({},n),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,c=i.position;return Xle(a,function(d,f){return n[f].apply(d,{bandAware:o,position:c})})},isInRange:function(a){return tce(a,function(i,o){return n[o].isInRange(i)})}})};function Nce(e){return(e%180+180)%180}var Cce=function(t){var n=t.width,r=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=Nce(a),o=i*Math.PI/180,c=Math.atan(r/n),d=o>c&&o<Math.PI-c?r/Math.sin(o):n/Math.cos(o);return Math.abs(d)},u1,II;function Ace(){if(II)return u1;II=1;var e=Ss(),t=yf(),n=yv();function r(a){return function(i,o,c){var d=Object(i);if(!t(i)){var f=e(o,3);i=n(i),o=function(p){return f(d[p],p,d)}}var h=a(i,o,c);return h>-1?d[f?i[h]:h]:void 0}}return u1=r,u1}var d1,MI;function _ce(){if(MI)return d1;MI=1;var e=a4();function t(n){var r=e(n),a=r%1;return r===r?a?r-a:r:0}return d1=t,d1}var f1,$I;function Ece(){if($I)return f1;$I=1;var e=v5(),t=Ss(),n=_ce(),r=Math.max;function a(i,o,c){var d=i==null?0:i.length;if(!d)return-1;var f=c==null?0:n(c);return f<0&&(f=r(d+f,0)),e(i,t(o,3),f)}return f1=a,f1}var p1,DI;function Pce(){if(DI)return p1;DI=1;var e=Ace(),t=Ece(),n=e(t);return p1=n,p1}Pce();var kce=R3();const Oce=Yt(kce);var Rce=Oce(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("")}),m4=v.createContext(void 0),v4=v.createContext(void 0),g4=v.createContext(void 0),Tce=v.createContext({}),y4=v.createContext(void 0),x4=v.createContext(0),b4=v.createContext(0),LI=function(t){var n=t.state,r=n.xAxisMap,a=n.yAxisMap,i=n.offset,o=t.clipPathId,c=t.children,d=t.width,f=t.height,h=Rce(i);return U.createElement(m4.Provider,{value:r},U.createElement(v4.Provider,{value:a},U.createElement(Tce.Provider,{value:i},U.createElement(g4.Provider,{value:h},U.createElement(y4.Provider,{value:o},U.createElement(x4.Provider,{value:f},U.createElement(b4.Provider,{value:d},c)))))))},Ice=function(){return v.useContext(y4)},w4=function(t){var n=v.useContext(m4);n==null&&Do();var r=n[t];return r==null&&Do(),r},j4=function(t){var n=v.useContext(v4);n==null&&Do();var r=n[t];return r==null&&Do(),r},Mce=function(){var t=v.useContext(g4);return t},S4=function(){return v.useContext(b4)},N4=function(){return v.useContext(x4)};function Cc(e){"@babel/helpers - typeof";return Cc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cc(e)}function $ce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dce(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,A4(r.key),r)}}function Lce(e,t,n){return t&&Dce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fce(e,t,n){return t=gm(t),Bce(e,C4()?Reflect.construct(t,n||[],gm(e).constructor):t.apply(e,n))}function Bce(e,t){if(t&&(Cc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zce(e)}function zce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function C4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(C4=function(){return!!e})()}function gm(e){return gm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},gm(e)}function Uce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Jj(e,t)}function Jj(e,t){return Jj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Jj(e,t)}function FI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function BI(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){aC(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 aC(e,t,n){return t=A4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A4(e){var t=qce(e,"string");return Cc(t)=="symbol"?t:t+""}function qce(e,t){if(Cc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Cc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Wce(e,t){return Gce(e)||Kce(e,t)||Hce(e,t)||Vce()}function Vce(){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 Hce(e,t){if(e){if(typeof e=="string")return zI(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 zI(e,t)}}function zI(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 Kce(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function Gce(e){if(Array.isArray(e))return e}function Zj(){return Zj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zj.apply(this,arguments)}var Yce=function(t,n){var r;return U.isValidElement(t)?r=U.cloneElement(t,n):jt(t)?r=t(n):r=U.createElement("line",Zj({},n,{className:"recharts-reference-line-line"})),r},Xce=function(t,n,r,a,i,o,c,d,f){var h=i.x,p=i.y,y=i.width,g=i.height;if(r){var j=f.y,b=t.y.apply(j,{position:o});if(hs(f,"discard")&&!t.y.isInRange(b))return null;var x=[{x:h+y,y:b},{x:h,y:b}];return d==="left"?x.reverse():x}if(n){var S=f.x,N=t.x.apply(S,{position:o});if(hs(f,"discard")&&!t.x.isInRange(N))return null;var C=[{x:N,y:p+g},{x:N,y:p}];return c==="top"?C.reverse():C}if(a){var E=f.segment,_=E.map(function(k){return t.apply(k,{position:o})});return hs(f,"discard")&&Hle(_,function(k){return!t.isInRange(k)})?null:_}return null};function Qce(e){var t=e.x,n=e.y,r=e.segment,a=e.xAxisId,i=e.yAxisId,o=e.shape,c=e.className,d=e.alwaysShow,f=Ice(),h=w4(a),p=j4(i),y=Mce();if(!f||!y)return null;Hs(d===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var g=rC({x:h.scale,y:p.scale}),j=Wn(t),b=Wn(n),x=r&&r.length===2,S=Xce(g,j,b,x,y,e.position,h.orientation,p.orientation,e);if(!S)return null;var N=Wce(S,2),C=N[0],E=C.x,_=C.y,k=N[1],O=k.x,R=k.y,T=hs(e,"hidden")?"url(#".concat(f,")"):void 0,F=BI(BI({clipPath:T},gt(e,!0)),{},{x1:E,y1:_,x2:O,y2:R});return U.createElement(zt,{className:At("recharts-reference-line",c)},Yce(o,F),tr.renderCallByParent(e,Sce({x1:E,y1:_,x2:O,y2:R})))}var sC=(function(e){function t(){return $ce(this,t),Fce(this,t,arguments)}return Uce(t,e),Lce(t,[{key:"render",value:function(){return U.createElement(Qce,this.props)}}])})(U.Component);aC(sC,"displayName","ReferenceLine");aC(sC,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function eS(){return eS=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},eS.apply(this,arguments)}function Ac(e){"@babel/helpers - typeof";return Ac=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ac(e)}function UI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function qI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UI(Object(n),!0).forEach(function(r){zv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zce(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,E4(r.key),r)}}function eue(e,t,n){return t&&Zce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function tue(e,t,n){return t=ym(t),nue(e,_4()?Reflect.construct(t,n||[],ym(e).constructor):t.apply(e,n))}function nue(e,t){if(t&&(Ac(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return rue(e)}function rue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_4=function(){return!!e})()}function ym(e){return ym=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ym(e)}function aue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tS(e,t)}function tS(e,t){return tS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},tS(e,t)}function zv(e,t,n){return t=E4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E4(e){var t=sue(e,"string");return Ac(t)=="symbol"?t:t+""}function sue(e,t){if(Ac(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ac(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var iue=function(t){var n=t.x,r=t.y,a=t.xAxis,i=t.yAxis,o=rC({x:a.scale,y:i.scale}),c=o.apply({x:n,y:r},{bandAware:!0});return hs(t,"discard")&&!o.isInRange(c)?null:c},Uv=(function(e){function t(){return Jce(this,t),tue(this,t,arguments)}return aue(t,e),eue(t,[{key:"render",value:function(){var r=this.props,a=r.x,i=r.y,o=r.r,c=r.alwaysShow,d=r.clipPathId,f=Wn(a),h=Wn(i);if(Hs(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!f||!h)return null;var p=iue(this.props);if(!p)return null;var y=p.x,g=p.y,j=this.props,b=j.shape,x=j.className,S=hs(this.props,"hidden")?"url(#".concat(d,")"):void 0,N=qI(qI({clipPath:S},gt(this.props,!0)),{},{cx:y,cy:g});return U.createElement(zt,{className:At("recharts-reference-dot",x)},t.renderDot(b,N),tr.renderCallByParent(this.props,{x:y-o,y:g-o,width:2*o,height:2*o}))}}])})(U.Component);zv(Uv,"displayName","ReferenceDot");zv(Uv,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});zv(Uv,"renderDot",function(e,t){var n;return U.isValidElement(e)?n=U.cloneElement(e,t):jt(e)?n=e(t):n=U.createElement(Tv,eS({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function nS(){return nS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nS.apply(this,arguments)}function _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 WI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function VI(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){qv(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 oue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lue(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,k4(r.key),r)}}function cue(e,t,n){return t&&lue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function uue(e,t,n){return t=xm(t),due(e,P4()?Reflect.construct(t,n||[],xm(e).constructor):t.apply(e,n))}function due(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 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 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 pue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rS(e,t)}function rS(e,t){return rS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},rS(e,t)}function qv(e,t,n){return t=k4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k4(e){var t=hue(e,"string");return _c(t)=="symbol"?t:t+""}function hue(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 mue=function(t,n,r,a,i){var o=i.x1,c=i.x2,d=i.y1,f=i.y2,h=i.xAxis,p=i.yAxis;if(!h||!p)return null;var y=rC({x:h.scale,y:p.scale}),g={x:t?y.x.apply(o,{position:"start"}):y.x.rangeMin,y:r?y.y.apply(d,{position:"start"}):y.y.rangeMin},j={x:n?y.x.apply(c,{position:"end"}):y.x.rangeMax,y:a?y.y.apply(f,{position:"end"}):y.y.rangeMax};return hs(i,"discard")&&(!y.isInRange(g)||!y.isInRange(j))?null:p4(g,j)},Wv=(function(e){function t(){return oue(this,t),uue(this,t,arguments)}return pue(t,e),cue(t,[{key:"render",value:function(){var r=this.props,a=r.x1,i=r.x2,o=r.y1,c=r.y2,d=r.className,f=r.alwaysShow,h=r.clipPathId;Hs(f===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=Wn(a),y=Wn(i),g=Wn(o),j=Wn(c),b=this.props.shape;if(!p&&!y&&!g&&!j&&!b)return null;var x=mue(p,y,g,j,this.props);if(!x&&!b)return null;var S=hs(this.props,"hidden")?"url(#".concat(h,")"):void 0;return U.createElement(zt,{className:At("recharts-reference-area",d)},t.renderRect(b,VI(VI({clipPath:S},gt(this.props,!0)),x)),tr.renderCallByParent(this.props,x))}}])})(U.Component);qv(Wv,"displayName","ReferenceArea");qv(Wv,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});qv(Wv,"renderRect",function(e,t){var n;return U.isValidElement(e)?n=U.cloneElement(e,t):jt(e)?n=e(t):n=U.createElement(nC,nS({},t,{className:"recharts-reference-area-rect"})),n});function O4(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],a=0;a<e.length;a+=t)r.push(e[a]);return r}function vue(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Cce(r,n)}function gue(e,t,n){var r=n==="width",a=e.x,i=e.y,o=e.width,c=e.height;return t===1?{start:r?a:i,end:r?a+o:i+c}:{start:r?a+o:i+c,end:r?a:i}}function bm(e,t,n,r,a){if(e*t<e*r||e*t>e*a)return!1;var i=n();return e*(t-e*i/2-r)>=0&&e*(t+e*i/2-a)<=0}function yue(e,t){return O4(e,t+1)}function xue(e,t,n,r,a){for(var i=(r||[]).slice(),o=t.start,c=t.end,d=0,f=1,h=o,p=function(){var j=r?.[d];if(j===void 0)return{v:O4(r,f)};var b=d,x,S=function(){return x===void 0&&(x=n(j,b)),x},N=j.coordinate,C=d===0||bm(e,N,S,h,c);C||(d=0,h=o,f+=1),C&&(h=N+e*(S()/2+a),d+=f)},y;f<=i.length;)if(y=p(),y)return y.v;return[]}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 HI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function gr(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){bue(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 bue(e,t,n){return t=wue(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wue(e){var t=jue(e,"string");return Qd(t)=="symbol"?t:t+""}function jue(e,t){if(Qd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Qd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sue(e,t,n,r,a){for(var i=(r||[]).slice(),o=i.length,c=t.start,d=t.end,f=function(y){var g=i[y],j,b=function(){return j===void 0&&(j=n(g,y)),j};if(y===o-1){var x=e*(g.coordinate+e*b()/2-d);i[y]=g=gr(gr({},g),{},{tickCoord:x>0?g.coordinate-x*e:g.coordinate})}else i[y]=g=gr(gr({},g),{},{tickCoord:g.coordinate});var S=bm(e,g.tickCoord,b,c,d);S&&(d=g.tickCoord-e*(b()/2+a),i[y]=gr(gr({},g),{},{isShow:!0}))},h=o-1;h>=0;h--)f(h);return i}function Nue(e,t,n,r,a,i){var o=(r||[]).slice(),c=o.length,d=t.start,f=t.end;if(i){var h=r[c-1],p=n(h,c-1),y=e*(h.coordinate+e*p/2-f);o[c-1]=h=gr(gr({},h),{},{tickCoord:y>0?h.coordinate-y*e:h.coordinate});var g=bm(e,h.tickCoord,function(){return p},d,f);g&&(f=h.tickCoord-e*(p/2+a),o[c-1]=gr(gr({},h),{},{isShow:!0}))}for(var j=i?c-1:c,b=function(N){var C=o[N],E,_=function(){return E===void 0&&(E=n(C,N)),E};if(N===0){var k=e*(C.coordinate-e*_()/2-d);o[N]=C=gr(gr({},C),{},{tickCoord:k<0?C.coordinate-k*e:C.coordinate})}else o[N]=C=gr(gr({},C),{},{tickCoord:C.coordinate});var O=bm(e,C.tickCoord,_,d,f);O&&(d=C.tickCoord+e*(_()/2+a),o[N]=gr(gr({},C),{},{isShow:!0}))},x=0;x<j;x++)b(x);return o}function Cue(e,t,n){var r=e.tick,a=e.ticks,i=e.viewBox,o=e.minTickGap,c=e.orientation,d=e.interval,f=e.tickFormatter,h=e.unit,p=e.angle;if(!a||!a.length||!r)return[];if(Ue(d)||Ko.isSsr)return yue(a,typeof d=="number"&&Ue(d)?d:0);var y=[],g=c==="top"||c==="bottom"?"width":"height",j=h&&g==="width"?ad(h,{fontSize:t,letterSpacing:n}):{width:0,height:0},b=function(C,E){var _=jt(f)?f(C.value,E):C.value;return g==="width"?vue(ad(_,{fontSize:t,letterSpacing:n}),j,p):ad(_,{fontSize:t,letterSpacing:n})[g]},x=a.length>=2?jr(a[1].coordinate-a[0].coordinate):1,S=gue(i,x,g);return d==="equidistantPreserveStart"?xue(x,S,b,a,o):(d==="preserveStart"||d==="preserveStartEnd"?y=Nue(x,S,b,a,o,d==="preserveStartEnd"):y=Sue(x,S,b,a,o),y.filter(function(N){return N.isShow}))}var Aue=["viewBox"],_ue=["viewBox"],Eue=["ticks"];function Ec(e){"@babel/helpers - typeof";return Ec=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ec(e)}function Wl(){return Wl=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},Wl.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(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function zn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KI(Object(n),!0).forEach(function(r){iC(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 h1(e,t){if(e==null)return{};var n=Pue(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Pue(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function kue(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,T4(r.key),r)}}function Oue(e,t,n){return t&&GI(e.prototype,t),n&&GI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Rue(e,t,n){return t=wm(t),Tue(e,R4()?Reflect.construct(t,n||[],wm(e).constructor):t.apply(e,n))}function Tue(e,t){if(t&&(Ec(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Iue(e)}function Iue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(R4=function(){return!!e})()}function wm(e){return wm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},wm(e)}function Mue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&aS(e,t)}function aS(e,t){return aS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},aS(e,t)}function iC(e,t,n){return t=T4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T4(e){var t=$ue(e,"string");return Ec(t)=="symbol"?t:t+""}function $ue(e,t){if(Ec(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ec(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Vv=(function(e){function t(n){var r;return kue(this,t),r=Rue(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return Mue(t,e),Oue(t,[{key:"shouldComponentUpdate",value:function(r,a){var i=r.viewBox,o=h1(r,Aue),c=this.props,d=c.viewBox,f=h1(c,_ue);return!Jl(i,d)||!Jl(o,f)||!Jl(a,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var a=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];a&&this.setState({fontSize:window.getComputedStyle(a).fontSize,letterSpacing:window.getComputedStyle(a).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var a=this.props,i=a.x,o=a.y,c=a.width,d=a.height,f=a.orientation,h=a.tickSize,p=a.mirror,y=a.tickMargin,g,j,b,x,S,N,C=p?-1:1,E=r.tickSize||h,_=Ue(r.tickCoord)?r.tickCoord:r.coordinate;switch(f){case"top":g=j=r.coordinate,x=o+ +!p*d,b=x-C*E,N=b-C*y,S=_;break;case"left":b=x=r.coordinate,j=i+ +!p*c,g=j-C*E,S=g-C*y,N=_;break;case"right":b=x=r.coordinate,j=i+ +p*c,g=j+C*E,S=g+C*y,N=_;break;default:g=j=r.coordinate,x=o+ +p*d,b=x+C*E,N=b+C*y,S=_;break}return{line:{x1:g,y1:b,x2:j,y2:x},tick:{x:S,y:N}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,a=r.orientation,i=r.mirror,o;switch(a){case"left":o=i?"start":"end";break;case"right":o=i?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,a=r.orientation,i=r.mirror,o="end";switch(a){case"left":case"right":o="middle";break;case"top":o=i?"start":"end";break;default:o=i?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.x,i=r.y,o=r.width,c=r.height,d=r.orientation,f=r.mirror,h=r.axisLine,p=zn(zn(zn({},gt(this.props,!1)),gt(h,!1)),{},{fill:"none"});if(d==="top"||d==="bottom"){var y=+(d==="top"&&!f||d==="bottom"&&f);p=zn(zn({},p),{},{x1:a,y1:i+y*c,x2:a+o,y2:i+y*c})}else{var g=+(d==="left"&&!f||d==="right"&&f);p=zn(zn({},p),{},{x1:a+g*o,y1:i,x2:a+g*o,y2:i+c})}return U.createElement("line",Wl({},p,{className:At("recharts-cartesian-axis-line",aa(h,"className"))}))}},{key:"renderTicks",value:function(r,a,i){var o=this,c=this.props,d=c.tickLine,f=c.stroke,h=c.tick,p=c.tickFormatter,y=c.unit,g=Cue(zn(zn({},this.props),{},{ticks:r}),a,i),j=this.getTickTextAnchor(),b=this.getTickVerticalAnchor(),x=gt(this.props,!1),S=gt(h,!1),N=zn(zn({},x),{},{fill:"none"},gt(d,!1)),C=g.map(function(E,_){var k=o.getTickLineCoord(E),O=k.line,R=k.tick,T=zn(zn(zn(zn({textAnchor:j,verticalAnchor:b},x),{},{stroke:"none",fill:f},S),R),{},{index:_,payload:E,visibleTicksCount:g.length,tickFormatter:p});return U.createElement(zt,Wl({className:"recharts-cartesian-axis-tick",key:"tick-".concat(E.value,"-").concat(E.coordinate,"-").concat(E.tickCoord)},Io(o.props,E,_)),d&&U.createElement("line",Wl({},N,O,{className:At("recharts-cartesian-axis-tick-line",aa(d,"className"))})),h&&t.renderTickItem(h,T,"".concat(jt(p)?p(E.value,_):E.value).concat(y||"")))});return U.createElement("g",{className:"recharts-cartesian-axis-ticks"},C)}},{key:"render",value:function(){var r=this,a=this.props,i=a.axisLine,o=a.width,c=a.height,d=a.ticksGenerator,f=a.className,h=a.hide;if(h)return null;var p=this.props,y=p.ticks,g=h1(p,Eue),j=y;return jt(d)&&(j=y&&y.length>0?d(this.props):d(g)),o<=0||c<=0||!j||!j.length?null:U.createElement(zt,{className:At("recharts-cartesian-axis",f),ref:function(x){r.layerReference=x}},i&&this.renderAxisLine(),this.renderTicks(j,this.state.fontSize,this.state.letterSpacing),tr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,a,i){var o,c=At(a.className,"recharts-cartesian-axis-tick-value");return U.isValidElement(r)?o=U.cloneElement(r,zn(zn({},a),{},{className:c})):jt(r)?o=r(zn(zn({},a),{},{className:c})):o=U.createElement(Mo,Wl({},a,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])})(v.Component);iC(Vv,"displayName","CartesianAxis");iC(Vv,"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 Due=["type","layout","connectNulls","ref"],Lue=["key"];function Pc(e){"@babel/helpers - typeof";return Pc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pc(e)}function YI(e,t){if(e==null)return{};var n=Fue(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Fue(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 ud(){return ud=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},ud.apply(this,arguments)}function XI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Xr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?XI(Object(n),!0).forEach(function(r){za(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tl(e){return que(e)||Uue(e)||zue(e)||Bue()}function Bue(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
117
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zue(e,t){if(e){if(typeof e=="string")return sS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sS(e,t)}}function Uue(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function que(e){if(Array.isArray(e))return sS(e)}function sS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Wue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function QI(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 Vue(e,t,n){return t&&QI(e.prototype,t),n&&QI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Hue(e,t,n){return t=jm(t),Kue(e,I4()?Reflect.construct(t,n||[],jm(e).constructor):t.apply(e,n))}function Kue(e,t){if(t&&(Pc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gue(e)}function Gue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function I4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(I4=function(){return!!e})()}function jm(e){return jm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},jm(e)}function Yue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&iS(e,t)}function iS(e,t){return iS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},iS(e,t)}function za(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=Xue(e,"string");return Pc(t)=="symbol"?t:t+""}function Xue(e,t){if(Pc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Pc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Lo=(function(e){function t(){var n;Wue(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=Hue(this,t,[].concat(a)),za(n,"state",{isAnimationFinished:!0,totalLength:0}),za(n,"generateSimpleStrokeDasharray",function(o,c){return"".concat(c,"px ").concat(o-c,"px")}),za(n,"getStrokeDasharray",function(o,c,d){var f=d.reduce(function(S,N){return S+N});if(!f)return n.generateSimpleStrokeDasharray(c,o);for(var h=Math.floor(o/f),p=o%f,y=c-o,g=[],j=0,b=0;j<d.length;b+=d[j],++j)if(b+d[j]>p){g=[].concat(Tl(d.slice(0,j)),[p-b]);break}var x=g.length%2===0?[0,y]:[y];return[].concat(Tl(t.repeat(d,h)),Tl(g),x).map(function(S){return"".concat(S,"px")}).join(", ")}),za(n,"id",Kc("recharts-line-")),za(n,"pathRef",function(o){n.mainCurve=o}),za(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),za(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return Yue(t,e),Vue(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.points,c=i.xAxis,d=i.yAxis,f=i.layout,h=i.children,p=sa(h,Nf);if(!p)return null;var y=function(b,x){return{x:b.x,y:b.y,value:b.value,errorVal:qn(b.payload,x)}},g={clipPath:r?"url(#clipPath-".concat(a,")"):null};return U.createElement(zt,g,p.map(function(j){return U.cloneElement(j,{key:"bar-".concat(j.props.dataKey),data:o,xAxis:c,yAxis:d,layout:f,dataPointFormatter:y})}))}},{key:"renderDots",value:function(r,a,i){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var c=this.props,d=c.dot,f=c.points,h=c.dataKey,p=gt(this.props,!1),y=gt(d,!0),g=f.map(function(b,x){var S=Xr(Xr(Xr({key:"dot-".concat(x),r:3},p),y),{},{index:x,cx:b.x,cy:b.y,value:b.value,dataKey:h,payload:b.payload,points:f});return t.renderDotItem(d,S)}),j={clipPath:r?"url(#clipPath-".concat(a?"":"dots-").concat(i,")"):null};return U.createElement(zt,ud({className:"recharts-line-dots",key:"dots"},j),g)}},{key:"renderCurveStatically",value:function(r,a,i,o){var c=this.props,d=c.type,f=c.layout,h=c.connectNulls;c.ref;var p=YI(c,Due),y=Xr(Xr(Xr({},gt(p,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:a?"url(#clipPath-".concat(i,")"):null,points:r},o),{},{type:d,layout:f,connectNulls:h});return U.createElement(tm,ud({},y,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,a){var i=this,o=this.props,c=o.points,d=o.strokeDasharray,f=o.isAnimationActive,h=o.animationBegin,p=o.animationDuration,y=o.animationEasing,g=o.animationId,j=o.animateNewValues,b=o.width,x=o.height,S=this.state,N=S.prevPoints,C=S.totalLength;return U.createElement(ys,{begin:h,duration:p,isActive:f,easing:y,from:{t:0},to:{t:1},key:"line-".concat(g),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(E){var _=E.t;if(N){var k=N.length/c.length,O=c.map(function($,Y){var H=Math.floor(Y*k);if(N[H]){var K=N[H],J=ea(K.x,$.x),Q=ea(K.y,$.y);return Xr(Xr({},$),{},{x:J(_),y:Q(_)})}if(j){var D=ea(b*2,$.x),B=ea(x/2,$.y);return Xr(Xr({},$),{},{x:D(_),y:B(_)})}return Xr(Xr({},$),{},{x:$.x,y:$.y})});return i.renderCurveStatically(O,r,a)}var R=ea(0,C),T=R(_),F;if(d){var L="".concat(d).split(/[,\s]+/gim).map(function($){return parseFloat($)});F=i.getStrokeDasharray(T,C,L)}else F=i.generateSimpleStrokeDasharray(C,T);return i.renderCurveStatically(c,r,a,{strokeDasharray:F})})}},{key:"renderCurve",value:function(r,a){var i=this.props,o=i.points,c=i.isAnimationActive,d=this.state,f=d.prevPoints,h=d.totalLength;return c&&o&&o.length&&(!f&&h>0||!Sf(f,o))?this.renderCurveWithAnimation(r,a):this.renderCurveStatically(o,r,a)}},{key:"render",value:function(){var r,a=this.props,i=a.hide,o=a.dot,c=a.points,d=a.className,f=a.xAxis,h=a.yAxis,p=a.top,y=a.left,g=a.width,j=a.height,b=a.isAnimationActive,x=a.id;if(i||!c||!c.length)return null;var S=this.state.isAnimationFinished,N=c.length===1,C=At("recharts-line",d),E=f&&f.allowDataOverflow,_=h&&h.allowDataOverflow,k=E||_,O=Ct(x)?this.id:x,R=(r=gt(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},T=R.r,F=T===void 0?3:T,L=R.strokeWidth,$=L===void 0?2:L,Y=BY(o)?o:{},H=Y.clipDot,K=H===void 0?!0:H,J=F*2+$;return U.createElement(zt,{className:C},E||_?U.createElement("defs",null,U.createElement("clipPath",{id:"clipPath-".concat(O)},U.createElement("rect",{x:E?y:y-g/2,y:_?p:p-j/2,width:E?g:g*2,height:_?j:j*2})),!K&&U.createElement("clipPath",{id:"clipPath-dots-".concat(O)},U.createElement("rect",{x:y-J/2,y:p-J/2,width:g+J,height:j+J}))):null,!N&&this.renderCurve(k,O),this.renderErrorBar(k,O),(N||o)&&this.renderDots(k,K,O),(!b||S)&&Gs.renderCallByParent(this.props,c))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:a.curPoints}:r.points!==a.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,a){for(var i=r.length%2!==0?[].concat(Tl(r),[0]):r,o=[],c=0;c<a;++c)o=[].concat(Tl(o),Tl(i));return o}},{key:"renderDotItem",value:function(r,a){var i;if(U.isValidElement(r))i=U.cloneElement(r,a);else if(jt(r))i=r(a);else{var o=a.key,c=YI(a,Lue),d=At("recharts-line-dot",typeof r!="boolean"?r.className:"");i=U.createElement(Tv,ud({key:o},c,{className:d}))}return i}}])})(v.PureComponent);za(Lo,"displayName","Line");za(Lo,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!Ko.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});za(Lo,"getComposedData",function(e){var t=e.props,n=e.xAxis,r=e.yAxis,a=e.xAxisTicks,i=e.yAxisTicks,o=e.dataKey,c=e.bandSize,d=e.displayedData,f=e.offset,h=t.layout,p=d.map(function(y,g){var j=qn(y,o);return h==="horizontal"?{x:a2({axis:n,ticks:a,bandSize:c,entry:y,index:g}),y:Ct(j)?null:r.scale(j),value:j,payload:y}:{x:Ct(j)?null:n.scale(j),y:a2({axis:r,ticks:i,bandSize:c,entry:y,index:g}),value:j,payload:y}});return Xr({points:p,layout:h},f)});function kc(e){"@babel/helpers - typeof";return kc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kc(e)}function Que(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jue(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,L4(r.key),r)}}function Zue(e,t,n){return t&&Jue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ede(e,t,n){return t=Sm(t),tde(e,$4()?Reflect.construct(t,n||[],Sm(e).constructor):t.apply(e,n))}function tde(e,t){if(t&&(kc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nde(e)}function nde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($4=function(){return!!e})()}function Sm(e){return Sm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Sm(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&&oS(e,t)}function oS(e,t){return oS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},oS(e,t)}function D4(e,t,n){return t=L4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L4(e){var t=ade(e,"string");return kc(t)=="symbol"?t:t+""}function ade(e,t){if(kc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(kc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function lS(){return lS=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},lS.apply(this,arguments)}function sde(e){var t=e.xAxisId,n=S4(),r=N4(),a=w4(t);return a==null?null:v.createElement(Vv,lS({},a,{className:At("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return Ao(o,!0)}}))}var Wi=(function(e){function t(){return Que(this,t),ede(this,t,arguments)}return rde(t,e),Zue(t,[{key:"render",value:function(){return v.createElement(sde,this.props)}}])})(v.Component);D4(Wi,"displayName","XAxis");D4(Wi,"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 Oc(e){"@babel/helpers - typeof";return Oc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oc(e)}function ide(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ode(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 lde(e,t,n){return t&&ode(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function cde(e,t,n){return t=Nm(t),ude(e,F4()?Reflect.construct(t,n||[],Nm(e).constructor):t.apply(e,n))}function ude(e,t){if(t&&(Oc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dde(e)}function dde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function F4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(F4=function(){return!!e})()}function Nm(e){return Nm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Nm(e)}function fde(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cS(e,t)}function cS(e,t){return cS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},cS(e,t)}function B4(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=pde(e,"string");return Oc(t)=="symbol"?t:t+""}function pde(e,t){if(Oc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Oc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function uS(){return uS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uS.apply(this,arguments)}var hde=function(t){var n=t.yAxisId,r=S4(),a=N4(),i=j4(n);return i==null?null:v.createElement(Vv,uS({},i,{className:At("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:a},ticksGenerator:function(c){return Ao(c,!0)}}))},Vi=(function(e){function t(){return ide(this,t),cde(this,t,arguments)}return fde(t,e),lde(t,[{key:"render",value:function(){return v.createElement(hde,this.props)}}])})(v.Component);B4(Vi,"displayName","YAxis");B4(Vi,"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 JI(e){return yde(e)||gde(e)||vde(e)||mde()}function mde(){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 vde(e,t){if(e){if(typeof e=="string")return dS(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 dS(e,t)}}function gde(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function yde(e){if(Array.isArray(e))return dS(e)}function dS(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 fS=function(t,n,r,a,i){var o=sa(t,sC),c=sa(t,Uv),d=[].concat(JI(o),JI(c)),f=sa(t,Wv),h="".concat(a,"Id"),p=a[0],y=n;if(d.length&&(y=d.reduce(function(b,x){if(x.props[h]===r&&hs(x.props,"extendDomain")&&Ue(x.props[p])){var S=x.props[p];return[Math.min(b[0],S),Math.max(b[1],S)]}return b},y)),f.length){var g="".concat(p,"1"),j="".concat(p,"2");y=f.reduce(function(b,x){if(x.props[h]===r&&hs(x.props,"extendDomain")&&Ue(x.props[g])&&Ue(x.props[j])){var S=x.props[g],N=x.props[j];return[Math.min(b[0],S,N),Math.max(b[1],S,N)]}return b},y)}return i&&i.length&&(y=i.reduce(function(b,x){return Ue(x)?[Math.min(b[0],x),Math.max(b[1],x)]:b},y)),y},m1={exports:{}},ZI;function xde(){return ZI||(ZI=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function a(d,f,h){this.fn=d,this.context=f,this.once=h||!1}function i(d,f,h,p,y){if(typeof h!="function")throw new TypeError("The listener must be a function");var g=new a(h,p||d,y),j=n?n+f:f;return d._events[j]?d._events[j].fn?d._events[j]=[d._events[j],g]:d._events[j].push(g):(d._events[j]=g,d._eventsCount++),d}function o(d,f){--d._eventsCount===0?d._events=new r:delete d._events[f]}function c(){this._events=new r,this._eventsCount=0}c.prototype.eventNames=function(){var f=[],h,p;if(this._eventsCount===0)return f;for(p in h=this._events)t.call(h,p)&&f.push(n?p.slice(1):p);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(h)):f},c.prototype.listeners=function(f){var h=n?n+f:f,p=this._events[h];if(!p)return[];if(p.fn)return[p.fn];for(var y=0,g=p.length,j=new Array(g);y<g;y++)j[y]=p[y].fn;return j},c.prototype.listenerCount=function(f){var h=n?n+f:f,p=this._events[h];return p?p.fn?1:p.length:0},c.prototype.emit=function(f,h,p,y,g,j){var b=n?n+f:f;if(!this._events[b])return!1;var x=this._events[b],S=arguments.length,N,C;if(x.fn){switch(x.once&&this.removeListener(f,x.fn,void 0,!0),S){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,h),!0;case 3:return x.fn.call(x.context,h,p),!0;case 4:return x.fn.call(x.context,h,p,y),!0;case 5:return x.fn.call(x.context,h,p,y,g),!0;case 6:return x.fn.call(x.context,h,p,y,g,j),!0}for(C=1,N=new Array(S-1);C<S;C++)N[C-1]=arguments[C];x.fn.apply(x.context,N)}else{var E=x.length,_;for(C=0;C<E;C++)switch(x[C].once&&this.removeListener(f,x[C].fn,void 0,!0),S){case 1:x[C].fn.call(x[C].context);break;case 2:x[C].fn.call(x[C].context,h);break;case 3:x[C].fn.call(x[C].context,h,p);break;case 4:x[C].fn.call(x[C].context,h,p,y);break;default:if(!N)for(_=1,N=new Array(S-1);_<S;_++)N[_-1]=arguments[_];x[C].fn.apply(x[C].context,N)}}return!0},c.prototype.on=function(f,h,p){return i(this,f,h,p,!1)},c.prototype.once=function(f,h,p){return i(this,f,h,p,!0)},c.prototype.removeListener=function(f,h,p,y){var g=n?n+f:f;if(!this._events[g])return this;if(!h)return o(this,g),this;var j=this._events[g];if(j.fn)j.fn===h&&(!y||j.once)&&(!p||j.context===p)&&o(this,g);else{for(var b=0,x=[],S=j.length;b<S;b++)(j[b].fn!==h||y&&!j[b].once||p&&j[b].context!==p)&&x.push(j[b]);x.length?this._events[g]=x.length===1?x[0]:x:o(this,g)}return this},c.prototype.removeAllListeners=function(f){var h;return f?(h=n?n+f:f,this._events[h]&&o(this,h)):(this._events=new r,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c})(m1)),m1.exports}var bde=xde();const wde=Yt(bde);var v1=new wde,g1="recharts.syncMouseEvents";function Jd(e){"@babel/helpers - typeof";return Jd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jd(e)}function jde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sde(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,U4(r.key),r)}}function Nde(e,t,n){return t&&Sde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function y1(e,t,n){return t=U4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U4(e){var t=Cde(e,"string");return Jd(t)=="symbol"?t:t+""}function Cde(e,t){if(Jd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Jd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Ade=(function(){function e(){jde(this,e),y1(this,"activeIndex",0),y1(this,"coordinateList",[]),y1(this,"layout","horizontal")}return Nde(e,[{key:"setDetails",value:function(n){var r,a=n.coordinateList,i=a===void 0?null:a,o=n.container,c=o===void 0?null:o,d=n.layout,f=d===void 0?null:d,h=n.offset,p=h===void 0?null:h,y=n.mouseHandlerCallback,g=y===void 0?null:y;this.coordinateList=(r=i??this.coordinateList)!==null&&r!==void 0?r:[],this.container=c??this.container,this.layout=f??this.layout,this.offset=p??this.offset,this.mouseHandlerCallback=g??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var a=this.container.getBoundingClientRect(),i=a.x,o=a.y,c=a.height,d=this.coordinateList[this.activeIndex].coordinate,f=((n=window)===null||n===void 0?void 0:n.scrollX)||0,h=((r=window)===null||r===void 0?void 0:r.scrollY)||0,p=i+d+f,y=o+this.offset.top+c/2+h;this.mouseHandlerCallback({pageX:p,pageY:y})}}}])})();function _de(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e?.[0],a=e?.[1];if(r&&a&&Ue(r)&&Ue(a))return!0}return!1}function Ede(e,t,n,r){var a=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-a:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-a,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function q4(e){var t=e.cx,n=e.cy,r=e.radius,a=e.startAngle,i=e.endAngle,o=dn(t,n,r,a),c=dn(t,n,r,i);return{points:[o,c],cx:t,cy:n,radius:r,startAngle:a,endAngle:i}}function Pde(e,t,n){var r,a,i,o;if(e==="horizontal")r=t.x,i=r,a=n.top,o=n.top+n.height;else if(e==="vertical")a=t.y,o=a,r=n.left,i=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var c=t.cx,d=t.cy,f=t.innerRadius,h=t.outerRadius,p=t.angle,y=dn(c,d,f,p),g=dn(c,d,h,p);r=y.x,a=y.y,i=g.x,o=g.y}else return q4(t);return[{x:r,y:a},{x:i,y:o}]}function Zd(e){"@babel/helpers - typeof";return Zd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zd(e)}function eM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function rh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eM(Object(n),!0).forEach(function(r){kde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kde(e,t,n){return t=Ode(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ode(e){var t=Rde(e,"string");return Zd(t)=="symbol"?t:t+""}function Rde(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 Tde(e){var t,n,r=e.element,a=e.tooltipEventType,i=e.isActive,o=e.activeCoordinate,c=e.activePayload,d=e.offset,f=e.activeTooltipIndex,h=e.tooltipAxisBandSize,p=e.layout,y=e.chartName,g=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!g||!i||!o||y!=="ScatterChart"&&a!=="axis")return null;var j,b=tm;if(y==="ScatterChart")j=o,b=voe;else if(y==="BarChart")j=Ede(p,o,d,h),b=nC;else if(p==="radial"){var x=q4(o),S=x.cx,N=x.cy,C=x.radius,E=x.startAngle,_=x.endAngle;j={cx:S,cy:N,startAngle:E,endAngle:_,innerRadius:C,outerRadius:C},b=qL}else j={points:Pde(p,o,d)},b=tm;var k=rh(rh(rh(rh({stroke:"#ccc",pointerEvents:"none"},d),j),gt(g,!1)),{},{payload:c,payloadIndex:f,className:At("recharts-tooltip-cursor",g.className)});return v.isValidElement(g)?v.cloneElement(g,k):v.createElement(b,k)}var Ide=["item"],Mde=["children","className","width","height","style","compact","title","desc"];function Rc(e){"@babel/helpers - typeof";return Rc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rc(e)}function Vl(){return Vl=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},Vl.apply(this,arguments)}function tM(e,t){return Lde(e)||Dde(e,t)||V4(e,t)||$de()}function $de(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
119
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dde(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function Lde(e){if(Array.isArray(e))return e}function nM(e,t){if(e==null)return{};var n=Fde(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Fde(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 Bde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zde(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,H4(r.key),r)}}function Ude(e,t,n){return t&&zde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function qde(e,t,n){return t=Cm(t),Wde(e,W4()?Reflect.construct(t,n||[],Cm(e).constructor):t.apply(e,n))}function Wde(e,t){if(t&&(Rc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Vde(e)}function Vde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function W4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(W4=function(){return!!e})()}function Cm(e){return Cm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Cm(e)}function Hde(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&&pS(e,t)}function pS(e,t){return pS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},pS(e,t)}function Tc(e){return Yde(e)||Gde(e)||V4(e)||Kde()}function Kde(){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 V4(e,t){if(e){if(typeof e=="string")return hS(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 hS(e,t)}}function Gde(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Yde(e){if(Array.isArray(e))return hS(e)}function hS(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 rM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function we(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){yt(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 yt(e,t,n){return t=H4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H4(e){var t=Xde(e,"string");return Rc(t)=="symbol"?t:t+""}function Xde(e,t){if(Rc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Rc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Qde={xAxis:["bottom","top"],yAxis:["left","right"]},Jde={width:"100%",height:"100%"},K4={x:0,y:0};function ah(e){return e}var Zde=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},efe=function(t,n,r,a){var i=n.find(function(h){return h&&h.index===r});if(i){if(t==="horizontal")return{x:i.coordinate,y:a.y};if(t==="vertical")return{x:a.x,y:i.coordinate};if(t==="centric"){var o=i.coordinate,c=a.radius;return we(we(we({},a),dn(a.cx,a.cy,c,o)),{},{angle:o,radius:c})}var d=i.coordinate,f=a.angle;return we(we(we({},a),dn(a.cx,a.cy,d,f)),{},{angle:f,radius:d})}return K4},Hv=function(t,n){var r=n.graphicalItems,a=n.dataStartIndex,i=n.dataEndIndex,o=(r??[]).reduce(function(c,d){var f=d.props.data;return f&&f.length?[].concat(Tc(c),Tc(f)):c},[]);return o.length>0?o:t&&t.length&&Ue(a)&&Ue(i)?t.slice(a,i+1):[]};function G4(e){return e==="number"?[0,"auto"]:void 0}var mS=function(t,n,r,a){var i=t.graphicalItems,o=t.tooltipAxis,c=Hv(n,t);return r<0||!i||!i.length||r>=c.length?null:i.reduce(function(d,f){var h,p=(h=f.props.data)!==null&&h!==void 0?h:n;p&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(p=p.slice(t.dataStartIndex,t.dataEndIndex+1));var y;if(o.dataKey&&!o.allowDuplicatedCategory){var g=p===void 0?c:p;y=Ch(g,o.dataKey,a)}else y=p&&p[r]||c[r];return y?[].concat(Tc(d),[DL(f,y)]):d},[])},aM=function(t,n,r,a){var i=a||{x:t.chartX,y:t.chartY},o=Zde(i,r),c=t.orderedTooltipTicks,d=t.tooltipAxis,f=t.tooltipTicks,h=Dre(o,c,f,d);if(h>=0&&f){var p=f[h]&&f[h].value,y=mS(t,n,h,p),g=efe(r,c,h,i);return{activeTooltipIndex:h,activeLabel:p,activePayload:y,activeCoordinate:g}}return null},tfe=function(t,n){var r=n.axes,a=n.graphicalItems,i=n.axisType,o=n.axisIdKey,c=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,h=t.layout,p=t.children,y=t.stackOffset,g=RL(h,i);return r.reduce(function(j,b){var x,S=b.type.defaultProps!==void 0?we(we({},b.type.defaultProps),b.props):b.props,N=S.type,C=S.dataKey,E=S.allowDataOverflow,_=S.allowDuplicatedCategory,k=S.scale,O=S.ticks,R=S.includeHidden,T=S[o];if(j[T])return j;var F=Hv(t.data,{graphicalItems:a.filter(function(M){var re,te=o in M.props?M.props[o]:(re=M.type.defaultProps)===null||re===void 0?void 0:re[o];return te===T}),dataStartIndex:d,dataEndIndex:f}),L=F.length,$,Y,H;_de(S.domain,E,N)&&($=Pj(S.domain,null,E),g&&(N==="number"||k!=="auto")&&(H=id(F,C,"category")));var K=G4(N);if(!$||$.length===0){var J,Q=(J=S.domain)!==null&&J!==void 0?J:K;if(C){if($=id(F,C,N),N==="category"&&g){var D=kY($);_&&D?(Y=$,$=fm(0,L)):_||($=l2(Q,$,b).reduce(function(M,re){return M.indexOf(re)>=0?M:[].concat(Tc(M),[re])},[]))}else if(N==="category")_?$=$.filter(function(M){return M!==""&&!Ct(M)}):$=l2(Q,$,b).reduce(function(M,re){return M.indexOf(re)>=0||re===""||Ct(re)?M:[].concat(Tc(M),[re])},[]);else if(N==="number"){var B=Ure(F,a.filter(function(M){var re,te,G=o in M.props?M.props[o]:(re=M.type.defaultProps)===null||re===void 0?void 0:re[o],de="hide"in M.props?M.props.hide:(te=M.type.defaultProps)===null||te===void 0?void 0:te.hide;return G===T&&(R||!de)}),C,i,h);B&&($=B)}g&&(N==="number"||k!=="auto")&&(H=id(F,C,"category"))}else g?$=fm(0,L):c&&c[T]&&c[T].hasStack&&N==="number"?$=y==="expand"?[0,1]:$L(c[T].stackGroups,d,f):$=OL(F,a.filter(function(M){var re=o in M.props?M.props[o]:M.type.defaultProps[o],te="hide"in M.props?M.props.hide:M.type.defaultProps.hide;return re===T&&(R||!te)}),N,h,!0);if(N==="number")$=fS(p,$,T,i,O),Q&&($=Pj(Q,$,E));else if(N==="category"&&Q){var Z=Q,z=$.every(function(M){return Z.indexOf(M)>=0});z&&($=Z)}}return we(we({},j),{},yt({},T,we(we({},S),{},{axisType:i,domain:$,categoricalDomain:H,duplicateDomain:Y,originalDomain:(x=S.domain)!==null&&x!==void 0?x:K,isCategorical:g,layout:h})))},{})},nfe=function(t,n){var r=n.graphicalItems,a=n.Axis,i=n.axisType,o=n.axisIdKey,c=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,h=t.layout,p=t.children,y=Hv(t.data,{graphicalItems:r,dataStartIndex:d,dataEndIndex:f}),g=y.length,j=RL(h,i),b=-1;return r.reduce(function(x,S){var N=S.type.defaultProps!==void 0?we(we({},S.type.defaultProps),S.props):S.props,C=N[o],E=G4("number");if(!x[C]){b++;var _;return j?_=fm(0,g):c&&c[C]&&c[C].hasStack?(_=$L(c[C].stackGroups,d,f),_=fS(p,_,C,i)):(_=Pj(E,OL(y,r.filter(function(k){var O,R,T=o in k.props?k.props[o]:(O=k.type.defaultProps)===null||O===void 0?void 0:O[o],F="hide"in k.props?k.props.hide:(R=k.type.defaultProps)===null||R===void 0?void 0:R.hide;return T===C&&!F}),"number",h),a.defaultProps.allowDataOverflow),_=fS(p,_,C,i)),we(we({},x),{},yt({},C,we(we({axisType:i},a.defaultProps),{},{hide:!0,orientation:aa(Qde,"".concat(i,".").concat(b%2),null),domain:_,originalDomain:E,isCategorical:j,layout:h})))}return x},{})},rfe=function(t,n){var r=n.axisType,a=r===void 0?"xAxis":r,i=n.AxisComp,o=n.graphicalItems,c=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,h=t.children,p="".concat(a,"Id"),y=sa(h,i),g={};return y&&y.length?g=tfe(t,{axes:y,graphicalItems:o,axisType:a,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f}):o&&o.length&&(g=nfe(t,{Axis:i,graphicalItems:o,axisType:a,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f})),g},afe=function(t){var n=Dl(t),r=Ao(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:PN(r,function(a){return a.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Jh(n,r)}},sM=function(t){var n=t.children,r=t.defaultShowTooltip,a=Jr(n,Sc),i=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(i=a.props.startIndex),a.props.endIndex>=0&&(o=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!r}},sfe=function(t){return!t||!t.length?!1:t.some(function(n){var r=Vs(n&&n.type);return r&&r.indexOf("Bar")>=0})},iM=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"}},ife=function(t,n){var r=t.props,a=t.graphicalItems,i=t.xAxisMap,o=i===void 0?{}:i,c=t.yAxisMap,d=c===void 0?{}:c,f=r.width,h=r.height,p=r.children,y=r.margin||{},g=Jr(p,Sc),j=Jr(p,_o),b=Object.keys(d).reduce(function(_,k){var O=d[k],R=O.orientation;return!O.mirror&&!O.hide?we(we({},_),{},yt({},R,_[R]+O.width)):_},{left:y.left||0,right:y.right||0}),x=Object.keys(o).reduce(function(_,k){var O=o[k],R=O.orientation;return!O.mirror&&!O.hide?we(we({},_),{},yt({},R,aa(_,"".concat(R))+O.height)):_},{top:y.top||0,bottom:y.bottom||0}),S=we(we({},x),b),N=S.bottom;g&&(S.bottom+=g.props.height||Sc.defaultProps.height),j&&n&&(S=Bre(S,a,r,n));var C=f-S.left-S.right,E=h-S.top-S.bottom;return we(we({brushBottom:N},S),{},{width:Math.max(C,0),height:Math.max(E,0)})},ofe=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},oC=function(t){var n=t.chartName,r=t.GraphicalChild,a=t.defaultTooltipEventType,i=a===void 0?"axis":a,o=t.validateTooltipEventTypes,c=o===void 0?["axis"]:o,d=t.axisComponents,f=t.legendContent,h=t.formatAxisMap,p=t.defaultProps,y=function(S,N){var C=N.graphicalItems,E=N.stackGroups,_=N.offset,k=N.updateId,O=N.dataStartIndex,R=N.dataEndIndex,T=S.barSize,F=S.layout,L=S.barGap,$=S.barCategoryGap,Y=S.maxBarSize,H=iM(F),K=H.numericAxisName,J=H.cateAxisName,Q=sfe(C),D=[];return C.forEach(function(B,Z){var z=Hv(S.data,{graphicalItems:[B],dataStartIndex:O,dataEndIndex:R}),M=B.type.defaultProps!==void 0?we(we({},B.type.defaultProps),B.props):B.props,re=M.dataKey,te=M.maxBarSize,G=M["".concat(K,"Id")],de=M["".concat(J,"Id")],ce={},he=d.reduce(function(Re,Xe){var It=N["".concat(Xe.axisType,"Map")],qt=M["".concat(Xe.axisType,"Id")];It&&It[qt]||Xe.axisType==="zAxis"||Do();var ee=It[qt];return we(we({},Re),{},yt(yt({},Xe.axisType,ee),"".concat(Xe.axisType,"Ticks"),Ao(ee)))},ce),ie=he[J],ue=he["".concat(J,"Ticks")],Ae=E&&E[G]&&E[G].hasStack&&Qre(B,E[G].stackGroups),ae=Vs(B.type).indexOf("Bar")>=0,$e=Jh(ie,ue),W=[],ve=Q&&Lre({barSize:T,stackGroups:E,totalSize:ofe(he,J)});if(ae){var oe,be,Ie=Ct(te)?Y:te,Ye=(oe=(be=Jh(ie,ue,!0))!==null&&be!==void 0?be:Ie)!==null&&oe!==void 0?oe:0;W=Fre({barGap:L,barCategoryGap:$,bandSize:Ye!==$e?Ye:$e,sizeList:ve[de],maxBarSize:Ie}),Ye!==$e&&(W=W.map(function(Re){return we(we({},Re),{},{position:we(we({},Re.position),{},{offset:Re.position.offset-Ye/2})})}))}var je=B&&B.type&&B.type.getComposedData;je&&D.push({props:we(we({},je(we(we({},he),{},{displayedData:z,props:S,dataKey:re,item:B,bandSize:$e,barPosition:W,offset:_,stackedData:Ae,layout:F,dataStartIndex:O,dataEndIndex:R}))),{},yt(yt(yt({key:B.key||"item-".concat(Z)},K,he[K]),J,he[J]),"animationId",k)),childIndex:qY(B,S.children),item:B})}),D},g=function(S,N){var C=S.props,E=S.dataStartIndex,_=S.dataEndIndex,k=S.updateId;if(!jk({props:C}))return null;var O=C.children,R=C.layout,T=C.stackOffset,F=C.data,L=C.reverseStackOrder,$=iM(R),Y=$.numericAxisName,H=$.cateAxisName,K=sa(O,r),J=Yre(F,K,"".concat(Y,"Id"),"".concat(H,"Id"),T,L),Q=d.reduce(function(M,re){var te="".concat(re.axisType,"Map");return we(we({},M),{},yt({},te,rfe(C,we(we({},re),{},{graphicalItems:K,stackGroups:re.axisType===Y&&J,dataStartIndex:E,dataEndIndex:_}))))},{}),D=ife(we(we({},Q),{},{props:C,graphicalItems:K}),N?.legendBBox);Object.keys(Q).forEach(function(M){Q[M]=h(C,Q[M],D,M.replace("Map",""),n)});var B=Q["".concat(H,"Map")],Z=afe(B),z=y(C,we(we({},Q),{},{dataStartIndex:E,dataEndIndex:_,updateId:k,graphicalItems:K,stackGroups:J,offset:D}));return we(we({formattedGraphicalItems:z,graphicalItems:K,offset:D,stackGroups:J},Z),Q)},j=(function(x){function S(N){var C,E,_;return Bde(this,S),_=qde(this,S,[N]),yt(_,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),yt(_,"accessibilityManager",new Ade),yt(_,"handleLegendBBoxUpdate",function(k){if(k){var O=_.state,R=O.dataStartIndex,T=O.dataEndIndex,F=O.updateId;_.setState(we({legendBBox:k},g({props:_.props,dataStartIndex:R,dataEndIndex:T,updateId:F},we(we({},_.state),{},{legendBBox:k}))))}}),yt(_,"handleReceiveSyncEvent",function(k,O,R){if(_.props.syncId===k){if(R===_.eventEmitterSymbol&&typeof _.props.syncMethod!="function")return;_.applySyncEvent(O)}}),yt(_,"handleBrushChange",function(k){var O=k.startIndex,R=k.endIndex;if(O!==_.state.dataStartIndex||R!==_.state.dataEndIndex){var T=_.state.updateId;_.setState(function(){return we({dataStartIndex:O,dataEndIndex:R},g({props:_.props,dataStartIndex:O,dataEndIndex:R,updateId:T},_.state))}),_.triggerSyncEvent({dataStartIndex:O,dataEndIndex:R})}}),yt(_,"handleMouseEnter",function(k){var O=_.getMouseInfo(k);if(O){var R=we(we({},O),{},{isTooltipActive:!0});_.setState(R),_.triggerSyncEvent(R);var T=_.props.onMouseEnter;jt(T)&&T(R,k)}}),yt(_,"triggeredAfterMouseMove",function(k){var O=_.getMouseInfo(k),R=O?we(we({},O),{},{isTooltipActive:!0}):{isTooltipActive:!1};_.setState(R),_.triggerSyncEvent(R);var T=_.props.onMouseMove;jt(T)&&T(R,k)}),yt(_,"handleItemMouseEnter",function(k){_.setState(function(){return{isTooltipActive:!0,activeItem:k,activePayload:k.tooltipPayload,activeCoordinate:k.tooltipPosition||{x:k.cx,y:k.cy}}})}),yt(_,"handleItemMouseLeave",function(){_.setState(function(){return{isTooltipActive:!1}})}),yt(_,"handleMouseMove",function(k){k.persist(),_.throttleTriggeredAfterMouseMove(k)}),yt(_,"handleMouseLeave",function(k){_.throttleTriggeredAfterMouseMove.cancel();var O={isTooltipActive:!1};_.setState(O),_.triggerSyncEvent(O);var R=_.props.onMouseLeave;jt(R)&&R(O,k)}),yt(_,"handleOuterEvent",function(k){var O=UY(k),R=aa(_.props,"".concat(O));if(O&&jt(R)){var T,F;/.*touch.*/i.test(O)?F=_.getMouseInfo(k.changedTouches[0]):F=_.getMouseInfo(k),R((T=F)!==null&&T!==void 0?T:{},k)}}),yt(_,"handleClick",function(k){var O=_.getMouseInfo(k);if(O){var R=we(we({},O),{},{isTooltipActive:!0});_.setState(R),_.triggerSyncEvent(R);var T=_.props.onClick;jt(T)&&T(R,k)}}),yt(_,"handleMouseDown",function(k){var O=_.props.onMouseDown;if(jt(O)){var R=_.getMouseInfo(k);O(R,k)}}),yt(_,"handleMouseUp",function(k){var O=_.props.onMouseUp;if(jt(O)){var R=_.getMouseInfo(k);O(R,k)}}),yt(_,"handleTouchMove",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&_.throttleTriggeredAfterMouseMove(k.changedTouches[0])}),yt(_,"handleTouchStart",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&_.handleMouseDown(k.changedTouches[0])}),yt(_,"handleTouchEnd",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&_.handleMouseUp(k.changedTouches[0])}),yt(_,"handleDoubleClick",function(k){var O=_.props.onDoubleClick;if(jt(O)){var R=_.getMouseInfo(k);O(R,k)}}),yt(_,"handleContextMenu",function(k){var O=_.props.onContextMenu;if(jt(O)){var R=_.getMouseInfo(k);O(R,k)}}),yt(_,"triggerSyncEvent",function(k){_.props.syncId!==void 0&&v1.emit(g1,_.props.syncId,k,_.eventEmitterSymbol)}),yt(_,"applySyncEvent",function(k){var O=_.props,R=O.layout,T=O.syncMethod,F=_.state.updateId,L=k.dataStartIndex,$=k.dataEndIndex;if(k.dataStartIndex!==void 0||k.dataEndIndex!==void 0)_.setState(we({dataStartIndex:L,dataEndIndex:$},g({props:_.props,dataStartIndex:L,dataEndIndex:$,updateId:F},_.state)));else if(k.activeTooltipIndex!==void 0){var Y=k.chartX,H=k.chartY,K=k.activeTooltipIndex,J=_.state,Q=J.offset,D=J.tooltipTicks;if(!Q)return;if(typeof T=="function")K=T(D,k);else if(T==="value"){K=-1;for(var B=0;B<D.length;B++)if(D[B].value===k.activeLabel){K=B;break}}var Z=we(we({},Q),{},{x:Q.left,y:Q.top}),z=Math.min(Y,Z.x+Z.width),M=Math.min(H,Z.y+Z.height),re=D[K]&&D[K].value,te=mS(_.state,_.props.data,K),G=D[K]?{x:R==="horizontal"?D[K].coordinate:z,y:R==="horizontal"?M:D[K].coordinate}:K4;_.setState(we(we({},k),{},{activeLabel:re,activeCoordinate:G,activePayload:te,activeTooltipIndex:K}))}else _.setState(k)}),yt(_,"renderCursor",function(k){var O,R=_.state,T=R.isTooltipActive,F=R.activeCoordinate,L=R.activePayload,$=R.offset,Y=R.activeTooltipIndex,H=R.tooltipAxisBandSize,K=_.getTooltipEventType(),J=(O=k.props.active)!==null&&O!==void 0?O:T,Q=_.props.layout,D=k.key||"_recharts-cursor";return U.createElement(Tde,{key:D,activeCoordinate:F,activePayload:L,activeTooltipIndex:Y,chartName:n,element:k,isActive:J,layout:Q,offset:$,tooltipAxisBandSize:H,tooltipEventType:K})}),yt(_,"renderPolarAxis",function(k,O,R){var T=aa(k,"type.axisType"),F=aa(_.state,"".concat(T,"Map")),L=k.type.defaultProps,$=L!==void 0?we(we({},L),k.props):k.props,Y=F&&F[$["".concat(T,"Id")]];return v.cloneElement(k,we(we({},Y),{},{className:At(T,Y.className),key:k.key||"".concat(O,"-").concat(R),ticks:Ao(Y,!0)}))}),yt(_,"renderPolarGrid",function(k){var O=k.props,R=O.radialLines,T=O.polarAngles,F=O.polarRadius,L=_.state,$=L.radiusAxisMap,Y=L.angleAxisMap,H=Dl($),K=Dl(Y),J=K.cx,Q=K.cy,D=K.innerRadius,B=K.outerRadius;return v.cloneElement(k,{polarAngles:Array.isArray(T)?T:Ao(K,!0).map(function(Z){return Z.coordinate}),polarRadius:Array.isArray(F)?F:Ao(H,!0).map(function(Z){return Z.coordinate}),cx:J,cy:Q,innerRadius:D,outerRadius:B,key:k.key||"polar-grid",radialLines:R})}),yt(_,"renderLegend",function(){var k=_.state.formattedGraphicalItems,O=_.props,R=O.children,T=O.width,F=O.height,L=_.props.margin||{},$=T-(L.left||0)-(L.right||0),Y=PL({children:R,formattedGraphicalItems:k,legendWidth:$,legendContent:f});if(!Y)return null;var H=Y.item,K=nM(Y,Ide);return v.cloneElement(H,we(we({},K),{},{chartWidth:T,chartHeight:F,margin:L,onBBoxUpdate:_.handleLegendBBoxUpdate}))}),yt(_,"renderTooltip",function(){var k,O=_.props,R=O.children,T=O.accessibilityLayer,F=Jr(R,Mr);if(!F)return null;var L=_.state,$=L.isTooltipActive,Y=L.activeCoordinate,H=L.activePayload,K=L.activeLabel,J=L.offset,Q=(k=F.props.active)!==null&&k!==void 0?k:$;return v.cloneElement(F,{viewBox:we(we({},J),{},{x:J.left,y:J.top}),active:Q,label:K,payload:Q?H:[],coordinate:Y,accessibilityLayer:T})}),yt(_,"renderBrush",function(k){var O=_.props,R=O.margin,T=O.data,F=_.state,L=F.offset,$=F.dataStartIndex,Y=F.dataEndIndex,H=F.updateId;return v.cloneElement(k,{key:k.key||"_recharts-brush",onChange:Zp(_.handleBrushChange,k.props.onChange),data:T,x:Ue(k.props.x)?k.props.x:L.left,y:Ue(k.props.y)?k.props.y:L.top+L.height+L.brushBottom-(R.bottom||0),width:Ue(k.props.width)?k.props.width:L.width,startIndex:$,endIndex:Y,updateId:"brush-".concat(H)})}),yt(_,"renderReferenceElement",function(k,O,R){if(!k)return null;var T=_,F=T.clipPathId,L=_.state,$=L.xAxisMap,Y=L.yAxisMap,H=L.offset,K=k.type.defaultProps||{},J=k.props,Q=J.xAxisId,D=Q===void 0?K.xAxisId:Q,B=J.yAxisId,Z=B===void 0?K.yAxisId:B;return v.cloneElement(k,{key:k.key||"".concat(O,"-").concat(R),xAxis:$[D],yAxis:Y[Z],viewBox:{x:H.left,y:H.top,width:H.width,height:H.height},clipPathId:F})}),yt(_,"renderActivePoints",function(k){var O=k.item,R=k.activePoint,T=k.basePoint,F=k.childIndex,L=k.isRange,$=[],Y=O.props.key,H=O.item.type.defaultProps!==void 0?we(we({},O.item.type.defaultProps),O.item.props):O.item.props,K=H.activeDot,J=H.dataKey,Q=we(we({index:F,dataKey:J,cx:R.x,cy:R.y,r:4,fill:tC(O.item),strokeWidth:2,stroke:"#fff",payload:R.payload,value:R.value},gt(K,!1)),Ah(K));return $.push(S.renderActiveDot(K,Q,"".concat(Y,"-activePoint-").concat(F))),T?$.push(S.renderActiveDot(K,we(we({},Q),{},{cx:T.x,cy:T.y}),"".concat(Y,"-basePoint-").concat(F))):L&&$.push(null),$}),yt(_,"renderGraphicChild",function(k,O,R){var T=_.filterFormatItem(k,O,R);if(!T)return null;var F=_.getTooltipEventType(),L=_.state,$=L.isTooltipActive,Y=L.tooltipAxis,H=L.activeTooltipIndex,K=L.activeLabel,J=_.props.children,Q=Jr(J,Mr),D=T.props,B=D.points,Z=D.isRange,z=D.baseLine,M=T.item.type.defaultProps!==void 0?we(we({},T.item.type.defaultProps),T.item.props):T.item.props,re=M.activeDot,te=M.hide,G=M.activeBar,de=M.activeShape,ce=!!(!te&&$&&Q&&(re||G||de)),he={};F!=="axis"&&Q&&Q.props.trigger==="click"?he={onClick:Zp(_.handleItemMouseEnter,k.props.onClick)}:F!=="axis"&&(he={onMouseLeave:Zp(_.handleItemMouseLeave,k.props.onMouseLeave),onMouseEnter:Zp(_.handleItemMouseEnter,k.props.onMouseEnter)});var ie=v.cloneElement(k,we(we({},T.props),he));function ue(Xe){return typeof Y.dataKey=="function"?Y.dataKey(Xe.payload):null}if(ce)if(H>=0){var Ae,ae;if(Y.dataKey&&!Y.allowDuplicatedCategory){var $e=typeof Y.dataKey=="function"?ue:"payload.".concat(Y.dataKey.toString());Ae=Ch(B,$e,K),ae=Z&&z&&Ch(z,$e,K)}else Ae=B?.[H],ae=Z&&z&&z[H];if(de||G){var W=k.props.activeIndex!==void 0?k.props.activeIndex:H;return[v.cloneElement(k,we(we(we({},T.props),he),{},{activeIndex:W})),null,null]}if(!Ct(Ae))return[ie].concat(Tc(_.renderActivePoints({item:T,activePoint:Ae,basePoint:ae,childIndex:H,isRange:Z})))}else{var ve,oe=(ve=_.getItemByXY(_.state.activeCoordinate))!==null&&ve!==void 0?ve:{graphicalItem:ie},be=oe.graphicalItem,Ie=be.item,Ye=Ie===void 0?k:Ie,je=be.childIndex,Re=we(we(we({},T.props),he),{},{activeIndex:je});return[v.cloneElement(Ye,Re),null,null]}return Z?[ie,null,null]:[ie,null]}),yt(_,"renderCustomized",function(k,O,R){return v.cloneElement(k,we(we({key:"recharts-customized-".concat(R)},_.props),_.state))}),yt(_,"renderMap",{CartesianGrid:{handler:ah,once:!0},ReferenceArea:{handler:_.renderReferenceElement},ReferenceLine:{handler:ah},ReferenceDot:{handler:_.renderReferenceElement},XAxis:{handler:ah},YAxis:{handler:ah},Brush:{handler:_.renderBrush,once:!0},Bar:{handler:_.renderGraphicChild},Line:{handler:_.renderGraphicChild},Area:{handler:_.renderGraphicChild},Radar:{handler:_.renderGraphicChild},RadialBar:{handler:_.renderGraphicChild},Scatter:{handler:_.renderGraphicChild},Pie:{handler:_.renderGraphicChild},Funnel:{handler:_.renderGraphicChild},Tooltip:{handler:_.renderCursor,once:!0},PolarGrid:{handler:_.renderPolarGrid,once:!0},PolarAngleAxis:{handler:_.renderPolarAxis},PolarRadiusAxis:{handler:_.renderPolarAxis},Customized:{handler:_.renderCustomized}}),_.clipPathId="".concat((C=N.id)!==null&&C!==void 0?C:Kc("recharts"),"-clip"),_.throttleTriggeredAfterMouseMove=P5(_.triggeredAfterMouseMove,(E=N.throttleDelay)!==null&&E!==void 0?E:1e3/60),_.state={},_}return Hde(S,x),Ude(S,[{key:"componentDidMount",value:function(){var C,E;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(C=this.props.margin.left)!==null&&C!==void 0?C: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 C=this.props,E=C.children,_=C.data,k=C.height,O=C.layout,R=Jr(E,Mr);if(R){var T=R.props.defaultIndex;if(!(typeof T!="number"||T<0||T>this.state.tooltipTicks.length-1)){var F=this.state.tooltipTicks[T]&&this.state.tooltipTicks[T].value,L=mS(this.state,_,T,F),$=this.state.tooltipTicks[T].coordinate,Y=(this.state.offset.top+k)/2,H=O==="horizontal",K=H?{x:$,y:Y}:{y:$,x:Y},J=this.state.formattedGraphicalItems.find(function(D){var B=D.item;return B.type.name==="Scatter"});J&&(K=we(we({},K),J.props.points[T].tooltipPosition),L=J.props.points[T].tooltipPayload);var Q={activeTooltipIndex:T,isTooltipActive:!0,activeLabel:F,activePayload:L,activeCoordinate:K};this.setState(Q),this.renderCursor(R),this.accessibilityManager.setIndex(T)}}}},{key:"getSnapshotBeforeUpdate",value:function(C,E){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==E.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==C.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==C.margin){var _,k;this.accessibilityManager.setDetails({offset:{left:(_=this.props.margin.left)!==null&&_!==void 0?_:0,top:(k=this.props.margin.top)!==null&&k!==void 0?k:0}})}return null}},{key:"componentDidUpdate",value:function(C){Q1([Jr(C.children,Mr)],[Jr(this.props.children,Mr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var C=Jr(this.props.children,Mr);if(C&&typeof C.props.shared=="boolean"){var E=C.props.shared?"axis":"item";return c.indexOf(E)>=0?E:i}return i}},{key:"getMouseInfo",value:function(C){if(!this.container)return null;var E=this.container,_=E.getBoundingClientRect(),k=PZ(_),O={chartX:Math.round(C.pageX-k.left),chartY:Math.round(C.pageY-k.top)},R=_.width/E.offsetWidth||1,T=this.inRange(O.chartX,O.chartY,R);if(!T)return null;var F=this.state,L=F.xAxisMap,$=F.yAxisMap,Y=this.getTooltipEventType(),H=aM(this.state,this.props.data,this.props.layout,T);if(Y!=="axis"&&L&&$){var K=Dl(L).scale,J=Dl($).scale,Q=K&&K.invert?K.invert(O.chartX):null,D=J&&J.invert?J.invert(O.chartY):null;return we(we({},O),{},{xValue:Q,yValue:D},H)}return H?we(we({},O),H):null}},{key:"inRange",value:function(C,E){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,k=this.props.layout,O=C/_,R=E/_;if(k==="horizontal"||k==="vertical"){var T=this.state.offset,F=O>=T.left&&O<=T.left+T.width&&R>=T.top&&R<=T.top+T.height;return F?{x:O,y:R}:null}var L=this.state,$=L.angleAxisMap,Y=L.radiusAxisMap;if($&&Y){var H=Dl($);return d2({x:O,y:R},H)}return null}},{key:"parseEventsOfWrapper",value:function(){var C=this.props.children,E=this.getTooltipEventType(),_=Jr(C,Mr),k={};_&&E==="axis"&&(_.props.trigger==="click"?k={onClick:this.handleClick}:k={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=Ah(this.props,this.handleOuterEvent);return we(we({},O),k)}},{key:"addListener",value:function(){v1.on(g1,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){v1.removeListener(g1,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(C,E,_){for(var k=this.state.formattedGraphicalItems,O=0,R=k.length;O<R;O++){var T=k[O];if(T.item===C||T.props.key===C.key||E===Vs(T.item.type)&&_===T.childIndex)return T}return null}},{key:"renderClipPath",value:function(){var C=this.clipPathId,E=this.state.offset,_=E.left,k=E.top,O=E.height,R=E.width;return U.createElement("defs",null,U.createElement("clipPath",{id:C},U.createElement("rect",{x:_,y:k,height:O,width:R})))}},{key:"getXScales",value:function(){var C=this.state.xAxisMap;return C?Object.entries(C).reduce(function(E,_){var k=tM(_,2),O=k[0],R=k[1];return we(we({},E),{},yt({},O,R.scale))},{}):null}},{key:"getYScales",value:function(){var C=this.state.yAxisMap;return C?Object.entries(C).reduce(function(E,_){var k=tM(_,2),O=k[0],R=k[1];return we(we({},E),{},yt({},O,R.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(C){var E;return(E=this.state.xAxisMap)===null||E===void 0||(E=E[C])===null||E===void 0?void 0:E.scale}},{key:"getYScaleByAxisId",value:function(C){var E;return(E=this.state.yAxisMap)===null||E===void 0||(E=E[C])===null||E===void 0?void 0:E.scale}},{key:"getItemByXY",value:function(C){var E=this.state,_=E.formattedGraphicalItems,k=E.activeItem;if(_&&_.length)for(var O=0,R=_.length;O<R;O++){var T=_[O],F=T.props,L=T.item,$=L.type.defaultProps!==void 0?we(we({},L.type.defaultProps),L.props):L.props,Y=Vs(L.type);if(Y==="Bar"){var H=(F.data||[]).find(function(D){return Xie(C,D)});if(H)return{graphicalItem:T,payload:H}}else if(Y==="RadialBar"){var K=(F.data||[]).find(function(D){return d2(C,D)});if(K)return{graphicalItem:T,payload:K}}else if(Lv(T,k)||Fv(T,k)||Kd(T,k)){var J=xle({graphicalItem:T,activeTooltipItem:k,itemData:$.data}),Q=$.activeIndex===void 0?J:$.activeIndex;return{graphicalItem:we(we({},T),{},{childIndex:Q}),payload:Kd(T,k)?$.data[J]:T.props.data[J]}}}return null}},{key:"render",value:function(){var C=this;if(!jk(this))return null;var E=this.props,_=E.children,k=E.className,O=E.width,R=E.height,T=E.style,F=E.compact,L=E.title,$=E.desc,Y=nM(E,Mde),H=gt(Y,!1);if(F)return U.createElement(LI,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},U.createElement(Z1,Vl({},H,{width:O,height:R,title:L,desc:$}),this.renderClipPath(),Nk(_,this.renderMap)));if(this.props.accessibilityLayer){var K,J;H.tabIndex=(K=this.props.tabIndex)!==null&&K!==void 0?K:0,H.role=(J=this.props.role)!==null&&J!==void 0?J:"application",H.onKeyDown=function(D){C.accessibilityManager.keyboardEvent(D)},H.onFocus=function(){C.accessibilityManager.focus()}}var Q=this.parseEventsOfWrapper();return U.createElement(LI,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},U.createElement("div",Vl({className:At("recharts-wrapper",k),style:we({position:"relative",cursor:"default",width:O,height:R},T)},Q,{ref:function(B){C.container=B}}),U.createElement(Z1,Vl({},H,{width:O,height:R,title:L,desc:$,style:Jde}),this.renderClipPath(),Nk(_,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(v.Component);yt(j,"displayName",n),yt(j,"defaultProps",we({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},p)),yt(j,"getDerivedStateFromProps",function(x,S){var N=x.dataKey,C=x.data,E=x.children,_=x.width,k=x.height,O=x.layout,R=x.stackOffset,T=x.margin,F=S.dataStartIndex,L=S.dataEndIndex;if(S.updateId===void 0){var $=sM(x);return we(we(we({},$),{},{updateId:0},g(we(we({props:x},$),{},{updateId:0}),S)),{},{prevDataKey:N,prevData:C,prevWidth:_,prevHeight:k,prevLayout:O,prevStackOffset:R,prevMargin:T,prevChildren:E})}if(N!==S.prevDataKey||C!==S.prevData||_!==S.prevWidth||k!==S.prevHeight||O!==S.prevLayout||R!==S.prevStackOffset||!Jl(T,S.prevMargin)){var Y=sM(x),H={chartX:S.chartX,chartY:S.chartY,isTooltipActive:S.isTooltipActive},K=we(we({},aM(S,C,O)),{},{updateId:S.updateId+1}),J=we(we(we({},Y),H),K);return we(we(we({},J),g(we({props:x},J),S)),{},{prevDataKey:N,prevData:C,prevWidth:_,prevHeight:k,prevLayout:O,prevStackOffset:R,prevMargin:T,prevChildren:E})}if(!Q1(E,S.prevChildren)){var Q,D,B,Z,z=Jr(E,Sc),M=z&&(Q=(D=z.props)===null||D===void 0?void 0:D.startIndex)!==null&&Q!==void 0?Q:F,re=z&&(B=(Z=z.props)===null||Z===void 0?void 0:Z.endIndex)!==null&&B!==void 0?B:L,te=M!==F||re!==L,G=!Ct(C),de=G&&!te?S.updateId:S.updateId+1;return we(we({updateId:de},g(we(we({props:x},S),{},{updateId:de,dataStartIndex:M,dataEndIndex:re}),S)),{},{prevChildren:E,dataStartIndex:M,dataEndIndex:re})}return null}),yt(j,"renderActiveDot",function(x,S,N){var C;return v.isValidElement(x)?C=v.cloneElement(x,S):jt(x)?C=x(S):C=U.createElement(Tv,S),U.createElement(zt,{className:"recharts-active-dot",key:N},C)});var b=v.forwardRef(function(S,N){return U.createElement(j,Vl({},S,{ref:N}))});return b.displayName=j.displayName,b},vS=oC({chartName:"LineChart",GraphicalChild:Lo,axisComponents:[{axisType:"xAxis",AxisComp:Wi},{axisType:"yAxis",AxisComp:Vi}],formatAxisMap:f4}),lfe=oC({chartName:"BarChart",GraphicalChild:Qo,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Wi},{axisType:"yAxis",AxisComp:Vi}],formatAxisMap:f4}),cfe=oC({chartName:"PieChart",GraphicalChild:si,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Dv},{axisType:"radiusAxis",AxisComp:Mv}],formatAxisMap:oae,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const ufe=()=>{const{configs:e}=mf(),{source:t}=Tn(),[n,r]=v.useState([]),[a,i]=v.useState("timestamp"),[o,c]=v.useState("desc"),d=x=>{if(a===x){c(S=>S==="asc"?"desc":"asc");return}i(x),c("desc")};v.useEffect(()=>{let x=!0;return t.listResults().then(S=>{x&&r(S)}),()=>{x=!1}},[t]);const f=e.length,h=n.length,p=h===0?0:n.reduce((x,S)=>x+S.overallPassRate,0)/h,y=h===0?0:Math.round(n.reduce((x,S)=>x+S.avgLatency,0)/h),g=v.useMemo(()=>[...n].sort((S,N)=>{let C=0;return a==="timestamp"&&(C=new Date(S.timestamp).getTime()-new Date(N.timestamp).getTime()),a==="passRate"&&(C=S.overallPassRate-N.overallPassRate),a==="latency"&&(C=S.avgLatency-N.avgLatency),a==="scenarios"&&(C=S.totalScenarios-N.totalScenarios),o==="asc"?C:-C}),[n,a,o]),j=[...g].reverse().map(x=>({date:new Date(x.timestamp).toLocaleDateString("en-US",{month:"short",day:"numeric"}),passRate:Math.round(x.overallPassRate*100),latency:x.avgLatency})),b=x=>{const S=Array.from(new Set(x.scenarios.map(_=>_.scenarioId).filter(Boolean))),N=Array.from(new Set(x.scenarios.map(_=>_.agentName).filter(Boolean))),C=S.slice(0,2).join(", "),E=S.length>2?` +${S.length-2}`:"";return{scenarioCount:S.length,agentCount:N.length,scenarioPreview:C?`${C}${E}`:"n/a"}};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(m$,{className:"h-6 w-6"}),"Dashboard"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Overview of your MCP evaluation runs"})]}),s.jsxs("div",{className:"flex gap-3",children:[s.jsx(le,{asChild:!0,children:s.jsxs(wt,{to:"/mcp-evaluations/new",children:[s.jsx(BS,{className:"mr-2 h-4 w-4"}),"New MCP Evaluation"]})}),s.jsx(le,{variant:"outline",asChild:!0,children:s.jsxs(wt,{to:"/run",children:[s.jsx(Gl,{className:"mr-2 h-4 w-4"}),"Run Evaluation"]})}),s.jsx(le,{variant:"outline",asChild:!0,children:s.jsxs(wt,{to:"/results",children:[s.jsx(fd,{className:"mr-2 h-4 w-4"}),"Browse Results"]})})]})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(is,{title:"MCP Evaluations",value:f,icon:O1,subtitle:`${f} active`}),s.jsx(is,{title:"Total Runs",value:h,icon:u$,subtitle:"Last 30 days"}),s.jsx(is,{title:"Pass Rate",value:`${Math.round(p*100)}%`,icon:fd,subtitle:"+5% from last week",trend:"up"}),s.jsx(is,{title:"Avg Latency",value:`${y}ms`,icon:b$,subtitle:"-120ms from last week",trend:"up"})]}),s.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[s.jsxs(qe,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Pass Rate Trend"})}),s.jsx(We,{children:s.jsx($h,{width:"100%",height:200,children:s.jsxs(vS,{data:j,children:[s.jsx(Wi,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(Vi,{domain:[0,100],tick:{fontSize:11},tickLine:!1,axisLine:!1,tickFormatter:x=>`${x}%`}),s.jsx(Mr,{formatter:x=>[`${x}%`,"Pass Rate"]}),s.jsx(Lo,{type:"monotone",dataKey:"passRate",stroke:"hsl(38, 92%, 50%)",strokeWidth:2,dot:{r:3,fill:"hsl(38, 92%, 50%)"}})]})})})]}),s.jsxs(qe,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Recent Tool Latency (ms)"})}),s.jsx(We,{children:s.jsx($h,{width:"100%",height:200,children:s.jsxs(vS,{data:j,children:[s.jsx(Wi,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(Vi,{tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(Mr,{formatter:x=>[`${x}ms`,"Latency"]}),s.jsx(Lo,{type:"monotone",dataKey:"latency",stroke:"hsl(200, 80%, 50%)",strokeWidth:2,dot:{r:3,fill:"hsl(200, 80%, 50%)"}})]})})})]})]}),s.jsx("div",{className:"grid gap-6",children:s.jsxs(qe,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Recent Runs"})}),s.jsx(We,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs(Mt,{children:[s.jsx(tt,{children:"Run ID"}),s.jsx(tt,{children:"Evaluated"}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>d("timestamp"),children:["Timestamp",a==="timestamp"?o==="asc"?s.jsx(ds,{className:"h-3.5 w-3.5"}):s.jsx(Gt,{className:"h-3.5 w-3.5"}):s.jsx(Hl,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>d("passRate"),children:["Pass Rate",a==="passRate"?o==="asc"?s.jsx(ds,{className:"h-3.5 w-3.5"}):s.jsx(Gt,{className:"h-3.5 w-3.5"}):s.jsx(Hl,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),s.jsx(tt,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>d("scenarios"),children:["Scenarios",a==="scenarios"?o==="asc"?s.jsx(ds,{className:"h-3.5 w-3.5"}):s.jsx(Gt,{className:"h-3.5 w-3.5"}):s.jsx(Hl,{className:"h-3.5 w-3.5 text-muted-foreground"})]})})]})}),s.jsx(Lr,{children:g.map(x=>s.jsxs(Mt,{className:"cursor-pointer",children:[s.jsx(ze,{children:s.jsx(wt,{to:`/results/${x.id}`,className:"font-mono text-xs text-primary hover:underline",children:x.id})}),s.jsx(ze,{className:"text-[11px] text-muted-foreground",children:(()=>{const S=b(x);return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Evaluated: ",S.scenarioCount," scenario",S.scenarioCount===1?"":"s"," · ",S.agentCount," agent",S.agentCount===1?"":"s"]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:S.scenarioPreview})]})})()}),s.jsx(ze,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(of,{className:"h-3 w-3"}),new Date(x.timestamp).toLocaleString()]})}),s.jsx(ze,{children:s.jsx(zs,{rate:x.overallPassRate})}),s.jsx(ze,{className:"text-right font-mono text-sm",children:x.totalScenarios})]},x.id))})]})})]})})]})};var dfe=v.createContext(void 0);function Jc(e){const t=v.useContext(dfe);return e||t||"ltr"}var x1="rovingFocusGroup.onEntryFocus",ffe={bubbles:!1,cancelable:!0},Cf="RovingFocusGroup",[gS,Y4,pfe]=af(Cf),[hfe,Kv]=lr(Cf,[pfe]),[mfe,vfe]=hfe(Cf),X4=v.forwardRef((e,t)=>s.jsx(gS.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(gS.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(gfe,{...e,ref:t})})}));X4.displayName=Cf;var gfe=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:h=!1,...p}=e,y=v.useRef(null),g=vt(t,y),j=Jc(i),[b,x]=ia({prop:o,defaultProp:c??null,onChange:d,caller:Cf}),[S,N]=v.useState(!1),C=Rn(f),E=Y4(n),_=v.useRef(!1),[k,O]=v.useState(0);return v.useEffect(()=>{const R=y.current;if(R)return R.addEventListener(x1,C),()=>R.removeEventListener(x1,C)},[C]),s.jsx(mfe,{scope:n,orientation:r,dir:j,loop:a,currentTabStopId:b,onItemFocus:v.useCallback(R=>x(R),[x]),onItemShiftTab:v.useCallback(()=>N(!0),[]),onFocusableItemAdd:v.useCallback(()=>O(R=>R+1),[]),onFocusableItemRemove:v.useCallback(()=>O(R=>R-1),[]),children:s.jsx(Ke.div,{tabIndex:S||k===0?-1:0,"data-orientation":r,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:ke(e.onMouseDown,()=>{_.current=!0}),onFocus:ke(e.onFocus,R=>{const T=!_.current;if(R.target===R.currentTarget&&T&&!S){const F=new CustomEvent(x1,ffe);if(R.currentTarget.dispatchEvent(F),!F.defaultPrevented){const L=E().filter(J=>J.focusable),$=L.find(J=>J.active),Y=L.find(J=>J.id===b),K=[$,Y,...L].filter(Boolean).map(J=>J.ref.current);Z4(K,h)}}_.current=!1}),onBlur:ke(e.onBlur,()=>N(!1))})})}),Q4="RovingFocusGroupItem",J4=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:i,children:o,...c}=e,d=Vn(),f=i||d,h=vfe(Q4,n),p=h.currentTabStopId===f,y=Y4(n),{onFocusableItemAdd:g,onFocusableItemRemove:j,currentTabStopId:b}=h;return v.useEffect(()=>{if(r)return g(),()=>j()},[r,g,j]),s.jsx(gS.ItemSlot,{scope:n,id:f,focusable:r,active:a,children:s.jsx(Ke.span,{tabIndex:p?0:-1,"data-orientation":h.orientation,...c,ref:t,onMouseDown:ke(e.onMouseDown,x=>{r?h.onItemFocus(f):x.preventDefault()}),onFocus:ke(e.onFocus,()=>h.onItemFocus(f)),onKeyDown:ke(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){h.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const S=bfe(x,h.orientation,h.dir);if(S!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let C=y().filter(E=>E.focusable).map(E=>E.ref.current);if(S==="last")C.reverse();else if(S==="prev"||S==="next"){S==="prev"&&C.reverse();const E=C.indexOf(x.currentTarget);C=h.loop?wfe(C,E+1):C.slice(E+1)}setTimeout(()=>Z4(C))}}),children:typeof o=="function"?o({isCurrentTabStop:p,hasTabStop:b!=null}):o})})});J4.displayName=Q4;var yfe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function xfe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function bfe(e,t,n){const r=xfe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return yfe[r]}function Z4(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function wfe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var eF=X4,tF=J4;function jfe(e){const t=Sfe(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(Cfe);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function Sfe(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=_fe(a),c=Afe(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Cr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Nfe=Symbol("radix.slottable");function Cfe(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Nfe}function Afe(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function _fe(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 yS=["Enter"," "],Efe=["ArrowDown","PageUp","Home"],nF=["ArrowUp","PageDown","End"],Pfe=[...Efe,...nF],kfe={ltr:[...yS,"ArrowRight"],rtl:[...yS,"ArrowLeft"]},Ofe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Af="Menu",[ef,Rfe,Tfe]=af(Af),[Jo,rF]=lr(Af,[Tfe,Ki,Kv]),Gv=Ki(),aF=Kv(),[Ife,Zo]=Jo(Af),[Mfe,_f]=Jo(Af),sF=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:i,modal:o=!0}=e,c=Gv(t),[d,f]=v.useState(null),h=v.useRef(!1),p=Rn(i),y=Jc(a);return v.useEffect(()=>{const g=()=>{h.current=!0,document.addEventListener("pointerdown",j,{capture:!0,once:!0}),document.addEventListener("pointermove",j,{capture:!0,once:!0})},j=()=>h.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",j,{capture:!0}),document.removeEventListener("pointermove",j,{capture:!0})}},[]),s.jsx(Wm,{...c,children:s.jsx(Ife,{scope:t,open:n,onOpenChange:p,content:d,onContentChange:f,children:s.jsx(Mfe,{scope:t,onClose:v.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:h,dir:y,modal:o,children:r})})})};sF.displayName=Af;var $fe="MenuAnchor",lC=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=Gv(n);return s.jsx(cf,{...a,...r,ref:t})});lC.displayName=$fe;var cC="MenuPortal",[Dfe,iF]=Jo(cC,{forceMount:void 0}),oF=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,i=Zo(cC,t);return s.jsx(Dfe,{scope:t,forceMount:n,children:s.jsx(Kn,{present:n||i.open,children:s.jsx(Dc,{asChild:!0,container:a,children:r})})})};oF.displayName=cC;var Sa="MenuContent",[Lfe,uC]=Jo(Sa),lF=v.forwardRef((e,t)=>{const n=iF(Sa,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=Zo(Sa,e.__scopeMenu),o=_f(Sa,e.__scopeMenu);return s.jsx(ef.Provider,{scope:e.__scopeMenu,children:s.jsx(Kn,{present:r||i.open,children:s.jsx(ef.Slot,{scope:e.__scopeMenu,children:o.modal?s.jsx(Ffe,{...a,ref:t}):s.jsx(Bfe,{...a,ref:t})})})})}),Ffe=v.forwardRef((e,t)=>{const n=Zo(Sa,e.__scopeMenu),r=v.useRef(null),a=vt(t,r);return v.useEffect(()=>{const i=r.current;if(i)return av(i)},[]),s.jsx(dC,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ke(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Bfe=v.forwardRef((e,t)=>{const n=Zo(Sa,e.__scopeMenu);return s.jsx(dC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),zfe=jfe("MenuContent.ScrollLock"),dC=v.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:y,onDismiss:g,disableOutsideScroll:j,...b}=e,x=Zo(Sa,n),S=_f(Sa,n),N=Gv(n),C=aF(n),E=Rfe(n),[_,k]=v.useState(null),O=v.useRef(null),R=vt(t,O,x.onContentChange),T=v.useRef(0),F=v.useRef(""),L=v.useRef(0),$=v.useRef(null),Y=v.useRef("right"),H=v.useRef(0),K=j?df:v.Fragment,J=j?{as:zfe,allowPinchZoom:!0}:void 0,Q=B=>{const Z=F.current+B,z=E().filter(ce=>!ce.disabled),M=document.activeElement,re=z.find(ce=>ce.ref.current===M)?.textValue,te=z.map(ce=>ce.textValue),G=Zfe(te,Z,re),de=z.find(ce=>ce.textValue===G)?.ref.current;(function ce(he){F.current=he,window.clearTimeout(T.current),he!==""&&(T.current=window.setTimeout(()=>ce(""),1e3))})(Z),de&&setTimeout(()=>de.focus())};v.useEffect(()=>()=>window.clearTimeout(T.current),[]),nv();const D=v.useCallback(B=>Y.current===$.current?.side&&tpe(B,$.current?.area),[]);return s.jsx(Lfe,{scope:n,searchRef:F,onItemEnter:v.useCallback(B=>{D(B)&&B.preventDefault()},[D]),onItemLeave:v.useCallback(B=>{D(B)||(O.current?.focus(),k(null))},[D]),onTriggerLeave:v.useCallback(B=>{D(B)&&B.preventDefault()},[D]),pointerGraceTimerRef:L,onPointerGraceIntentChange:v.useCallback(B=>{$.current=B},[]),children:s.jsx(K,{...J,children:s.jsx(uf,{asChild:!0,trapped:a,onMountAutoFocus:ke(i,B=>{B.preventDefault(),O.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:s.jsx(Uo,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:y,onDismiss:g,children:s.jsx(eF,{asChild:!0,...C,dir:S.dir,orientation:"vertical",loop:r,currentTabStopId:_,onCurrentTabStopIdChange:k,onEntryFocus:ke(d,B=>{S.isUsingKeyboardRef.current||B.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(Vm,{role:"menu","aria-orientation":"vertical","data-state":NF(x.open),"data-radix-menu-content":"",dir:S.dir,...N,...b,ref:R,style:{outline:"none",...b.style},onKeyDown:ke(b.onKeyDown,B=>{const z=B.target.closest("[data-radix-menu-content]")===B.currentTarget,M=B.ctrlKey||B.altKey||B.metaKey,re=B.key.length===1;z&&(B.key==="Tab"&&B.preventDefault(),!M&&re&&Q(B.key));const te=O.current;if(B.target!==te||!Pfe.includes(B.key))return;B.preventDefault();const de=E().filter(ce=>!ce.disabled).map(ce=>ce.ref.current);nF.includes(B.key)&&de.reverse(),Qfe(de)}),onBlur:ke(e.onBlur,B=>{B.currentTarget.contains(B.target)||(window.clearTimeout(T.current),F.current="")}),onPointerMove:ke(e.onPointerMove,tf(B=>{const Z=B.target,z=H.current!==B.clientX;if(B.currentTarget.contains(Z)&&z){const M=B.clientX>H.current?"right":"left";Y.current=M,H.current=B.clientX}}))})})})})})})});lF.displayName=Sa;var Ufe="MenuGroup",fC=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(Ke.div,{role:"group",...r,ref:t})});fC.displayName=Ufe;var qfe="MenuLabel",cF=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(Ke.div,{...r,ref:t})});cF.displayName=qfe;var Am="MenuItem",oM="menu.itemSelect",Yv=v.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...a}=e,i=v.useRef(null),o=_f(Am,e.__scopeMenu),c=uC(Am,e.__scopeMenu),d=vt(t,i),f=v.useRef(!1),h=()=>{const p=i.current;if(!n&&p){const y=new CustomEvent(oM,{bubbles:!0,cancelable:!0});p.addEventListener(oM,g=>r?.(g),{once:!0}),IS(p,y),y.defaultPrevented?f.current=!1:o.onClose()}};return s.jsx(uF,{...a,ref:d,disabled:n,onClick:ke(e.onClick,h),onPointerDown:p=>{e.onPointerDown?.(p),f.current=!0},onPointerUp:ke(e.onPointerUp,p=>{f.current||p.currentTarget?.click()}),onKeyDown:ke(e.onKeyDown,p=>{const y=c.searchRef.current!=="";n||y&&p.key===" "||yS.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Yv.displayName=Am;var uF=v.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:a,...i}=e,o=uC(Am,n),c=aF(n),d=v.useRef(null),f=vt(t,d),[h,p]=v.useState(!1),[y,g]=v.useState("");return v.useEffect(()=>{const j=d.current;j&&g((j.textContent??"").trim())},[i.children]),s.jsx(ef.ItemSlot,{scope:n,disabled:r,textValue:a??y,children:s.jsx(tF,{asChild:!0,...c,focusable:!r,children:s.jsx(Ke.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:f,onPointerMove:ke(e.onPointerMove,tf(j=>{r?o.onItemLeave(j):(o.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ke(e.onPointerLeave,tf(j=>o.onItemLeave(j))),onFocus:ke(e.onFocus,()=>p(!0)),onBlur:ke(e.onBlur,()=>p(!1))})})})}),Wfe="MenuCheckboxItem",dF=v.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...a}=e;return s.jsx(vF,{scope:e.__scopeMenu,checked:n,children:s.jsx(Yv,{role:"menuitemcheckbox","aria-checked":_m(n)?"mixed":n,...a,ref:t,"data-state":hC(n),onSelect:ke(a.onSelect,()=>r?.(_m(n)?!0:!n),{checkForDefaultPrevented:!1})})})});dF.displayName=Wfe;var fF="MenuRadioGroup",[Vfe,Hfe]=Jo(fF,{value:void 0,onValueChange:()=>{}}),pF=v.forwardRef((e,t)=>{const{value:n,onValueChange:r,...a}=e,i=Rn(r);return s.jsx(Vfe,{scope:e.__scopeMenu,value:n,onValueChange:i,children:s.jsx(fC,{...a,ref:t})})});pF.displayName=fF;var hF="MenuRadioItem",mF=v.forwardRef((e,t)=>{const{value:n,...r}=e,a=Hfe(hF,e.__scopeMenu),i=n===a.value;return s.jsx(vF,{scope:e.__scopeMenu,checked:i,children:s.jsx(Yv,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":hC(i),onSelect:ke(r.onSelect,()=>a.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});mF.displayName=hF;var pC="MenuItemIndicator",[vF,Kfe]=Jo(pC,{checked:!1}),gF=v.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...a}=e,i=Kfe(pC,n);return s.jsx(Kn,{present:r||_m(i.checked)||i.checked===!0,children:s.jsx(Ke.span,{...a,ref:t,"data-state":hC(i.checked)})})});gF.displayName=pC;var Gfe="MenuSeparator",yF=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(Ke.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});yF.displayName=Gfe;var Yfe="MenuArrow",xF=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=Gv(n);return s.jsx(Hm,{...a,...r,ref:t})});xF.displayName=Yfe;var Xfe="MenuSub",[Bge,bF]=Jo(Xfe),ed="MenuSubTrigger",wF=v.forwardRef((e,t)=>{const n=Zo(ed,e.__scopeMenu),r=_f(ed,e.__scopeMenu),a=bF(ed,e.__scopeMenu),i=uC(ed,e.__scopeMenu),o=v.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=i,f={__scopeMenu:e.__scopeMenu},h=v.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return v.useEffect(()=>h,[h]),v.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),d(null)}},[c,d]),s.jsx(lC,{asChild:!0,...f,children:s.jsx(uF,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":NF(n.open),...e,ref:Cr(t,a.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ke(e.onPointerMove,tf(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:ke(e.onPointerLeave,tf(p=>{h();const y=n.content?.getBoundingClientRect();if(y){const g=n.content?.dataset.side,j=g==="right",b=j?-5:5,x=y[j?"left":"right"],S=y[j?"right":"left"];i.onPointerGraceIntentChange({area:[{x:p.clientX+b,y:p.clientY},{x,y:y.top},{x:S,y:y.top},{x:S,y:y.bottom},{x,y:y.bottom}],side:g}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(p),p.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ke(e.onKeyDown,p=>{const y=i.searchRef.current!=="";e.disabled||y&&p.key===" "||kfe[r.dir].includes(p.key)&&(n.onOpenChange(!0),n.content?.focus(),p.preventDefault())})})})});wF.displayName=ed;var jF="MenuSubContent",SF=v.forwardRef((e,t)=>{const n=iF(Sa,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=Zo(Sa,e.__scopeMenu),o=_f(Sa,e.__scopeMenu),c=bF(jF,e.__scopeMenu),d=v.useRef(null),f=vt(t,d);return s.jsx(ef.Provider,{scope:e.__scopeMenu,children:s.jsx(Kn,{present:r||i.open,children:s.jsx(ef.Slot,{scope:e.__scopeMenu,children:s.jsx(dC,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:f,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{o.isUsingKeyboardRef.current&&d.current?.focus(),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:ke(e.onFocusOutside,h=>{h.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:ke(e.onEscapeKeyDown,h=>{o.onClose(),h.preventDefault()}),onKeyDown:ke(e.onKeyDown,h=>{const p=h.currentTarget.contains(h.target),y=Ofe[o.dir].includes(h.key);p&&y&&(i.onOpenChange(!1),c.trigger?.focus(),h.preventDefault())})})})})})});SF.displayName=jF;function NF(e){return e?"open":"closed"}function _m(e){return e==="indeterminate"}function hC(e){return _m(e)?"indeterminate":e?"checked":"unchecked"}function Qfe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Jfe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Zfe(e,t,n){const a=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=Jfe(e,Math.max(i,0));a.length===1&&(o=o.filter(f=>f!==n));const d=o.find(f=>f.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function epe(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const c=t[i],d=t[o],f=c.x,h=c.y,p=d.x,y=d.y;h>r!=y>r&&n<(p-f)*(r-h)/(y-h)+f&&(a=!a)}return a}function tpe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return epe(n,t)}function tf(e){return t=>t.pointerType==="mouse"?e(t):void 0}var npe=sF,rpe=lC,ape=oF,spe=lF,ipe=fC,ope=cF,lpe=Yv,cpe=dF,upe=pF,dpe=mF,fpe=gF,ppe=yF,hpe=xF,mpe=wF,vpe=SF,Xv="DropdownMenu",[gpe]=lr(Xv,[rF]),Ar=rF(),[ype,CF]=gpe(Xv),AF=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:i,onOpenChange:o,modal:c=!0}=e,d=Ar(t),f=v.useRef(null),[h,p]=ia({prop:a,defaultProp:i??!1,onChange:o,caller:Xv});return s.jsx(ype,{scope:t,triggerId:Vn(),triggerRef:f,contentId:Vn(),open:h,onOpenChange:p,onOpenToggle:v.useCallback(()=>p(y=>!y),[p]),modal:c,children:s.jsx(npe,{...d,open:h,onOpenChange:p,dir:r,modal:c,children:n})})};AF.displayName=Xv;var _F="DropdownMenuTrigger",EF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...a}=e,i=CF(_F,n),o=Ar(n);return s.jsx(rpe,{asChild:!0,...o,children:s.jsx(Ke.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...a,ref:Cr(t,i.triggerRef),onPointerDown:ke(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(i.onOpenToggle(),i.open||c.preventDefault())}),onKeyDown:ke(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&i.onOpenToggle(),c.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});EF.displayName=_F;var xpe="DropdownMenuPortal",PF=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Ar(t);return s.jsx(ape,{...r,...n})};PF.displayName=xpe;var kF="DropdownMenuContent",OF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=CF(kF,n),i=Ar(n),o=v.useRef(!1);return s.jsx(spe,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...r,ref:t,onCloseAutoFocus:ke(e.onCloseAutoFocus,c=>{o.current||a.triggerRef.current?.focus(),o.current=!1,c.preventDefault()}),onInteractOutside:ke(e.onInteractOutside,c=>{const d=c.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0,h=d.button===2||f;(!a.modal||h)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});OF.displayName=kF;var bpe="DropdownMenuGroup",wpe=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(ipe,{...a,...r,ref:t})});wpe.displayName=bpe;var jpe="DropdownMenuLabel",RF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(ope,{...a,...r,ref:t})});RF.displayName=jpe;var Spe="DropdownMenuItem",TF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(lpe,{...a,...r,ref:t})});TF.displayName=Spe;var Npe="DropdownMenuCheckboxItem",IF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(cpe,{...a,...r,ref:t})});IF.displayName=Npe;var Cpe="DropdownMenuRadioGroup",Ape=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(upe,{...a,...r,ref:t})});Ape.displayName=Cpe;var _pe="DropdownMenuRadioItem",MF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(dpe,{...a,...r,ref:t})});MF.displayName=_pe;var Epe="DropdownMenuItemIndicator",$F=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(fpe,{...a,...r,ref:t})});$F.displayName=Epe;var Ppe="DropdownMenuSeparator",DF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(ppe,{...a,...r,ref:t})});DF.displayName=Ppe;var kpe="DropdownMenuArrow",Ope=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(hpe,{...a,...r,ref:t})});Ope.displayName=kpe;var Rpe="DropdownMenuSubTrigger",LF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(mpe,{...a,...r,ref:t})});LF.displayName=Rpe;var Tpe="DropdownMenuSubContent",FF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Ar(n);return s.jsx(vpe,{...a,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});FF.displayName=Tpe;var Ipe=AF,Mpe=EF,$pe=PF,BF=OF,zF=RF,UF=TF,qF=IF,WF=MF,VF=$F,HF=DF,KF=LF,GF=FF;const Zc=Ipe,eu=Mpe,Dpe=v.forwardRef(({className:e,inset:t,children:n,...r},a)=>s.jsxs(KF,{ref:a,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,s.jsx(d$,{className:"ml-auto h-4 w-4"})]}));Dpe.displayName=KF.displayName;const Lpe=v.forwardRef(({className:e,...t},n)=>s.jsx(GF,{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}));Lpe.displayName=GF.displayName;const el=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx($pe,{children:s.jsx(BF,{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})}));el.displayName=BF.displayName;const yr=v.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(UF,{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}));yr.displayName=UF.displayName;const Fpe=v.forwardRef(({className:e,children:t,checked:n,...r},a)=>s.jsxs(qF,{ref:a,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:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(VF,{children:s.jsx(sc,{className:"h-4 w-4"})})}),t]}));Fpe.displayName=qF.displayName;const Bpe=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(WF,{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:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(VF,{children:s.jsx(D7,{className:"h-2 w-2 fill-current"})})}),t]}));Bpe.displayName=WF.displayName;const mC=v.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(zF,{ref:r,className:Se("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));mC.displayName=zF.displayName;const vC=v.forwardRef(({className:e,...t},n)=>s.jsx(HF,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",e),...t}));vC.displayName=HF.displayName;const Ku=e=>e.configName?.trim()||e.name,zpe=()=>{const{configs:e,deleteConfig:t,cloneConfig:n,loading:r,reload:a}=mf(),i=_a(),[o,c]=v.useState("name"),[d,f]=v.useState("asc"),h=S=>{if(o===S){f(N=>N==="asc"?"desc":"asc");return}c(S),f(S==="updatedAt"?"desc":"asc")};v.useEffect(()=>{a();const S=()=>{a()};return window.addEventListener("focus",S),()=>{window.removeEventListener("focus",S)}},[a]);const p=async(S,N)=>{await t(S),Pe({title:"Deleted",description:`"${N}" has been removed.`})},y=async S=>{const N=await n(S);Pe({title:"Cloned",description:`Created "${Ku(N)}".`}),i(`/mcp-evaluations/${N.id}`)},g=S=>S.agentEntries?.length??S.agents?.length??0,j=S=>S.scenarioEntries?.length??S.scenarios?.length??0,b=v.useMemo(()=>[...e].sort((N,C)=>{let E=0;return o==="name"&&(E=Ku(N).localeCompare(Ku(C))),o==="scenarios"&&(E=j(N)-j(C)),o==="agents"&&(E=g(N)-g(C)),o==="updatedAt"&&(E=new Date(N.updatedAt).getTime()-new Date(C.updatedAt).getTime()),d==="asc"?E:-E}),[e,o,d]),x=S=>o!==S?s.jsx(Hl,{className:"h-3.5 w-3.5 text-muted-foreground"}):d==="asc"?s.jsx(ds,{className:"h-3.5 w-3.5"}):s.jsx(Gt,{className:"h-3.5 w-3.5"});return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(h$,{className:"h-6 w-6"}),"MCP Evaluations"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage your MCP evaluation suites"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(le,{variant:"outline",size:"sm",onClick:()=>{a()},children:[s.jsx(Na,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(le,{variant:"outline",size:"sm",children:[s.jsx(W7,{className:"mr-2 h-4 w-4"}),"Import YAML"]}),s.jsx(le,{size:"sm",asChild:!0,children:s.jsxs(wt,{to:"/mcp-evaluations/new",children:[s.jsx(ms,{className:"mr-2 h-4 w-4"}),"Create New"]})})]})]}),s.jsx(qe,{children:s.jsx(We,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs(Mt,{children:[s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>h("name"),children:["Name",x("name")]})}),s.jsx(tt,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>h("scenarios"),children:["Scenarios",x("scenarios")]})}),s.jsx(tt,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>h("agents"),children:["Agents",x("agents")]})}),s.jsx(tt,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>h("updatedAt"),children:["Last Updated",x("updatedAt")]})}),s.jsx(tt,{className:"w-10"})]})}),s.jsxs(Lr,{children:[b.map(S=>s.jsxs(Mt,{children:[s.jsx(ze,{children:s.jsxs("div",{children:[s.jsx(wt,{to:`/mcp-evaluations/${S.id}`,className:"font-medium text-sm hover:text-primary",children:Ku(S)}),S.loadError&&s.jsxs(Je,{variant:"destructive",className:"ml-2 align-middle text-[10px]",children:[s.jsx(uh,{className:"mr-1 h-3 w-3"}),"Broken"]}),S.description&&s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:S.description}),S.loadError&&s.jsx("p",{className:"text-xs text-destructive mt-0.5 break-all",children:S.loadError})]})}),s.jsx(ze,{className:"text-right font-mono text-sm",children:j(S)}),s.jsx(ze,{className:"text-right font-mono text-sm",children:g(S)}),s.jsx(ze,{className:"text-right text-xs text-muted-foreground",children:new Date(S.updatedAt).toLocaleDateString()}),s.jsx(ze,{children:s.jsxs(Zc,{children:[s.jsx(eu,{asChild:!0,children:s.jsx(le,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Dm,{className:"h-4 w-4"})})}),s.jsxs(el,{align:"end",children:[s.jsxs(yr,{onClick:()=>i(`/mcp-evaluations/${S.id}`),children:[s.jsx(Lm,{className:"mr-2 h-3.5 w-3.5"}),"Edit"]}),s.jsxs(yr,{onClick:()=>{y(S.id)},children:[s.jsx(zi,{className:"mr-2 h-3.5 w-3.5"}),"Clone"]}),s.jsxs(yr,{children:[s.jsx(ja,{className:"mr-2 h-3.5 w-3.5"}),"Download YAML"]}),s.jsxs(yr,{className:"text-destructive",onClick:()=>{p(S.id,Ku(S))},children:[s.jsx(Ca,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]})})]},S.id)),!r&&e.length===0&&s.jsx(Mt,{children:s.jsx(ze,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"No MCP evaluations yet. Create your first one to get started."})}),r&&s.jsx(Mt,{children:s.jsx(ze,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"Loading MCP evaluations..."})})]})]})})})]})};var Upe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],qpe=Upe.reduce((e,t)=>{const n=tv(`Primitive.${t}`),r=v.forwardRef((a,i)=>{const{asChild:o,...c}=a,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Wpe="Label",YF=v.forwardRef((e,t)=>s.jsx(qpe.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));YF.displayName=Wpe;var XF=YF;const Vpe=qo("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Fe=v.forwardRef(({className:e,...t},n)=>s.jsx(XF,{ref:n,className:Se(Vpe(),e),...t}));Fe.displayName=XF.displayName;const qa=v.forwardRef(({className:e,...t},n)=>s.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}));qa.displayName="Textarea";function Qv(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Jv="Switch",[Hpe]=lr(Jv),[Kpe,Gpe]=Hpe(Jv),QF=v.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:a,defaultChecked:i,required:o,disabled:c,value:d="on",onCheckedChange:f,form:h,...p}=e,[y,g]=v.useState(null),j=vt(t,C=>g(C)),b=v.useRef(!1),x=y?h||!!y.closest("form"):!0,[S,N]=ia({prop:a,defaultProp:i??!1,onChange:f,caller:Jv});return s.jsxs(Kpe,{scope:n,checked:S,disabled:c,children:[s.jsx(Ke.button,{type:"button",role:"switch","aria-checked":S,"aria-required":o,"data-state":tB(S),"data-disabled":c?"":void 0,disabled:c,value:d,...p,ref:j,onClick:ke(e.onClick,C=>{N(E=>!E),x&&(b.current=C.isPropagationStopped(),b.current||C.stopPropagation())})}),x&&s.jsx(eB,{control:y,bubbles:!b.current,name:r,value:d,checked:S,required:o,disabled:c,form:h,style:{transform:"translateX(-100%)"}})]})});QF.displayName=Jv;var JF="SwitchThumb",ZF=v.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,a=Gpe(JF,n);return s.jsx(Ke.span,{"data-state":tB(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});ZF.displayName=JF;var Ype="SwitchBubbleInput",eB=v.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...a},i)=>{const o=v.useRef(null),c=vt(o,i),d=Qv(n),f=qm(t);return v.useEffect(()=>{const h=o.current;if(!h)return;const p=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==n&&g){const j=new Event("click",{bubbles:r});g.call(h,n),h.dispatchEvent(j)}},[d,n,r]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:c,style:{...a.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});eB.displayName=Ype;function tB(e){return e?"checked":"unchecked"}var nB=QF,Xpe=ZF;const Em=v.forwardRef(({className:e,...t},n)=>s.jsx(nB,{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:s.jsx(Xpe,{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")})}));Em.displayName=nB.displayName;var Zv="Tabs",[Qpe]=lr(Zv,[Kv]),rB=Kv(),[Jpe,gC]=Qpe(Zv),aB=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:o="horizontal",dir:c,activationMode:d="automatic",...f}=e,h=Jc(c),[p,y]=ia({prop:r,onChange:a,defaultProp:i??"",caller:Zv});return s.jsx(Jpe,{scope:n,baseId:Vn(),value:p,onValueChange:y,orientation:o,dir:h,activationMode:d,children:s.jsx(Ke.div,{dir:h,"data-orientation":o,...f,ref:t})})});aB.displayName=Zv;var sB="TabsList",iB=v.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,i=gC(sB,n),o=rB(n);return s.jsx(eF,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:r,children:s.jsx(Ke.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});iB.displayName=sB;var oB="TabsTrigger",lB=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,o=gC(oB,n),c=rB(n),d=dB(o.baseId,r),f=fB(o.baseId,r),h=r===o.value;return s.jsx(tF,{asChild:!0,...c,focusable:!a,active:h,children:s.jsx(Ke.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":f,"data-state":h?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:d,...i,ref:t,onMouseDown:ke(e.onMouseDown,p=>{!a&&p.button===0&&p.ctrlKey===!1?o.onValueChange(r):p.preventDefault()}),onKeyDown:ke(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&o.onValueChange(r)}),onFocus:ke(e.onFocus,()=>{const p=o.activationMode!=="manual";!h&&!a&&p&&o.onValueChange(r)})})})});lB.displayName=oB;var cB="TabsContent",uB=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:i,...o}=e,c=gC(cB,n),d=dB(c.baseId,r),f=fB(c.baseId,r),h=r===c.value,p=v.useRef(h);return v.useEffect(()=>{const y=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(y)},[]),s.jsx(Kn,{present:a||h,children:({present:y})=>s.jsx(Ke.div,{"data-state":h?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!y,id:f,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:y&&i})})});uB.displayName=cB;function dB(e,t){return`${e}-trigger-${t}`}function fB(e,t){return`${e}-content-${t}`}var Zpe=aB,pB=iB,hB=lB,mB=uB;const yC=Zpe,eg=v.forwardRef(({className:e,...t},n)=>s.jsx(pB,{ref:n,className:Se("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));eg.displayName=pB.displayName;const Fi=v.forwardRef(({className:e,...t},n)=>s.jsx(hB,{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}));Fi.displayName=hB.displayName;const nf=v.forwardRef(({className:e,...t},n)=>s.jsx(mB,{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=mB.displayName;const lM={openai:"bg-emerald-100 text-emerald-800",anthropic:"bg-orange-100 text-orange-800",azure:"bg-blue-100 text-blue-800",google:"bg-yellow-100 text-yellow-800",custom:"bg-gray-100 text-gray-800"};function vB({provider:e}){return s.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${lM[e]??lM.custom}`,children:e})}function rf(e,[t,n]){return Math.min(n,Math.max(t,e))}function ehe(e){const t=the(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(rhe);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function the(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=she(a),c=ahe(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Cr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var nhe=Symbol("radix.slottable");function rhe(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===nhe}function ahe(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function she(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 ihe=[" ","Enter","ArrowUp","ArrowDown"],ohe=[" ","Enter"],Fo="Select",[tg,ng,lhe]=af(Fo),[tu]=lr(Fo,[lhe,Ki]),rg=Ki(),[che,Zi]=tu(Fo),[uhe,dhe]=tu(Fo),gB=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:i,value:o,defaultValue:c,onValueChange:d,dir:f,name:h,autoComplete:p,disabled:y,required:g,form:j}=e,b=rg(t),[x,S]=v.useState(null),[N,C]=v.useState(null),[E,_]=v.useState(!1),k=Jc(f),[O,R]=ia({prop:r,defaultProp:a??!1,onChange:i,caller:Fo}),[T,F]=ia({prop:o,defaultProp:c,onChange:d,caller:Fo}),L=v.useRef(null),$=x?j||!!x.closest("form"):!0,[Y,H]=v.useState(new Set),K=Array.from(Y).map(J=>J.props.value).join(";");return s.jsx(Wm,{...b,children:s.jsxs(che,{required:g,scope:t,trigger:x,onTriggerChange:S,valueNode:N,onValueNodeChange:C,valueNodeHasChildren:E,onValueNodeHasChildrenChange:_,contentId:Vn(),value:T,onValueChange:F,open:O,onOpenChange:R,dir:k,triggerPointerDownPosRef:L,disabled:y,children:[s.jsx(tg.Provider,{scope:t,children:s.jsx(uhe,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(J=>{H(Q=>new Set(Q).add(J))},[]),onNativeOptionRemove:v.useCallback(J=>{H(Q=>{const D=new Set(Q);return D.delete(J),D})},[]),children:n})}),$?s.jsxs(zB,{"aria-hidden":!0,required:g,tabIndex:-1,name:h,autoComplete:p,value:T,onChange:J=>F(J.target.value),disabled:y,form:j,children:[T===void 0?s.jsx("option",{value:""}):null,Array.from(Y)]},K):null]})})};gB.displayName=Fo;var yB="SelectTrigger",xB=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,i=rg(n),o=Zi(yB,n),c=o.disabled||r,d=vt(t,o.onTriggerChange),f=ng(n),h=v.useRef("touch"),[p,y,g]=qB(b=>{const x=f().filter(C=>!C.disabled),S=x.find(C=>C.value===o.value),N=WB(x,b,S);N!==void 0&&o.onValueChange(N.value)}),j=b=>{c||(o.onOpenChange(!0),g()),b&&(o.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return s.jsx(cf,{asChild:!0,...i,children:s.jsx(Ke.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":UB(o.value)?"":void 0,...a,ref:d,onClick:ke(a.onClick,b=>{b.currentTarget.focus(),h.current!=="mouse"&&j(b)}),onPointerDown:ke(a.onPointerDown,b=>{h.current=b.pointerType;const x=b.target;x.hasPointerCapture(b.pointerId)&&x.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(j(b),b.preventDefault())}),onKeyDown:ke(a.onKeyDown,b=>{const x=p.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&y(b.key),!(x&&b.key===" ")&&ihe.includes(b.key)&&(j(),b.preventDefault())})})})});xB.displayName=yB;var bB="SelectValue",wB=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:i,placeholder:o="",...c}=e,d=Zi(bB,n),{onValueNodeHasChildrenChange:f}=d,h=i!==void 0,p=vt(t,d.onValueNodeChange);return Hn(()=>{f(h)},[f,h]),s.jsx(Ke.span,{...c,ref:p,style:{pointerEvents:"none"},children:UB(d.value)?s.jsx(s.Fragment,{children:o}):i})});wB.displayName=bB;var fhe="SelectIcon",jB=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return s.jsx(Ke.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});jB.displayName=fhe;var phe="SelectPortal",SB=e=>s.jsx(Dc,{asChild:!0,...e});SB.displayName=phe;var Bo="SelectContent",NB=v.forwardRef((e,t)=>{const n=Zi(Bo,e.__scopeSelect),[r,a]=v.useState();if(Hn(()=>{a(new DocumentFragment)},[]),!n.open){const i=r;return i?$c.createPortal(s.jsx(CB,{scope:e.__scopeSelect,children:s.jsx(tg.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),i):null}return s.jsx(AB,{...e,ref:t})});NB.displayName=Bo;var La=10,[CB,eo]=tu(Bo),hhe="SelectContentImpl",mhe=ehe("SelectContent.RemoveScroll"),AB=v.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:o,side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:y,collisionPadding:g,sticky:j,hideWhenDetached:b,avoidCollisions:x,...S}=e,N=Zi(Bo,n),[C,E]=v.useState(null),[_,k]=v.useState(null),O=vt(t,ce=>E(ce)),[R,T]=v.useState(null),[F,L]=v.useState(null),$=ng(n),[Y,H]=v.useState(!1),K=v.useRef(!1);v.useEffect(()=>{if(C)return av(C)},[C]),nv();const J=v.useCallback(ce=>{const[he,...ie]=$().map(ae=>ae.ref.current),[ue]=ie.slice(-1),Ae=document.activeElement;for(const ae of ce)if(ae===Ae||(ae?.scrollIntoView({block:"nearest"}),ae===he&&_&&(_.scrollTop=0),ae===ue&&_&&(_.scrollTop=_.scrollHeight),ae?.focus(),document.activeElement!==Ae))return},[$,_]),Q=v.useCallback(()=>J([R,C]),[J,R,C]);v.useEffect(()=>{Y&&Q()},[Y,Q]);const{onOpenChange:D,triggerPointerDownPosRef:B}=N;v.useEffect(()=>{if(C){let ce={x:0,y:0};const he=ue=>{ce={x:Math.abs(Math.round(ue.pageX)-(B.current?.x??0)),y:Math.abs(Math.round(ue.pageY)-(B.current?.y??0))}},ie=ue=>{ce.x<=10&&ce.y<=10?ue.preventDefault():C.contains(ue.target)||D(!1),document.removeEventListener("pointermove",he),B.current=null};return B.current!==null&&(document.addEventListener("pointermove",he),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",he),document.removeEventListener("pointerup",ie,{capture:!0})}}},[C,D,B]),v.useEffect(()=>{const ce=()=>D(!1);return window.addEventListener("blur",ce),window.addEventListener("resize",ce),()=>{window.removeEventListener("blur",ce),window.removeEventListener("resize",ce)}},[D]);const[Z,z]=qB(ce=>{const he=$().filter(Ae=>!Ae.disabled),ie=he.find(Ae=>Ae.ref.current===document.activeElement),ue=WB(he,ce,ie);ue&&setTimeout(()=>ue.ref.current.focus())}),M=v.useCallback((ce,he,ie)=>{const ue=!K.current&&!ie;(N.value!==void 0&&N.value===he||ue)&&(T(ce),ue&&(K.current=!0))},[N.value]),re=v.useCallback(()=>C?.focus(),[C]),te=v.useCallback((ce,he,ie)=>{const ue=!K.current&&!ie;(N.value!==void 0&&N.value===he||ue)&&L(ce)},[N.value]),G=r==="popper"?xS:_B,de=G===xS?{side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:y,collisionPadding:g,sticky:j,hideWhenDetached:b,avoidCollisions:x}:{};return s.jsx(CB,{scope:n,content:C,viewport:_,onViewportChange:k,itemRefCallback:M,selectedItem:R,onItemLeave:re,itemTextRefCallback:te,focusSelectedItem:Q,selectedItemText:F,position:r,isPositioned:Y,searchRef:Z,children:s.jsx(df,{as:mhe,allowPinchZoom:!0,children:s.jsx(uf,{asChild:!0,trapped:N.open,onMountAutoFocus:ce=>{ce.preventDefault()},onUnmountAutoFocus:ke(a,ce=>{N.trigger?.focus({preventScroll:!0}),ce.preventDefault()}),children:s.jsx(Uo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:ce=>ce.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:s.jsx(G,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:ce=>ce.preventDefault(),...S,...de,onPlaced:()=>H(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:ke(S.onKeyDown,ce=>{const he=ce.ctrlKey||ce.altKey||ce.metaKey;if(ce.key==="Tab"&&ce.preventDefault(),!he&&ce.key.length===1&&z(ce.key),["ArrowUp","ArrowDown","Home","End"].includes(ce.key)){let ue=$().filter(Ae=>!Ae.disabled).map(Ae=>Ae.ref.current);if(["ArrowUp","End"].includes(ce.key)&&(ue=ue.slice().reverse()),["ArrowUp","ArrowDown"].includes(ce.key)){const Ae=ce.target,ae=ue.indexOf(Ae);ue=ue.slice(ae+1)}setTimeout(()=>J(ue)),ce.preventDefault()}})})})})})})});AB.displayName=hhe;var vhe="SelectItemAlignedPosition",_B=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,i=Zi(Bo,n),o=eo(Bo,n),[c,d]=v.useState(null),[f,h]=v.useState(null),p=vt(t,O=>h(O)),y=ng(n),g=v.useRef(!1),j=v.useRef(!0),{viewport:b,selectedItem:x,selectedItemText:S,focusSelectedItem:N}=o,C=v.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&f&&b&&x&&S){const O=i.trigger.getBoundingClientRect(),R=f.getBoundingClientRect(),T=i.valueNode.getBoundingClientRect(),F=S.getBoundingClientRect();if(i.dir!=="rtl"){const Ae=F.left-R.left,ae=T.left-Ae,$e=O.left-ae,W=O.width+$e,ve=Math.max(W,R.width),oe=window.innerWidth-La,be=rf(ae,[La,Math.max(La,oe-ve)]);c.style.minWidth=W+"px",c.style.left=be+"px"}else{const Ae=R.right-F.right,ae=window.innerWidth-T.right-Ae,$e=window.innerWidth-O.right-ae,W=O.width+$e,ve=Math.max(W,R.width),oe=window.innerWidth-La,be=rf(ae,[La,Math.max(La,oe-ve)]);c.style.minWidth=W+"px",c.style.right=be+"px"}const L=y(),$=window.innerHeight-La*2,Y=b.scrollHeight,H=window.getComputedStyle(f),K=parseInt(H.borderTopWidth,10),J=parseInt(H.paddingTop,10),Q=parseInt(H.borderBottomWidth,10),D=parseInt(H.paddingBottom,10),B=K+J+Y+D+Q,Z=Math.min(x.offsetHeight*5,B),z=window.getComputedStyle(b),M=parseInt(z.paddingTop,10),re=parseInt(z.paddingBottom,10),te=O.top+O.height/2-La,G=$-te,de=x.offsetHeight/2,ce=x.offsetTop+de,he=K+J+ce,ie=B-he;if(he<=te){const Ae=L.length>0&&x===L[L.length-1].ref.current;c.style.bottom="0px";const ae=f.clientHeight-b.offsetTop-b.offsetHeight,$e=Math.max(G,de+(Ae?re:0)+ae+Q),W=he+$e;c.style.height=W+"px"}else{const Ae=L.length>0&&x===L[0].ref.current;c.style.top="0px";const $e=Math.max(te,K+b.offsetTop+(Ae?M:0)+de)+ie;c.style.height=$e+"px",b.scrollTop=he-te+b.offsetTop}c.style.margin=`${La}px 0`,c.style.minHeight=Z+"px",c.style.maxHeight=$+"px",r?.(),requestAnimationFrame(()=>g.current=!0)}},[y,i.trigger,i.valueNode,c,f,b,x,S,i.dir,r]);Hn(()=>C(),[C]);const[E,_]=v.useState();Hn(()=>{f&&_(window.getComputedStyle(f).zIndex)},[f]);const k=v.useCallback(O=>{O&&j.current===!0&&(C(),N?.(),j.current=!1)},[C,N]);return s.jsx(yhe,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:k,children:s.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:s.jsx(Ke.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});_B.displayName=vhe;var ghe="SelectPopperPosition",xS=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=La,...i}=e,o=rg(n);return s.jsx(Vm,{...o,...i,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});xS.displayName=ghe;var[yhe,xC]=tu(Bo,{}),bS="SelectViewport",EB=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,i=eo(bS,n),o=xC(bS,n),c=vt(t,i.onViewportChange),d=v.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),s.jsx(tg.Slot,{scope:n,children:s.jsx(Ke.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:ke(a.onScroll,f=>{const h=f.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:y}=o;if(y?.current&&p){const g=Math.abs(d.current-h.scrollTop);if(g>0){const j=window.innerHeight-La*2,b=parseFloat(p.style.minHeight),x=parseFloat(p.style.height),S=Math.max(b,x);if(S<j){const N=S+g,C=Math.min(j,N),E=N-C;p.style.height=C+"px",p.style.bottom==="0px"&&(h.scrollTop=E>0?E:0,p.style.justifyContent="flex-end")}}}d.current=h.scrollTop})})})]})});EB.displayName=bS;var PB="SelectGroup",[xhe,bhe]=tu(PB),whe=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Vn();return s.jsx(xhe,{scope:n,id:a,children:s.jsx(Ke.div,{role:"group","aria-labelledby":a,...r,ref:t})})});whe.displayName=PB;var kB="SelectLabel",OB=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=bhe(kB,n);return s.jsx(Ke.div,{id:a.id,...r,ref:t})});OB.displayName=kB;var Pm="SelectItem",[jhe,RB]=tu(Pm),TB=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:i,...o}=e,c=Zi(Pm,n),d=eo(Pm,n),f=c.value===r,[h,p]=v.useState(i??""),[y,g]=v.useState(!1),j=vt(t,N=>d.itemRefCallback?.(N,r,a)),b=Vn(),x=v.useRef("touch"),S=()=>{a||(c.onValueChange(r),c.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return s.jsx(jhe,{scope:n,value:r,disabled:a,textId:b,isSelected:f,onItemTextChange:v.useCallback(N=>{p(C=>C||(N?.textContent??"").trim())},[]),children:s.jsx(tg.ItemSlot,{scope:n,value:r,disabled:a,textValue:h,children:s.jsx(Ke.div,{role:"option","aria-labelledby":b,"data-highlighted":y?"":void 0,"aria-selected":f&&y,"data-state":f?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...o,ref:j,onFocus:ke(o.onFocus,()=>g(!0)),onBlur:ke(o.onBlur,()=>g(!1)),onClick:ke(o.onClick,()=>{x.current!=="mouse"&&S()}),onPointerUp:ke(o.onPointerUp,()=>{x.current==="mouse"&&S()}),onPointerDown:ke(o.onPointerDown,N=>{x.current=N.pointerType}),onPointerMove:ke(o.onPointerMove,N=>{x.current=N.pointerType,a?d.onItemLeave?.():x.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ke(o.onPointerLeave,N=>{N.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:ke(o.onKeyDown,N=>{d.searchRef?.current!==""&&N.key===" "||(ohe.includes(N.key)&&S(),N.key===" "&&N.preventDefault())})})})})});TB.displayName=Pm;var td="SelectItemText",IB=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...i}=e,o=Zi(td,n),c=eo(td,n),d=RB(td,n),f=dhe(td,n),[h,p]=v.useState(null),y=vt(t,S=>p(S),d.onItemTextChange,S=>c.itemTextRefCallback?.(S,d.value,d.disabled)),g=h?.textContent,j=v.useMemo(()=>s.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value),[d.disabled,d.value,g]),{onNativeOptionAdd:b,onNativeOptionRemove:x}=f;return Hn(()=>(b(j),()=>x(j)),[b,x,j]),s.jsxs(s.Fragment,{children:[s.jsx(Ke.span,{id:d.textId,...i,ref:y}),d.isSelected&&o.valueNode&&!o.valueNodeHasChildren?$c.createPortal(i.children,o.valueNode):null]})});IB.displayName=td;var MB="SelectItemIndicator",$B=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return RB(MB,n).isSelected?s.jsx(Ke.span,{"aria-hidden":!0,...r,ref:t}):null});$B.displayName=MB;var wS="SelectScrollUpButton",DB=v.forwardRef((e,t)=>{const n=eo(wS,e.__scopeSelect),r=xC(wS,e.__scopeSelect),[a,i]=v.useState(!1),o=vt(t,r.onScrollButtonChange);return Hn(()=>{if(n.viewport&&n.isPositioned){let c=function(){const f=d.scrollTop>0;i(f)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),a?s.jsx(FB,{...e,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});DB.displayName=wS;var jS="SelectScrollDownButton",LB=v.forwardRef((e,t)=>{const n=eo(jS,e.__scopeSelect),r=xC(jS,e.__scopeSelect),[a,i]=v.useState(!1),o=vt(t,r.onScrollButtonChange);return Hn(()=>{if(n.viewport&&n.isPositioned){let c=function(){const f=d.scrollHeight-d.clientHeight,h=Math.ceil(d.scrollTop)<f;i(h)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),a?s.jsx(FB,{...e,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});LB.displayName=jS;var FB=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,i=eo("SelectScrollButton",n),o=v.useRef(null),c=ng(n),d=v.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return v.useEffect(()=>()=>d(),[d]),Hn(()=>{c().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),s.jsx(Ke.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:ke(a.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:ke(a.onPointerMove,()=>{i.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:ke(a.onPointerLeave,()=>{d()})})}),She="SelectSeparator",BB=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(Ke.div,{"aria-hidden":!0,...r,ref:t})});BB.displayName=She;var SS="SelectArrow",Nhe=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=rg(n),i=Zi(SS,n),o=eo(SS,n);return i.open&&o.position==="popper"?s.jsx(Hm,{...a,...r,ref:t}):null});Nhe.displayName=SS;var Che="SelectBubbleInput",zB=v.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=v.useRef(null),i=vt(r,a),o=Qv(t);return v.useEffect(()=>{const c=a.current;if(!c)return;const d=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(d,"value").set;if(o!==t&&h){const p=new Event("change",{bubbles:!0});h.call(c,t),c.dispatchEvent(p)}},[o,t]),s.jsx(Ke.select,{...n,style:{...UM,...n.style},ref:i,defaultValue:t})});zB.displayName=Che;function UB(e){return e===""||e===void 0}function qB(e){const t=Rn(e),n=v.useRef(""),r=v.useRef(0),a=v.useCallback(o=>{const c=n.current+o;t(c),(function d(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(c)},[t]),i=v.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}function WB(e,t,n){const a=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=Ahe(e,Math.max(i,0));a.length===1&&(o=o.filter(f=>f!==n));const d=o.find(f=>f.textValue.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function Ahe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var _he=gB,VB=xB,Ehe=wB,Phe=jB,khe=SB,HB=NB,Ohe=EB,KB=OB,GB=TB,Rhe=IB,The=$B,YB=DB,XB=LB,QB=BB;const cn=_he,un=Ehe,tn=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(VB,{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,s.jsx(Phe,{asChild:!0,children:s.jsx(Gt,{className:"h-4 w-4 opacity-50"})})]}));tn.displayName=VB.displayName;const JB=v.forwardRef(({className:e,...t},n)=>s.jsx(YB,{ref:n,className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(ds,{className:"h-4 w-4"})}));JB.displayName=YB.displayName;const ZB=v.forwardRef(({className:e,...t},n)=>s.jsx(XB,{ref:n,className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Gt,{className:"h-4 w-4"})}));ZB.displayName=XB.displayName;const nn=v.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>s.jsx(khe,{children:s.jsxs(HB,{ref:a,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:[s.jsx(JB,{}),s.jsx(Ohe,{className:Se("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(ZB,{})]})}));nn.displayName=HB.displayName;const Ihe=v.forwardRef(({className:e,...t},n)=>s.jsx(KB,{ref:n,className:Se("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Ihe.displayName=KB.displayName;const lt=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(GB,{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:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(The,{children:s.jsx(sc,{className:"h-4 w-4"})})}),s.jsx(Rhe,{children:t})]}));lt.displayName=GB.displayName;const Mhe=v.forwardRef(({className:e,...t},n)=>s.jsx(QB,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",e),...t}));Mhe.displayName=QB.displayName;var ag="Collapsible",[$he]=lr(ag),[Dhe,bC]=$he(ag),ez=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:i,onOpenChange:o,...c}=e,[d,f]=ia({prop:r,defaultProp:a??!1,onChange:o,caller:ag});return s.jsx(Dhe,{scope:n,disabled:i,contentId:Vn(),open:d,onOpenToggle:v.useCallback(()=>f(h=>!h),[f]),children:s.jsx(Ke.div,{"data-state":jC(d),"data-disabled":i?"":void 0,...c,ref:t})})});ez.displayName=ag;var tz="CollapsibleTrigger",nz=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,a=bC(tz,n);return s.jsx(Ke.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":jC(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:t,onClick:ke(e.onClick,a.onOpenToggle)})});nz.displayName=tz;var wC="CollapsibleContent",rz=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=bC(wC,e.__scopeCollapsible);return s.jsx(Kn,{present:n||a.open,children:({present:i})=>s.jsx(Lhe,{...r,ref:t,present:i})})});rz.displayName=wC;var Lhe=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:a,...i}=e,o=bC(wC,n),[c,d]=v.useState(r),f=v.useRef(null),h=vt(t,f),p=v.useRef(0),y=p.current,g=v.useRef(0),j=g.current,b=o.open||c,x=v.useRef(b),S=v.useRef(void 0);return v.useEffect(()=>{const N=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(N)},[]),Hn(()=>{const N=f.current;if(N){S.current=S.current||{transitionDuration:N.style.transitionDuration,animationName:N.style.animationName},N.style.transitionDuration="0s",N.style.animationName="none";const C=N.getBoundingClientRect();p.current=C.height,g.current=C.width,x.current||(N.style.transitionDuration=S.current.transitionDuration,N.style.animationName=S.current.animationName),d(r)}},[o.open,r]),s.jsx(Ke.div,{"data-state":jC(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!b,...i,ref:h,style:{"--radix-collapsible-content-height":y?`${y}px`:void 0,"--radix-collapsible-content-width":j?`${j}px`:void 0,...e.style},children:b&&a})});function jC(e){return e?"open":"closed"}var Fhe=ez;const Ti=Fhe,Ls=nz,Ii=rz,Bhe=iv,zhe=ov,az=v.forwardRef(({className:e,...t},n)=>s.jsx(qc,{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}));az.displayName=qc.displayName;const sz=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(zhe,{children:[s.jsx(az,{}),s.jsxs(Wc,{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,s.jsxs(lv,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[s.jsx(Ys,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));sz.displayName=Wc.displayName;const iz=({className:e,...t})=>s.jsx("div",{className:Se("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});iz.displayName="DialogHeader";const oz=v.forwardRef(({className:e,...t},n)=>s.jsx(ff,{ref:n,className:Se("text-lg font-semibold leading-none tracking-tight",e),...t}));oz.displayName=ff.displayName;const lz=v.forwardRef(({className:e,...t},n)=>s.jsx(pf,{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));lz.displayName=pf.displayName;function Uhe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var SC="ScrollArea",[cz]=lr(SC),[qhe,Pa]=cz(SC),uz=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:a,scrollHideDelay:i=600,...o}=e,[c,d]=v.useState(null),[f,h]=v.useState(null),[p,y]=v.useState(null),[g,j]=v.useState(null),[b,x]=v.useState(null),[S,N]=v.useState(0),[C,E]=v.useState(0),[_,k]=v.useState(!1),[O,R]=v.useState(!1),T=vt(t,L=>d(L)),F=Jc(a);return s.jsx(qhe,{scope:n,type:r,dir:F,scrollHideDelay:i,scrollArea:c,viewport:f,onViewportChange:h,content:p,onContentChange:y,scrollbarX:g,onScrollbarXChange:j,scrollbarXEnabled:_,onScrollbarXEnabledChange:k,scrollbarY:b,onScrollbarYChange:x,scrollbarYEnabled:O,onScrollbarYEnabledChange:R,onCornerWidthChange:N,onCornerHeightChange:E,children:s.jsx(Ke.div,{dir:F,...o,ref:T,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":C+"px",...e.style}})})});uz.displayName=SC;var dz="ScrollAreaViewport",fz=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...i}=e,o=Pa(dz,n),c=v.useRef(null),d=vt(t,c,o.onViewportChange);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),s.jsx(Ke.div,{"data-radix-scroll-area-viewport":"",...i,ref:d,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:s.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});fz.displayName=dz;var Ns="ScrollAreaScrollbar",NC=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Pa(Ns,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=a,c=e.orientation==="horizontal";return v.useEffect(()=>(c?i(!0):o(!0),()=>{c?i(!1):o(!1)}),[c,i,o]),a.type==="hover"?s.jsx(Whe,{...r,ref:t,forceMount:n}):a.type==="scroll"?s.jsx(Vhe,{...r,ref:t,forceMount:n}):a.type==="auto"?s.jsx(pz,{...r,ref:t,forceMount:n}):a.type==="always"?s.jsx(CC,{...r,ref:t}):null});NC.displayName=Ns;var Whe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Pa(Ns,e.__scopeScrollArea),[i,o]=v.useState(!1);return v.useEffect(()=>{const c=a.scrollArea;let d=0;if(c){const f=()=>{window.clearTimeout(d),o(!0)},h=()=>{d=window.setTimeout(()=>o(!1),a.scrollHideDelay)};return c.addEventListener("pointerenter",f),c.addEventListener("pointerleave",h),()=>{window.clearTimeout(d),c.removeEventListener("pointerenter",f),c.removeEventListener("pointerleave",h)}}},[a.scrollArea,a.scrollHideDelay]),s.jsx(Kn,{present:n||i,children:s.jsx(pz,{"data-state":i?"visible":"hidden",...r,ref:t})})}),Vhe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Pa(Ns,e.__scopeScrollArea),i=e.orientation==="horizontal",o=ig(()=>d("SCROLL_END"),100),[c,d]=Uhe("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return v.useEffect(()=>{if(c==="idle"){const f=window.setTimeout(()=>d("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(f)}},[c,a.scrollHideDelay,d]),v.useEffect(()=>{const f=a.viewport,h=i?"scrollLeft":"scrollTop";if(f){let p=f[h];const y=()=>{const g=f[h];p!==g&&(d("SCROLL"),o()),p=g};return f.addEventListener("scroll",y),()=>f.removeEventListener("scroll",y)}},[a.viewport,i,d,o]),s.jsx(Kn,{present:n||c!=="hidden",children:s.jsx(CC,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:ke(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:ke(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),pz=v.forwardRef((e,t)=>{const n=Pa(Ns,e.__scopeScrollArea),{forceMount:r,...a}=e,[i,o]=v.useState(!1),c=e.orientation==="horizontal",d=ig(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;o(c?f:h)}},10);return Ic(n.viewport,d),Ic(n.content,d),s.jsx(Kn,{present:r||i,children:s.jsx(CC,{"data-state":i?"visible":"hidden",...a,ref:t})})}),CC=v.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,a=Pa(Ns,e.__scopeScrollArea),i=v.useRef(null),o=v.useRef(0),[c,d]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=yz(c.viewport,c.content),h={...r,sizes:c,onSizesChange:d,hasThumb:f>0&&f<1,onThumbChange:y=>i.current=y,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:y=>o.current=y};function p(y,g){return Qhe(y,o.current,c,g)}return n==="horizontal"?s.jsx(Hhe,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const y=a.viewport.scrollLeft,g=cM(y,c,a.dir);i.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:y=>{a.viewport&&(a.viewport.scrollLeft=y)},onDragScroll:y=>{a.viewport&&(a.viewport.scrollLeft=p(y,a.dir))}}):n==="vertical"?s.jsx(Khe,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const y=a.viewport.scrollTop,g=cM(y,c);i.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:y=>{a.viewport&&(a.viewport.scrollTop=y)},onDragScroll:y=>{a.viewport&&(a.viewport.scrollTop=p(y))}}):null}),Hhe=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=Pa(Ns,e.__scopeScrollArea),[o,c]=v.useState(),d=v.useRef(null),f=vt(t,d,i.onScrollbarXChange);return v.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),s.jsx(mz,{"data-orientation":"horizontal",...a,ref:f,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":sg(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,p)=>{if(i.viewport){const y=i.viewport.scrollLeft+h.deltaX;e.onWheelScroll(y),bz(y,p)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&o&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:Om(o.paddingLeft),paddingEnd:Om(o.paddingRight)}})}})}),Khe=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=Pa(Ns,e.__scopeScrollArea),[o,c]=v.useState(),d=v.useRef(null),f=vt(t,d,i.onScrollbarYChange);return v.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),s.jsx(mz,{"data-orientation":"vertical",...a,ref:f,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":sg(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,p)=>{if(i.viewport){const y=i.viewport.scrollTop+h.deltaY;e.onWheelScroll(y),bz(y,p)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&o&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:Om(o.paddingTop),paddingEnd:Om(o.paddingBottom)}})}})}),[Ghe,hz]=cz(Ns),mz=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:a,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:h,onResize:p,...y}=e,g=Pa(Ns,n),[j,b]=v.useState(null),x=vt(t,T=>b(T)),S=v.useRef(null),N=v.useRef(""),C=g.viewport,E=r.content-r.viewport,_=Rn(h),k=Rn(d),O=ig(p,10);function R(T){if(S.current){const F=T.clientX-S.current.left,L=T.clientY-S.current.top;f({x:F,y:L})}}return v.useEffect(()=>{const T=F=>{const L=F.target;j?.contains(L)&&_(F,E)};return document.addEventListener("wheel",T,{passive:!1}),()=>document.removeEventListener("wheel",T,{passive:!1})},[C,j,E,_]),v.useEffect(k,[r,k]),Ic(j,O),Ic(g.content,O),s.jsx(Ghe,{scope:n,scrollbar:j,hasThumb:a,onThumbChange:Rn(i),onThumbPointerUp:Rn(o),onThumbPositionChange:k,onThumbPointerDown:Rn(c),children:s.jsx(Ke.div,{...y,ref:x,style:{position:"absolute",...y.style},onPointerDown:ke(e.onPointerDown,T=>{T.button===0&&(T.target.setPointerCapture(T.pointerId),S.current=j.getBoundingClientRect(),N.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),R(T))}),onPointerMove:ke(e.onPointerMove,R),onPointerUp:ke(e.onPointerUp,T=>{const F=T.target;F.hasPointerCapture(T.pointerId)&&F.releasePointerCapture(T.pointerId),document.body.style.webkitUserSelect=N.current,g.viewport&&(g.viewport.style.scrollBehavior=""),S.current=null})})})}),km="ScrollAreaThumb",vz=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=hz(km,e.__scopeScrollArea);return s.jsx(Kn,{present:n||a.hasThumb,children:s.jsx(Yhe,{ref:t,...r})})}),Yhe=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,i=Pa(km,n),o=hz(km,n),{onThumbPositionChange:c}=o,d=vt(t,p=>o.onThumbChange(p)),f=v.useRef(void 0),h=ig(()=>{f.current&&(f.current(),f.current=void 0)},100);return v.useEffect(()=>{const p=i.viewport;if(p){const y=()=>{if(h(),!f.current){const g=Jhe(p,c);f.current=g,c()}};return c(),p.addEventListener("scroll",y),()=>p.removeEventListener("scroll",y)}},[i.viewport,h,c]),s.jsx(Ke.div,{"data-state":o.hasThumb?"visible":"hidden",...a,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:ke(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:ke(e.onPointerUp,o.onThumbPointerUp)})});vz.displayName=km;var AC="ScrollAreaCorner",gz=v.forwardRef((e,t)=>{const n=Pa(AC,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx(Xhe,{...e,ref:t}):null});gz.displayName=AC;var Xhe=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=Pa(AC,n),[i,o]=v.useState(0),[c,d]=v.useState(0),f=!!(i&&c);return Ic(a.scrollbarX,()=>{const h=a.scrollbarX?.offsetHeight||0;a.onCornerHeightChange(h),d(h)}),Ic(a.scrollbarY,()=>{const h=a.scrollbarY?.offsetWidth||0;a.onCornerWidthChange(h),o(h)}),f?s.jsx(Ke.div,{...r,ref:t,style:{width:i,height:c,position:"absolute",right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Om(e){return e?parseInt(e,10):0}function yz(e,t){const n=e/t;return isNaN(n)?0:n}function sg(e){const t=yz(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Qhe(e,t,n,r="ltr"){const a=sg(n),i=a/2,o=t||i,c=a-o,d=n.scrollbar.paddingStart+o,f=n.scrollbar.size-n.scrollbar.paddingEnd-c,h=n.content-n.viewport,p=r==="ltr"?[0,h]:[h*-1,0];return xz([d,f],p)(e)}function cM(e,t,n="ltr"){const r=sg(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-a,o=t.content-t.viewport,c=i-r,d=n==="ltr"?[0,o]:[o*-1,0],f=rf(e,d);return xz([0,o],[0,c])(f)}function xz(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 bz(e,t){return e>0&&e<t}var Jhe=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function a(){const i={left:e.scrollLeft,top:e.scrollTop},o=n.left!==i.left,c=n.top!==i.top;(o||c)&&t(),n=i,r=window.requestAnimationFrame(a)})(),()=>window.cancelAnimationFrame(r)};function ig(e,t){const n=Rn(e),r=v.useRef(0);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),v.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Ic(e,t){const n=Rn(t);Hn(()=>{let r=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return a.observe(e),()=>{window.cancelAnimationFrame(r),a.unobserve(e)}}},[e,n])}var wz=uz,Zhe=fz,eme=gz;const Rm=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(wz,{ref:r,className:Se("relative overflow-hidden",e),...n,children:[s.jsx(Zhe,{className:"h-full w-full rounded-[inherit]",children:t}),s.jsx(jz,{}),s.jsx(eme,{})]}));Rm.displayName=wz.displayName;const jz=v.forwardRef(({className:e,orientation:t="vertical",...n},r)=>s.jsx(NC,{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:s.jsx(vz,{className:"relative flex-1 rounded-full bg-border"})}));jz.displayName=NC.displayName;const tme=[{label:"Suggest Checks",description:"Propose stronger evaluation checks for this scenario.",prompt:"Suggest checks"},{label:"Suggest Value Capture Rules",description:"Recommend extract/value capture rules for key outputs.",prompt:"Suggest value capture rules"},{label:"Improve Prompt Determinism",description:"Reduce ambiguity and improve reproducibility.",prompt:"Improve prompt determinism"},{label:"Explain Snapshot Drift Risk",description:"Assess likely causes of drift and stabilization options.",prompt:"Explain snapshot drift risk"},{label:"Generate Scenario Draft",description:"Create a draft scenario from the current context.",prompt:"Generate scenario draft"}];function nme({open:e,onOpenChange:t,configId:n,configPath:r,scenario:a,agents:i,servers:o,snapshotEval:c,defaultAssistantAgentName:d,initialUserMessage:f,onApplyPatch:h}){const{source:p}=Tn(),[y,g]=v.useState(null),[j,b]=v.useState(null),[x,S]=v.useState(""),[N,C]=v.useState(!1),[E,_]=v.useState(new Set),k=v.useRef(null),O=v.useRef(null),R=v.useRef(null),[T,F]=v.useState(!1),L=v.useRef(!1),$=d||i[0]?.id||"";v.useEffect(()=>{if(!e||!$||y)return;let G=!1;return C(!0),p.createScenarioAssistantSession({configId:n,configPath:r,scenarioId:a.id,selectedAssistantAgentName:$,context:{configSnapshotPolicy:c?{enabled:c.enabled,mode:c.mode,baselineSnapshotId:c.baselineSnapshotId}:void 0,scenario:{id:a.id,name:a.name,prompt:a.prompt,serverNames:a.serverIds,evalRules:a.evalRules,extractRules:a.extractRules,snapshotEval:a.snapshotEval?{enabled:a.snapshotEval.enabled,baselineSnapshotId:a.snapshotEval.baselineSnapshotId}:void 0},availableServers:o.map(de=>({name:de.name||de.id,url:de.url})),availableAgents:i.map(de=>({name:de.name||de.id,provider:de.provider,model:de.model}))}}).then(de=>{G||(g(de.sessionId),b(de.session))}).catch(de=>{G||Pe({title:"Could not start Scenario Assistant",description:de instanceof Error?de.message:String(de),variant:"destructive"})}).finally(()=>{G||C(!1)}),()=>{G=!0}},[e,p,y,n,r,a,c,i,o,$]);const Y=()=>{g(null),b(null),S(""),_(new Set),R.current=null},H=G=>{Y(),p.closeScenarioAssistantSession(G).catch(()=>{})};v.useEffect(()=>{e||y&&(L.current||T||H(y))},[e,y,p,T]),v.useEffect(()=>()=>{y&&p.closeScenarioAssistantSession(y).catch(()=>{})},[y,p]),v.useEffect(()=>{if(!e)return;T&&F(!1),L.current&&(L.current=!1);const G=window.setTimeout(()=>{k.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(G)},[e,N,j?.messages.length,j?.pendingToolCalls.length,j?.warnings.length]),v.useEffect(()=>{const G=O.current;if(!G)return;G.style.height="0px";const de=Math.min(G.scrollHeight,160);G.style.height=`${Math.max(40,de)}px`},[x,e]);const K=i.length>0&&a.serverIds.length>0&&!!$,J=async G=>{if(!y)return;const de=G.trim();if(!de)return;const ce=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,he={id:ce,role:"user",text:de,createdAt:new Date().toISOString()};b(ie=>ie&&{...ie,messages:[...ie.messages,he]}),S(""),C(!0);try{const ie=await p.sendScenarioAssistantMessage(y,de);b(ie.session)}catch(ie){b(ue=>ue&&{...ue,messages:ue.messages.filter(Ae=>Ae.id!==ce)}),S(ue=>ue.trim()?ue:de),Pe({title:"Scenario Assistant error",description:ie instanceof Error?ie.message:String(ie),variant:"destructive"})}finally{C(!1)}},Q=G=>{S(G),requestAnimationFrame(()=>O.current?.focus())};v.useEffect(()=>{if(!e||!y||!j||!K||N)return;const G=String(f??"").trim();G&&R.current!==G&&(R.current=G,J(G))},[e,y,j,K,N,f]);const D=async G=>{if(y){C(!0);try{const de=await p.approveScenarioAssistantToolCall(y,G);b(de.session)}catch(de){Pe({title:"Tool call failed",description:de instanceof Error?de.message:String(de),variant:"destructive"})}finally{C(!1)}}},B=async G=>{if(y){C(!0);try{const de=await p.denyScenarioAssistantToolCall(y,G);b(de.session)}catch(de){Pe({title:"Could not deny tool call",description:de instanceof Error?de.message:String(de),variant:"destructive"})}finally{C(!1)}}},Z=async()=>{if(y){C(!0);try{const G=await p.approveAllScenarioAssistantToolCalls(y);b(G.session)}catch(G){Pe({title:"Could not approve all tool calls",description:G instanceof Error?G.message:String(G),variant:"destructive"})}finally{C(!1)}}},z=(G,de,ce)=>{if(!de)return;if(ce==="prompt"&&de.prompt&&h({prompt:de.prompt.replacement}),ce==="evalRules"&&de.evalRules&&h({evalRules:de.evalRules.replacement}),ce==="extractRules"&&de.extractRules&&h({extractRules:de.extractRules.replacement}),ce==="snapshotEval"&&de.snapshotEval&&h({snapshotEval:{enabled:de.snapshotEval.patch.enabled,baselineSnapshotId:de.snapshotEval.patch.baselineSnapshotId}}),G){const ie=`${G}:${ce}`;_(ue=>new Set([...ue,ie]))}Pe({title:"Applied suggestion",description:`Updated ${{prompt:"Prompt",evalRules:"Checks",extractRules:"Value Capture Rules",snapshotEval:"Snapshot Settings"}[ce]}`})},M=G=>{G||(F(!1),L.current=!1),t(G)},re=()=>{L.current=!0,F(!0),t(!1)},te=()=>{L.current=!1,F(!1),y&&H(y)};return s.jsxs(s.Fragment,{children:[!e&&y&&s.jsxs("div",{className:"mt-3 flex items-center justify-between gap-2 rounded-md border bg-background px-3 py-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm font-medium",children:"Scenario Assistant (session active)"}),s.jsxs("p",{className:"truncate text-xs text-muted-foreground",children:["Resume conversation for ",s.jsx("span",{className:"font-mono",children:a.id}),j?` · ${j.messages.length} messages`:""]})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[s.jsxs(le,{type:"button",size:"sm",variant:"outline",onClick:()=>t(!0),children:[s.jsx(ya,{className:"mr-1.5 h-3.5 w-3.5"}),"Resume"]}),s.jsx(le,{type:"button",size:"sm",variant:"ghost",className:"h-8 px-2 text-muted-foreground",onClick:te,"aria-label":"Discard assistant session",title:"Discard assistant session",children:s.jsx(Ys,{className:"h-4 w-4"})})]})]}),s.jsx(Bhe,{open:e,onOpenChange:M,children:s.jsxs(sz,{className:"max-w-6xl h-[85vh] flex flex-col",children:[y&&s.jsxs("button",{type:"button",className:"absolute right-12 top-4 z-10 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",onClick:re,"aria-label":"Minimize assistant",title:"Minimize assistant",children:[s.jsx(z7,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Minimize"})]}),s.jsx(iz,{className:"pr-20",children:s.jsx("div",{className:"flex items-start justify-between gap-3",children:s.jsxs("div",{className:"min-w-0",children:[s.jsxs(oz,{className:"flex items-center gap-2",children:[s.jsx(ya,{className:"h-4 w-4"}),"Scenario Assistant"]}),s.jsx(lz,{children:"LLM-guided scenario authoring with MCP tool introspection and per-tool-call approval."})]})})}),K?s.jsxs("div",{className:"min-h-0 flex flex-1 flex-col gap-3",children:[s.jsx("div",{className:"grid gap-3 sm:grid-cols-1",children:s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"MCP Context"}),s.jsxs("div",{className:"h-8 rounded-md border px-2 text-xs flex items-center gap-2",children:[s.jsx(os,{className:"h-3.5 w-3.5"}),j?`Loaded ${j.toolsLoaded} tools`:"Preparing..."]})]})}),s.jsx(Rm,{className:"min-h-0 flex-1 rounded-md border p-3",children:s.jsxs("div",{className:"space-y-3",children:[j?.warnings?.map((G,de)=>s.jsx("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900",children:G},`${G}-${de}`)),j?.messages.map(G=>s.jsxs(v.Fragment,{children:[(()=>{const de=G.pendingToolCallIds??(G.pendingToolCallId?[G.pendingToolCallId]:[]),ce=de.map(ae=>(j?.pendingToolCalls??[]).find($e=>$e.id===ae)).filter(ae=>!!ae),he=de.map(ae=>j.pendingToolCalls.find($e=>$e.id===ae)??j.pendingToolCalls.find($e=>$e.id===ae)).filter(Boolean);if(!(G.role==="assistant"&&de.length>0))return s.jsx("div",{className:"space-y-2",children:s.jsx(rme,{message:G})});const ue=ce.length,Ae=he.length-ue;return s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700",children:s.jsx(ba,{className:"h-3 w-3"})}),s.jsxs("div",{className:"w-full max-w-[92%] space-y-2",children:[s.jsx("div",{className:"rounded-md border border-border/60 bg-background px-3 py-2",children:s.jsx(NS,{text:G.text,variant:"assistant"})}),he.length>1&&ue>0&&s.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border border-amber-200 bg-amber-50/50 px-3 py-1.5",children:[s.jsxs("span",{className:"text-xs text-amber-900",children:[Ae," of ",he.length," tool calls resolved"]}),s.jsxs(le,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{Z()},children:["Approve All (",ue,")"]})]}),he.map(ae=>{const $e=ae.status==="pending",W=ae.tool??ae.publicToolName??"unknown_tool";return s.jsxs("details",{open:$e,className:"group overflow-hidden rounded-md border border-border/60 bg-background",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2",children:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(os,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:`Tool call ${W}`}),s.jsx("span",{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${$e?"bg-amber-100 text-amber-900":ae.status==="error"?"bg-red-100 text-red-900":ae.status==="denied"?"bg-gray-100 text-gray-700":"bg-muted text-muted-foreground"}`,children:$e?"Needs approval":ae.status==="error"?"Error":ae.status==="denied"?"Denied":"Approved"})]})}),s.jsx(Gt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),s.jsxs("div",{className:"space-y-2 border-t border-border/50 px-3 py-2",children:[s.jsx("pre",{className:"max-h-40 w-full max-w-full overflow-x-auto overflow-y-auto whitespace-pre rounded border bg-muted/50 p-2 text-xs",children:s.jsx("code",{children:JSON.stringify(ae.arguments??{},null,2)})}),$e&&s.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[s.jsx(le,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{B(ae.id)},children:"Deny"}),s.jsx(le,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{D(ae.id)},children:"Approve"})]})]})]},ae.id)})]})]})})(),G.suggestions&&s.jsxs("div",{className:"ml-0 space-y-3 rounded-md border border-dashed bg-muted/10 p-3",children:[s.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground",children:[s.jsx(ya,{className:"h-3.5 w-3.5"}),"Structured Suggestions"]}),G.suggestions.prompt&&s.jsx(sh,{title:"Prompt",rationale:G.suggestions.prompt.rationale,preview:G.suggestions.prompt.replacement,applied:E.has(`${G.id}:prompt`),onApply:()=>z(G.id,G.suggestions,"prompt")}),G.suggestions.evalRules&&s.jsx(sh,{title:"Checks",rationale:G.suggestions.evalRules.rationale,preview:JSON.stringify(G.suggestions.evalRules.replacement,null,2),applied:E.has(`${G.id}:evalRules`),onApply:()=>z(G.id,G.suggestions,"evalRules")}),G.suggestions.extractRules&&s.jsx(sh,{title:"Value Capture Rules",rationale:G.suggestions.extractRules.rationale,preview:JSON.stringify(G.suggestions.extractRules.replacement,null,2),applied:E.has(`${G.id}:extractRules`),onApply:()=>z(G.id,G.suggestions,"extractRules")}),G.suggestions.snapshotEval&&s.jsx(sh,{title:"Snapshot Settings",rationale:G.suggestions.snapshotEval.rationale,preview:JSON.stringify(G.suggestions.snapshotEval.patch,null,2),applied:E.has(`${G.id}:snapshotEval`),onApply:()=>z(G.id,G.suggestions,"snapshotEval")}),(()=>{const de=G.suggestions?.notes,ce=Array.isArray(de)?de:typeof de=="string"?[de]:[];return ce.length===0?null:s.jsxs("div",{className:"space-y-2 rounded-md border p-3",children:[s.jsx("h5",{className:"text-sm font-medium",children:"Notes"}),s.jsx("ul",{className:"space-y-1 text-xs text-muted-foreground list-disc pl-4",children:ce.map((he,ie)=>s.jsx("li",{children:he},`${G.id}-note-${ie}`))})]})})()]})]},G.id)),(j?.pendingToolCalls??[]).filter(G=>!(j?.messages??[]).some(de=>de.pendingToolCallId===G.id||de.pendingToolCallIds?.includes(G.id))).map(G=>s.jsxs("details",{open:!0,className:"group min-w-0 rounded-md border bg-background",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-2 p-3",children:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(os,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),s.jsx("p",{className:"min-w-0 truncate font-mono text-xs font-semibold",children:G.publicToolName||G.tool}),s.jsx("span",{className:"shrink-0 rounded bg-amber-100 px-1.5 py-0.5 text-[10px] font-semibold text-amber-900",children:"Needs approval"})]})}),s.jsx(Gt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),s.jsxs("div",{className:"border-t px-3 pb-3 pt-2",children:[s.jsx("pre",{className:"max-h-40 w-full max-w-full overflow-x-auto overflow-y-auto whitespace-pre rounded border bg-muted/50 p-2 text-xs",children:s.jsx("code",{children:JSON.stringify(G.arguments??{},null,2)})}),s.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[s.jsx(le,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{B(G.id)},children:"Deny"}),s.jsx(le,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{D(G.id)},children:"Approve"})]})]})]},G.id)),!j&&N&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(or,{className:"h-4 w-4 animate-spin"}),"Starting assistant session..."]}),j&&N&&s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700",children:s.jsx(ba,{className:"h-3 w-3"})}),s.jsxs("div",{className:"inline-flex items-center gap-2 rounded-md border bg-background px-3 py-2 text-sm text-muted-foreground",children:[s.jsx(or,{className:"h-4 w-4 animate-spin"}),"Thinking..."]})]}),s.jsx("div",{ref:k})]})}),s.jsxs("div",{className:"rounded-xl border bg-background p-2 shadow-sm",children:[s.jsx(qa,{ref:O,value:x,onChange:G=>S(G.target.value),placeholder:"Get assistance with creating or refining this scenario ...",disabled:!y||N,rows:1,className:"min-h-10 max-h-40 resize-none border-0 bg-transparent px-2 py-1 text-sm shadow-none focus-visible:ring-0 focus-visible:ring-offset-0",onKeyDown:G=>{G.key==="Enter"&&!G.shiftKey&&(G.preventDefault(),J(x))}}),s.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 px-1 pt-1",children:[s.jsxs(Zc,{children:[s.jsx(eu,{asChild:!0,children:s.jsxs(le,{type:"button",variant:"ghost",size:"sm",className:"h-7 shrink-0 gap-1 px-1.5 text-[11px] font-normal text-muted-foreground/80 hover:text-muted-foreground",disabled:!y||N,children:[s.jsx(ms,{className:"h-3 w-3"}),"Snippets",s.jsx(Gt,{className:"h-3 w-3"})]})}),s.jsxs(el,{align:"start",className:"w-[320px]",children:[s.jsx(mC,{children:"Scenario Assistant Snippets"}),s.jsx(vC,{}),tme.map(G=>s.jsx(yr,{className:"items-start whitespace-normal px-2 py-2",onSelect:()=>Q(G.prompt),children:s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("div",{className:"text-xs font-medium leading-tight",children:G.label}),s.jsx("div",{className:"text-[11px] leading-snug text-muted-foreground",children:G.description})]})},G.label))]})]}),s.jsx(le,{type:"button",size:"icon",className:"h-8 w-8 rounded-full",onClick:()=>{J(x)},disabled:!y||N||!x.trim(),"aria-label":"Send message",title:"Send message",children:N?s.jsx(or,{className:"h-4 w-4 animate-spin"}):s.jsxs(s.Fragment,{children:[s.jsx(x$,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Send"})]})})]})]})]}):s.jsx("div",{className:"rounded-md border p-3 text-sm text-muted-foreground",children:"Scenario Assistant requires a configured assistant agent and at least one selected server on the scenario."})]})})]})}function sh({title:e,rationale:t,preview:n,applied:r=!1,onApply:a}){return s.jsxs("div",{className:`space-y-2 rounded-md border p-3 ${r?"border-emerald-300 bg-emerald-50/40":""}`,children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("h5",{className:"text-sm font-medium",children:e}),s.jsx(le,{type:"button",size:"sm",variant:r?"secondary":"outline",onClick:a,disabled:r,children:r?s.jsxs(s.Fragment,{children:[s.jsx(Kl,{className:"mr-1.5 h-3.5 w-3.5"}),"Applied"]}):"Apply"})]}),t&&s.jsx("p",{className:"text-xs text-muted-foreground",children:t}),s.jsx("pre",{className:"max-h-56 overflow-auto rounded bg-muted p-2 text-xs whitespace-pre-wrap",children:n})]})}function rme({message:e}){const t=async o=>{try{await navigator.clipboard.writeText(o),Pe({title:"Copied"})}catch(c){Pe({title:"Could not copy",description:c instanceof Error?c.message:String(c),variant:"destructive"})}},n=e.role;if(n==="tool"){const o=String(e.text??"").trim();return/^(Approved|Denied) tool call\b/i.test(o)?null:s.jsxs("div",{className:"rounded-md border border-sky-500/30 bg-sky-500/10 px-3 py-2 text-sm",children:[s.jsxs("div",{className:"mb-1 flex items-center gap-2 text-[11px] font-semibold uppercase tracking-wide text-sky-700",children:[s.jsx(os,{className:"h-3.5 w-3.5"}),"Tool",s.jsx("span",{className:"font-normal normal-case text-sky-700/80",children:new Date(e.createdAt).toLocaleTimeString()})]}),s.jsx("p",{className:"whitespace-pre-wrap text-sky-900",children:e.text})]})}if(n==="system")return s.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700",children:s.jsx(y$,{className:"h-3 w-3"})}),s.jsx("div",{className:"max-w-[92%] rounded-md border border-amber-400/30 bg-amber-50/70 p-3 text-sm",children:s.jsx(NS,{text:e.text,variant:"assistant"})})]});const r=n==="user",a=r?zS:ba,i=n==="user"||n==="assistant";return s.jsxs("div",{className:`flex items-start gap-2 text-xs ${r?"justify-end":"justify-start"}`,children:[!r&&s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700",children:s.jsx(a,{className:"h-3 w-3"})}),s.jsxs("div",{className:"relative max-w-[92%]",children:[s.jsxs("div",{className:`max-w-full rounded-md border px-3 py-2 text-sm ${r?"border-primary/20 bg-primary/10":"border-border/80 bg-background shadow-sm"}`,children:[!r&&s.jsx("p",{className:"mb-2 text-[11px] font-semibold text-muted-foreground",children:"Assistant"}),r?s.jsx("p",{className:"whitespace-pre-wrap",children:e.text}):s.jsx(NS,{text:e.text,variant:"assistant"})]}),i&&s.jsx(le,{type:"button",variant:"ghost",size:"icon",className:`absolute bottom-1 h-6 w-6 text-muted-foreground ${r?"-left-8":"-right-8"}`,onClick:()=>{t(e.text)},"aria-label":"Copy message",title:"Copy message",children:s.jsx(zi,{className:"h-3.5 w-3.5"})})]}),r&&s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-primary/30 bg-primary/15 text-primary",children:s.jsx(a,{className:"h-3 w-3"})})]})}function NS({text:e,variant:t="assistant"}){const n=ame(e);return s.jsx("div",{className:Se("space-y-2",t==="system"&&"text-xs"),children:n.map((r,a)=>s.jsx(v.Fragment,{children:sme(r,a,t)},`md-${a}`))})}function ame(e){const t=e.replace(/\r\n/g,`
|
|
121
|
-
`).split(`
|
|
122
|
-
`),n=[];let r=0;const a=o=>o.trim()==="",i=o=>o.trimStart().startsWith("```");for(;r<t.length;){const o=t[r],c=o.trim();if(a(o)){r+=1;continue}if(i(o)){const y=c.replace(/^```/,"").trim()||void 0;r+=1;const g=[];for(;r<t.length&&!i(t[r]);)g.push(t[r]),r+=1;r<t.length&&i(t[r])&&(r+=1),n.push({type:"code",lang:y,code:g.join(`
|
|
123
|
-
`)});continue}if(/^---+$/.test(c)||/^\*\*\*+$/.test(c)){n.push({type:"hr"}),r+=1;continue}const d=c.match(/^(#{1,4})\s+(.+)$/);if(d){n.push({type:"heading",level:d[1].length,text:d[2].trim()}),r+=1;continue}if(uM(t,r)){const y=dM(t[r]);r+=2;const g=[];for(;r<t.length&&t[r].includes("|")&&!a(t[r]);)g.push(dM(t[r])),r+=1;n.push({type:"table",headers:y,rows:g});continue}const f=c.match(/^\d+\.\s+/),h=c.match(/^[-*+]\s+/);if(f||h){const y=!!f,g=[];for(;r<t.length;){const j=t[r].trim();if(y?/^\d+\.\s+/.test(j):/^[-*+]\s+/.test(j)){g.push(j.replace(y?/^\d+\.\s+/:/^[-*+]\s+/,"")),r+=1;continue}a(t[r])&&(r+=1);break}n.push({type:"list",ordered:y,items:g});continue}const p=[o];for(r+=1;r<t.length;){const y=t[r],g=y.trim();if(a(y)||i(y)||/^---+$/.test(g)||/^#{1,4}\s+/.test(g)||uM(t,r)||/^\d+\.\s+/.test(g)||/^[-*+]\s+/.test(g))break;p.push(y),r+=1}n.push({type:"paragraph",text:p.join(`
|
|
124
|
-
`)})}return n}function uM(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 dM(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>t.trim())}function sme(e,t,n){if(e.type==="hr")return s.jsx("hr",{className:"border-border/60"});if(e.type==="heading"){const r=e.level===1?"text-base font-semibold":e.level===2?"text-sm font-semibold":"text-sm font-medium";return s.jsx("h4",{className:r,children:Gu(e.text,`${t}-h`)})}if(e.type==="paragraph")return s.jsx("p",{className:Se("whitespace-pre-wrap leading-relaxed",n==="system"&&"leading-normal"),children:Gu(e.text,`${t}-p`)});if(e.type==="code")return s.jsxs("div",{className:"rounded-md border bg-muted/70",children:[e.lang&&s.jsx("div",{className:"border-b px-2 py-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:e.lang}),s.jsx("pre",{className:"max-h-72 overflow-auto p-2 text-xs",children:s.jsx("code",{children:e.code})})]});if(e.type==="list"){const r=e.ordered?"ol":"ul";return s.jsx(r,{className:Se("space-y-1 pl-5",e.ordered?"list-decimal":"list-disc"),children:e.items.map((a,i)=>s.jsx("li",{className:"leading-relaxed",children:Gu(a,`${t}-li-${i}`)},`${t}-li-${i}`))})}return e.type==="table"?s.jsx("div",{className:"overflow-x-auto rounded-md border",children:s.jsxs("table",{className:"w-full min-w-[480px] border-collapse text-xs",children:[s.jsx("thead",{className:"bg-muted/40",children:s.jsx("tr",{children:e.headers.map((r,a)=>s.jsx("th",{className:"border-b px-2 py-1.5 text-left font-semibold align-top",children:Gu(r,`${t}-thc-${a}`)},`${t}-th-${a}`))})}),s.jsx("tbody",{children:e.rows.map((r,a)=>s.jsx("tr",{className:"border-t",children:r.map((i,o)=>s.jsx("td",{className:"px-2 py-1.5 align-top",children:Gu(i,`${t}-tdc-${a}-${o}`)},`${t}-td-${a}-${o}`))},`${t}-row-${a}`))})]})}):null}function Gu(e,t){return e.split(/(`[^`]+`|\*\*[^*]+\*\*)/g).filter(Boolean).map((r,a)=>r.startsWith("`")&&r.endsWith("`")?s.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.92em]",children:r.slice(1,-1)},`${t}-${a}`):r.startsWith("**")&&r.endsWith("**")?s.jsx("strong",{children:r.slice(2,-2)},`${t}-${a}`):s.jsx(v.Fragment,{children:r},`${t}-${a}`))}const ime="mcplab.feature.";function og(e,t=!1){if(typeof window>"u")return t;try{const n=window.localStorage.getItem(`${ime}${e}`);return n==null?t:n==="1"||n==="true"}catch{return t}}const ome=()=>({id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]});function CS({scenarios:e,scenarioOrigins:t,agents:n,servers:r,configId:a,configPath:i,defaultAssistantAgentName:o,assistantInitialPromptByScenarioId:c,assistantAutoOpenNonceByScenarioId:d,snapshotEval:f,onChange:h,readOnly:p,allowAdd:y=!p,allowStructureEdits:g=!p}){const j=(N,C)=>{const E=e.map((_,k)=>k===N?{..._,...C}:_);h(E)},b=N=>h(e.filter((C,E)=>E!==N)),x=()=>h([...e,ome()]),S=(N,C)=>{const E=N+C;if(E<0||E>=e.length)return;const _=[...e],[k]=_.splice(N,1);_.splice(E,0,k),h(_)};return s.jsxs("div",{className:p?"space-y-2":"space-y-4",children:[!p&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"Scenarios"}),y&&g&&s.jsxs(le,{type:"button",variant:"outline",size:"sm",onClick:x,children:[s.jsx(ms,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Scenario"]})]}),e.map((N,C)=>s.jsx(lme,{scenario:N,scenarioOrigin:t?.[C],index:C,total:e.length,agents:n,servers:r,configId:a,configPath:i,defaultAssistantAgentName:o,assistantInitialPrompt:c?.[N.id],assistantAutoOpenNonce:d?.[N.id],snapshotEval:f,onUpdate:E=>j(C,E),onMoveUp:()=>S(C,-1),onMoveDown:()=>S(C,1),onRemove:()=>b(C),readOnly:p,allowStructureEdits:g},N.id)),e.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No scenarios configured. Add one to get started."})]})}function lme({scenario:e,scenarioOrigin:t,index:n,total:r,agents:a,servers:i,configId:o,configPath:c,defaultAssistantAgentName:d,assistantInitialPrompt:f,assistantAutoOpenNonce:h,snapshotEval:p,onUpdate:y,onMoveUp:g,onMoveDown:j,onRemove:b,readOnly:x,allowStructureEdits:S}){const{source:N}=Tn(),C=og("snapshots",!1),[E,_]=v.useState("required_tool"),[k,O]=v.useState(""),[R,T]=v.useState(""),[F,L]=v.useState(null),[$,Y]=v.useState(!1),[H,K]=v.useState(null),[J,Q]=v.useState(""),[D,B]=v.useState(""),[Z,z]=v.useState(!1),[M,re]=v.useState(!x),te=()=>{k.trim()&&(y({evalRules:[...e.evalRules,{type:E,value:k.trim()}]}),O(""),T(""))},G=je=>{y({evalRules:e.evalRules.filter((Re,Xe)=>Xe!==je)})},de=()=>{!J.trim()||!D.trim()||(y({extractRules:[...e.extractRules,{name:J.trim(),pattern:D.trim()}]}),Q(""),B(""))},ce=je=>{y({extractRules:e.extractRules.filter((Re,Xe)=>Xe!==je)})},he=je=>{const Re=e.serverIds.includes(je)?e.serverIds.filter(Xe=>Xe!==je):[...e.serverIds,je];y({serverIds:Re})},ie={required_tool:"Required",forbidden_tool:"Forbidden",response_contains:"Contains",response_not_contains:"Not Contains"},ue={required_tool:"border-sky-300/60 bg-sky-500/10 text-sky-700",forbidden_tool:"border-rose-300/60 bg-rose-500/10 text-rose-700",response_contains:"border-violet-300/60 bg-violet-500/10 text-violet-700",response_not_contains:"border-amber-300/60 bg-amber-500/10 text-amber-700"},Ae=E==="required_tool"||E==="forbidden_tool",ae=e.serverIds.filter(je=>i.some(Re=>Re.id===je)),$e=ae.length>0,W=e.snapshotEval?.baselineSnapshotId!==void 0,[ve,oe]=v.useState(""),[be,Ie]=v.useState(0);v.useEffect(()=>{const je=(f??"").trim();je&&ve!==je&&(z(!0),oe(je))},[f,ve]),v.useEffect(()=>{h&&h!==be&&(z(!0),Ie(h))},[h,be]),v.useEffect(()=>{L(null),K(null),T("")},[e.serverIds.join("|")]),v.useEffect(()=>{T("")},[E]);const Ye=async()=>{if(!(!$e||x)){Y(!0),K(null);try{const je=new Set;for(const Re of ae){const Xe=await N.discoverToolsForAnalysis({serverNames:[Re]});for(const It of Xe.servers)for(const qt of It.tools)je.add(qt.name)}L(Array.from(je).sort((Re,Xe)=>Re.localeCompare(Xe)))}catch(je){K(je instanceof Error?je.message:"Failed to load tools")}finally{Y(!1)}}};return s.jsx(Ti,{open:M,onOpenChange:re,children:s.jsxs(qe,{className:x?"rounded-md border shadow-none":"border-dashed",children:[s.jsxs(St,{className:x?"px-3 py-3 flex-row items-center justify-between space-y-0":"pb-3 flex-row items-center justify-between space-y-0",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[!x&&s.jsx(Ls,{asChild:!0,children:s.jsx(le,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",children:s.jsx(Gt,{className:`h-3.5 w-3.5 transition-transform ${M?"rotate-0":"-rotate-90"}`})})}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[n+1,"."]}),s.jsx(Nt,{className:"truncate text-sm font-medium",children:e.name||`Scenario ${n+1}`})]}),x?s.jsxs("div",{className:"flex items-center gap-2",children:[t&&s.jsx(Je,{variant:t==="inline"?"secondary":"outline",children:t==="referenced"?"Referenced":"Inline"}),s.jsx(Ls,{asChild:!0,children:s.jsx(le,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8","aria-label":M?"Collapse scenario details":"Expand scenario details",children:s.jsx(Gt,{className:`h-4 w-4 transition-transform ${M?"rotate-180":""}`})})})]}):S&&s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsxs(le,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>z(!0),title:a.length===0?"Add at least one agent in the config":e.serverIds.length===0?"Select at least one server for this scenario":"Open Scenario Assistant",children:[s.jsx(ya,{className:"h-3.5 w-3.5"}),"Ask Assistant"]}),s.jsx(le,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:g,disabled:n===0,"aria-label":"Move scenario up",children:s.jsx(ds,{className:"h-3.5 w-3.5"})}),s.jsx(le,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:j,disabled:n===r-1,"aria-label":"Move scenario down",children:s.jsx(Gt,{className:"h-3.5 w-3.5"})}),s.jsx(le,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:b,children:s.jsx(Ca,{className:"h-3.5 w-3.5 text-destructive"})})]})]}),s.jsx(Ii,{children:s.jsxs(We,{className:"space-y-3",children:[s.jsx(nme,{open:Z,onOpenChange:z,configId:o,configPath:c,scenario:e,agents:a,servers:i,snapshotEval:p,defaultAssistantAgentName:d,initialUserMessage:f,onApplyPatch:je=>y({...je.prompt!==void 0?{prompt:je.prompt}:{},...je.evalRules!==void 0?{evalRules:je.evalRules}:{},...je.extractRules!==void 0?{extractRules:je.extractRules}:{},...je.snapshotEval!==void 0?{snapshotEval:{...e.snapshotEval??{},...je.snapshotEval}}:{}})}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Name"}),s.jsx(mt,{value:e.name,onChange:je=>y({name:je.target.value}),disabled:x,placeholder:"e.g. List directory"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Servers"}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[i.map(je=>s.jsx(Je,{variant:e.serverIds.includes(je.id)?"default":"outline",className:`cursor-pointer text-xs ${e.serverIds.includes(je.id)?"":"opacity-50"}`,onClick:()=>!x&&he(je.id),children:je.name||je.id},je.id)),i.length===0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:"Add servers above first"})]})]}),s.jsxs(qe,{className:"border bg-card",children:[s.jsxs(St,{className:"pb-2",children:[s.jsx(Nt,{className:"text-sm",children:"Prompt"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"The instruction sent to the agent for this scenario. Be explicit about the task, expected output, and constraints."})]}),s.jsx(We,{className:"pt-0",children:s.jsx(qa,{value:e.prompt,onChange:je=>y({prompt:je.target.value}),disabled:x,placeholder:"The prompt to send to the agent...",rows:4,className:"text-xs"})})]}),s.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[s.jsxs(qe,{className:"border bg-muted/20",children:[s.jsx(St,{className:"pb-2",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx(Nt,{className:"text-sm",children:"Checks"}),s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Checks determine pass/fail for the scenario. Add tool checks or text pattern checks for the final answer."})]}),!x&&s.jsxs(le,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>z(!0),title:"Ask for help improving checks",children:[s.jsx(ya,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]})}),s.jsx(We,{className:"space-y-2",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx(Fe,{className:"text-xs",children:"Checks (pass / fail)"}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"These determine whether the scenario passes. Add tool checks (required/forbidden) or text pattern checks for the final answer."}),s.jsx("div",{className:"space-y-1.5",children:e.evalRules.length===0?s.jsx("p",{className:"rounded-md border border-dashed bg-background/60 px-2 py-2 text-xs text-muted-foreground",children:"No checks yet. Add tool checks or text pattern checks below."}):e.evalRules.map((je,Re)=>s.jsxs("div",{className:"flex items-start justify-between gap-2 rounded-md border bg-background px-2 py-2 text-xs",children:[s.jsx("div",{className:"min-w-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:`rounded-full border px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${ue[je.type]}`,children:ie[je.type]}),s.jsx("span",{className:"font-mono break-all",children:je.value})]})}),!x&&s.jsx(le,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>G(Re),"aria-label":`Remove check ${Re+1}`,children:s.jsx(Ys,{className:"h-3.5 w-3.5"})})]},Re))}),!x&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex gap-2 items-end",children:[s.jsxs(cn,{value:E,onValueChange:je=>_(je),children:[s.jsx(tn,{className:"h-8 w-[14.5rem] shrink-0 text-xs",children:s.jsx(un,{})}),s.jsxs(nn,{children:[s.jsx(lt,{value:"required_tool",children:"Required Tool"}),s.jsx(lt,{value:"forbidden_tool",children:"Forbidden Tool"}),s.jsx(lt,{value:"response_contains",children:"Text matches pattern"}),s.jsx(lt,{value:"response_not_contains",children:"Text must not match"})]})]}),s.jsx(mt,{value:k,onChange:je=>O(je.target.value),placeholder:"Value",className:"h-8 text-xs font-mono",onKeyDown:je=>je.key==="Enter"&&(je.preventDefault(),te())}),s.jsx(le,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:te,children:"Add"})]}),Ae&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx(Fe,{className:"mb-1 block text-[11px] text-muted-foreground",children:"Pick from selected server tools (optional)"}),s.jsxs(cn,{value:R,onValueChange:je=>{T(je),O(je)},disabled:$||!F||F.length===0,children:[s.jsx(tn,{className:"h-8 text-xs",children:s.jsx(un,{placeholder:$?"Loading tools...":F&&F.length>0?"Select tool to insert in value field":"Load tools first"})}),s.jsx(nn,{children:(F??[]).map(je=>s.jsx(lt,{value:je,children:je},je))})]})]}),s.jsx(le,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:Ye,disabled:!$e||$,children:$?"Loading...":F?"Refresh tools":"Load tools"})]}),!$e&&s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Select at least one server in this scenario to load tool names."}),H&&s.jsxs("p",{className:"text-[11px] text-destructive",children:["Could not load tools: ",H]})]})]})]})})]}),s.jsxs(qe,{className:"border bg-muted/10",children:[s.jsx(St,{className:"pb-2",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx(Nt,{className:"text-sm",children:"Value Capture Rules"}),s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Formerly “Extract Rules”. These do not fail the run. They capture structured values from the final answer for reporting, snapshots, and comparisons."})]}),!x&&s.jsxs(le,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>z(!0),title:"Ask for help improving value capture rules",children:[s.jsx(ya,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]})}),s.jsx(We,{className:"space-y-2",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx(Fe,{className:"text-xs",children:"Value Capture Rules"}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Use regex patterns to capture values like max concentration, product names, date ranges, or IDs from the final answer text."}),s.jsx("div",{className:"space-y-1.5",children:e.extractRules.length===0?s.jsx("p",{className:"w-full rounded-md border border-dashed bg-background/60 px-2 py-2 text-xs text-muted-foreground",children:"No value capture rules yet. Add one below to capture structured output from the final answer."}):e.extractRules.map((je,Re)=>s.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border bg-background px-2 py-2 text-xs",children:[s.jsx("div",{className:"min-w-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"rounded-full border border-violet-300/60 bg-violet-500/10 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-violet-700",children:je.name}),s.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground",children:"regex:"}),s.jsx("code",{className:"font-mono break-all text-foreground",children:je.pattern})]})}),!x&&s.jsx(le,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>ce(Re),"aria-label":`Remove value capture rule ${Re+1}`,children:s.jsx(Ys,{className:"h-3.5 w-3.5"})})]},Re))}),!x&&s.jsxs("div",{className:"flex gap-2 items-end",children:[s.jsx(mt,{value:J,onChange:je=>Q(je.target.value),placeholder:"Field name",className:"h-8 text-xs w-36"}),s.jsx(mt,{value:D,onChange:je=>B(je.target.value),placeholder:"Regex pattern",className:"h-8 text-xs font-mono",onKeyDown:je=>je.key==="Enter"&&(je.preventDefault(),de())}),s.jsx(le,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:de,children:"Add"})]})]})})]})]}),C&&s.jsxs(qe,{className:"border bg-amber-50/40",children:[s.jsxs(St,{className:"pb-2",children:[s.jsx(Nt,{className:"text-sm",children:"Snapshot Evaluation"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Per-scenario toggle for config baseline drift checks."})]}),s.jsxs(We,{className:"space-y-2 text-xs text-muted-foreground",children:[s.jsxs("div",{className:"flex items-center justify-between rounded-md border bg-white/60 px-2 py-1.5",children:[s.jsx("span",{children:"Enabled for this scenario"}),s.jsx(Em,{checked:e.snapshotEval?.enabled!==!1,disabled:x,onCheckedChange:je=>y({snapshotEval:{...e.snapshotEval??{},enabled:je}})})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between rounded-md border bg-white/60 px-2 py-1.5",children:[s.jsx("span",{children:"Use config baseline"}),s.jsx(Em,{checked:!W,disabled:x,onCheckedChange:je=>{if(je){y({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:void 0}});return}y({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:e.snapshotEval?.baselineSnapshotId??""}})}})]}),W&&s.jsx(mt,{value:e.snapshotEval?.baselineSnapshotId??"",onChange:je=>y({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:je.target.value}}),disabled:x,placeholder:"Override baseline snapshot id",className:"h-8 text-xs font-mono"})]}),s.jsxs("p",{children:["Effective baseline snapshot:"," ",s.jsx("span",{className:"font-mono",children:e.snapshotEval?.baselineSnapshotId||p?.baselineSnapshotId||"Not configured"})]}),s.jsxs("p",{children:["Policy:"," ",s.jsx("span",{className:"font-mono",children:p?.mode??"warn"})," · config-level switch"," ",s.jsx("span",{className:"font-mono",children:p?.enabled?"on":"off"})]})]})]})]})})]})})}function Sz(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 cme=()=>({id:`cfg-${Date.now()}`,name:"",configName:"",description:"",servers:[],serverEntries:[],agents:[],agentEntries:[],scenarios:[],scenarioEntries:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),fM=()=>{const{id:e,tab:t}=Wo(),n=_a(),[r,a]=Vo(),{getConfig:i,addConfig:o,updateConfig:c,loading:d}=mf(),{source:f}=Tn(),h=og("snapshots",!1),{servers:p,agents:y,scenarios:g}=Ka(),j=e==="new",b=!j&&!!e,x=b?i(e):void 0,[S,N]=v.useState(j),[C,E]=v.useState(()=>x?structuredClone(x):cme()),[_,k]=v.useState([]),[O,R]=v.useState(""),[T,F]=v.useState(""),[L,$]=v.useState(""),[Y,H]=v.useState(null),[K,J]=v.useState(!1),[Q,D]=v.useState(!1),[B,Z]=v.useState(""),[z,M]=v.useState(""),[re,te]=v.useState({}),[G,de]=v.useState({}),[ce,he]=v.useState({}),ie=v.useMemo(()=>{const V=t||r.get("tab");return V==="agents"||V==="scenarios"?V:"scenarios"},[t,r]);v.useEffect(()=>{x&&!S&&E(structuredClone(x))},[x,S]),v.useEffect(()=>{let V=!0;return f.listSnapshots().then(ye=>{V&&k(ye)}).catch(()=>{V&&k([])}),()=>{V=!1}},[f]),v.useEffect(()=>{if(!O.trim()){H(null);return}let V=!0;return f.getResult(O.trim()).then(ye=>{if(!V)return;if(!ye){H(!1);return}const Ve=ye.overallPassRate===1&&ye.scenarios.every(ut=>ut.runs.every(kt=>kt.passed));H(Ve)}).catch(()=>{V&&H(!1)}),()=>{V=!1}},[O,f]);const ue=V=>E(ye=>({...ye,...V})),Ae=v.useMemo(()=>C.serverEntries&&C.serverEntries.length>0?C.serverEntries:(C.servers??[]).map(V=>({kind:"inline",server:V})),[C.serverEntries,C.servers]),ae=v.useMemo(()=>C.scenarioEntries&&C.scenarioEntries.length>0?C.scenarioEntries:C.scenarios.map(V=>({kind:"inline",scenario:V})),[C.scenarioEntries,C.scenarios]),$e=V=>{ue({scenarioEntries:V,scenarios:V.filter(ye=>ye.kind==="inline").map(ye=>ye.scenario)})},W=v.useMemo(()=>C.agentEntries&&C.agentEntries.length>0?C.agentEntries:C.agents.map(V=>({kind:"inline",agent:V})),[C.agentEntries,C.agents]),ve=V=>{ue({agentEntries:V,agents:V.filter(ye=>ye.kind==="inline").map(ye=>ye.agent)})},oe=!S,be=C.runDefaults?.selectedAgentNames??[],Ie=async V=>{if(!C.id||oe===!1){ue({snapshotEval:{enabled:V.enabled,mode:V.mode,baselineSnapshotId:V.baselineSnapshotId,baselineSourceRunId:V.baselineSourceRunId,lastUpdatedAt:new Date().toISOString()}});return}J(!0);try{const ye=await f.updateSnapshotPolicy(C.id,V);E(ye),Pe({title:"Snapshot policy updated"})}catch(ye){Pe({title:"Could not update snapshot policy",description:ye instanceof Error?ye.message:String(ye),variant:"destructive"})}finally{J(!1)}},Ye=async()=>{if(!(!C.id||!O.trim())){D(!0);try{const V=await f.generateSnapshotEvalBaseline(O.trim(),C.id,T.trim()||void 0);E(V.config),$(V.snapshot.id),k(ye=>[V.snapshot,...ye.filter(Ve=>Ve.id!==V.snapshot.id)]),Pe({title:"Snapshot baseline generated",description:`${V.snapshot.name} (${V.snapshot.id})`})}catch(V){Pe({title:"Could not generate baseline",description:V instanceof Error?V.message:String(V),variant:"destructive"})}finally{D(!1)}}},je=async()=>{if(!C.name.trim()){Pe({title:"Validation Error",description:"Config ID is required.",variant:"destructive"});return}const V=Ae.map(He=>He.kind==="referenced"?{kind:"referenced",ref:p.find(Dt=>Dt.id===He.ref)?.id||He.ref}:He),ye=W.map(He=>He.kind==="referenced"?{kind:"referenced",ref:y.find(Dt=>Dt.id===He.ref)?.id||He.ref}:He),Ve=ae.map(He=>He.kind==="referenced"?{kind:"referenced",ref:g.find(Dt=>Dt.id===He.ref)?.id||He.ref}:He),ut=V.filter(He=>He.kind==="inline").map(He=>({server:He.server,error:Sz(He.server)})).find(He=>!!He.error);if(ut?.error){Pe({title:"Validation Error",description:ut.error,variant:"destructive"});return}if(Ve.filter(He=>He.kind==="inline").some(He=>!He.scenario.name?.trim())){Pe({title:"Validation Error",description:"Inline scenarios must have a name before saving.",variant:"destructive"});return}const Tt=new Set(ye.map(He=>He.kind==="inline"?He.agent.id:He.ref)),Ot=(C.runDefaults?.selectedAgentNames??[]).filter(He=>Tt.has(He)),Pn={...C,serverEntries:V,servers:V.filter(He=>He.kind==="inline").map(He=>He.server),agentEntries:ye,agents:ye.filter(He=>He.kind==="inline").map(He=>He.agent),scenarioEntries:Ve,scenarios:Ve.filter(He=>He.kind==="inline").map(He=>He.scenario),runDefaults:Ot.length>0?{...C.runDefaults??{},selectedAgentNames:Ot}:void 0,updatedAt:new Date().toISOString()};if(j){const He=await o(Pn);E(He);const Wt=He.configName?.trim()||He.name;Pe({title:"MCP Evaluation Created",description:`"${Wt}" has been saved.`}),n(`/mcp-evaluations/${He.id}`)}else{const He=await c(C.id,Pn);E(He);const Wt=He.configName?.trim()||He.name;Pe({title:"MCP Evaluation Updated",description:`"${Wt}" has been updated.`}),N(!1),He.id!==e&&n(`/mcp-evaluations/${He.id}`,{replace:!0})}},Re=C.configName?.trim()||C.name,Xe=j?"New MCP Evaluation":S?`Editing: ${Re}`:Re,It=j?"/mcp-evaluations/new":`/mcp-evaluations/${encodeURIComponent(C.id||e||"")}`,qt=!!x?.loadError,ee=v.useMemo(()=>y.map(V=>({id:V.id,ref:V.id,label:V.name||V.id,model:V.model})).sort((V,ye)=>V.label.localeCompare(ye.label)),[y]),Ce=(V,ye)=>{const Ve=ye?Array.from(new Set([...be,V])):be.filter(ut=>ut!==V);ue({runDefaults:{...C.runDefaults??{},selectedAgentNames:Ve}})},Ne=V=>{const ye=new Set([...W.filter(Tt=>Tt.kind==="inline").map(Tt=>Tt.agent.name||Tt.agent.id),...y.map(Tt=>Tt.name||Tt.id)]),Ve=`${V}-custom`;let ut=Ve,kt=2;for(;ye.has(ut);)ut=`${Ve}-${kt}`,kt+=1;return ut},Me=()=>{const ye={id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096};ve([{kind:"inline",agent:ye},...W]),te(Ve=>({...Ve,[ye.id]:!0}))},Be=()=>{const V=y.find(ut=>ut.id===z);if(!V)return;const ye=V.id;new Set(W.filter(ut=>ut.kind==="referenced").map(ut=>ut.ref)).has(ye)||ve([...W,{kind:"referenced",ref:ye}]),M("")},et=()=>{const V=new Set(W.filter(Ve=>Ve.kind==="referenced").map(Ve=>Ve.ref)),ye=y.filter(Ve=>!V.has(Ve.id)).map(Ve=>({kind:"referenced",ref:Ve.id}));ye.length>0&&ve([...W,...ye])},Et=()=>{const V=y.find(kt=>kt.id===z);if(!V)return;const ye=V.name||V.id,Ve=Ne(ye),ut={...structuredClone(V),id:`agt-${Date.now()}`,name:Ve};ve([...W,{kind:"inline",agent:ut}]),te(kt=>({...kt,[ut.id]:!0})),M(""),Pe({title:"Imported agent as inline",description:Ve})},Sn=V=>{const ye=W[V];if(!ye)return;const Ve=ye.kind==="inline"?ye.agent.id:ye.ref,ut=be.filter(kt=>kt!==Ve);ue({runDefaults:{...C.runDefaults??{},selectedAgentNames:ut}}),ye.kind==="inline"&&te(kt=>{const Tt={...kt};return delete Tt[ye.agent.id],Tt}),ve(W.filter((kt,Tt)=>Tt!==V))},Nn=(V,ye)=>{const Ve=V+ye;if(Ve<0||Ve>=W.length)return;const ut=[...W],[kt]=ut.splice(V,1);ut.splice(Ve,0,kt),ve(ut)},cr=V=>{const ye=W[V];if(!ye||ye.kind!=="referenced")return;const Ve=Xt(ye.ref);if(!Ve){Pe({title:"Referenced agent not found",variant:"destructive"});return}const ut=Ve.name||Ve.id,kt=Ne(ut),Tt={...structuredClone(Ve),id:`agt-${Date.now()}`,name:kt},Ot=[...W];if(Ot[V]={kind:"inline",agent:Tt},ve(Ot),be.includes(ye.ref)){const Pn=be.map(He=>He===ye.ref?Tt.id:He);ue({runDefaults:{...C.runDefaults??{},selectedAgentNames:Array.from(new Set(Pn))}})}te(Pn=>({...Pn,[Tt.id]:!0})),Pe({title:"Referenced agent converted to inline",description:kt})},ur=()=>{const V=g.find(Ve=>Ve.id===B);if(!V)return;const ye={...structuredClone(V),id:`scn-${Date.now()}`,serverIds:[...V.serverIds]};$e([...ae,{kind:"inline",scenario:ye}]),he(Ve=>({...Ve,[ye.id]:!0})),Z("")},Dn=()=>{const ye={id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};$e([{kind:"inline",scenario:ye},...ae]),he(Ve=>({...Ve,[ye.id]:!0}))},dr=()=>{const V=g.find(ut=>ut.id===B);if(!V)return;const ye=V.id;new Set(ae.filter(ut=>ut.kind==="referenced").map(ut=>ut.ref)).has(ye)||$e([...ae,{kind:"referenced",ref:ye}]),Z("")},_r=V=>{const ye=ae[V];ye?.kind==="inline"&&he(Ve=>{const ut={...Ve};return delete ut[ye.scenario.id],ut}),$e(ae.filter((Ve,ut)=>ut!==V))},Ur=(V,ye)=>{const Ve=V+ye;if(Ve<0||Ve>=ae.length)return;const ut=[...ae],[kt]=ut.splice(V,1);ut.splice(Ve,0,kt),$e(ut)},qr=V=>{const ye=ae[V];if(!ye||ye.kind!=="referenced")return;const Ve=En(ye.ref);if(!Ve){Pe({title:"Referenced scenario not found",variant:"destructive"});return}const ut=new Set(ae.filter(Dt=>Dt.kind==="inline").map(Dt=>Dt.scenario.name?.trim().toLowerCase()).filter(Boolean)),kt=`${(Ve.name||Ve.id).trim()}-custom`;let Tt=kt,Ot=2;for(;ut.has(Tt.toLowerCase());)Tt=`${kt}-${Ot}`,Ot+=1;const Pn=Date.now(),He={...structuredClone(Ve),id:`scn-${Pn}`,name:Tt,serverIds:[...Ve.serverIds]},Wt=[...ae];Wt[V]={kind:"inline",scenario:He},$e(Wt),he(Dt=>({...Dt,[He.id]:!0})),Pe({title:"Referenced scenario converted to inline",description:Tt})},Yn=V=>p.find(ye=>ye.id===V),Xt=V=>y.find(ye=>ye.id===V),En=V=>g.find(ye=>ye.id===V),fe=Ae.filter(V=>V.kind==="referenced").map(V=>V.ref),De=fe.map(Yn).filter(V=>!!V),st=W.filter(V=>V.kind==="referenced").map(V=>V.ref),xt=st.map(Xt).filter(V=>!!V);W.filter(V=>V.kind==="inline");const $t=W.flatMap(V=>{if(V.kind==="referenced"){const ye=Xt(V.ref);return ye?[{agent:ye,origin:"referenced",ref:V.ref}]:[]}return[{agent:V.agent,origin:"inline",ref:void 0}]}),an=ae.filter(V=>V.kind==="referenced").map(V=>V.ref),fn=ae.flatMap(V=>{if(V.kind==="referenced"){const ye=En(V.ref);return ye?[{scenario:ye,origin:"referenced"}]:[]}return[{scenario:V.scenario,origin:"inline"}]}),Xn=Array.from(new Map([...y,...C.agents,...xt].map(V=>[V.id,V])).values()),Cn=Array.from(new Map([...p,...C.servers??[],...De].map(V=>[V.id,V])).values()),rr=fe.filter(V=>!Yn(V)),fr=st.filter(V=>!Xt(V)),Wr=an.filter(V=>!En(V));new Set(rr);const oi=new Set(Wr),li=W.length,tl=ae.length;return v.useEffect(()=>{if(!z)return;y.some(ye=>ye.id===z)||M("")},[y,z]),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(le,{variant:"ghost",size:"icon",asChild:!0,className:"h-8 w-8",children:s.jsx(wt,{to:"/mcp-evaluations",children:s.jsx(ko,{className:"h-4 w-4"})})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h1",{className:"text-2xl font-bold truncate",children:Xe}),s.jsx("p",{className:"text-sm text-muted-foreground",children:j?"Create a new MCP evaluation":d?"Loading configuration...":x?x.loadError?"MCP evaluation could not be fully loaded":`Last updated ${new Date(C.updatedAt).toLocaleDateString()}`:"MCP evaluation not found"})]}),s.jsxs("div",{className:"flex gap-2 shrink-0",children:[b&&!S&&s.jsx(le,{size:"sm",onClick:()=>N(!0),children:"Edit"}),b&&!S&&x&&!qt&&s.jsx(le,{size:"sm",variant:"outline",asChild:!0,children:s.jsxs(wt,{to:`/run?configId=${encodeURIComponent(x.id)}`,children:[s.jsx(Gl,{className:"mr-1.5 h-3.5 w-3.5"}),"Run MCP Evaluation"]})}),b&&!S&&qt&&s.jsxs(Je,{variant:"destructive",className:"py-1 px-3 text-xs",children:[s.jsx(uh,{className:"mr-1 h-3 w-3"}),"Broken config"]}),S&&s.jsxs(s.Fragment,{children:[!j&&s.jsx(le,{variant:"outline",size:"sm",onClick:()=>{E(structuredClone(x)),N(!1)},children:"Cancel"}),s.jsxs(le,{size:"sm",onClick:()=>{je()},children:[s.jsx(q7,{className:"mr-1.5 h-3.5 w-3.5"}),"Save"]})]})]})]}),qt&&!S&&s.jsx(qe,{className:"border-destructive/40",children:s.jsxs(We,{className:"pt-6 space-y-3",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(uh,{className:"mt-0.5 h-5 w-5 text-destructive"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold",children:"This configuration is broken"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"The file is still present, but it could not be loaded because one or more references or fields are invalid."})]})]}),s.jsxs("div",{className:"rounded-md border bg-muted/20 p-3",children:[s.jsx("p",{className:"text-xs font-medium mb-1",children:"File"}),s.jsx("p",{className:"text-xs font-mono break-all",children:x?.sourcePath||x?.description})]}),s.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3",children:[s.jsx("p",{className:"text-xs font-medium mb-1 text-destructive",children:"Load Error"}),s.jsx("p",{className:"text-xs break-all text-destructive",children:x?.loadError})]}),(rr.length>0||fr.length>0||Wr.length>0)&&s.jsxs("div",{className:"rounded-md border border-destructive/30 bg-background p-3 space-y-1.5",children:[s.jsx("p",{className:"text-xs font-medium",children:"Broken references"}),rr.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Servers: ",s.jsx("span",{className:"text-destructive",children:rr.join(", ")})]}),fr.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Agents: ",s.jsx("span",{className:"text-destructive",children:fr.join(", ")})]}),Wr.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Scenarios: ",s.jsx("span",{className:"text-destructive",children:Wr.join(", ")})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Valid items still render below. Only the missing references are marked as broken."})]})}),!qt&&(C.loadWarnings?.length??0)>0&&s.jsx(qe,{className:"border-amber-500/30",children:s.jsxs(We,{className:"pt-4 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-amber-700 dark:text-amber-300",children:[s.jsx(uh,{className:"h-4 w-4"}),"Migration warnings"]}),C.loadWarnings?.map((V,ye)=>s.jsx("p",{className:"text-xs text-muted-foreground",children:V},`${V}-${ye}`))]})}),s.jsxs("div",{className:"flex gap-4",children:[s.jsx(Je,{variant:ie==="scenarios"?"default":"outline",className:"py-1 px-3 text-xs",children:s.jsxs(wt,{to:`${It}/scenarios`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[s.jsx(yE,{className:"h-3 w-3"}),tl," scenario",tl!==1?"s":""]})}),s.jsx(Je,{variant:ie==="agents"?"default":"outline",className:"py-1 px-3 text-xs",children:s.jsxs(wt,{to:`${It}/agents`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[s.jsx(ba,{className:"h-3 w-3"}),li," agent",li!==1?"s":""]})})]}),s.jsx(qe,{children:s.jsx(We,{className:"pt-6 space-y-3",children:s.jsxs("div",{className:`grid gap-4 ${oe||!j?"sm:grid-cols-2":"sm:grid-cols-3"}`,children:[!oe&&j&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Config ID"}),s.jsx(mt,{value:C.name,onChange:V=>ue({name:V.target.value}),disabled:oe,placeholder:"e.g. check-weather"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Name (optional)"}),s.jsx(mt,{value:C.configName||"",onChange:V=>ue({configName:V.target.value}),disabled:oe,placeholder:"e.g. Weather checks baseline"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Description"}),s.jsx(mt,{value:C.description||"",onChange:V=>ue({description:V.target.value}),disabled:oe,placeholder:"Brief description..."})]})]})})}),h&&s.jsx(qe,{children:s.jsxs(We,{className:"pt-6 space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-semibold",children:"Snapshot Evaluation"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Config baseline versioning. One active baseline is selected; scenarios can opt in/out below."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Fe,{className:"text-xs",children:"Enable snapshot baseline"}),s.jsx(Em,{checked:C.snapshotEval?.enabled??!1,disabled:K,onCheckedChange:V=>{const ye=C.snapshotEval;Ie({enabled:V,mode:ye?.mode??"warn",baselineSnapshotId:ye?.baselineSnapshotId,baselineSourceRunId:ye?.baselineSourceRunId})}})]})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Drift mode"}),s.jsxs(cn,{value:C.snapshotEval?.mode??"warn",onValueChange:V=>{const ye=C.snapshotEval;Ie({enabled:ye?.enabled??!1,mode:V,baselineSnapshotId:ye?.baselineSnapshotId,baselineSourceRunId:ye?.baselineSourceRunId})},children:[s.jsx(tn,{className:"h-8",children:s.jsx(un,{})}),s.jsxs(nn,{children:[s.jsx(lt,{value:"warn",children:"Warn"}),s.jsx(lt,{value:"fail_on_drift",children:"Fail on drift"})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Active baseline"}),s.jsx("p",{className:"rounded-md border bg-muted/20 px-2 py-2 text-xs font-mono",children:C.snapshotEval?.baselineSnapshotId??"No baseline linked"})]})]}),C.id&&s.jsxs("div",{className:"grid gap-2 rounded-md border bg-muted/20 p-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Generate baseline from passing run"}),s.jsx(mt,{value:O,onChange:V=>R(V.target.value),placeholder:"Run id (e.g. 20260208-140213)",className:"h-8 font-mono text-xs"}),Y===!1&&s.jsx("p",{className:"text-[11px] text-destructive",children:"Run is missing or not fully passing."})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Snapshot name (optional)"}),s.jsx(mt,{value:T,onChange:V=>F(V.target.value),placeholder:"e.g. config-baseline-v1",className:"h-8 text-xs"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Switch baseline"}),s.jsxs(cn,{value:L||C.snapshotEval?.baselineSnapshotId||"",onValueChange:V=>{$(V),Ie({enabled:C.snapshotEval?.enabled??!0,mode:C.snapshotEval?.mode??"warn",baselineSnapshotId:V||void 0,baselineSourceRunId:C.snapshotEval?.baselineSourceRunId})},children:[s.jsx(tn,{className:"h-8",children:s.jsx(un,{placeholder:"Select snapshot"})}),s.jsx(nn,{children:_.map(V=>s.jsx(lt,{value:V.id,children:V.name},V.id))})]})]}),s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsx(le,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:()=>{Ye()},disabled:Q||!O.trim()||Y!==!0,children:Q?"Generating...":"Generate Baseline"}),s.jsx(le,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:()=>{Ie({enabled:C.snapshotEval?.enabled??!1,mode:C.snapshotEval?.mode??"warn",baselineSnapshotId:void 0,baselineSourceRunId:void 0})},disabled:K,children:"Clear Baseline"})]})]})]})}),s.jsxs(yC,{value:ie,onValueChange:V=>{if(V!=="servers"&&V!=="agents"&&V!=="scenarios")return;const ye=new URLSearchParams(r);if(ye.delete("tab"),a(ye,{replace:!0}),e&&e!=="new"){n(`/mcp-evaluations/${encodeURIComponent(e)}/${V}`,{replace:!0});return}n(`/mcp-evaluations/${e??"new"}/${V}`,{replace:!0})},className:"space-y-4",children:[s.jsxs(eg,{children:[s.jsxs(Fi,{value:"scenarios",className:"gap-1.5",children:[s.jsx(yE,{className:"h-3.5 w-3.5"}),"Scenarios"]}),s.jsxs(Fi,{value:"agents",className:"gap-1.5",children:[s.jsx(ba,{className:"h-3.5 w-3.5"}),"Agents"]})]}),s.jsxs(nf,{value:"agents",children:[!oe&&s.jsx(qe,{className:"mb-4",children:s.jsxs(We,{className:"pt-4 space-y-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[s.jsxs(cn,{value:z,onValueChange:M,children:[s.jsx(tn,{className:"h-8",children:s.jsx(un,{placeholder:"Select agent from library"})}),s.jsx(nn,{children:ee.map(V=>s.jsx(lt,{value:V.id,children:V.label},V.id))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(le,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!z,onClick:Be,children:"Add Ref"}),s.jsx(le,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!z,onClick:Et,children:"Import Inline"}),s.jsx(le,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:y.length===0||y.every(V=>W.some(ye=>ye.kind==="referenced"&&ye.ref===V.id)),onClick:et,children:"Add All Refs"}),s.jsx(le,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:Me,children:"Add agent"})]})]}),s.jsxs("div",{className:"space-y-2",children:[W.map((V,ye)=>{const Ve=V.kind==="referenced"?Xt(V.ref):null,ut=V.kind==="inline"?V.agent.name?.trim()||V.agent.id:Ve?.name||V.ref,kt=V.kind==="inline"?V.agent.model:Ve?.model||"unknown",Tt=V.kind==="inline"?V.agent.id:V.ref,Ot=V.kind==="referenced"&&!Ve,Pn=V.kind==="inline"?V.agent.id:V.ref,He=be.includes(Pn),Wt=V.kind==="inline"&&!!re[V.agent.id];return s.jsxs("div",{className:"rounded-md border text-sm",children:[s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(le,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Nn(ye,-1),disabled:ye===0,"aria-label":"Move agent up",children:s.jsx(ds,{className:"h-3 w-3"})}),s.jsx(le,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Nn(ye,1),disabled:ye===W.length-1,"aria-label":"Move agent down",children:s.jsx(Gt,{className:"h-3 w-3"})})]}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[ye+1,"."]}),s.jsx("span",{className:"truncate font-medium",children:ut}),s.jsx(Je,{variant:V.kind==="inline"?"secondary":"outline",children:V.kind==="inline"?"Inline":"Referenced"}),s.jsx(Je,{variant:"outline",className:"font-mono text-[10px]",children:kt}),He&&s.jsx(Je,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),Ot&&s.jsx(Je,{variant:"destructive",children:"Missing"})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsxs("label",{className:"mx-2 flex items-center gap-1.5 text-xs text-muted-foreground",children:[s.jsx("input",{type:"checkbox",checked:He,onChange:Dt=>Ce(Pn,Dt.target.checked)}),s.jsx("span",{children:"Default"})]}),V.kind==="inline"&&s.jsx(le,{type:"button",size:"sm",variant:"outline",onClick:()=>te(Dt=>({...Dt,[V.agent.id]:!Dt[V.agent.id]})),children:Wt?"Collapse":"Expand"}),V.kind==="referenced"&&s.jsx(s.Fragment,{children:s.jsx(le,{type:"button",size:"sm",variant:"outline",onClick:()=>cr(ye),disabled:Ot,children:"Convert to inline"})}),s.jsx(le,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>Sn(ye),"aria-label":"Remove agent entry",children:s.jsx(Ca,{className:"h-3.5 w-3.5"})})]})]}),V.kind==="inline"&&Wt&&s.jsxs("div",{className:"border-t px-3 py-3 space-y-3",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Name"}),s.jsx(mt,{value:V.agent.name,onChange:Dt=>{const kn=[...W];kn[ye]={kind:"inline",agent:{...V.agent,name:Dt.target.value}},ve(kn)},placeholder:"e.g. GPT-5 Mini custom"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Provider"}),s.jsxs(cn,{value:V.agent.provider,onValueChange:Dt=>{const kn=[...W];kn[ye]={kind:"inline",agent:{...V.agent,provider:Dt}},ve(kn)},children:[s.jsx(tn,{children:s.jsx(un,{})}),s.jsxs(nn,{children:[s.jsx(lt,{value:"openai",children:"OpenAI"}),s.jsx(lt,{value:"anthropic",children:"Anthropic"}),s.jsx(lt,{value:"azure",children:"Azure OpenAI"}),s.jsx(lt,{value:"google",children:"Google"}),s.jsx(lt,{value:"custom",children:"Custom"})]})]})]})]}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Model"}),s.jsx(mt,{value:V.agent.model,onChange:Dt=>{const kn=[...W];kn[ye]={kind:"inline",agent:{...V.agent,model:Dt.target.value}},ve(kn)},className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Max Tokens"}),s.jsx(mt,{type:"number",min:1,max:128e3,value:V.agent.maxTokens,onChange:Dt=>{const kn=[...W];kn[ye]={kind:"inline",agent:{...V.agent,maxTokens:parseInt(Dt.target.value)||0}},ve(kn)},className:"font-mono text-xs"})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Temperature"}),s.jsx(mt,{type:"number",min:0,max:2,step:.01,value:V.agent.temperature,onChange:Dt=>{const kn=[...W];kn[ye]={kind:"inline",agent:{...V.agent,temperature:Number(Dt.target.value)||0}},ve(kn)},className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"System Prompt"}),s.jsx(qa,{value:V.agent.systemPrompt||"",onChange:Dt=>{const kn=[...W];kn[ye]={kind:"inline",agent:{...V.agent,systemPrompt:Dt.target.value}},ve(kn)},rows:3,className:"text-xs"})]})]})]},`agent-entry-${ye}-${Tt}`)}),W.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents configured yet. Add inline agents or references."})]}),fr.length>0&&s.jsxs("p",{className:"text-xs text-destructive",children:["Missing agent refs: ",fr.join(", ")]})]})}),oe?s.jsx(qe,{children:s.jsx(We,{className:"pt-4",children:s.jsxs("div",{className:"space-y-2",children:[$t.map((V,ye)=>{const Ve=V.agent.name||V.agent.id,ut=be.includes(V.origin==="inline"?V.agent.id:V.ref||V.agent.id),kt=V.ref??V.agent.id,Tt=!!G[kt];return s.jsxs("div",{className:"rounded-md border p-3",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsxs("span",{className:"text-xs text-muted-foreground",children:[ye+1,"."]}),s.jsx("div",{className:"truncate font-medium text-sm",children:Ve})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[ut&&s.jsx(Je,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),s.jsx(Je,{variant:V.origin==="inline"?"secondary":"outline",children:V.origin==="inline"?"Inline":"Referenced"}),s.jsx(le,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8",onClick:()=>de(Ot=>({...Ot,[kt]:!Ot[kt]})),"aria-label":Tt?"Collapse agent details":"Expand agent details",children:s.jsx(Gt,{className:`h-4 w-4 transition-transform ${Tt?"rotate-180":""}`})})]})]}),Tt&&s.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 border-t pt-2",children:[s.jsx(vB,{provider:V.agent.provider}),s.jsx(Je,{variant:"outline",className:"text-xs font-mono",children:V.agent.model}),s.jsxs(Je,{variant:"outline",className:"text-xs font-mono",children:["max_tokens: ",V.agent.maxTokens]}),s.jsxs(Je,{variant:"outline",className:"text-xs font-mono",children:["temperature: ",V.agent.temperature]})]})]},`agent-view-${ye}-${V.ref??V.agent.id}`)}),$t.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No agents configured."})]})})}):null]}),s.jsxs(nf,{value:"scenarios",children:[!oe&&s.jsx(qe,{className:"mb-4",children:s.jsxs(We,{className:"pt-4 space-y-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[s.jsxs(cn,{value:B,onValueChange:Z,children:[s.jsx(tn,{className:"h-8",children:s.jsx(un,{placeholder:"Select scenario from library"})}),s.jsx(nn,{children:[...g].sort((V,ye)=>(V.name||V.id).localeCompare(ye.name||ye.id)).map(V=>s.jsx(lt,{value:V.id,children:V.name||V.id},V.id))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(le,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!B,onClick:dr,children:"Add Ref"}),s.jsx(le,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!B,onClick:ur,children:"Import Inline"}),s.jsx(le,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:Dn,children:"Add scenario"})]})]}),s.jsxs("div",{className:"space-y-2",children:[ae.map((V,ye)=>{const Ve=V.kind==="referenced"?En(V.ref):null,ut=V.kind==="inline"?V.scenario.name?.trim()||V.scenario.id:Ve?.name||V.ref,kt=V.kind==="inline"&&!V.scenario.name?.trim(),Tt=V.kind==="referenced"&&oi.has(V.ref),Ot=V.kind==="inline"&&!!ce[V.scenario.id];return s.jsxs("div",{className:"rounded-md border text-sm",children:[s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(le,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Ur(ye,-1),disabled:ye===0,"aria-label":"Move scenario up",children:s.jsx(ds,{className:"h-3 w-3"})}),s.jsx(le,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Ur(ye,1),disabled:ye===ae.length-1,"aria-label":"Move scenario down",children:s.jsx(Gt,{className:"h-3 w-3"})})]}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[ye+1,"."]}),s.jsx("span",{className:"truncate font-medium",children:ut}),s.jsx(Je,{variant:V.kind==="inline"?"secondary":"outline",children:V.kind==="inline"?"Inline":"Referenced"}),kt&&s.jsx(Je,{variant:"destructive",children:"Name required"}),Tt&&s.jsx(Je,{variant:"destructive",children:"Missing"})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[V.kind==="inline"&&s.jsx(le,{type:"button",size:"icon",variant:"outline",className:"h-7 w-7",onClick:()=>he(Pn=>({...Pn,[V.scenario.id]:!Pn[V.scenario.id]})),"aria-label":Ot?"Collapse scenario details":"Expand scenario details",children:s.jsx(Gt,{className:`h-3.5 w-3.5 transition-transform ${Ot?"rotate-180":""}`})}),V.kind==="referenced"&&s.jsx(s.Fragment,{children:s.jsx(le,{type:"button",size:"sm",variant:"outline",onClick:()=>qr(ye),disabled:Tt,children:"Convert to inline"})}),s.jsx(le,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>_r(ye),"aria-label":"Remove scenario entry",children:s.jsx(Ca,{className:"h-3.5 w-3.5"})})]})]}),V.kind==="inline"&&Ot&&s.jsx("div",{className:"border-t px-3 py-3",children:s.jsx(CS,{scenarios:[V.scenario],scenarioOrigins:["inline"],agents:[...C.agents,...xt],servers:[...C.servers??[],...De],configId:C.id,configPath:C.sourcePath,defaultAssistantAgentName:C.runDefaults?.selectedAgentNames?.[0],snapshotEval:C.snapshotEval,onChange:Pn=>{const He=Pn[0];if(!He)return;const Wt=[...ae];Wt[ye]={kind:"inline",scenario:He},$e(Wt)},readOnly:!1,allowAdd:!1,allowStructureEdits:!1})})]},`scenario-entry-${ye}-${V.kind==="inline"?V.scenario.id:V.ref}`)}),ae.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No scenarios configured yet. Add inline scenarios or references."})]}),Wr.length>0&&s.jsxs("p",{className:"text-xs text-destructive",children:["Missing scenario refs: ",Wr.join(", ")]})]})}),oe?s.jsx(qe,{children:s.jsx(We,{className:"pt-4",children:s.jsx(CS,{scenarios:fn.map(V=>V.scenario),scenarioOrigins:fn.map(V=>V.origin),agents:Xn,servers:Cn,configId:C.id,configPath:C.sourcePath,defaultAssistantAgentName:C.runDefaults?.selectedAgentNames?.[0],snapshotEval:C.snapshotEval,onChange:()=>{},readOnly:!0})})}):null]})]})]})};var ume=Symbol("radix.slottable");function dme(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=ume,t}var Nz="AlertDialog",[fme]=lr(Nz,[zD]),ii=zD(),Cz=e=>{const{__scopeAlertDialog:t,...n}=e,r=ii(t);return s.jsx(iv,{...r,...n,modal:!0})};Cz.displayName=Nz;var pme="AlertDialogTrigger",hme=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ii(n);return s.jsx(XK,{...a,...r,ref:t})});hme.displayName=pme;var mme="AlertDialogPortal",Az=e=>{const{__scopeAlertDialog:t,...n}=e,r=ii(t);return s.jsx(ov,{...r,...n})};Az.displayName=mme;var vme="AlertDialogOverlay",_z=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ii(n);return s.jsx(qc,{...a,...r,ref:t})});_z.displayName=vme;var tc="AlertDialogContent",[gme,yme]=fme(tc),xme=dme("AlertDialogContent"),Ez=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,i=ii(n),o=v.useRef(null),c=vt(t,o),d=v.useRef(null);return s.jsx(HK,{contentName:tc,titleName:Pz,docsSlug:"alert-dialog",children:s.jsx(gme,{scope:n,cancelRef:d,children:s.jsxs(Wc,{role:"alertdialog",...i,...a,ref:c,onOpenAutoFocus:ke(a.onOpenAutoFocus,f=>{f.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[s.jsx(xme,{children:r}),s.jsx(wme,{contentRef:o})]})})})});Ez.displayName=tc;var Pz="AlertDialogTitle",kz=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ii(n);return s.jsx(ff,{...a,...r,ref:t})});kz.displayName=Pz;var Oz="AlertDialogDescription",Rz=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ii(n);return s.jsx(pf,{...a,...r,ref:t})});Rz.displayName=Oz;var bme="AlertDialogAction",Tz=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ii(n);return s.jsx(lv,{...a,...r,ref:t})});Tz.displayName=bme;var Iz="AlertDialogCancel",Mz=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=yme(Iz,n),i=ii(n),o=vt(t,a);return s.jsx(lv,{...i,...r,ref:o})});Mz.displayName=Iz;var wme=({contentRef:e})=>{const t=`\`${tc}\` requires a description for the component to be accessible for screen reader users.
|
|
125
|
-
|
|
126
|
-
You can add a description to the \`${tc}\` by passing a \`${Oz}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
127
|
-
|
|
128
|
-
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${tc}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
129
|
-
|
|
130
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return v.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},jme=Cz,Sme=Az,$z=_z,Dz=Ez,Lz=Tz,Fz=Mz,Bz=kz,zz=Rz;const Cs=jme,Nme=Sme,Uz=v.forwardRef(({className:e,...t},n)=>s.jsx($z,{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}));Uz.displayName=$z.displayName;const Ya=v.forwardRef(({className:e,...t},n)=>s.jsxs(Nme,{children:[s.jsx(Uz,{}),s.jsx(Dz,{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})]}));Ya.displayName=Dz.displayName;const Xa=({className:e,...t})=>s.jsx("div",{className:Se("flex flex-col space-y-2 text-center sm:text-left",e),...t});Xa.displayName="AlertDialogHeader";const Qa=({className:e,...t})=>s.jsx("div",{className:Se("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Qa.displayName="AlertDialogFooter";const Ja=v.forwardRef(({className:e,...t},n)=>s.jsx(Bz,{ref:n,className:Se("text-lg font-semibold",e),...t}));Ja.displayName=Bz.displayName;const Za=v.forwardRef(({className:e,...t},n)=>s.jsx(zz,{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));Za.displayName=zz.displayName;const es=v.forwardRef(({className:e,...t},n)=>s.jsx(Lz,{ref:n,className:Se(aN(),e),...t}));es.displayName=Lz.displayName;const ts=v.forwardRef(({className:e,...t},n)=>s.jsx(Fz,{ref:n,className:Se(aN({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));ts.displayName=Fz.displayName;const Cme=()=>{const{servers:e,setServers:t,reload:n,loading:r}=Ka(),a=_a(),[i,o]=v.useState(null),c=p=>p.name?.trim()||p.id,d=async p=>{const y=`${c(p)}-copy`;let g=y,j=1;for(;e.some(x=>(x.name?.trim()||x.id)===g);)g=`${y}-${j}`,j+=1;const b={...structuredClone(p),id:`srv-${Date.now()}`,name:g};await t([...e,b]),Pe({title:"Server duplicated",description:`Created ${g}.`})},f=async p=>{await t(e.filter(y=>y.id!==p.id)),Pe({title:"Server deleted",description:`${c(p)} was removed.`}),o(null)},h=p=>p.transport==="stdio"?[p.command,...p.args||[]].filter(Boolean).join(" "):p.url||"";return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(f$,{className:"h-6 w-6"}),"Servers"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Reusable MCP server definitions shared across configurations."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(le,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[s.jsx(Na,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(le,{type:"button",size:"sm",onClick:()=>a("/libraries/servers/new"),children:[s.jsx(ms,{className:"mr-2 h-4 w-4"}),"Add Server"]})]})]}),e.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed py-16 text-center",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"No servers configured. Add one to get started."}),s.jsxs(le,{type:"button",size:"sm",className:"mt-4",onClick:()=>a("/libraries/servers/new"),children:[s.jsx(ms,{className:"mr-2 h-4 w-4"}),"Add Server"]})]}):s.jsx(qe,{children:s.jsx(We,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs(Mt,{children:[s.jsx(tt,{children:"Name"}),s.jsx(tt,{children:"Transport"}),s.jsx(tt,{children:"Endpoint"}),s.jsx(tt,{children:"Auth"}),s.jsx(tt,{className:"text-right",children:"Actions"})]})}),s.jsx(Lr,{children:e.map(p=>s.jsxs(Mt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>a(`/libraries/servers/${encodeURIComponent(p.id)}`),children:[s.jsx(ze,{className:"font-medium",children:c(p)}),s.jsx(ze,{children:s.jsx(Je,{variant:"secondary",className:"font-mono text-xs",children:p.transport})}),s.jsx(ze,{children:s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:h(p)})}),s.jsx(ze,{children:!p.authType||p.authType==="none"?s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"}):s.jsx(Je,{variant:"outline",className:"text-xs",children:p.authType})}),s.jsx(ze,{className:"text-right",onClick:y=>y.stopPropagation(),children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsxs(le,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>o(p),children:[s.jsx(Ca,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(le,{type:"button",size:"sm",variant:"outline",onClick:()=>{d(p)},children:[s.jsx(zi,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(le,{type:"button",size:"sm",variant:"outline",onClick:()=>a(`/libraries/servers/${encodeURIComponent(p.id)}`),children:[s.jsx(Lm,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},p.id))})]})})}),s.jsx(Cs,{open:!!i,onOpenChange:p=>!p&&o(null),children:s.jsxs(Ya,{children:[s.jsxs(Xa,{children:[s.jsx(Ja,{children:"Delete server?"}),s.jsxs(Za,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-mono",children:i?c(i):""})," from the library. This action cannot be undone."]})]}),s.jsxs(Qa,{children:[s.jsx(ts,{children:"Cancel"}),s.jsx(es,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{i&&f(i)},children:"Delete Server"})]})]})})]})},pM={stdio:"Check that the command is installed and the args are correct",sse:"Check that the server is running and the URL is reachable","streamable-http":"Check that the server is running and the URL is reachable"},Ame=()=>({id:`srv-${Date.now()}`,name:"",transport:"stdio",authType:"none",oauthRedirectUrl:"http://localhost:6274/oauth/"}),_me=()=>{const{serverId:e}=Wo(),t=_a(),{servers:n,setServers:r}=Ka(),{source:a}=Tn(),i=e==="new",o=e?decodeURIComponent(e):"",c=i?null:n.find(R=>R.id===o||R.name===o),d=R=>R.name?.trim()||R.id,[f,h]=v.useState(()=>c??Ame()),[p,y]=v.useState(!1),[g,j]=v.useState(!1),[b,x]=v.useState({status:"idle"}),[S,N]=v.useState(!1);v.useEffect(()=>{c&&h(c)},[c]);const C=R=>{h(T=>({...T,authType:R,...R!=="bearer"&&R!=="api-key"?{authValue:void 0}:{},...R!=="api-key"?{apiKeyHeaderName:void 0}:{apiKeyHeaderName:T.apiKeyHeaderName||"X-API-Key"},...R!=="oauth2"?{oauthClientId:void 0,oauthClientSecret:void 0,oauthRedirectUrl:void 0,oauthScope:void 0}:{oauthRedirectUrl:T.oauthRedirectUrl||"http://localhost:6274/oauth/"}}))},E=async()=>{N(!0),x({status:"loading"});try{const T=(await a.discoverToolsForAnalysis({serverNames:[f.id]})).servers[0];T&&T.warnings.length===0?x({status:"success",toolNames:T.tools.map(F=>F.name),toolCount:T.tools.length,testedAt:new Date().toISOString()}):x({status:"error",message:T?.warnings[0]??"Connection failed",testedAt:new Date().toISOString()})}catch(R){x({status:"error",message:R instanceof Error?R.message:String(R),testedAt:new Date().toISOString()})}},_=async()=>{if(!f.name.trim()){Pe({title:"Name is required",variant:"destructive"});return}const R=Sz(f);if(R){Pe({title:"Validation Error",description:R,variant:"destructive"});return}const T={...f,authValue:f.authValue?.trim(),apiKeyHeaderName:f.apiKeyHeaderName?.trim()||void 0};j(!0);try{if(i)await r([...n,T]),Pe({title:"Server created"}),t(`/libraries/servers/${encodeURIComponent(T.id)}`);else{const F=n.map(L=>L.id===c?.id?T:L);await r(F),Pe({title:"Server saved"}),T.id!==o&&t(`/libraries/servers/${encodeURIComponent(T.id)}`,{replace:!0})}}finally{j(!1)}},k=async()=>{const R=n.filter(T=>T.id!==c?.id);await r(R),Pe({title:"Server deleted"}),t("/libraries/servers")},O=()=>f.transport==="stdio"?[f.command,...f.args||[]].filter(Boolean).join(" "):f.url||"";return!i&&!c?s.jsxs("div",{className:"space-y-4",children:[s.jsxs(wt,{to:"/libraries/servers",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(ko,{className:"h-4 w-4"})," Servers"]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:['Server "',o,'" not found.']})]}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsxs(wt,{to:"/libraries/servers",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(ko,{className:"h-4 w-4"})," Servers"]}),s.jsx("h1",{className:"text-2xl font-bold",children:i?"New Server":d(f)})]}),!i&&s.jsxs(le,{type:"button",onClick:()=>{E()},children:[s.jsx(w$,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),S&&s.jsxs(qe,{children:[s.jsxs(St,{className:"flex-row items-center justify-between space-y-0",children:[s.jsx(Nt,{className:"text-base",children:"Connection Test"}),s.jsx("button",{type:"button",onClick:()=>N(!1),className:"rounded-sm opacity-70 hover:opacity-100",children:s.jsx(Ys,{className:"h-4 w-4"})})]}),s.jsxs(We,{className:"space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground",children:[s.jsx("span",{children:"Server:"}),s.jsx("span",{className:"font-medium text-foreground",children:d(f)}),s.jsx("span",{className:"mx-1",children:"·"}),s.jsx("span",{children:"Transport:"}),s.jsx("span",{className:"font-medium text-foreground",children:f.transport}),O()&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"mx-1",children:"·"}),s.jsx("span",{children:"Endpoint:"}),s.jsx("code",{className:"font-mono text-xs",children:O()})]})]}),b.status==="loading"&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(or,{className:"h-4 w-4 animate-spin"}),"Connecting to MCP server…"]}),b.status==="success"&&s.jsxs("div",{className:"space-y-3",children:[s.jsxs("p",{className:"flex items-center gap-2 text-sm text-emerald-700",children:[s.jsx(sc,{className:"h-4 w-4 shrink-0"}),"Connected — discovered ",b.toolCount," tool",b.toolCount!==1?"s":""]}),b.toolNames.length>0&&s.jsxs("div",{className:"rounded-md bg-muted p-3",children:[s.jsx("p",{className:"mb-1 text-xs font-medium text-muted-foreground",children:"First 5 tools:"}),s.jsx("ul",{className:"space-y-0.5",children:b.toolNames.slice(0,5).map(R=>s.jsx("li",{className:"font-mono text-xs",children:R},R))})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(b.testedAt).toLocaleString()]})]}),b.status==="error"&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("p",{className:"text-sm text-destructive",children:[s.jsx("span",{className:"font-medium",children:"✗ Connection failed"})," — ",b.message]}),pM[f.transport]&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",pM[f.transport]]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(b.testedAt).toLocaleString()]})]})]})]}),s.jsxs(qe,{children:[s.jsx(St,{children:s.jsx(Nt,{className:"text-base",children:"Configuration"})}),s.jsxs(We,{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"Name"}),s.jsx(mt,{value:f.name,onChange:R=>h(T=>({...T,name:R.target.value})),placeholder:"e.g. Filesystem MCP"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"Transport"}),s.jsxs(cn,{value:f.transport,onValueChange:R=>h(T=>({...T,transport:R})),children:[s.jsx(tn,{children:s.jsx(un,{})}),s.jsxs(nn,{children:[s.jsx(lt,{value:"stdio",children:"stdio"}),s.jsx(lt,{value:"sse",children:"SSE"}),s.jsx(lt,{value:"streamable-http",children:"Streamable HTTP"})]})]})]})]}),f.transport==="stdio"?s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"Command"}),s.jsx(mt,{value:f.command||"",onChange:R=>h(T=>({...T,command:R.target.value})),placeholder:"npx",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"Args (comma-separated)"}),s.jsx(mt,{value:(f.args||[]).join(", "),onChange:R=>h(T=>({...T,args:R.target.value.split(",").map(F=>F.trim()).filter(Boolean)})),placeholder:"-y, @mcp/server",className:"font-mono text-xs"})]})]}):s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"URL"}),s.jsx(mt,{value:f.url||"",onChange:R=>h(T=>({...T,url:R.target.value})),placeholder:"http://localhost:3001/sse",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"Auth Type"}),s.jsxs(cn,{value:f.authType||"none",onValueChange:R=>C(R),children:[s.jsx(tn,{children:s.jsx(un,{})}),s.jsxs(nn,{children:[s.jsx(lt,{value:"none",children:"None"}),s.jsx(lt,{value:"bearer",children:"Bearer Token"}),s.jsx(lt,{value:"api-key",children:"API Key"}),s.jsx(lt,{value:"oauth2",children:"OAuth 2.0"})]})]})]}),f.authType==="bearer"&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"Token"}),s.jsx(mt,{value:f.authValue||"",onChange:R=>h(T=>({...T,authValue:R.target.value})),placeholder:"${DATABRICKS_TOKEN}",className:"font-mono text-xs"})]})]}),f.authType==="bearer"&&s.jsxs("p",{className:"text-xs text-muted-foreground -mt-1",children:["Use ",s.jsx("code",{className:"rounded bg-muted px-1",children:"${VAR_NAME}"})," to reference an environment variable, or enter a token directly."]}),f.authType==="api-key"&&s.jsxs("div",{className:"space-y-3 rounded-md border p-3",children:[s.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"API Key"}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Header Name"}),s.jsx(mt,{value:f.apiKeyHeaderName||"X-API-Key",onChange:R=>h(T=>({...T,apiKeyHeaderName:R.target.value})),placeholder:"X-API-Key",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Value"}),s.jsx(mt,{value:f.authValue||"",onChange:R=>h(T=>({...T,authValue:R.target.value})),placeholder:"${MY_API_KEY}",className:"font-mono text-xs"})]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Use ",s.jsx("code",{className:"rounded bg-muted px-1",children:"${VAR_NAME}"})," to reference an environment variable, or enter a value directly."]})]}),f.authType==="oauth2"&&s.jsxs("div",{className:"space-y-3 rounded-md border p-3",children:[s.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"OAuth 2.0 Flow"}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Client ID"}),s.jsx(mt,{value:f.oauthClientId||"",onChange:R=>h(T=>({...T,oauthClientId:R.target.value})),placeholder:"your-client-id",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Client Secret (optional)"}),s.jsx(mt,{type:"password",value:f.oauthClientSecret||"",onChange:R=>h(T=>({...T,oauthClientSecret:R.target.value})),placeholder:"••••••••",className:"font-mono text-xs"})]})]}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Redirect URL"}),s.jsx(mt,{value:f.oauthRedirectUrl||"http://localhost:6274/oauth/",onChange:R=>h(T=>({...T,oauthRedirectUrl:R.target.value})),placeholder:"http://localhost:6274/oauth/",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Scope (space-separated)"}),s.jsx(mt,{value:f.oauthScope||"",onChange:R=>h(T=>({...T,oauthScope:R.target.value})),placeholder:"openid profile mcp",className:"font-mono text-xs"})]})]})]}),s.jsxs("div",{className:"flex items-center justify-between pt-2",children:[s.jsx("div",{children:!i&&s.jsx(le,{type:"button",variant:"destructive",size:"sm",onClick:()=>y(!0),children:"Delete"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:()=>t("/libraries/servers"),children:"Cancel"}),s.jsxs(le,{type:"button",size:"sm",onClick:()=>{_()},disabled:g,children:[g&&s.jsx(or,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Create Server":"Save"]})]})]})]})]}),s.jsx(Cs,{open:p,onOpenChange:y,children:s.jsxs(Ya,{children:[s.jsxs(Xa,{children:[s.jsx(Ja,{children:"Delete server?"}),s.jsxs(Za,{children:["This will permanently remove the server"," ",s.jsx("span",{className:"font-mono",children:f.name}),". This action cannot be undone."]})]}),s.jsxs(Qa,{children:[s.jsx(ts,{children:"Cancel"}),s.jsx(es,{onClick:()=>{k()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},Eme=()=>{const{agents:e,setAgents:t,reload:n,loading:r}=Ka(),a=_a(),[i,o]=v.useState(null),c=async f=>{const h=`${f.name}-copy`;let p=h,y=1;for(;e.some(j=>j.name===p);)p=`${h}-${y}`,y+=1;const g={...structuredClone(f),id:`agt-${Date.now()}`,name:p};await t([...e,g]),Pe({title:"Agent duplicated",description:`Created ${p}.`})},d=async f=>{await t(e.filter(h=>h.id!==f.id)),Pe({title:"Agent deleted",description:`${f.name} was removed.`}),o(null)};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(ba,{className:"h-6 w-6"}),"Agents"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Reusable agent profiles shared across configurations."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(le,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[s.jsx(Na,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(le,{type:"button",size:"sm",onClick:()=>a("/libraries/agents/new"),children:[s.jsx(ms,{className:"mr-2 h-4 w-4"}),"Add Agent"]})]})]}),e.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed py-16 text-center",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents configured. Add one to get started."}),s.jsxs(le,{type:"button",size:"sm",className:"mt-4",onClick:()=>a("/libraries/agents/new"),children:[s.jsx(ms,{className:"mr-2 h-4 w-4"}),"Add Agent"]})]}):s.jsx(qe,{children:s.jsx(We,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs(Mt,{children:[s.jsx(tt,{children:"Name"}),s.jsx(tt,{children:"Provider"}),s.jsx(tt,{children:"Model"}),s.jsx(tt,{children:"Max Tokens"}),s.jsx(tt,{children:"Temperature"}),s.jsx(tt,{className:"text-right",children:"Actions"})]})}),s.jsx(Lr,{children:e.map(f=>s.jsxs(Mt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>a(`/libraries/agents/${encodeURIComponent(f.id)}`),children:[s.jsx(ze,{className:"font-medium",children:f.name}),s.jsx(ze,{children:s.jsx(vB,{provider:f.provider})}),s.jsx(ze,{children:s.jsx("span",{className:"font-mono text-xs",children:f.model})}),s.jsx(ze,{className:"font-mono text-xs",children:f.maxTokens}),s.jsx(ze,{className:"font-mono text-xs",children:f.temperature.toFixed(2)}),s.jsx(ze,{className:"text-right",onClick:h=>h.stopPropagation(),children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsxs(le,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>o(f),children:[s.jsx(Ca,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(le,{type:"button",size:"sm",variant:"outline",onClick:()=>{c(f)},children:[s.jsx(zi,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(le,{type:"button",size:"sm",variant:"outline",onClick:()=>a(`/libraries/agents/${encodeURIComponent(f.id)}`),children:[s.jsx(Lm,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},f.id))})]})})}),s.jsx(Cs,{open:!!i,onOpenChange:f=>!f&&o(null),children:s.jsxs(Ya,{children:[s.jsxs(Xa,{children:[s.jsx(Ja,{children:"Delete agent?"}),s.jsxs(Za,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-mono",children:i?.name})," from the library. This action cannot be undone."]})]}),s.jsxs(Qa,{children:[s.jsx(ts,{children:"Cancel"}),s.jsx(es,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{i&&d(i)},children:"Delete Agent"})]})]})})]})};var qz=["PageUp","PageDown"],Wz=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Vz={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},nu="Slider",[AS,Pme,kme]=af(nu),[Hz]=lr(nu,[kme]),[Ome,lg]=Hz(nu),Kz=v.forwardRef((e,t)=>{const{name:n,min:r=0,max:a=100,step:i=1,orientation:o="horizontal",disabled:c=!1,minStepsBetweenThumbs:d=0,defaultValue:f=[r],value:h,onValueChange:p=()=>{},onValueCommit:y=()=>{},inverted:g=!1,form:j,...b}=e,x=v.useRef(new Set),S=v.useRef(0),C=o==="horizontal"?Rme:Tme,[E=[],_]=ia({prop:h,defaultProp:f,onChange:L=>{[...x.current][S.current]?.focus(),p(L)}}),k=v.useRef(E);function O(L){const $=Lme(E,L);F(L,$)}function R(L){F(L,S.current)}function T(){const L=k.current[S.current];E[S.current]!==L&&y(E)}function F(L,$,{commit:Y}={commit:!1}){const H=Ume(i),K=qme(Math.round((L-r)/i)*i+r,H),J=rf(K,[r,a]);_((Q=[])=>{const D=$me(Q,J,$);if(zme(D,d*i)){S.current=D.indexOf(J);const B=String(D)!==String(Q);return B&&Y&&y(D),B?D:Q}else return Q})}return s.jsx(Ome,{scope:e.__scopeSlider,name:n,disabled:c,min:r,max:a,valueIndexToChangeRef:S,thumbs:x.current,values:E,orientation:o,form:j,children:s.jsx(AS.Provider,{scope:e.__scopeSlider,children:s.jsx(AS.Slot,{scope:e.__scopeSlider,children:s.jsx(C,{"aria-disabled":c,"data-disabled":c?"":void 0,...b,ref:t,onPointerDown:ke(b.onPointerDown,()=>{c||(k.current=E)}),min:r,max:a,inverted:g,onSlideStart:c?void 0:O,onSlideMove:c?void 0:R,onSlideEnd:c?void 0:T,onHomeKeyDown:()=>!c&&F(r,0,{commit:!0}),onEndKeyDown:()=>!c&&F(a,E.length-1,{commit:!0}),onStepKeyDown:({event:L,direction:$})=>{if(!c){const K=qz.includes(L.key)||L.shiftKey&&Wz.includes(L.key)?10:1,J=S.current,Q=E[J],D=i*K*$;F(Q+D,J,{commit:!0})}}})})})})});Kz.displayName=nu;var[Gz,Yz]=Hz(nu,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Rme=v.forwardRef((e,t)=>{const{min:n,max:r,dir:a,inverted:i,onSlideStart:o,onSlideMove:c,onSlideEnd:d,onStepKeyDown:f,...h}=e,[p,y]=v.useState(null),g=vt(t,C=>y(C)),j=v.useRef(void 0),b=Jc(a),x=b==="ltr",S=x&&!i||!x&&i;function N(C){const E=j.current||p.getBoundingClientRect(),_=[0,E.width],O=_C(_,S?[n,r]:[r,n]);return j.current=E,O(C-E.left)}return s.jsx(Gz,{scope:e.__scopeSlider,startEdge:S?"left":"right",endEdge:S?"right":"left",direction:S?1:-1,size:"width",children:s.jsx(Xz,{dir:b,"data-orientation":"horizontal",...h,ref:g,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:C=>{const E=N(C.clientX);o?.(E)},onSlideMove:C=>{const E=N(C.clientX);c?.(E)},onSlideEnd:()=>{j.current=void 0,d?.()},onStepKeyDown:C=>{const _=Vz[S?"from-left":"from-right"].includes(C.key);f?.({event:C,direction:_?-1:1})}})})}),Tme=v.forwardRef((e,t)=>{const{min:n,max:r,inverted:a,onSlideStart:i,onSlideMove:o,onSlideEnd:c,onStepKeyDown:d,...f}=e,h=v.useRef(null),p=vt(t,h),y=v.useRef(void 0),g=!a;function j(b){const x=y.current||h.current.getBoundingClientRect(),S=[0,x.height],C=_C(S,g?[r,n]:[n,r]);return y.current=x,C(b-x.top)}return s.jsx(Gz,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:s.jsx(Xz,{"data-orientation":"vertical",...f,ref:p,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:b=>{const x=j(b.clientY);i?.(x)},onSlideMove:b=>{const x=j(b.clientY);o?.(x)},onSlideEnd:()=>{y.current=void 0,c?.()},onStepKeyDown:b=>{const S=Vz[g?"from-bottom":"from-top"].includes(b.key);d?.({event:b,direction:S?-1:1})}})})}),Xz=v.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:a,onSlideEnd:i,onHomeKeyDown:o,onEndKeyDown:c,onStepKeyDown:d,...f}=e,h=lg(nu,n);return s.jsx(Ke.span,{...f,ref:t,onKeyDown:ke(e.onKeyDown,p=>{p.key==="Home"?(o(p),p.preventDefault()):p.key==="End"?(c(p),p.preventDefault()):qz.concat(Wz).includes(p.key)&&(d(p),p.preventDefault())}),onPointerDown:ke(e.onPointerDown,p=>{const y=p.target;y.setPointerCapture(p.pointerId),p.preventDefault(),h.thumbs.has(y)?y.focus():r(p)}),onPointerMove:ke(e.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&a(p)}),onPointerUp:ke(e.onPointerUp,p=>{const y=p.target;y.hasPointerCapture(p.pointerId)&&(y.releasePointerCapture(p.pointerId),i(p))})})}),Qz="SliderTrack",Jz=v.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=lg(Qz,n);return s.jsx(Ke.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...r,ref:t})});Jz.displayName=Qz;var _S="SliderRange",Zz=v.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=lg(_S,n),i=Yz(_S,n),o=v.useRef(null),c=vt(t,o),d=a.values.length,f=a.values.map(y=>n8(y,a.min,a.max)),h=d>1?Math.min(...f):0,p=100-Math.max(...f);return s.jsx(Ke.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...r,ref:c,style:{...e.style,[i.startEdge]:h+"%",[i.endEdge]:p+"%"}})});Zz.displayName=_S;var ES="SliderThumb",e8=v.forwardRef((e,t)=>{const n=Pme(e.__scopeSlider),[r,a]=v.useState(null),i=vt(t,c=>a(c)),o=v.useMemo(()=>r?n().findIndex(c=>c.ref.current===r):-1,[n,r]);return s.jsx(Ime,{...e,ref:i,index:o})}),Ime=v.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:a,...i}=e,o=lg(ES,n),c=Yz(ES,n),[d,f]=v.useState(null),h=vt(t,N=>f(N)),p=d?o.form||!!d.closest("form"):!0,y=qm(d),g=o.values[r],j=g===void 0?0:n8(g,o.min,o.max),b=Dme(r,o.values.length),x=y?.[c.size],S=x?Fme(x,j,c.direction):0;return v.useEffect(()=>{if(d)return o.thumbs.add(d),()=>{o.thumbs.delete(d)}},[d,o.thumbs]),s.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${j}% + ${S}px)`},children:[s.jsx(AS.ItemSlot,{scope:e.__scopeSlider,children:s.jsx(Ke.span,{role:"slider","aria-label":e["aria-label"]||b,"aria-valuemin":o.min,"aria-valuenow":g,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...i,ref:h,style:g===void 0?{display:"none"}:e.style,onFocus:ke(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),p&&s.jsx(t8,{name:a??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:g},r)]})});e8.displayName=ES;var Mme="RadioBubbleInput",t8=v.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const a=v.useRef(null),i=vt(a,r),o=Qv(t);return v.useEffect(()=>{const c=a.current;if(!c)return;const d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"value").set;if(o!==t&&h){const p=new Event("input",{bubbles:!0});h.call(c,t),c.dispatchEvent(p)}},[o,t]),s.jsx(Ke.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});t8.displayName=Mme;function $me(e=[],t,n){const r=[...e];return r[n]=t,r.sort((a,i)=>a-i)}function n8(e,t,n){const i=100/(n-t)*(e-t);return rf(i,[0,100])}function Dme(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Lme(e,t){if(e.length===1)return 0;const n=e.map(a=>Math.abs(a-t)),r=Math.min(...n);return n.indexOf(r)}function Fme(e,t,n){const r=e/2,i=_C([0,50],[0,r]);return(r-i(t)*n)*n}function Bme(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function zme(e,t){if(t>0){const n=Bme(e);return Math.min(...n)>=t}return!0}function _C(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 Ume(e){return(String(e).split(".")[1]||"").length}function qme(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var r8=Kz,Wme=Jz,Vme=Zz,Hme=e8;const a8=v.forwardRef(({className:e,...t},n)=>s.jsxs(r8,{ref:n,className:Se("relative flex w-full touch-none select-none items-center",e),...t,children:[s.jsx(Wme,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:s.jsx(Vme,{className:"absolute h-full bg-primary"})}),s.jsx(Hme,{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"})]}));a8.displayName=r8.displayName;function Kme(e){const t=Gme(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(Xme);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function Gme(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=Jme(a),c=Qme(i,a.props);return a.type!==v.Fragment&&(c.ref=r?Cr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Yme=Symbol("radix.slottable");function Xme(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Yme}function Qme(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function Jme(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 cg="Popover",[s8]=lr(cg,[Ki]),Ef=Ki(),[Zme,to]=s8(cg),i8=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!1}=e,c=Ef(t),d=v.useRef(null),[f,h]=v.useState(!1),[p,y]=ia({prop:r,defaultProp:a??!1,onChange:i,caller:cg});return s.jsx(Wm,{...c,children:s.jsx(Zme,{scope:t,contentId:Vn(),triggerRef:d,open:p,onOpenChange:y,onOpenToggle:v.useCallback(()=>y(g=>!g),[y]),hasCustomAnchor:f,onCustomAnchorAdd:v.useCallback(()=>h(!0),[]),onCustomAnchorRemove:v.useCallback(()=>h(!1),[]),modal:o,children:n})})};i8.displayName=cg;var o8="PopoverAnchor",eve=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=to(o8,n),i=Ef(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:c}=a;return v.useEffect(()=>(o(),()=>c()),[o,c]),s.jsx(cf,{...i,...r,ref:t})});eve.displayName=o8;var l8="PopoverTrigger",c8=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=to(l8,n),i=Ef(n),o=vt(t,a.triggerRef),c=s.jsx(Ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":h8(a.open),...r,ref:o,onClick:ke(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:s.jsx(cf,{asChild:!0,...i,children:c})});c8.displayName=l8;var EC="PopoverPortal",[tve,nve]=s8(EC,{forceMount:void 0}),u8=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=to(EC,t);return s.jsx(tve,{scope:t,forceMount:n,children:s.jsx(Kn,{present:n||i.open,children:s.jsx(Dc,{asChild:!0,container:a,children:r})})})};u8.displayName=EC;var Mc="PopoverContent",d8=v.forwardRef((e,t)=>{const n=nve(Mc,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=to(Mc,e.__scopePopover);return s.jsx(Kn,{present:r||i.open,children:i.modal?s.jsx(ave,{...a,ref:t}):s.jsx(sve,{...a,ref:t})})});d8.displayName=Mc;var rve=Kme("PopoverContent.RemoveScroll"),ave=v.forwardRef((e,t)=>{const n=to(Mc,e.__scopePopover),r=v.useRef(null),a=vt(t,r),i=v.useRef(!1);return v.useEffect(()=>{const o=r.current;if(o)return av(o)},[]),s.jsx(df,{as:rve,allowPinchZoom:!0,children:s.jsx(f8,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ke(e.onCloseAutoFocus,o=>{o.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:ke(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:ke(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),sve=v.forwardRef((e,t)=>{const n=to(Mc,e.__scopePopover),r=v.useRef(!1),a=v.useRef(!1);return s.jsx(f8,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;n.triggerRef.current?.contains(o)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),f8=v.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,...p}=e,y=to(Mc,n),g=Ef(n);return nv(),s.jsx(uf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(Uo,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>y.onOpenChange(!1),children:s.jsx(Vm,{"data-state":h8(y.open),role:"dialog",id:y.contentId,...g,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),p8="PopoverClose",ive=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=to(p8,n);return s.jsx(Ke.button,{type:"button",...r,ref:t,onClick:ke(e.onClick,()=>a.onOpenChange(!1))})});ive.displayName=p8;var ove="PopoverArrow",lve=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Ef(n);return s.jsx(Hm,{...a,...r,ref:t})});lve.displayName=ove;function h8(e){return e?"open":"closed"}var cve=i8,uve=c8,dve=u8,m8=d8;const fve=cve,pve=uve,v8=v.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>s.jsx(dve,{children:s.jsx(m8,{ref:a,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})}));v8.displayName=m8.displayName;var hM=1,hve=.9,mve=.8,vve=.17,b1=.1,w1=.999,gve=.9999,yve=.99,xve=/[\\\/_+.#"@\[\(\{&]/,bve=/[\\\/_+.#"@\[\(\{&]/g,wve=/[\s-]/,g8=/[\s-]/g;function PS(e,t,n,r,a,i,o){if(i===t.length)return a===e.length?hM:yve;var c=`${a},${i}`;if(o[c]!==void 0)return o[c];for(var d=r.charAt(i),f=n.indexOf(d,a),h=0,p,y,g,j;f>=0;)p=PS(e,t,n,r,f+1,i+1,o),p>h&&(f===a?p*=hM:xve.test(e.charAt(f-1))?(p*=mve,g=e.slice(a,f-1).match(bve),g&&a>0&&(p*=Math.pow(w1,g.length))):wve.test(e.charAt(f-1))?(p*=hve,j=e.slice(a,f-1).match(g8),j&&a>0&&(p*=Math.pow(w1,j.length))):(p*=vve,a>0&&(p*=Math.pow(w1,f-a))),e.charAt(f)!==t.charAt(i)&&(p*=gve)),(p<b1&&n.charAt(f-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(f-1)!==r.charAt(i))&&(y=PS(e,t,n,r,f+1,i+2,o),y*b1>p&&(p=y*b1)),p>h&&(h=p),f=n.indexOf(d,f+1);return o[c]=h,h}function mM(e){return e.toLowerCase().replace(g8," ")}function jve(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,PS(e,t,mM(e),mM(t),0,0,{})}var Yu='[cmdk-group=""]',j1='[cmdk-group-items=""]',Sve='[cmdk-group-heading=""]',y8='[cmdk-item=""]',vM=`${y8}:not([aria-disabled="true"])`,kS="cmdk-item-select",Ll="data-value",Nve=(e,t,n)=>jve(e,t,n),x8=v.createContext(void 0),Pf=()=>v.useContext(x8),b8=v.createContext(void 0),PC=()=>v.useContext(b8),w8=v.createContext(void 0),j8=v.forwardRef((e,t)=>{let n=Fl(()=>{var M,re;return{search:"",value:(re=(M=e.value)!=null?M:e.defaultValue)!=null?re:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Fl(()=>new Set),a=Fl(()=>new Map),i=Fl(()=>new Map),o=Fl(()=>new Set),c=S8(e),{label:d,children:f,value:h,onValueChange:p,filter:y,shouldFilter:g,loop:j,disablePointerSelection:b=!1,vimBindings:x=!0,...S}=e,N=Vn(),C=Vn(),E=Vn(),_=v.useRef(null),k=Mve();zo(()=>{if(h!==void 0){let M=h.trim();n.current.value=M,O.emit()}},[h]),zo(()=>{k(6,Y)},[]);let O=v.useMemo(()=>({subscribe:M=>(o.current.add(M),()=>o.current.delete(M)),snapshot:()=>n.current,setState:(M,re,te)=>{var G,de,ce,he;if(!Object.is(n.current[M],re)){if(n.current[M]=re,M==="search")$(),F(),k(1,L);else if(M==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ie=document.getElementById(E);ie?ie.focus():(G=document.getElementById(N))==null||G.focus()}if(k(7,()=>{var ie;n.current.selectedItemId=(ie=H())==null?void 0:ie.id,O.emit()}),te||k(5,Y),((de=c.current)==null?void 0:de.value)!==void 0){let ie=re??"";(he=(ce=c.current).onValueChange)==null||he.call(ce,ie);return}}O.emit()}},emit:()=>{o.current.forEach(M=>M())}}),[]),R=v.useMemo(()=>({value:(M,re,te)=>{var G;re!==((G=i.current.get(M))==null?void 0:G.value)&&(i.current.set(M,{value:re,keywords:te}),n.current.filtered.items.set(M,T(re,te)),k(2,()=>{F(),O.emit()}))},item:(M,re)=>(r.current.add(M),re&&(a.current.has(re)?a.current.get(re).add(M):a.current.set(re,new Set([M]))),k(3,()=>{$(),F(),n.current.value||L(),O.emit()}),()=>{i.current.delete(M),r.current.delete(M),n.current.filtered.items.delete(M);let te=H();k(4,()=>{$(),te?.getAttribute("id")===M&&L(),O.emit()})}),group:M=>(a.current.has(M)||a.current.set(M,new Set),()=>{i.current.delete(M),a.current.delete(M)}),filter:()=>c.current.shouldFilter,label:d||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:N,inputId:E,labelId:C,listInnerRef:_}),[]);function T(M,re){var te,G;let de=(G=(te=c.current)==null?void 0:te.filter)!=null?G:Nve;return M?de(M,n.current.search,re):0}function F(){if(!n.current.search||c.current.shouldFilter===!1)return;let M=n.current.filtered.items,re=[];n.current.filtered.groups.forEach(G=>{let de=a.current.get(G),ce=0;de.forEach(he=>{let ie=M.get(he);ce=Math.max(ie,ce)}),re.push([G,ce])});let te=_.current;K().sort((G,de)=>{var ce,he;let ie=G.getAttribute("id"),ue=de.getAttribute("id");return((ce=M.get(ue))!=null?ce:0)-((he=M.get(ie))!=null?he:0)}).forEach(G=>{let de=G.closest(j1);de?de.appendChild(G.parentElement===de?G:G.closest(`${j1} > *`)):te.appendChild(G.parentElement===te?G:G.closest(`${j1} > *`))}),re.sort((G,de)=>de[1]-G[1]).forEach(G=>{var de;let ce=(de=_.current)==null?void 0:de.querySelector(`${Yu}[${Ll}="${encodeURIComponent(G[0])}"]`);ce?.parentElement.appendChild(ce)})}function L(){let M=K().find(te=>te.getAttribute("aria-disabled")!=="true"),re=M?.getAttribute(Ll);O.setState("value",re||void 0)}function $(){var M,re,te,G;if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let de=0;for(let ce of r.current){let he=(re=(M=i.current.get(ce))==null?void 0:M.value)!=null?re:"",ie=(G=(te=i.current.get(ce))==null?void 0:te.keywords)!=null?G:[],ue=T(he,ie);n.current.filtered.items.set(ce,ue),ue>0&&de++}for(let[ce,he]of a.current)for(let ie of he)if(n.current.filtered.items.get(ie)>0){n.current.filtered.groups.add(ce);break}n.current.filtered.count=de}function Y(){var M,re,te;let G=H();G&&(((M=G.parentElement)==null?void 0:M.firstChild)===G&&((te=(re=G.closest(Yu))==null?void 0:re.querySelector(Sve))==null||te.scrollIntoView({block:"nearest"})),G.scrollIntoView({block:"nearest"}))}function H(){var M;return(M=_.current)==null?void 0:M.querySelector(`${y8}[aria-selected="true"]`)}function K(){var M;return Array.from(((M=_.current)==null?void 0:M.querySelectorAll(vM))||[])}function J(M){let re=K()[M];re&&O.setState("value",re.getAttribute(Ll))}function Q(M){var re;let te=H(),G=K(),de=G.findIndex(he=>he===te),ce=G[de+M];(re=c.current)!=null&&re.loop&&(ce=de+M<0?G[G.length-1]:de+M===G.length?G[0]:G[de+M]),ce&&O.setState("value",ce.getAttribute(Ll))}function D(M){let re=H(),te=re?.closest(Yu),G;for(;te&&!G;)te=M>0?Tve(te,Yu):Ive(te,Yu),G=te?.querySelector(vM);G?O.setState("value",G.getAttribute(Ll)):Q(M)}let B=()=>J(K().length-1),Z=M=>{M.preventDefault(),M.metaKey?B():M.altKey?D(1):Q(1)},z=M=>{M.preventDefault(),M.metaKey?J(0):M.altKey?D(-1):Q(-1)};return v.createElement(Ke.div,{ref:t,tabIndex:-1,...S,"cmdk-root":"",onKeyDown:M=>{var re;(re=S.onKeyDown)==null||re.call(S,M);let te=M.nativeEvent.isComposing||M.keyCode===229;if(!(M.defaultPrevented||te))switch(M.key){case"n":case"j":{x&&M.ctrlKey&&Z(M);break}case"ArrowDown":{Z(M);break}case"p":case"k":{x&&M.ctrlKey&&z(M);break}case"ArrowUp":{z(M);break}case"Home":{M.preventDefault(),J(0);break}case"End":{M.preventDefault(),B();break}case"Enter":{M.preventDefault();let G=H();if(G){let de=new Event(kS);G.dispatchEvent(de)}}}}},v.createElement("label",{"cmdk-label":"",htmlFor:R.inputId,id:R.labelId,style:Dve},d),ug(e,M=>v.createElement(b8.Provider,{value:O},v.createElement(x8.Provider,{value:R},M))))}),Cve=v.forwardRef((e,t)=>{var n,r;let a=Vn(),i=v.useRef(null),o=v.useContext(w8),c=Pf(),d=S8(e),f=(r=(n=d.current)==null?void 0:n.forceMount)!=null?r:o?.forceMount;zo(()=>{if(!f)return c.item(a,o?.id)},[f]);let h=N8(a,i,[e.value,e.children,i],e.keywords),p=PC(),y=Hi(k=>k.value&&k.value===h.current),g=Hi(k=>f||c.filter()===!1?!0:k.search?k.filtered.items.get(a)>0:!0);v.useEffect(()=>{let k=i.current;if(!(!k||e.disabled))return k.addEventListener(kS,j),()=>k.removeEventListener(kS,j)},[g,e.onSelect,e.disabled]);function j(){var k,O;b(),(O=(k=d.current).onSelect)==null||O.call(k,h.current)}function b(){p.setState("value",h.current,!0)}if(!g)return null;let{disabled:x,value:S,onSelect:N,forceMount:C,keywords:E,..._}=e;return v.createElement(Ke.div,{ref:Cr(i,t),..._,id:a,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!y,"data-disabled":!!x,"data-selected":!!y,onPointerMove:x||c.getDisablePointerSelection()?void 0:b,onClick:x?void 0:j},e.children)}),Ave=v.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...i}=e,o=Vn(),c=v.useRef(null),d=v.useRef(null),f=Vn(),h=Pf(),p=Hi(g=>a||h.filter()===!1?!0:g.search?g.filtered.groups.has(o):!0);zo(()=>h.group(o),[]),N8(o,c,[e.value,e.heading,d]);let y=v.useMemo(()=>({id:o,forceMount:a}),[a]);return v.createElement(Ke.div,{ref:Cr(c,t),...i,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},n&&v.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),ug(e,g=>v.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},v.createElement(w8.Provider,{value:y},g))))}),_ve=v.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=v.useRef(null),i=Hi(o=>!o.search);return!n&&!i?null:v.createElement(Ke.div,{ref:Cr(a,t),...r,"cmdk-separator":"",role:"separator"})}),Eve=v.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,i=PC(),o=Hi(f=>f.search),c=Hi(f=>f.selectedItemId),d=Pf();return v.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),v.createElement(Ke.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":d.listId,"aria-labelledby":d.labelId,"aria-activedescendant":c,id:d.inputId,type:"text",value:a?e.value:o,onChange:f=>{a||i.setState("search",f.target.value),n?.(f.target.value)}})}),Pve=v.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,i=v.useRef(null),o=v.useRef(null),c=Hi(f=>f.selectedItemId),d=Pf();return v.useEffect(()=>{if(o.current&&i.current){let f=o.current,h=i.current,p,y=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let g=f.offsetHeight;h.style.setProperty("--cmdk-list-height",g.toFixed(1)+"px")})});return y.observe(f),()=>{cancelAnimationFrame(p),y.unobserve(f)}}},[]),v.createElement(Ke.div,{ref:Cr(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:d.listId},ug(e,f=>v.createElement("div",{ref:Cr(o,d.listInnerRef),"cmdk-list-sizer":""},f)))}),kve=v.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:i,container:o,...c}=e;return v.createElement(iv,{open:n,onOpenChange:r},v.createElement(ov,{container:o},v.createElement(qc,{"cmdk-overlay":"",className:a}),v.createElement(Wc,{"aria-label":e.label,"cmdk-dialog":"",className:i},v.createElement(j8,{ref:t,...c}))))}),Ove=v.forwardRef((e,t)=>Hi(n=>n.filtered.count===0)?v.createElement(Ke.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Rve=v.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...i}=e;return v.createElement(Ke.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},ug(e,o=>v.createElement("div",{"aria-hidden":!0},o)))}),zr=Object.assign(j8,{List:Pve,Item:Cve,Input:Eve,Group:Ave,Separator:_ve,Dialog:kve,Empty:Ove,Loading:Rve});function Tve(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Ive(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function S8(e){let t=v.useRef(e);return zo(()=>{t.current=e}),t}var zo=typeof window>"u"?v.useEffect:v.useLayoutEffect;function Fl(e){let t=v.useRef();return t.current===void 0&&(t.current=e()),t}function Hi(e){let t=PC(),n=()=>e(t.snapshot());return v.useSyncExternalStore(t.subscribe,n,n)}function N8(e,t,n,r=[]){let a=v.useRef(),i=Pf();return zo(()=>{var o;let c=(()=>{var f;for(let h of n){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(f=h.current.textContent)==null?void 0:f.trim():a.current}})(),d=r.map(f=>f.trim());i.value(e,c,d),(o=t.current)==null||o.setAttribute(Ll,c),a.current=c}),a}var Mve=()=>{let[e,t]=v.useState(),n=Fl(()=>new Map);return zo(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function $ve(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function ug({asChild:e,children:t},n){return e&&v.isValidElement(t)?v.cloneElement($ve(t),{ref:t.ref},n(t.props.children)):n(t)}var Dve={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const C8=v.forwardRef(({className:e,...t},n)=>s.jsx(zr,{ref:n,className:Se("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));C8.displayName=zr.displayName;const A8=v.forwardRef(({className:e,...t},n)=>s.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[s.jsx(FS,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),s.jsx(zr.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})]}));A8.displayName=zr.Input.displayName;const _8=v.forwardRef(({className:e,...t},n)=>s.jsx(zr.List,{ref:n,className:Se("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));_8.displayName=zr.List.displayName;const E8=v.forwardRef((e,t)=>s.jsx(zr.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));E8.displayName=zr.Empty.displayName;const P8=v.forwardRef(({className:e,...t},n)=>s.jsx(zr.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}));P8.displayName=zr.Group.displayName;const Lve=v.forwardRef(({className:e,...t},n)=>s.jsx(zr.Separator,{ref:n,className:Se("-mx-1 h-px bg-border",e),...t}));Lve.displayName=zr.Separator.displayName;const OS=v.forwardRef(({className:e,...t},n)=>s.jsx(zr.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}));OS.displayName=zr.Item.displayName;const gM={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:[]},yM={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"},Fve=()=>({id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096}),Bve=()=>{const{agentName:e}=Wo(),t=_a(),{agents:n,setAgents:r}=Ka(),{source:a}=Tn(),i=e==="new",o=e?decodeURIComponent(e):"",c=i?null:n.find(D=>D.id===o)??n.find(D=>D.name===o),[d,f]=v.useState(()=>c??Fve()),[h,p]=v.useState(!1),[y,g]=v.useState(!1),[j,b]=v.useState({status:"idle"}),[x,S]=v.useState(!1),[N,C]=v.useState([]),[E,_]=v.useState(!1),[k,O]=v.useState(!1),[R,T]=v.useState(!1);v.useEffect(()=>{c&&f(c)},[c]);const F=d.provider==="anthropic"||d.provider==="openai"||d.provider==="azure",L=Array.from(new Set([...gM[d.provider]||[],...N])),$=L.includes(d.model),Y=R||!!d.model&&!$,H=async()=>{if(S(!0),d.provider==="google"||d.provider==="custom"){b({status:"unsupported"});return}b({status:"loading"});try{const D=await a.listProviderModels(d.provider);b({status:"success",items:D.items,source:D.source,kind:D.kind,testedAt:new Date().toISOString()})}catch(D){b({status:"error",message:D instanceof Error?D.message:String(D),testedAt:new Date().toISOString()})}},K=async()=>{if(!F){Pe({title:"Provider discovery not supported",description:"Model discovery is available for Anthropic, OpenAI, and Azure OpenAI."});return}_(!0);try{const D=await a.listProviderModels(d.provider);C(D.items),Pe({title:D.kind==="deployments"?"Deployments loaded":"Models loaded",description:`${D.items.length} ${D.kind} from ${D.source}`})}catch(D){Pe({title:"Could not load provider models",description:String(D instanceof Error?D.message:D),variant:"destructive"})}finally{_(!1)}},J=async()=>{if(!d.name.trim()){Pe({title:"Name is required",variant:"destructive"});return}g(!0);try{if(i)await r([...n,d]),Pe({title:"Agent created"}),t(`/libraries/agents/${encodeURIComponent(d.id)}`);else{const D=n.map(B=>B.id===c?.id?d:B);await r(D),Pe({title:"Agent saved"}),d.id!==o&&t(`/libraries/agents/${encodeURIComponent(d.id)}`,{replace:!0})}}finally{g(!1)}},Q=async()=>{const D=n.filter(B=>B.id!==c?.id);await r(D),Pe({title:"Agent deleted"}),t("/libraries/agents")};return!i&&!c?s.jsxs("div",{className:"space-y-4",children:[s.jsxs(wt,{to:"/libraries/agents",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(ko,{className:"h-4 w-4"})," Agents"]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:['Agent "',o,'" not found.']})]}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsxs(wt,{to:"/libraries/agents",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(ko,{className:"h-4 w-4"})," Agents"]}),s.jsx("h1",{className:"text-2xl font-bold",children:i?"New Agent":d.name})]}),!i&&s.jsxs(le,{type:"button",onClick:()=>{H()},children:[s.jsx(w$,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),x&&s.jsxs(qe,{children:[s.jsxs(St,{className:"flex-row items-center justify-between space-y-0",children:[s.jsx(Nt,{className:"text-base",children:"Connection Test"}),s.jsx("button",{type:"button",onClick:()=>S(!1),className:"rounded-sm opacity-70 hover:opacity-100",children:s.jsx(Ys,{className:"h-4 w-4"})})]}),s.jsxs(We,{className:"space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground",children:[s.jsx("span",{children:"Provider:"}),s.jsx("span",{className:"font-medium text-foreground",children:d.provider}),s.jsx("span",{className:"mx-1",children:"·"}),s.jsx("span",{children:"Endpoint:"}),s.jsxs("code",{className:"font-mono text-xs",children:["/api/providers/models?provider=",d.provider]})]}),j.status==="loading"&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(or,{className:"h-4 w-4 animate-spin"}),"Testing connection..."]}),j.status==="success"&&s.jsxs("div",{className:"space-y-3",children:[s.jsxs("p",{className:"flex items-center gap-2 text-sm text-emerald-700",children:[s.jsx(sc,{className:"h-4 w-4 shrink-0"}),"Connected — discovered ",j.items.length," ",j.kind," from"," ",j.source]}),s.jsxs("div",{className:"rounded-md bg-muted p-3",children:[s.jsxs("p",{className:"mb-1 text-xs font-medium text-muted-foreground",children:["First 5 ",j.kind,":"]}),s.jsx("ul",{className:"space-y-0.5",children:j.items.slice(0,5).map(D=>s.jsx("li",{className:"font-mono text-xs",children:D},D))})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(j.testedAt).toLocaleString()]})]}),j.status==="error"&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("p",{className:"text-sm text-destructive",children:[s.jsx("span",{className:"font-medium",children:"✗ Connection failed"})," —"," ",j.message]}),yM[d.provider]&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",yM[d.provider]]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(j.testedAt).toLocaleString()]})]}),j.status==="unsupported"&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-sm text-muted-foreground",children:["Connection testing is not supported for the"," ",s.jsx("span",{className:"font-medium",children:d.provider})," provider. Supported providers: Anthropic, OpenAI, Azure OpenAI."]})]})]}),s.jsxs(qe,{children:[s.jsx(St,{children:s.jsx(Nt,{className:"text-base",children:"Configuration"})}),s.jsxs(We,{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"Name"}),s.jsx(mt,{value:d.name,onChange:D=>f(B=>({...B,name:D.target.value})),placeholder:"e.g. GPT-4o"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"Provider"}),s.jsxs(cn,{value:d.provider,onValueChange:D=>f(B=>({...B,provider:D,model:gM[D]?.[0]||""})),children:[s.jsx(tn,{children:s.jsx(un,{})}),s.jsxs(nn,{children:[s.jsx(lt,{value:"openai",children:"OpenAI"}),s.jsx(lt,{value:"anthropic",children:"Anthropic"}),s.jsx(lt,{value:"azure",children:"Azure OpenAI"}),s.jsx(lt,{value:"google",children:"Google"}),s.jsx(lt,{value:"custom",children:"Custom"})]})]})]})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:d.provider==="azure"?"Deployment":"Model"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(fve,{open:k,onOpenChange:O,children:[s.jsx(pve,{asChild:!0,children:s.jsxs(le,{type:"button",variant:"outline",role:"combobox","aria-expanded":k,className:"h-9 flex-1 justify-between font-mono text-xs",children:[s.jsx("span",{className:"truncate text-left",children:d.model||"Select model..."}),s.jsx(Gt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(v8,{className:"w-[420px] p-0",align:"start",children:s.jsxs(C8,{children:[s.jsx(A8,{placeholder:`Search ${d.provider==="azure"?"deployments":"models"}...`}),s.jsxs(_8,{children:[s.jsxs(E8,{children:["No ",d.provider==="azure"?"deployments":"models"," found."]}),s.jsxs(P8,{heading:d.provider==="azure"?"Deployments":"Models",children:[L.map(D=>s.jsxs(OS,{value:D,onSelect:B=>{f(Z=>({...Z,model:B})),T(!1),O(!1)},children:[s.jsx(sc,{className:Se("mr-2 h-4 w-4",d.model===D?"opacity-100":"opacity-0")}),s.jsx("span",{className:"font-mono text-xs",children:D})]},D)),s.jsx(OS,{value:"__custom_model_id__",onSelect:()=>{T(!0),O(!1)},children:s.jsx("span",{className:"font-medium",children:d.provider==="azure"?"Custom deployment ID...":"Custom model ID..."})})]})]})]})})]}),F&&s.jsxs(le,{type:"button",variant:"outline",size:"sm",className:"h-9 shrink-0 text-xs",onClick:()=>{K()},disabled:E,title:d.provider==="azure"?"Fetch Azure OpenAI deployments":`Fetch ${d.provider} models`,children:[E?s.jsx(or,{className:"mr-1 h-3 w-3 animate-spin"}):s.jsx(Na,{className:"mr-1 h-3 w-3"}),d.provider==="azure"?"Fetch Deployments":"Fetch Models"]})]}),Y&&s.jsx(mt,{value:d.model,onChange:D=>f(B=>({...B,model:D.target.value})),placeholder:d.provider==="azure"?"Type deployment name manually":"Type model name manually",className:"font-mono text-xs"}),N.length>0&&s.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Loaded ",N.length," ",d.provider==="azure"?"deployment names":"models"," from provider discovery."]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"Max Tokens"}),s.jsx(mt,{type:"number",min:1,max:128e3,value:d.maxTokens,onChange:D=>f(B=>({...B,maxTokens:parseInt(D.target.value)||0})),className:"font-mono text-xs"})]})]}),s.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"Max Turns"}),s.jsx(mt,{type:"number",min:1,max:50,value:d.maxTurns??"",onChange:D=>{const B=D.target.value.trim();f(Z=>({...Z,maxTurns:B&&parseInt(B)||void 0}))},placeholder:"30 (default)",className:"font-mono text-xs"}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Maximum number of LLM round-trips (tool calls + final answer) per eval run."})]})}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Fe,{children:"Temperature"}),s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:d.temperature.toFixed(2)})]}),s.jsx(a8,{value:[d.temperature],onValueChange:([D])=>f(B=>({...B,temperature:D})),min:0,max:2,step:.01})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"System Prompt"}),s.jsx(qa,{value:d.systemPrompt||"",onChange:D=>f(B=>({...B,systemPrompt:D.target.value})),placeholder:"Optional system prompt...",rows:3,className:"text-xs"})]}),s.jsxs("div",{className:"flex items-center justify-between pt-2",children:[s.jsx("div",{children:!i&&s.jsx(le,{type:"button",variant:"destructive",size:"sm",onClick:()=>p(!0),children:"Delete"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:()=>t("/libraries/agents"),children:"Cancel"}),s.jsxs(le,{type:"button",size:"sm",onClick:()=>{J()},disabled:y,children:[y&&s.jsx(or,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Create Agent":"Save"]})]})]})]})]}),s.jsx(Cs,{open:h,onOpenChange:p,children:s.jsxs(Ya,{children:[s.jsxs(Xa,{children:[s.jsx(Ja,{children:"Delete agent?"}),s.jsxs(Za,{children:["This will permanently remove the agent"," ",s.jsx("span",{className:"font-mono",children:d.name}),". This action cannot be undone."]})]}),s.jsxs(Qa,{children:[s.jsx(ts,{children:"Cancel"}),s.jsx(es,{onClick:()=>{Q()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},xM="mcplab.resultAssistantScenarioHandoff",bM=()=>{const{testCaseId:e}=Wo(),[t,n]=Vo(),r=_a(),{source:a}=Tn(),{scenarios:i,setScenarios:o,agents:c,servers:d,reload:f,loading:h}=Ka(),[p,y]=v.useState(""),[g,j]=v.useState("all"),[b,x]=v.useState("name"),[S,N]=v.useState("asc"),[C,E]=v.useState(""),[_,k]=v.useState(null),[O,R]=v.useState("idle"),[T,F]=v.useState(""),[L,$]=v.useState(""),[Y,H]=v.useState(0),[K,J]=v.useState(null),Q=v.useRef(null),D=v.useRef(!1),B=v.useRef(!1),Z=v.useRef(null),z=v.useRef(0),M=e?decodeURIComponent(e):void 0,re=M?i.findIndex(oe=>oe.id===M):-1,te=re>=0?i[re]:void 0,G=async oe=>{if(!te||re<0||!oe)return;const be=[...i];be[re]=oe,await o(be)},de=async()=>{const oe=Z.current;if(!oe||!te)return;if(D.current){B.current=!0;return}D.current=!0,B.current=!1;const be=++z.current;R("saving"),F("");try{await G(oe),be===z.current&&R("saved")}catch(Ie){const Ye=Ie instanceof Error?Ie.message:String(Ie);be===z.current&&(R("error"),F(Ye)),Pe({title:"Could not save scenario",description:Ye,variant:"destructive"})}finally{D.current=!1,B.current&&(B.current=!1,de())}},ce=oe=>{Z.current=oe,R("dirty"),F(""),Q.current&&window.clearTimeout(Q.current),Q.current=window.setTimeout(()=>{Q.current=null,de()},700)},he=async()=>{const oe=`scn-${Date.now()}`;let be=oe,Ie=1;for(;i.some(je=>je.id===be);)be=`${oe}-${Ie}`,Ie+=1;const Ye={id:be,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};await o([...i,Ye]),r(`/libraries/test-cases/${encodeURIComponent(be)}`),Pe({title:"Test case created",description:`Opened ${be} for editing.`})},ie=oe=>{const be=(oe||`scn-${Date.now()}`).trim().replace(/\s+/g,"-").replace(/[^a-zA-Z0-9_-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")||`scn-${Date.now()}`;let Ie=be,Ye=1;for(;i.some(je=>je.id===Ie);)Ie=`${be}-${Ye}`,Ye+=1;return Ie},ue=async(oe,be=!1)=>{const Ie=ie(`${oe.id}-copy`),Ye={...structuredClone(oe),id:Ie,name:oe.name?`${oe.name} (Copy)`:""};await o([...i,Ye]),Pe({title:"Test case duplicated",description:`Created ${Ye.id}.`}),be&&r(`/libraries/test-cases/${encodeURIComponent(Ye.id)}`)},Ae=async oe=>{Q.current&&(window.clearTimeout(Q.current),Q.current=null);const be=i.filter(Ie=>Ie.id!==oe.id);await o(be),Pe({title:"Test case deleted",description:`${oe.id} was removed.`}),te?.id===oe.id&&(k(null),Z.current=null,R("idle"),F(""),r("/libraries/test-cases"))},ae=oe=>oe.map(be=>d.find(Ie=>Ie.id===be)).filter(Boolean).map(be=>be?.name||be?.id).filter(Boolean),$e=v.useMemo(()=>{const oe=new Set;for(const be of i)for(const Ie of ae(be.serverIds))oe.add(Ie);return Array.from(oe).sort((be,Ie)=>be.localeCompare(Ie))},[i,d]),W=v.useMemo(()=>{const oe=p.trim().toLowerCase(),be=i.filter(Ie=>{const Ye=(Ie.name||"").toLowerCase(),je=Ie.id.toLowerCase(),Re=(Ie.prompt||"").toLowerCase(),Xe=ae(Ie.serverIds);return g!=="all"&&!Xe.includes(g)?!1:oe?Ye.includes(oe)||je.includes(oe)||Re.includes(oe)||Xe.some(It=>It.toLowerCase().includes(oe)):!0});return be.sort((Ie,Ye)=>{const je=ae(Ie.serverIds),Re=ae(Ye.serverIds);let Xe=0;switch(b){case"id":Xe=Ie.id.localeCompare(Ye.id);break;case"servers":Xe=je.length-Re.length;break;case"evalRules":Xe=Ie.evalRules.length-Ye.evalRules.length;break;case"extractRules":Xe=Ie.extractRules.length-Ye.extractRules.length;break;default:Xe=(Ie.name||Ie.id).localeCompare(Ye.name||Ye.id);break}return Xe===0&&(Xe=Ie.id.localeCompare(Ye.id)),S==="asc"?Xe:-Xe}),be},[i,p,g,b,S,d]);v.useEffect(()=>{let oe=!0;return a.getWorkspaceSettings().then(be=>{!oe||!be||E(be.scenarioAssistantAgentName??"")}).catch(()=>{oe&&E("")}),()=>{oe=!1}},[a]),v.useEffect(()=>{if(M&&t.get("assistantHandoff")==="1")try{const oe=window.sessionStorage.getItem(xM);if(!oe)return;const be=JSON.parse(oe);if(!be||be.scenarioId!==M||!be.prompt)return;$(String(be.prompt)),H(Date.now()),window.sessionStorage.removeItem(xM);const Ie=new URLSearchParams(t);Ie.delete("assistantHandoff"),n(Ie,{replace:!0}),Pe({title:"Suggestion sent to Scenario Assistant",description:"Review the suggestion and apply changes in the scenario editor."})}catch{}},[M,t,n]),v.useEffect(()=>{te?(k(structuredClone(te)),Z.current=structuredClone(te),R("idle"),F("")):(k(null),Z.current=null,R("idle"),F("")),Q.current&&(window.clearTimeout(Q.current),Q.current=null),D.current=!1,B.current=!1},[te]),v.useEffect(()=>()=>{Q.current&&window.clearTimeout(Q.current)},[]);const ve=C||c[0]?.name||"";return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(p$,{className:"h-6 w-6"}),"Manage Test Cases"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Reusable test case templates shared across configurations."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[te&&s.jsxs(le,{type:"button",size:"sm",variant:"outline",onClick:()=>r("/libraries/test-cases"),children:[s.jsx(ko,{className:"mr-2 h-4 w-4"}),"Back to Overview"]}),s.jsxs(le,{type:"button",size:"sm",variant:"outline",onClick:()=>{f()},disabled:h,children:[s.jsx(Na,{className:"mr-2 h-4 w-4"}),"Refresh"]}),!te&&s.jsxs(le,{type:"button",size:"sm",onClick:()=>{he()},children:[s.jsx(ms,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Test Case"]})]})]}),!te&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid gap-3 rounded-md border bg-muted/30 p-3 md:grid-cols-[1.6fr_1fr_1fr_auto]",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Search"}),s.jsxs("div",{className:"relative",children:[s.jsx(FS,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),s.jsx(mt,{value:p,onChange:oe=>y(oe.target.value),placeholder:"Search by name, id, prompt, server...",className:"h-8 pl-8 text-xs"})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Server Filter"}),s.jsxs(cn,{value:g,onValueChange:j,children:[s.jsx(tn,{className:"h-8 text-xs",children:s.jsx(un,{})}),s.jsxs(nn,{children:[s.jsx(lt,{value:"all",children:"All servers"}),$e.map(oe=>s.jsx(lt,{value:oe,children:oe},oe))]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Sort By"}),s.jsxs(cn,{value:b,onValueChange:oe=>x(oe),children:[s.jsx(tn,{className:"h-8 text-xs",children:s.jsx(un,{})}),s.jsxs(nn,{children:[s.jsx(lt,{value:"name",children:"Name"}),s.jsx(lt,{value:"id",children:"ID"}),s.jsx(lt,{value:"servers",children:"# Servers"}),s.jsx(lt,{value:"evalRules",children:"# Eval Rules"}),s.jsx(lt,{value:"extractRules",children:"# Extract Rules"})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Direction"}),s.jsxs(cn,{value:S,onValueChange:oe=>N(oe),children:[s.jsx(tn,{className:"h-8 w-28 text-xs",children:s.jsx(un,{})}),s.jsxs(nn,{children:[s.jsx(lt,{value:"asc",children:"Ascending"}),s.jsx(lt,{value:"desc",children:"Descending"})]})]})]})]}),s.jsx(qe,{children:s.jsxs(We,{className:"space-y-3 pt-6",children:[s.jsxs("div",{className:"text-xs text-muted-foreground",children:["Showing ",W.length," of ",i.length," test case",i.length!==1?"s":"","."]}),M&&!te&&s.jsxs("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900",children:["Test case ",s.jsx("code",{className:"font-mono",children:M})," was not found."]}),i.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No library test cases yet."}):W.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No test cases match the current filters."}):s.jsx("div",{className:"grid gap-3",children:W.map(oe=>{const be=M===oe.id,Ie=`/libraries/test-cases/${encodeURIComponent(oe.id)}`,Ye=ae(oe.serverIds);return s.jsx("div",{className:`rounded-lg border p-3 ${be?"border-primary bg-primary/5":""}`,children:s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"space-y-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx(wt,{to:Ie,className:"font-medium truncate hover:underline",children:oe.name||oe.id}),s.jsx(Je,{variant:"outline",className:"font-mono text-[10px]",children:oe.id}),be&&s.jsx(Je,{children:"Selected"})]}),s.jsxs("div",{className:"text-xs text-muted-foreground flex flex-wrap gap-x-3 gap-y-1",children:[s.jsxs("span",{children:[Ye.length," server",Ye.length!==1?"s":""]}),s.jsxs("span",{children:[oe.evalRules.length," eval rule",oe.evalRules.length!==1?"s":""]}),s.jsxs("span",{children:[oe.extractRules.length," extract rule",oe.extractRules.length!==1?"s":""]})]}),Ye.length>0&&s.jsx("div",{className:"flex flex-wrap gap-1",children:Ye.map(je=>s.jsx(Je,{variant:"secondary",className:"text-[10px]",children:je},`${oe.id}-${je}`))})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(le,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>J(oe),children:[s.jsx(Ca,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(le,{type:"button",size:"sm",variant:"outline",onClick:()=>{ue(oe)},children:[s.jsx(zi,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsx(le,{type:"button",size:"sm",variant:be?"default":"outline",asChild:!0,children:s.jsxs(wt,{to:Ie,children:[s.jsx(Lm,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})})]})]})},oe.id)})})]})})]}),te&&_?s.jsxs(qe,{children:[s.jsxs(St,{className:"pb-3",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsx("div",{children:s.jsx(Nt,{className:"text-base",children:"Edit Test Case"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(le,{type:"button",size:"sm",variant:"outline",onClick:()=>{ue(_,!0)},children:[s.jsx(zi,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(le,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>J(_),children:[s.jsx(Ca,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]})]})]}),s.jsx("div",{className:"text-sm text-muted-foreground",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs("span",{children:["Focused editor for ",s.jsx("code",{className:"font-mono",children:te.id}),"."]}),s.jsx(Je,{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"&&T&&s.jsx("span",{className:"text-[11px] text-destructive",children:T})]})})]}),s.jsx(We,{className:"pt-3",children:s.jsx(CS,{scenarios:[_],agents:c,servers:d,defaultAssistantAgentName:ve,assistantInitialPromptByScenarioId:L&&_?.id?{[_.id]:L}:void 0,assistantAutoOpenNonceByScenarioId:_?.id&&Y?{[_.id]:Y}:void 0,onChange:oe=>{const be=oe[0];be&&(k(be),ce(be))},allowAdd:!1})})]}):null,s.jsx(Cs,{open:!!K,onOpenChange:oe=>!oe&&J(null),children:s.jsxs(Ya,{children:[s.jsxs(Xa,{children:[s.jsx(Ja,{children:"Delete test case?"}),s.jsxs(Za,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-medium",children:K?.name||K?.id})," ","from the library. This action cannot be undone."]})]}),s.jsxs(Qa,{children:[s.jsx(ts,{children:"Cancel"}),s.jsx(es,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{K&&(Ae(K),J(null))},children:"Delete Test Case"})]})]})})]})},zve=()=>{const{source:e}=Tn(),{agents:t,reload:n,loading:r}=Ka(),[a,i]=v.useState(!1),[o,c]=v.useState(!1),[d,f]=v.useState(""),h=v.useMemo(()=>d||t[0]?.name||"",[d,t]),p=async()=>{i(!0);try{const j=await e.getWorkspaceSettings();f(j?.scenarioAssistantAgentName??"")}catch(j){f(""),Pe({title:"Could not load settings",description:j instanceof Error?j.message:String(j),variant:"destructive"})}finally{i(!1)}};v.useEffect(()=>{p()},[e]);const y=async j=>{f(j),c(!0);try{await e.updateWorkspaceSettings({scenarioAssistantAgentName:j||void 0}),Pe({title:"Settings updated",description:j?`Scenario Assistant Agent set to ${j}.`:"Scenario Assistant Agent cleared (will use first available agent by default)."})}catch(b){Pe({title:"Could not save settings",description:b instanceof Error?b.message:String(b),variant:"destructive"})}finally{c(!1)}},g=async()=>{await Promise.all([n(),p()])};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(BS,{className:"h-6 w-6"}),"Settings"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Workspace-level MCP Lab settings and defaults."})]}),s.jsxs(le,{type:"button",size:"sm",variant:"outline",onClick:()=>{g()},disabled:r||a,children:[s.jsx(Na,{className:"mr-2 h-4 w-4"}),"Refresh"]})]}),s.jsxs(qe,{children:[s.jsxs(St,{className:"pb-3",children:[s.jsx(Nt,{className:"text-base",children:"Scenario Assistant"}),s.jsx(Ws,{children:"Default assistant model used on library test case pages. If unset, MCP Lab uses the first available agent automatically."})]}),s.jsxs(We,{className:"grid gap-3 md:grid-cols-[1.3fr_auto] md:items-end",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Assistant Agent"}),s.jsxs(cn,{value:h||"__none__",onValueChange:j=>{y(j==="__none__"?"":j)},disabled:o,children:[s.jsx(tn,{className:"h-9 text-sm",children:s.jsx(un,{placeholder:"Select assistant agent"})}),s.jsxs(nn,{children:[s.jsx(lt,{value:"__none__",children:"None (use first agent)"}),t.map(j=>s.jsxs(lt,{value:j.id,children:[j.name||j.id," · ",j.model]},j.id))]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Applies to `/libraries/test-cases/:testCaseId`. MCP Evaluation editors can still override the assistant agent from their evaluation context."})]}),s.jsx("div",{className:"text-xs text-muted-foreground",children:"Saved in workspace settings"})]})]})]})};var dg="Checkbox",[Uve]=lr(dg),[qve,kC]=Uve(dg);function Wve(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:a,disabled:i,form:o,name:c,onCheckedChange:d,required:f,value:h="on",internal_do_not_use_render:p}=e,[y,g]=ia({prop:n,defaultProp:a??!1,onChange:d,caller:dg}),[j,b]=v.useState(null),[x,S]=v.useState(null),N=v.useRef(!1),C=j?!!o||!!j.closest("form"):!0,E={checked:y,disabled:i,setChecked:g,control:j,setControl:b,name:c,form:o,value:h,hasConsumerStoppedPropagationRef:N,required:f,defaultChecked:Bi(a)?!1:a,isFormControl:C,bubbleInput:x,setBubbleInput:S};return s.jsx(qve,{scope:t,...E,children:Vve(p)?p(E):r})}var k8="CheckboxTrigger",O8=v.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},a)=>{const{control:i,value:o,disabled:c,checked:d,required:f,setControl:h,setChecked:p,hasConsumerStoppedPropagationRef:y,isFormControl:g,bubbleInput:j}=kC(k8,e),b=vt(a,h),x=v.useRef(d);return v.useEffect(()=>{const S=i?.form;if(S){const N=()=>p(x.current);return S.addEventListener("reset",N),()=>S.removeEventListener("reset",N)}},[i,p]),s.jsx(Ke.button,{type:"button",role:"checkbox","aria-checked":Bi(d)?"mixed":d,"aria-required":f,"data-state":$8(d),"data-disabled":c?"":void 0,disabled:c,value:o,...r,ref:b,onKeyDown:ke(t,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:ke(n,S=>{p(N=>Bi(N)?!0:!N),j&&g&&(y.current=S.isPropagationStopped(),y.current||S.stopPropagation())})})});O8.displayName=k8;var OC=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:i,required:o,disabled:c,value:d,onCheckedChange:f,form:h,...p}=e;return s.jsx(Wve,{__scopeCheckbox:n,checked:a,defaultChecked:i,disabled:c,required:o,onCheckedChange:f,name:r,form:h,value:d,internal_do_not_use_render:({isFormControl:y})=>s.jsxs(s.Fragment,{children:[s.jsx(O8,{...p,ref:t,__scopeCheckbox:n}),y&&s.jsx(M8,{__scopeCheckbox:n})]})})});OC.displayName=dg;var R8="CheckboxIndicator",T8=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,i=kC(R8,n);return s.jsx(Kn,{present:r||Bi(i.checked)||i.checked===!0,children:s.jsx(Ke.span,{"data-state":$8(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});T8.displayName=R8;var I8="CheckboxBubbleInput",M8=v.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:a,checked:i,defaultChecked:o,required:c,disabled:d,name:f,value:h,form:p,bubbleInput:y,setBubbleInput:g}=kC(I8,e),j=vt(n,g),b=Qv(i),x=qm(r);v.useEffect(()=>{const N=y;if(!N)return;const C=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(C,"checked").set,k=!a.current;if(b!==i&&_){const O=new Event("click",{bubbles:k});N.indeterminate=Bi(i),_.call(N,Bi(i)?!1:i),N.dispatchEvent(O)}},[y,b,i,a]);const S=v.useRef(Bi(i)?!1:i);return s.jsx(Ke.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??S.current,required:c,disabled:d,name:f,value:h,form:p,...t,tabIndex:-1,ref:j,style:{...t.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});M8.displayName=I8;function Vve(e){return typeof e=="function"}function Bi(e){return e==="indeterminate"}function $8(e){return Bi(e)?"indeterminate":e?"checked":"unchecked"}const na=v.forwardRef(({className:e,...t},n)=>s.jsx(OC,{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:s.jsx(T8,{className:Se("flex items-center justify-center text-current"),children:s.jsx(sc,{className:"h-4 w-4"})})}));na.displayName=OC.displayName;const Hve=qo("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"}}),nc=v.forwardRef(({className:e,variant:t,...n},r)=>s.jsx("div",{ref:r,role:"alert",className:Se(Hve({variant:t}),e),...n}));nc.displayName="Alert";const rc=v.forwardRef(({className:e,...t},n)=>s.jsx("h5",{ref:n,className:Se("mb-1 font-medium leading-none tracking-tight",e),...t}));rc.displayName="AlertTitle";const ac=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Se("text-sm [&_p]:leading-relaxed",e),...t}));ac.displayName="AlertDescription";function Kve(e,t=[]){let n=[];function r(i,o){const c=v.createContext(o);c.displayName=i+"Context";const d=n.length;n=[...n,o];const f=p=>{const{scope:y,children:g,...j}=p,b=y?.[e]?.[d]||c,x=v.useMemo(()=>j,Object.values(j));return s.jsx(b.Provider,{value:x,children:g})};f.displayName=i+"Provider";function h(p,y){const g=y?.[e]?.[d]||c,j=v.useContext(g);if(j)return j;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[f,h]}const a=()=>{const i=n.map(o=>v.createContext(o));return function(c){const d=c?.[e]||i;return v.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return a.scopeName=e,[r,Gve(a,...t)]}function Gve(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=r.reduce((c,{useScope:d,scopeName:f})=>{const p=d(i)[`__scope${f}`];return{...c,...p}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var Yve=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],D8=Yve.reduce((e,t)=>{const n=tv(`Primitive.${t}`),r=v.forwardRef((a,i)=>{const{asChild:o,...c}=a,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),RC="Progress",TC=100,[Xve]=Kve(RC),[Qve,Jve]=Xve(RC),L8=v.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:a,getValueLabel:i=Zve,...o}=e;(a||a===0)&&!wM(a)&&console.error(ege(`${a}`,"Progress"));const c=wM(a)?a:TC;r!==null&&!jM(r,c)&&console.error(tge(`${r}`,"Progress"));const d=jM(r,c)?r:null,f=Tm(d)?i(d,c):void 0;return s.jsx(Qve,{scope:n,value:d,max:c,children:s.jsx(D8.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":Tm(d)?d:void 0,"aria-valuetext":f,role:"progressbar","data-state":z8(d,c),"data-value":d??void 0,"data-max":c,...o,ref:t})})});L8.displayName=RC;var F8="ProgressIndicator",B8=v.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,a=Jve(F8,n);return s.jsx(D8.div,{"data-state":z8(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...r,ref:t})});B8.displayName=F8;function Zve(e,t){return`${Math.round(e/t*100)}%`}function z8(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Tm(e){return typeof e=="number"}function wM(e){return Tm(e)&&!isNaN(e)&&e>0}function jM(e,t){return Tm(e)&&!isNaN(e)&&e<=t&&e>=0}function ege(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${TC}\`.`}function tge(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
131
|
-
- a positive number
|
|
132
|
-
- less than the value passed to \`max\` (or ${TC} if no \`max\` prop is set)
|
|
133
|
-
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
134
|
-
|
|
135
|
-
Defaulting to \`null\`.`}var U8=L8,nge=B8;const fg=v.forwardRef(({className:e,value:t,...n},r)=>s.jsx(U8,{ref:r,className:Se("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:s.jsx(nge,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));fg.displayName=U8.displayName;const Xu=["critical","high","medium","low","info"];function S1(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 rge(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 SM({text:e}){return s.jsxs("div",{className:"mt-2 rounded-md border px-2.5 py-2 text-[11px] text-slate-800",children:[s.jsxs("div",{className:"mb-1 inline-flex items-center gap-1 font-medium text-slate-700",children:[s.jsx(B7,{className:"h-3.5 w-3.5"}),"Suggested improvement"]}),s.jsx("p",{children:e})]})}function IC(e){const t=[];t.push("# MCP Tool Analysis Report",""),t.push(`- Created: ${e.createdAt}`),t.push(`- Assistant Agent: ${e.assistantAgentName}`),t.push(`- Assistant Model: ${e.assistantAgentModel}`),t.push(`- Modes: ${[e.modes.metadataReview?"metadata review":null,e.modes.deeperAnalysis?"deeper analysis":null].filter(Boolean).join(" + ")}`),t.push("","## Summary"),t.push(`- Servers analyzed: ${e.summary.serversAnalyzed}`),t.push(`- Tools analyzed: ${e.summary.toolsAnalyzed}`),t.push(`- Tools skipped: ${e.summary.toolsSkipped}`,"");for(const n of e.servers){t.push(`## Server: ${n.serverName}`),n.warnings.length>0&&t.push(...n.warnings.map(r=>`- Warning: ${r}`),"");for(const r of n.tools){if(t.push(`### ${r.publicToolName}`),t.push(`- Safety: ${r.safetyClassification} (${r.classificationReason})`),r.metadataReview?.issues.length){t.push("#### Metadata issues");for(const a of r.metadataReview.issues)t.push(` - [${a.severity}] ${a.title}: ${a.detail}`)}if(r.deeperAnalysis)if(!r.deeperAnalysis.attempted)t.push(`- Deeper analysis: skipped (${r.deeperAnalysis.skippedReason??"unknown"})`);else{t.push(`- Deeper analysis sample calls: ${r.deeperAnalysis.sampleCalls.length}`);for(const a of r.deeperAnalysis.sampleCalls){t.push(` - Call ${a.callIndex}: ${a.ok?"ok":"error"}${a.durationMs?` (${a.durationMs}ms)`:""}`),a.error&&t.push(` - Error: ${a.error}`);for(const i of a.observations)t.push(` - ${i}`)}}if(r.overallRecommendations.length>0){t.push("#### Recommendations");for(const a of r.overallRecommendations)t.push(` - ${a}`)}if(r.metadataReview?.evalReadinessNotes.length){t.push("#### Agent/Eval readiness notes");for(const a of r.metadataReview.evalReadinessNotes)t.push(` - ${a}`)}t.push("")}}return`${t.join(`
|
|
136
|
-
`)}
|
|
137
|
-
`}function q8({report:e}){const[t,n]=v.useState([...Xu]),r=v.useMemo(()=>new Set(t),[t]),a=i=>{n(o=>{const c=o.includes(i)?o.filter(d=>d!==i):[...o,i];return c.length===0?[...Xu]:c})};return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[s.jsx(qe,{children:s.jsxs(We,{className:"pt-6",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Tools analyzed"}),s.jsx("div",{className:"text-2xl font-semibold",children:e.summary.toolsAnalyzed})]})}),s.jsx(qe,{children:s.jsxs(We,{className:"pt-6",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Tools skipped"}),s.jsx("div",{className:"text-2xl font-semibold",children:e.summary.toolsSkipped})]})}),s.jsx(qe,{children:s.jsxs(We,{className:"pt-6",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Findings"}),s.jsx("div",{className:"text-2xl font-semibold",children:e.findings.length})]})})]}),s.jsxs(qe,{children:[s.jsxs(St,{className:"pb-3",children:[s.jsx(Nt,{className:"text-base",children:"Analysis Overview"}),s.jsx(Ws,{children:"Visual breakdown of findings by severity. Click badges to filter the report."})]}),s.jsx(We,{children:s.jsxs("div",{className:"flex flex-wrap gap-2",children:[Xu.filter(i=>e.summary.issueCounts[i]>0).map(i=>{const o=r.has(i);return s.jsx("button",{type:"button",onClick:()=>a(i),className:"rounded-full","aria-pressed":o,children:s.jsxs(Je,{variant:"outline",className:`capitalize font-normal ${o?S1(i):rge(i)} ${o?"ring-1 ring-current":"opacity-70"}`,children:[i,": ",e.summary.issueCounts[i]]})},i)}),s.jsx(le,{type:"button",size:"sm",variant:"ghost",onClick:()=>n([...Xu]),className:"h-7 px-2 text-xs",children:"Reset"})]})})]}),s.jsx("div",{className:"space-y-4",children:e.servers.map(i=>{const o=i.tools.filter(c=>{const d=[...c.metadataReview?.issues??[],...c.deeperAnalysis?.sampleCalls.flatMap(f=>f.issues)??[]];return d.length===0?t.length===Xu.length:d.some(f=>r.has(f.severity))});return o.length===0?null:s.jsxs(qe,{children:[s.jsxs(St,{className:"pb-3",children:[s.jsx(Nt,{className:"text-base",children:i.serverName}),s.jsxs(Ws,{children:["Discovered ",i.toolCountDiscovered," · Showing ",o.length," of ",i.toolCountAnalyzed," analyzed · Skipped ",i.toolCountSkipped]})]}),s.jsxs(We,{className:"space-y-3",children:[i.warnings.length>0&&s.jsxs(nc,{children:[s.jsx(rc,{children:"Warnings"}),s.jsx(ac,{children:s.jsx("ul",{className:"ml-4 list-disc space-y-1",children:i.warnings.map(c=>s.jsx("li",{children:c},`${i.serverName}-${c}`))})})]}),o.map(c=>s.jsxs("details",{className:"group rounded-md border p-3",children:[s.jsx("summary",{className:"cursor-pointer list-none",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("div",{className:"font-mono text-sm",children:c.publicToolName}),c.description&&s.jsx("p",{className:"text-xs text-muted-foreground",children:c.description})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Je,{variant:c.safetyClassification==="read_like"?"secondary":"outline",children:c.safetyClassification}),s.jsx(Gt,{className:"h-4 w-4 text-muted-foreground transition-transform group-open:rotate-180"})]})]})}),s.jsxs("div",{className:"mt-3 space-y-2",children:[c.metadataReview&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:"Metadata review"}),c.metadataReview.issues.filter(d=>r.has(d.severity)).length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No metadata issues reported."}):s.jsx("div",{className:"space-y-1",children:c.metadataReview.issues.filter(d=>r.has(d.severity)).map((d,f)=>s.jsxs("div",{className:"rounded border p-2 text-xs",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx("span",{className:"inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full border bg-muted px-1 text-[10px] font-semibold text-muted-foreground",children:f+1}),s.jsx("span",{className:"min-w-0 font-bold leading-tight",children:d.title})]}),s.jsx(Je,{variant:"outline",className:`shrink-0 text-[10px] ${S1(d.severity)}`,children:d.severity})]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",d.detail]}),d.suggestion&&s.jsx(SM,{text:d.suggestion})]},d.id))})]}),c.deeperAnalysis&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:"Deeper analysis"}),c.deeperAnalysis.attempted?s.jsx("div",{className:"space-y-2",children:c.deeperAnalysis.sampleCalls.map(d=>s.jsxs("div",{className:"rounded border p-2 text-xs",children:[s.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[s.jsx(Je,{variant:d.ok?"secondary":"destructive",className:"text-[10px]",children:d.ok?"ok":"error"}),s.jsxs("span",{children:["Call ",d.callIndex]}),d.durationMs!==void 0&&s.jsxs("span",{className:"text-muted-foreground",children:[d.durationMs,"ms"]})]}),d.error&&s.jsx("p",{className:"text-destructive",children:d.error}),d.observations.length>0&&s.jsxs("div",{className:"mt-2",children:[s.jsx("div",{className:"mb-1 inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Observations"}),s.jsx("ul",{className:"ml-4 list-disc space-y-1",children:d.observations.map((f,h)=>s.jsx("li",{children:f},`${c.publicToolName}-obs-${d.callIndex}-${h}`))})]}),d.issues.filter(f=>r.has(f.severity)).length>0&&s.jsx("div",{className:"mt-2 space-y-1",children:d.issues.filter(f=>r.has(f.severity)).map((f,h)=>s.jsxs("div",{className:"rounded border p-2",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx("span",{className:"inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full border bg-muted px-1 text-[10px] font-semibold text-muted-foreground",children:h+1}),s.jsx("span",{className:"min-w-0 font-bold leading-tight",children:f.title})]}),s.jsx(Je,{variant:"outline",className:`shrink-0 text-[10px] ${S1(f.severity)}`,children:f.severity})]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",f.detail]}),f.suggestion&&s.jsx(SM,{text:f.suggestion})]},`${d.callIndex}-${f.id}`))})]},`${c.publicToolName}-call-${d.callIndex}`))}):s.jsx("p",{className:"text-xs text-muted-foreground",children:c.deeperAnalysis.skippedReason??"Skipped"})]})]})]},c.publicToolName))]})]},i.serverName)})})]})}const N1="mcplab.toolAnalysis.activeJobId";function NM(e,t,n){const r=new Blob([t],{type:n}),a=URL.createObjectURL(r),i=document.createElement("a");i.href=a,i.download=e,i.click(),URL.revokeObjectURL(a)}function CM({text:e}){return s.jsxs(lD,{children:[s.jsx(cD,{asChild:!0,children:s.jsx("button",{type:"button",className:"inline-flex h-4 w-4 items-center justify-center rounded text-muted-foreground hover:text-foreground",onClick:t=>t.preventDefault(),"aria-label":e,children:s.jsx($7,{className:"h-3.5 w-3.5"})})}),s.jsx(JS,{className:"max-w-xs text-xs",children:s.jsx("p",{children:e})})]})}function age(e,t){const n=t.toLowerCase();return n.includes("failed to load tools")||n.includes("failed to connect to mcp server")?`Could not load tools from '${e}'. Check that the MCP server is running and reachable, then try Refresh Servers / Discover Tools again.`:t}const sge=()=>{const{source:e}=Tn(),{servers:t,agents:n,loading:r,reload:a}=Ka(),[i,o]=v.useState(""),[c,d]=v.useState([]),[f,h]=v.useState(!1),[p,y]=v.useState([]),[g,j]=v.useState({}),[b,x]=v.useState(""),[S,N]=v.useState(!0),[C,E]=v.useState(!1),[_,k]=v.useState(2),[O,R]=v.useState(1),[T,F]=v.useState(1e4),[L,$]=v.useState(null),[Y,H]=v.useState([]),[K,J]=v.useState(null),[Q,D]=v.useState(null),[B,Z]=v.useState(!1),[z,M]=v.useState("configure"),[re,te]=v.useState("idle"),G=v.useRef(null),de=i||n[0]?.name||"",ce=v.useMemo(()=>{let ee=0;const Ce=new Set,Ne=new Set;for(const Be of Y){const et=typeof Be.payload?.message=="string"?Be.payload.message:"";if(!et)continue;const Et=et.match(/\((\d+)\s+tools?\)/i);Et&&(ee=Math.max(ee,Number(Et[1])||0));const Sn=et.match(/^Started\s+(.+)$/);Sn&&Ce.add(Sn[1]);const Nn=et.match(/^Finished\s+(.+)$/);Nn&&Ne.add(Nn[1])}const Me=ee>0?Math.max(0,Math.min(100,Math.round(Ne.size/ee*100))):0;return{totalTools:ee,startedTools:Ce.size,finishedTools:Ne.size,percent:Me}},[Y]);v.useEffect(()=>{let ee=!0;return e.getWorkspaceSettings().then(Ce=>{!ee||!Ce||o(Ce.scenarioAssistantAgentName??"")}).catch(()=>{ee&&o("")}),()=>{ee=!1}},[e]),v.useEffect(()=>()=>{G.current?.()},[]);const he=()=>{try{sessionStorage.removeItem(N1)}catch{}},ie=ee=>{try{sessionStorage.setItem(N1,ee)}catch{}},ue=ee=>{G.current?.(),G.current=e.subscribeToolAnalysisJob(ee,Ce=>{if(H(Ne=>[...Ne,Ce]),Ce.type==="completed")e.getToolAnalysisResult(ee).then(Ne=>{J(Ne.report),D(Ne.savedReportId??null)}).catch(Ne=>Pe({title:"Could not load analysis report",description:Ne instanceof Error?Ne.message:String(Ne),variant:"destructive"})).finally(()=>{he(),$(null),Z(!1),te("idle"),M("run")});else if(Ce.type==="error"){const Ne=String(Ce.payload?.message??"");he(),te(Ne.toLowerCase().includes("abort")?"stopped":"error"),$(null),Z(!1)}})};v.useEffect(()=>{if(L||K)return;let ee="";try{ee=sessionStorage.getItem(N1)??""}catch{ee=""}if(ee)return M("run"),te("running"),Z(!0),$(ee),H([]),ue(ee),()=>{}},[e,L,K]);const Ae=async()=>{if(c.length===0){y([]),j({});return}h(!0);try{const ee=await e.discoverToolsForAnalysis({serverNames:c});y(ee.servers),j(Ce=>{const Ne={};for(const Me of ee.servers){const Be=Ce[Me.serverName]??[],et=Me.tools.map(Sn=>Sn.name),Et=Be.filter(Sn=>et.includes(Sn));Ne[Me.serverName]=Et.length>0?Et:et}return Ne})}catch(ee){Pe({title:"Could not discover MCP tools",description:ee instanceof Error?ee.message:String(ee),variant:"destructive"})}finally{h(!1)}};v.useEffect(()=>{Ae()},[c.join("|")]);const ae=v.useMemo(()=>{const ee=b.trim().toLowerCase();return ee?p.map(Ce=>({...Ce,tools:Ce.tools.filter(Ne=>Ne.name.toLowerCase().includes(ee)||(Ne.description||"").toLowerCase().includes(ee))})).filter(Ce=>Ce.tools.length>0):p},[p,b]),$e=v.useMemo(()=>Object.values(g).reduce((ee,Ce)=>ee+Ce.length,0),[g]),W=c[0]??"",ve=async()=>{if(!S&&!C){Pe({title:"Select at least one mode",variant:"destructive"});return}if(c.length!==1){Pe({title:"Select exactly one server",variant:"destructive"});return}if($e===0){Pe({title:"Select at least one tool",variant:"destructive"});return}Z(!0),H([]),J(null),D(null),M("run"),te("running");try{const{jobId:ee}=await e.startToolAnalysis({serverNames:c,selectedToolsByServer:g,maxParallelTools:_,modes:{metadataReview:S,deeperAnalysis:C},deeperAnalysisOptions:{autoRunPolicy:"read_only_allowlist",sampleCallsPerTool:O,toolCallTimeoutMs:T}});$(ee),ie(ee),ue(ee)}catch(ee){Z(!1),te("error"),M("run"),Pe({title:"Could not start tool analysis",description:ee instanceof Error?ee.message:String(ee),variant:"destructive"})}},oe=async()=>{if(!L)return;const ee=L;try{const Ce=await e.stopToolAnalysis(ee);if(Ce.status==="completed"){G.current?.(),G.current=null;const Ne=await e.getToolAnalysisResult(ee);J(Ne.report),D(Ne.savedReportId??null),he(),$(null),Z(!1),te("idle"),M("run"),Pe({title:"Analysis already finished",description:"Showing the result overview."});return}if(Ce.status==="stopped"){G.current?.(),G.current=null,he(),$(null),Z(!1),te("stopped"),Pe({title:"Analysis stopped"});return}if(Ce.status==="error"){G.current?.(),G.current=null,he(),$(null),Z(!1),te("error"),Pe({title:"Analysis already ended with an error",description:"Review the progress log and return to Configure Analysis."});return}Pe({title:"Stopping analysis..."})}catch(Ce){Pe({title:"Could not stop analysis",description:Ce instanceof Error?Ce.message:String(Ce),variant:"destructive"})}},be=()=>{M("configure"),te("idle"),$(null)},Ie=(ee,Ce)=>{d(Ne=>Ce?[ee]:Ne.filter(Me=>Me!==ee))},Ye=(ee,Ce,Ne)=>{j(Me=>{const Be=new Set(Me[ee]??[]);return Ne?Be.add(Ce):Be.delete(Ce),{...Me,[ee]:Array.from(Be)}})},je=(ee,Ce)=>{j(Ne=>({...Ne,[ee]:Ce}))},Re=!0,Xe=L!==null||Y.length>0||re==="stopped"||re==="error",It=!!K,qt=ee=>{if(ee==="configure"&&Re){M("configure");return}if(ee==="run"&&Xe){M("run");return}ee==="report"&&It&&M("report")};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(v$,{className:"h-6 w-6"}),"Analyze MCP Tools"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Review MCP tools for schema quality, ergonomics, and agent/eval readiness."})]}),s.jsxs("div",{className:"hidden flex-wrap items-center gap-2 md:flex",children:[s.jsx("button",{type:"button",onClick:()=>qt("configure"),className:"rounded-full","aria-label":"Open Configure Analysis",children:s.jsx(Je,{variant:z==="configure"?"default":"outline",className:"cursor-pointer",children:"Configure Analysis"})}),s.jsx("button",{type:"button",onClick:()=>qt("run"),disabled:!Xe,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Run Analysis",children:s.jsx(Je,{variant:z==="run"?"default":"outline",className:Xe?"cursor-pointer":"cursor-not-allowed",children:"Run Analysis"})}),s.jsx("button",{type:"button",onClick:()=>qt("report"),disabled:!It,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Report",children:s.jsx(Je,{variant:z==="report"?"default":"outline",className:It?"cursor-pointer":"cursor-not-allowed",children:"Report"})})]})]}),z==="configure"&&s.jsxs(qe,{children:[s.jsxs(St,{children:[s.jsx(Nt,{className:"text-base",children:"Run MCP analysis"}),s.jsx(Ws,{children:"Select servers and tools, choose metadata review and/or deeper sample-call analysis, then run the report."})]}),s.jsxs(We,{className:"space-y-5",children:[!de&&s.jsxs(nc,{children:[s.jsx(rc,{children:"No assistant agent available"}),s.jsxs(ac,{children:["Add a library agent in"," ",s.jsx(wt,{to:"/libraries/agents",className:"underline",children:"Agents"})," ","and optionally set the default Scenario Assistant Agent in"," ",s.jsx(wt,{to:"/settings",className:"underline",children:"Settings"}),"."]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx(Fe,{className:"text-xs",children:"Servers"}),s.jsxs(le,{type:"button",size:"sm",variant:"outline",onClick:()=>{a()},disabled:r,children:[s.jsx(Na,{className:"mr-2 h-4 w-4"}),"Refresh Servers"]})]}),s.jsx("div",{className:"grid gap-2 rounded-md border p-3 md:grid-cols-2",children:t.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No library servers configured."}):t.map(ee=>{const Ce=c.includes(ee.id);return s.jsxs("label",{className:"flex items-start gap-2 rounded-md border p-2 text-sm",children:[s.jsx(na,{checked:Ce,onCheckedChange:Ne=>Ie(ee.id,!!Ne)}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"font-medium",children:ee.name||ee.id}),ee.url&&s.jsx("div",{className:"truncate text-xs text-muted-foreground",children:ee.url})]})]},ee.id)})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Select exactly one MCP server for analysis."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Fe,{className:"text-xs",children:"Filter visible tools"}),s.jsxs("div",{className:"relative",children:[s.jsx(FS,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),s.jsx(mt,{className:"h-9 pl-8",placeholder:"Filter tools by name or description...",value:b,onChange:ee=>x(ee.target.value)})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Filtering only changes what is shown; selected tools remain selected."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx(Fe,{className:"text-xs",children:W?`Tools for ${W}`:"Tools"}),s.jsxs(le,{type:"button",size:"sm",variant:"outline",onClick:()=>{Ae()},disabled:f||c.length===0,children:[f&&s.jsx(or,{className:"mr-2 h-4 w-4 animate-spin"}),"Discover Tools"]})]}),s.jsx("div",{className:"space-y-3 rounded-md border p-3",children:c.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"Select a server to discover tools."}):f&&p.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading tools..."}):ae.length===0&&!f?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No discovered tools match the current filters."}):ae.map(ee=>{const Ce=new Set(g[ee.serverName]??[]);return s.jsxs("div",{className:"rounded-md border p-3",children:[s.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[s.jsx("div",{className:"font-medium",children:ee.serverName}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(le,{type:"button",size:"sm",variant:"ghost",onClick:()=>je(ee.serverName,ee.tools.map(Ne=>Ne.name)),children:"Select all"}),s.jsx(le,{type:"button",size:"sm",variant:"ghost",onClick:()=>je(ee.serverName,[]),children:"Clear"})]})]}),ee.warnings.length>0&&s.jsx("div",{className:"mb-2 space-y-1",children:ee.warnings.map(Ne=>s.jsx("div",{className:"text-xs text-amber-700",children:age(ee.serverName,Ne)},`${ee.serverName}-${Ne}`))}),s.jsx("div",{className:"grid gap-2",children:ee.tools.map(Ne=>s.jsxs("label",{className:"flex items-start gap-2 rounded border p-2",children:[s.jsx(na,{checked:Ce.has(Ne.name),onCheckedChange:Me=>Ye(ee.serverName,Ne.name,!!Me)}),s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("span",{className:"font-mono text-xs",children:Ne.name}),s.jsx(Je,{variant:Ne.safetyClassification==="read_like"?"secondary":"outline",className:"text-[10px]",children:Ne.safetyClassification==="read_like"?"read-like":"unsafe/unknown"})]}),Ne.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:Ne.description}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:Ne.classificationReason})]})]},`${ee.serverName}-${Ne.name}`))})]},ee.serverName)})}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Selected tools: ",$e]})]}),s.jsxs("div",{className:"space-y-3 rounded-md border p-3",children:[s.jsx("div",{className:"text-sm font-medium",children:"Analysis Modes"}),s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx(na,{checked:S,onCheckedChange:ee=>N(!!ee)}),s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Metadata / schema review",s.jsx(CM,{text:"No tool execution. Reviews tool names, descriptions, and schemas only."})]})]}),s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx(na,{checked:C,onCheckedChange:ee=>E(!!ee)}),s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Deeper analysis",s.jsx(CM,{text:"Runs sample MCP tool calls automatically for read-like tools only (based on the safety allowlist)."})]})]}),s.jsxs("div",{className:"grid gap-3 rounded-md border bg-muted/20 p-3 md:grid-cols-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Max parallel tools"}),s.jsx(mt,{type:"number",min:1,max:8,value:_,onChange:ee=>k(Math.max(1,Math.min(8,Number(ee.target.value)||2))),className:"h-8"})]}),C?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Safety profile"}),s.jsx("div",{className:"text-sm",children:"Read-only allowlist only"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Sample calls per tool"}),s.jsx(mt,{type:"number",min:1,max:5,value:O,onChange:ee=>R(Math.max(1,Math.min(5,Number(ee.target.value)||1))),className:"h-8"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Tool call timeout (ms)"}),s.jsx(mt,{type:"number",min:1e3,max:6e4,step:500,value:T,onChange:ee=>F(Math.max(1e3,Math.min(6e4,Number(ee.target.value)||1e4))),className:"h-8"})]}),s.jsx("div",{className:"md:col-span-3 text-xs text-amber-700",children:"Deeper analysis may execute read-only MCP tools automatically."})]}):s.jsx("div",{className:"md:col-span-2 text-xs text-muted-foreground",children:"Deeper analysis is disabled. Only metadata/schema review will run."})]})]}),s.jsx("div",{className:"flex flex-wrap items-center gap-2",children:s.jsxs(le,{type:"button",onClick:()=>{ve()},disabled:B||!!L,children:[(B||!!L)&&s.jsx(or,{className:"mr-2 h-4 w-4 animate-spin"}),"Analyze Tools"]})})]})]}),z==="run"&&s.jsxs(qe,{children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Nt,{className:"flex items-center gap-2 text-base",children:s.jsx("span",{children:"Progress"})}),s.jsx(Ws,{children:L?"Live tool-analysis job events:":K?"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."})]}),L?s.jsx(le,{type:"button",size:"sm",variant:"outline",onClick:()=>{oe()},children:"Stop Analysis"}):s.jsx(le,{type:"button",size:"sm",variant:"outline",onClick:be,children:"Back to Configure Analysis"})]})}),s.jsxs(We,{className:"space-y-2",children:[L&&s.jsxs("div",{className:"inline-flex items-center gap-2 rounded-md border bg-muted/20 px-2.5 py-1 text-xs text-muted-foreground",children:[s.jsx(or,{className:"h-3.5 w-3.5 animate-spin"}),"Analysis is still running..."]}),(ce.totalTools>0||L)&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[s.jsx("span",{children:ce.totalTools>0?`${ce.finishedTools}/${ce.totalTools} tools finished`:"Preparing analysis..."}),s.jsx("span",{children:ce.totalTools>0?`${ce.percent}%`:"0%"})]}),s.jsx(fg,{value:ce.totalTools>0?ce.percent:0,className:"h-2"})]}),Y.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:L?"Starting analysis...":"No progress events captured."}):s.jsx("div",{className:"max-h-64 space-y-1 overflow-auto rounded border bg-muted/20 p-2",children:Y.map((ee,Ce)=>s.jsxs("div",{className:"text-xs",children:[s.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(ee.ts).toLocaleTimeString()}),s.jsx(Je,{variant:"outline",className:"mr-2 text-[10px]",children:ee.type}),s.jsx("span",{className:"break-all",children:typeof ee.payload.message=="string"?ee.payload.message:JSON.stringify(ee.payload)})]},`${ee.ts}-${Ce}`))}),!L&&K&&s.jsx(qe,{className:"mt-2 border-green-200 bg-green-50/40 dark:border-green-900/40 dark:bg-green-950/10",children:s.jsxs(We,{className:"pt-4 space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-semibold",children:"Result overview"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[K.summary.toolsAnalyzed," tools analyzed, ",K.summary.toolsSkipped," skipped, across"," ",K.summary.serversAnalyzed," server",K.summary.serversAnalyzed!==1?"s":"","."]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[Q&&s.jsx(le,{asChild:!0,size:"sm",children:s.jsx(wt,{to:`/tool-analysis-results/${Q}`,children:"Open result details"})}),s.jsx(le,{asChild:!0,size:"sm",variant:"outline",children:s.jsx(wt,{to:"/tool-analysis-results",children:"View all results"})}),s.jsx(le,{type:"button",size:"sm",variant:"outline",onClick:()=>qt("report"),children:"View inline report"})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[K.summary.issueCounts.critical>0&&s.jsxs(Je,{className:"bg-red-600 text-white hover:bg-red-600",children:["Critical: ",K.summary.issueCounts.critical]}),K.summary.issueCounts.high>0&&s.jsxs(Je,{className:"bg-orange-500 text-white hover:bg-orange-500",children:["High: ",K.summary.issueCounts.high]}),K.summary.issueCounts.medium>0&&s.jsxs(Je,{className:"bg-amber-500 text-white hover:bg-amber-500",children:["Medium: ",K.summary.issueCounts.medium]}),K.summary.issueCounts.low>0&&s.jsxs(Je,{className:"bg-blue-500 text-white hover:bg-blue-500",children:["Low: ",K.summary.issueCounts.low]}),K.summary.issueCounts.info>0&&s.jsxs(Je,{variant:"outline",children:["Info: ",K.summary.issueCounts.info]}),Object.values(K.summary.issueCounts).every(ee=>ee===0)&&s.jsx(Je,{className:"bg-green-600 text-white hover:bg-green-600",children:"No findings"})]})]})})]})]}),z==="report"&&K&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-semibold",children:"Report"}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:[K.summary.toolsAnalyzed," tools analyzed across ",K.summary.serversAnalyzed," server",K.summary.serversAnalyzed!==1?"s":"","."]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(le,{type:"button",size:"sm",variant:"outline",onClick:be,children:"Back to Configure Analysis"}),Q&&s.jsxs(s.Fragment,{children:[s.jsx(le,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx(wt,{to:`/tool-analysis-results/${Q}`,children:"Open saved report"})}),s.jsx(le,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx(wt,{to:"/tool-analysis-results",children:"View all reports"})})]}),s.jsxs(le,{type:"button",size:"sm",variant:"outline",onClick:()=>NM(`tool-analysis-${Date.now()}.json`,`${JSON.stringify(K,null,2)}
|
|
138
|
-
`,"application/json"),children:[s.jsx(ja,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(le,{type:"button",size:"sm",variant:"outline",onClick:()=>NM(`tool-analysis-${Date.now()}.md`,IC(K),"text/markdown"),children:[s.jsx(ja,{className:"mr-2 h-4 w-4"}),"Export Markdown"]})]})]}),s.jsx(q8,{report:K})]})]})};function AM(e,t,n){const r=new Blob([t],{type:n}),a=URL.createObjectURL(r),i=document.createElement("a");i.href=a,i.download=e,i.click(),URL.revokeObjectURL(a)}function ige(){const{source:e}=Tn(),[t,n]=v.useState([]),[r,a]=v.useState(!0),[i,o]=v.useState(null),[c,d]=v.useState(!1),f=async()=>{a(!0);try{n(await e.listToolAnalysisResults())}catch(g){Pe({title:"Could not load tool analysis results",description:g instanceof Error?g.message:String(g),variant:"destructive"})}finally{a(!1)}};v.useEffect(()=>{f()},[]);const h=v.useMemo(()=>t.find(g=>g.reportId===i)??null,[t,i]),p=async()=>{if(i){d(!0);try{await e.deleteToolAnalysisSavedResult(i),n(g=>g.filter(j=>j.reportId!==i)),Pe({title:"Tool analysis report deleted"}),o(null)}catch(g){Pe({title:"Could not delete report",description:g instanceof Error?g.message:String(g),variant:"destructive"})}finally{d(!1)}}},y=async(g,j)=>{try{const b=await e.getToolAnalysisSavedResult(g);j==="json"?AM(`${g}.json`,`${JSON.stringify(b,null,2)}
|
|
139
|
-
`,"application/json"):AM(`${g}.md`,IC(b.report),"text/markdown")}catch(b){Pe({title:"Could not export saved report",description:b instanceof Error?b.message:String(b),variant:"destructive"})}};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(g$,{className:"h-6 w-6"}),"Tool Analysis Results"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Browse persisted Analyze MCP Tools reports."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(le,{variant:"outline",onClick:()=>{f()},disabled:r,children:r?"Refreshing...":"Refresh"}),s.jsx(le,{asChild:!0,variant:"outline",children:s.jsx(wt,{to:"/tool-analysis",children:"Analyze MCP Tools"})})]})]}),s.jsx(qe,{children:s.jsx(We,{className:"p-0",children:r?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Loading tool analysis results..."}):t.length===0?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"No saved tool analysis reports yet."}):s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs(Mt,{children:[s.jsx(tt,{children:"Report ID"}),s.jsx(tt,{children:"Evaluated"}),s.jsx(tt,{children:"Timestamp"}),s.jsx(tt,{children:"Issues"}),s.jsx(tt,{children:"Modes"}),s.jsx(tt,{className:"w-10"})]})}),s.jsx(Lr,{children:t.map(g=>s.jsxs(Mt,{children:[s.jsx(ze,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(wt,{to:`/tool-analysis-results/${g.reportId}`,className:"font-mono text-xs text-primary hover:underline",children:g.reportId}),s.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[g.assistantAgentName," · ",g.assistantAgentModel]})]})}),s.jsx(ze,{className:"text-[11px] text-muted-foreground",children:s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Servers: ",s.jsx("span",{className:"font-medium text-foreground",children:g.serverNames.length})," · Tools:"," ",s.jsx("span",{className:"font-medium text-foreground",children:g.summary.toolsAnalyzed})," · ","Skipped: ",s.jsx("span",{className:"font-medium text-foreground",children:g.summary.toolsSkipped})]}),s.jsxs("div",{className:"font-mono text-xs text-foreground/80",children:[g.serverNames.slice(0,2).join(", "),g.serverNames.length>2?` +${g.serverNames.length-2}`:""]})]})}),s.jsx(ze,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(of,{className:"h-3 w-3"}),new Date(g.createdAt).toLocaleString()]})}),s.jsx(ze,{children:s.jsxs("div",{className:"flex flex-wrap gap-1",children:[["critical","high","medium","low","info"].map(j=>g.summary.issueCounts[j]>0?s.jsxs(Je,{variant:"outline",className:"capitalize",children:[j,": ",g.summary.issueCounts[j]]},`${g.reportId}-${j}`):null),Object.values(g.summary.issueCounts).every(j=>j===0)&&s.jsx(Je,{variant:"outline",children:"No issues"})]})}),s.jsx(ze,{children:s.jsxs("div",{className:"flex flex-wrap gap-1",children:[g.modes.metadataReview&&s.jsx(Je,{variant:"outline",children:"metadata"}),g.modes.deeperAnalysis&&s.jsx(Je,{variant:"outline",children:"deeper"})]})}),s.jsx(ze,{children:s.jsxs(Zc,{children:[s.jsx(eu,{asChild:!0,children:s.jsx(le,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Dm,{className:"h-4 w-4"})})}),s.jsxs(el,{align:"end",children:[s.jsx(yr,{asChild:!0,children:s.jsx(wt,{to:`/tool-analysis-results/${g.reportId}`,children:"View"})}),s.jsxs(yr,{onSelect:()=>{y(g.reportId,"json")},children:[s.jsx(ja,{className:"mr-2 h-3.5 w-3.5"})," Export JSON"]}),s.jsxs(yr,{onSelect:()=>{y(g.reportId,"markdown")},children:[s.jsx(ja,{className:"mr-2 h-3.5 w-3.5"})," Export Markdown"]}),s.jsxs(yr,{className:"text-destructive",onSelect:j=>{j.preventDefault(),o(g.reportId)},children:[s.jsx(Ca,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},g.reportId))})]})})}),s.jsx(Cs,{open:!!i,onOpenChange:g=>!g&&o(null),children:s.jsxs(Ya,{children:[s.jsxs(Xa,{children:[s.jsx(Ja,{children:"Delete tool analysis report?"}),s.jsx(Za,{children:h?`Delete saved report '${h.reportId}' from disk? This cannot be undone.`:"Delete this saved report from disk? This cannot be undone."})]}),s.jsxs(Qa,{children:[s.jsx(ts,{disabled:c,children:"Cancel"}),s.jsx(es,{onClick:g=>{g.preventDefault(),p()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}function _M(e,t,n){const r=new Blob([t],{type:n}),a=URL.createObjectURL(r),i=document.createElement("a");i.href=a,i.download=e,i.click(),URL.revokeObjectURL(a)}function oge(){const{id:e=""}=Wo(),t=_a(),{source:n}=Tn(),[r,a]=v.useState(null),[i,o]=v.useState(!0),[c,d]=v.useState(!1),[f,h]=v.useState(!1),[p,y]=v.useState(!1);v.useEffect(()=>{let j=!0;return o(!0),d(!1),n.getToolAnalysisSavedResult(e).then(b=>{j&&a(b)}).catch(b=>{if(!j)return;const x=b instanceof Error?b.message:String(b);if(x.includes("(404)")){d(!0),a(null);return}Pe({title:"Could not load saved tool analysis report",description:x,variant:"destructive"})}).finally(()=>{j&&o(!1)}),()=>{j=!1}},[e,n]);const g=async()=>{y(!0);try{await n.deleteToolAnalysisSavedResult(e),Pe({title:"Tool analysis report deleted"}),t("/tool-analysis-results")}catch(j){Pe({title:"Could not delete report",description:j instanceof Error?j.message:String(j),variant:"destructive"})}finally{y(!1),h(!1)}};return i?s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading saved tool analysis report..."}):c||!r?s.jsxs("div",{className:"space-y-4",children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Tool Analysis Result"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Saved report not found."}),s.jsx(le,{asChild:!0,variant:"outline",children:s.jsx(wt,{to:"/tool-analysis-results",children:"Back to Tool Analysis Results"})})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"font-mono text-xl font-semibold",children:r.reportId}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:[new Date(r.createdAt).toLocaleString()," · ",r.serverNames.join(", ")||"—"]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(le,{asChild:!0,size:"sm",variant:"outline",children:s.jsx(wt,{to:"/tool-analysis-results",children:"Back to results"})}),s.jsxs(le,{type:"button",size:"sm",variant:"outline",onClick:()=>_M(`${r.reportId}.json`,`${JSON.stringify(r,null,2)}
|
|
140
|
-
`,"application/json"),children:[s.jsx(ja,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(le,{type:"button",size:"sm",variant:"outline",onClick:()=>_M(`${r.reportId}.md`,IC(r.report),"text/markdown"),children:[s.jsx(ja,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),s.jsxs(le,{type:"button",size:"sm",variant:"outline",onClick:()=>h(!0),children:[s.jsx(Ca,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]}),s.jsx(q8,{report:r.report}),s.jsx(Cs,{open:f,onOpenChange:h,children:s.jsxs(Ya,{children:[s.jsxs(Xa,{children:[s.jsx(Ja,{children:"Delete tool analysis report?"}),s.jsxs(Za,{children:["Delete saved report '",r.reportId,"' from disk? This cannot be undone."]})]}),s.jsxs(Qa,{children:[s.jsx(ts,{disabled:p,children:"Cancel"}),s.jsx(es,{onClick:j=>{j.preventDefault(),g()},disabled:p,children:p?"Deleting...":"Delete"})]})]})})]})}const lge=[{id:"configure",label:"Configure Debug Session"},{id:"run",label:"Run / Inspect Flow"},{id:"report",label:"Report / Export"}];function cge(e){return navigator.clipboard.writeText(e)}function uge(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}function dge(e,t){const n=[];n.push("# OAuth Debugger Report"),n.push(""),n.push(`- Session ID: ${e.id}`),n.push(`- Status: ${e.status}`),n.push(`- Registration method: ${e.registrationMethod}`),n.push(`- Profile: ${e.profile}`),n.push(""),n.push("## Steps");for(const r of e.stepStates)n.push(`- ${r.title}: ${r.status}${r.outcomeSummary?` — ${r.outcomeSummary}`:""}`);if(n.push(""),n.push("## Validation Findings"),e.validations.length===0)n.push("- None");else for(const r of e.validations)n.push(`- [${r.severity}] ${r.title} (${r.stepId})`),n.push(` - ${r.detail}`),r.recommendation&&n.push(` - Recommendation: ${r.recommendation}`);n.push(""),n.push("## Event Log");for(const r of t){const a=typeof r.payload.message=="string"?r.payload.message:JSON.stringify(r.payload);n.push(`- ${new Date(r.ts).toLocaleTimeString()} [${r.type}] ${a}`)}return`${n.join(`
|
|
141
|
-
`)}
|
|
142
|
-
`}function fge(){const{source:e}=Tn(),{servers:t,reload:n,loading:r}=Ka(),[a,i]=v.useState("configure"),[o,c]=v.useState(""),[d,f]=v.useState("pre_registered"),[h,p]=v.useState("local_callback"),[y,g]=v.useState(!0),[j,b]=v.useState(!0),[x,S]=v.useState(""),[N,C]=v.useState(""),[E,_]=v.useState(""),[k,O]=v.useState(""),[R,T]=v.useState("client_secret_basic"),[F,L]=v.useState("{}"),[$,Y]=v.useState(""),[H,K]=v.useState(""),[J,Q]=v.useState(""),[D,B]=v.useState(""),[Z,z]=v.useState(""),[M,re]=v.useState(""),[te,G]=v.useState(""),[de,ce]=v.useState(""),[he,ie]=v.useState(null),[ue,Ae]=v.useState(null),[ae,$e]=v.useState([]),[W,ve]=v.useState(!1),[oe,be]=v.useState(!1),[Ie,Ye]=v.useState(!1),[je,Re]=v.useState("all"),[Xe,It]=v.useState("all"),[qt,ee]=v.useState("inspector"),Ce=v.useRef(null),Ne=v.useRef(null);v.useEffect(()=>()=>{Ce.current?.(),Ce.current=null},[]),v.useEffect(()=>{Ne.current?.scrollIntoView({behavior:"smooth",block:"end"})},[ae.length]);const Me=v.useMemo(()=>t.filter(fe=>fe.authType==="oauth2"),[t]),Be=Me.find(fe=>fe.id===o);v.useEffect(()=>{o&&(Me.some(fe=>fe.id===o)||c(""))},[Me,o]);const et=v.useMemo(()=>{const fe=he?.stepStates.length??0,De=he?.stepStates.filter($t=>$t.status==="completed"||$t.status==="skipped").length??0,st=he?.stepStates.filter($t=>$t.status==="failed").length??0,xt=fe>0?Math.round((De+st)/fe*100):0;return{total:fe,completed:De,failed:st,percent:xt}},[he]),Et=v.useMemo(()=>(he?.network??[]).filter(De=>!(je!=="all"&&De.stepId!==je||Xe==="error"&&!(De.phase==="response"&&(De.status??0)>=400)||Xe==="ok"&&!(De.phase==="response"&&(De.status??0)<400))),[he?.network,je,Xe]),Sn=!!ue,Nn=!!(he&&(he.status==="completed"||he.status==="error"||he.status==="stopped")),cr=fe=>{if(fe==="configure"||fe==="run"&&Sn||fe==="report"&&Nn)return i(fe)},ur=()=>{let fe;if(d==="dcr"&&F.trim())try{fe=JSON.parse(F)}catch{throw new Error("DCR metadata JSON is invalid")}if(!Be)throw new Error("Select an MCP server");return{profile:"latest",target:{serverName:Be.id,overrides:{authorizationServerMetadataUrl:J||void 0,authorizationEndpoint:D||void 0,tokenEndpoint:Z||void 0,registrationEndpoint:M||void 0,cimdUrl:$||void 0,resourceBaseUrl:te||void 0}},registrationMethod:d,clientConfig:{preRegistered:d==="pre_registered"?{clientId:E.trim(),clientSecret:k.trim()||void 0,tokenEndpointAuthMethod:R||void 0}:void 0,dcr:d==="dcr"?{metadata:fe,tokenEndpointAuthMethod:R||void 0}:void 0,cimd:d==="cimd"?{cimdUrl:$||void 0,expectedClientId:H||void 0}:void 0},runtime:{redirectMode:h,scopes:x.split(/[,\s]+/).map(De=>De.trim()).filter(Boolean),resource:N.trim()||void 0,usePkce:j,codeChallengeMethod:"S256"},display:{showSensitiveValues:y}}},Dn=fe=>{Ce.current?.(),Ce.current=e.subscribeOAuthDebuggerSession(fe,De=>{$e(xt=>[...xt,De]),(De.type==="completed"||De.type==="error"||De.type==="stopped")&&ve(!1),e.getOAuthDebuggerSession(fe).then(xt=>{ie(xt.session),xt.session.status==="completed"&&i("report")}).catch(()=>{})})},dr=async()=>{be(!0);try{const fe=ur(),De=await e.createOAuthDebuggerSession(fe);Ae(De.sessionId),ie(De.session),$e([]),i("run"),Dn(De.sessionId);const st=await e.startOAuthDebuggerSession(De.sessionId);ie(st.session),ve(!0),(st.session.status==="waiting_for_user"||st.session.status==="waiting_for_browser_callback")&&ve(!1)}catch(fe){Pe({title:"Could not start OAuth Debugger session",description:fe instanceof Error?fe.message:String(fe),variant:"destructive"})}finally{be(!1)}},_r=async()=>{if(ue)try{be(!0);const fe=await e.submitOAuthDebuggerManualCallback(ue,{redirectUrl:de.trim()||void 0});ie(fe.session),ce(""),ve(!0)}catch(fe){Pe({title:"Could not submit callback",description:fe instanceof Error?fe.message:String(fe),variant:"destructive"})}finally{be(!1)}},Ur=async()=>{if(ue){Ye(!0);try{const fe=await e.stopOAuthDebuggerSession(ue);if(ve(!1),fe.status!=="running"){const De=await e.getOAuthDebuggerSession(ue);ie(De.session),De.session.status==="completed"?i("report"):i("run")}}catch(fe){Pe({title:"Could not stop session",description:fe instanceof Error?fe.message:String(fe),variant:"destructive"})}finally{Ye(!1)}}},qr=async()=>{Ce.current?.(),Ce.current=null,ie(null),Ae(null),$e([]),ve(!1),Ye(!1),be(!1),ce(""),Re("all"),It("all"),ee("inspector"),i("run"),await dr()},Yn=async fe=>{if(!(!ue||!he))try{const De=await e.exportOAuthDebuggerSession(ue,fe);let st="";const xt=fe==="json"?"json":fe==="raw"?"txt":"md";typeof De=="string"?st=De:st=`${JSON.stringify(De,null,2)}
|
|
143
|
-
`;const $t=new Blob([st],{type:"text/plain;charset=utf-8"}),an=URL.createObjectURL($t),fn=document.createElement("a");fn.href=an,fn.download=`oauth-debugger-${ue}.${xt}`,fn.click(),URL.revokeObjectURL(an)}catch(De){if(fe==="markdown"){const st=dge(he,ae),xt=new Blob([st],{type:"text/markdown;charset=utf-8"}),$t=URL.createObjectURL(xt),an=document.createElement("a");an.href=$t,an.download=`oauth-debugger-${he.id}.md`,an.click(),URL.revokeObjectURL($t);return}Pe({title:"Export failed",description:De instanceof Error?De.message:String(De),variant:"destructive"})}},Xt=ue?`${uge()}/api/oauth-debugger/sessions/${ue}/authorize`:void 0,En=fe=>fe==="error"?"destructive":fe==="warning"?"outline":"secondary";return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"OAuth Debugger"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Step-by-step OAuth flow debugging for MCP servers (latest MCP authorization draft profile)."})]}),s.jsx("div",{className:"flex flex-wrap items-center gap-2",children:lge.map(fe=>{const De=a===fe.id,st=fe.id==="configure"||fe.id==="run"&&Sn||fe.id==="report"&&Nn;return s.jsx("button",{type:"button",onClick:()=>st&&cr(fe.id),disabled:!st,className:"rounded-full",children:s.jsx(Je,{variant:De?"default":"outline",className:st?"":"opacity-50",children:fe.label})},fe.id)})})]}),a==="configure"&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs(qe,{children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Nt,{className:"text-base",children:"Target MCP Server"}),s.jsx(Ws,{children:"Select one MCP server from Libraries and optionally override endpoints."})]}),s.jsxs(le,{type:"button",variant:"outline",size:"sm",onClick:()=>{n()},disabled:r,children:[s.jsx(Na,{className:`mr-2 h-4 w-4 ${r?"animate-spin":""}`}),"Refresh Servers"]})]})}),s.jsx(We,{className:"space-y-3",children:s.jsxs("div",{className:"max-w-xl space-y-2",children:[s.jsx(Fe,{children:"MCP Server"}),s.jsxs(cn,{value:o,onValueChange:c,children:[s.jsx(tn,{children:s.jsx(un,{placeholder:"Select an MCP server"})}),s.jsx(nn,{children:Me.map(fe=>s.jsx(lt,{value:fe.id,children:fe.name||fe.id},fe.id))})]}),Me.length===0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["No MCP servers with OAuth configured found. Add OAuth 2.0 auth in"," ",s.jsx("a",{href:"/libraries/servers",className:"underline text-primary",children:"Manage Servers"}),"."]}),Be&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:[Be.transport," · ",Be.url||Be.command||"No URL/command"]})]})})]}),s.jsxs(qe,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Client Registration Method"})}),s.jsxs(We,{className:"space-y-3",children:[s.jsx("div",{className:"grid gap-2 md:grid-cols-3",children:[{id:"pre_registered",label:"Pre-registered client"},{id:"dcr",label:"Dynamic Client Registration (DCR)"},{id:"cimd",label:"Client ID Metadata Document (CIMD)"}].map(fe=>s.jsx("button",{type:"button",onClick:()=>f(fe.id),className:"rounded-md border p-3 text-left",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:`h-2.5 w-2.5 rounded-full ${d===fe.id?"bg-primary":"bg-muted-foreground/30"}`}),s.jsx("span",{className:"text-sm font-medium",children:fe.label})]})},fe.id))}),s.jsx("div",{className:"grid gap-3 md:grid-cols-1",children:s.jsxs("div",{className:"max-w-md space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Redirect mode"}),s.jsxs(cn,{value:h,onValueChange:fe=>p(fe),children:[s.jsx(tn,{children:s.jsx(un,{})}),s.jsxs(nn,{children:[s.jsx(lt,{value:"local_callback",children:"Local callback (recommended)"}),s.jsx(lt,{value:"manual",children:"Manual paste redirect URL"})]})]})]})}),d==="pre_registered"&&s.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"client_id"}),s.jsx(mt,{value:E,onChange:fe=>_(fe.target.value)})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"client_secret (optional)"}),s.jsx(mt,{value:k,onChange:fe=>O(fe.target.value),type:"password"})]})]}),d==="cimd"&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"CIMD URL"}),s.jsx(mt,{value:$,onChange:fe=>Y(fe.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),s.jsxs(qe,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Runtime OAuth Inputs"})}),s.jsxs(We,{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Scopes (space or comma separated)"}),s.jsx(mt,{value:x,onChange:fe=>S(fe.target.value),placeholder:"openid profile mcp"})]}),s.jsxs("div",{className:"flex items-center gap-2 md:col-span-2",children:[s.jsx(na,{checked:j,onCheckedChange:fe=>b(!!fe)}),s.jsx(Fe,{children:"Use PKCE (S256)"})]})]})]}),s.jsxs("details",{className:"rounded-md border bg-card p-3 shadow-sm",children:[s.jsx("summary",{className:"cursor-pointer text-sm font-medium",children:"Advanced"}),s.jsxs("div",{className:"mt-3 space-y-4",children:[s.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Token endpoint auth method"}),s.jsx(mt,{value:R,onChange:fe=>T(fe.target.value),placeholder:"client_secret_basic / none / client_secret_post"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Resource / audience (optional)"}),s.jsx(mt,{value:N,onChange:fe=>C(fe.target.value),placeholder:"https://resource.example.com"})]})]}),d==="dcr"&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"DCR metadata JSON (optional overrides)"}),s.jsx(qa,{value:F,onChange:fe=>L(fe.target.value),className:"min-h-32 font-mono text-xs"})]}),d==="cimd"&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Expected client_id (optional)"}),s.jsx(mt,{value:H,onChange:fe=>K(fe.target.value)})]}),s.jsxs("div",{className:"rounded-md border bg-background p-3",children:[s.jsx("div",{className:"mb-3 text-sm font-medium",children:"Endpoint overrides"}),s.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Authorization server metadata URL"}),s.jsx(mt,{value:J,onChange:fe=>Q(fe.target.value),placeholder:"https://.../.well-known/oauth-authorization-server"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Resource server base URL"}),s.jsx(mt,{value:te,onChange:fe=>G(fe.target.value),placeholder:"https://resource.example.com"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Authorization endpoint"}),s.jsx(mt,{value:D,onChange:fe=>B(fe.target.value),placeholder:"https://.../authorize"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Token endpoint"}),s.jsx(mt,{value:Z,onChange:fe=>z(fe.target.value),placeholder:"https://.../token"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Registration endpoint (DCR)"}),s.jsx(mt,{value:M,onChange:fe=>re(fe.target.value),placeholder:"https://.../register"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"CIMD URL override"}),s.jsx(mt,{value:$,onChange:fe=>Y(fe.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),s.jsxs(nc,{children:[s.jsx(tx,{className:"h-4 w-4"}),s.jsx(rc,{children:"Secrets display"}),s.jsxs(ac,{className:"space-y-2",children:[s.jsx("p",{children:"This debugger is configured to show full tokens/secrets in network logs and exports."}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(na,{checked:!y,onCheckedChange:fe=>g(fe===!1)}),s.jsx(Fe,{children:"Hide sensitive values in inspector"})]})]})]})]})]}),s.jsx("div",{className:"flex justify-end",children:s.jsxs(le,{type:"button",onClick:()=>{dr()},disabled:oe,children:[oe&&s.jsx(or,{className:"mr-2 h-4 w-4 animate-spin"}),"Start OAuth Debug Session"]})})]}),a==="run"&&s.jsx("div",{className:"space-y-4",children:s.jsxs("div",{className:"grid gap-4 xl:grid-cols-[1.2fr_1fr]",children:[s.jsxs(qe,{className:"xl:col-span-1",children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Nt,{className:"text-base",children:"Progress"}),s.jsx(Ws,{children:"Visual OAuth flow guide with live session events and next-step actions."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[he?.uiHints.authorizationUrl&&Xt&&s.jsx(le,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsxs("a",{href:Xt,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(mh,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})}),s.jsxs(le,{type:"button",size:"sm",variant:"outline",onClick:()=>{qr()},disabled:oe,children:[s.jsx(Na,{className:"mr-2 h-4 w-4"}),"Restart"]}),ue&&s.jsxs(le,{type:"button",size:"sm",variant:"outline",onClick:()=>{Ur()},disabled:Ie||!ue,children:[(Ie||W)&&Ie&&s.jsx(or,{className:"mr-2 h-4 w-4 animate-spin"}),s.jsx(ch,{className:"mr-2 h-4 w-4"}),"Stop Debug Session"]})]})]})}),s.jsxs(We,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[s.jsxs("span",{children:[et.completed+et.failed,"/",et.total," steps"]}),s.jsxs("span",{children:[et.percent,"%"]})]}),s.jsx(fg,{value:et.percent,className:"h-2"})]}),he?.status==="waiting_for_user"&&s.jsx(qe,{children:s.jsxs(We,{className:"pt-4 space-y-2",children:[s.jsx("div",{className:"text-sm font-medium",children:"Manual callback required"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Open the authorization URL, complete authentication, then paste the final redirect URL here."}),s.jsx(qa,{value:de,onChange:fe=>ce(fe.target.value),placeholder:"Paste the final redirect URL (with code and state)",className:"min-h-24 text-xs font-mono"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(le,{type:"button",size:"sm",onClick:()=>{_r()},disabled:oe||!de.trim(),children:[oe&&s.jsx(or,{className:"mr-2 h-4 w-4 animate-spin"}),"Continue"]}),he.uiHints.authorizationUrl&&Xt&&s.jsx(le,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx("a",{href:Xt,target:"_blank",rel:"noopener noreferrer",children:"Open Authorization URL"})})]})]})}),he?.status==="waiting_for_browser_callback"&&s.jsxs(nc,{children:[s.jsx(tx,{className:"h-4 w-4"}),s.jsx(rc,{children:"Waiting for browser callback"}),s.jsxs(ac,{className:"space-y-1",children:[s.jsx("p",{className:"text-xs",children:"Complete the authorization flow in your browser. MCP Lab is listening for the callback at:"}),s.jsx("p",{className:"text-xs font-mono break-all",children:he.uiHints.callbackUrl}),he.uiHints.authorizationUrl&&Xt&&s.jsx("div",{className:"pt-2",children:s.jsx(le,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsxs("a",{href:Xt,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(mh,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})})})]})]}),s.jsx("div",{className:"space-y-2",children:he?.stepStates.map(fe=>s.jsxs("div",{className:"rounded-md border p-3",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium",children:fe.title}),s.jsx("div",{className:"text-xs text-muted-foreground",children:fe.description})]}),s.jsx(Je,{variant:fe.status==="failed"?"destructive":fe.status==="completed"?"outline":fe.status==="active"?"secondary":"outline",className:fe.status==="completed"?"border-emerald-300 bg-emerald-50 text-emerald-700":void 0,children:fe.status})]}),fe.outcomeSummary&&s.jsx("p",{className:"mt-2 text-xs text-muted-foreground break-all",children:fe.outcomeSummary})]},fe.id))||s.jsx("p",{className:"text-sm text-muted-foreground",children:"No steps yet."})})]})]}),s.jsx("div",{className:"space-y-4 xl:col-span-1",children:s.jsxs(qe,{children:[s.jsxs(St,{className:"pb-3",children:[s.jsx(Nt,{className:"text-base",children:"Inspect"}),s.jsx(Ws,{children:"Live events and network requests/responses for the OAuth flow."})]}),s.jsx(We,{className:"space-y-3",children:s.jsxs(yC,{value:qt,onValueChange:fe=>ee(fe),children:[s.jsxs(eg,{className:"grid grid-cols-2",children:[s.jsx(Fi,{value:"inspector",children:"Network Inspector"}),s.jsx(Fi,{value:"events",children:"Live Debug"})]}),s.jsx(nf,{value:"events",className:"mt-3",children:s.jsxs("div",{className:"max-h-64 space-y-1 overflow-auto rounded-md border bg-muted/10 p-3 text-xs",children:[ae.length===0?s.jsx("p",{className:"text-muted-foreground",children:"No events yet."}):ae.map((fe,De)=>s.jsxs("div",{className:"break-all",children:[s.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(fe.ts).toLocaleTimeString()}),s.jsx(Je,{variant:"outline",className:"mr-2 text-[10px]",children:fe.type}),typeof fe.payload.message=="string"?fe.payload.message:JSON.stringify(fe.payload)]},`${fe.ts}-${De}`)),s.jsx("div",{ref:Ne})]})}),s.jsxs(nf,{value:"inspector",className:"space-y-3 mt-3",children:[s.jsxs("div",{className:"grid gap-2 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Filter by step"}),s.jsxs(cn,{value:je,onValueChange:Re,children:[s.jsx(tn,{className:"h-8",children:s.jsx(un,{})}),s.jsxs(nn,{children:[s.jsx(lt,{value:"all",children:"All steps"}),(he?.stepStates??[]).map(fe=>s.jsx(lt,{value:fe.id,children:fe.title},fe.id))]})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Filter by status"}),s.jsxs(cn,{value:Xe,onValueChange:It,children:[s.jsx(tn,{className:"h-8",children:s.jsx(un,{})}),s.jsxs(nn,{children:[s.jsx(lt,{value:"all",children:"All"}),s.jsx(lt,{value:"ok",children:"Successful responses"}),s.jsx(lt,{value:"error",children:"Error responses"})]})]})]})]}),s.jsx("div",{className:"max-h-[34rem] space-y-2 overflow-auto",children:Et.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No network exchanges captured yet."}):Et.map(fe=>s.jsxs("details",{className:"rounded-md border p-3",children:[s.jsx("summary",{className:"cursor-pointer list-none",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium",children:fe.label}),s.jsxs("div",{className:"text-xs text-muted-foreground break-all",children:[fe.method?`${fe.method} `:"",fe.url]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Je,{variant:"outline",children:fe.phase}),typeof fe.status=="number"&&s.jsx(Je,{variant:fe.status>=400?"destructive":"secondary",children:fe.status})]})]})}),s.jsxs("div",{className:"mt-3 space-y-3",children:[s.jsxs("div",{children:[s.jsx("div",{className:"mb-1 text-xs font-medium",children:"Headers"}),s.jsx("pre",{className:"max-h-40 overflow-auto whitespace-pre rounded bg-muted p-2 text-xs",children:JSON.stringify(fe.headers,null,2)})]}),fe.bodyText&&s.jsxs("div",{children:[s.jsx("div",{className:"mb-1 text-xs font-medium",children:"Body"}),s.jsx("pre",{className:"max-h-64 overflow-auto whitespace-pre rounded bg-muted p-2 text-xs",children:fe.bodyText})]}),s.jsx("div",{className:"flex gap-2",children:s.jsxs(le,{type:"button",size:"sm",variant:"outline",onClick:()=>{cge(JSON.stringify(fe,null,2))},children:[s.jsx(zi,{className:"mr-2 h-4 w-4"}),"Copy JSON"]})})]})]},fe.id))})]})]})})]})})]})}),a==="report"&&he&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-semibold",children:"Report / Export"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"OAuth debug session summary, validations, and trace exports."})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(le,{type:"button",size:"sm",variant:"outline",onClick:()=>i("configure"),children:"Back to Configure"}),s.jsxs(le,{type:"button",size:"sm",variant:"outline",onClick:()=>{Yn("json")},children:[s.jsx(ja,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(le,{type:"button",size:"sm",variant:"outline",onClick:()=>{Yn("markdown")},children:[s.jsx(ja,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),s.jsxs(le,{type:"button",size:"sm",variant:"outline",onClick:()=>{Yn("raw")},children:[s.jsx(ja,{className:"mr-2 h-4 w-4"}),"Copy/Export Raw Trace"]})]})]}),s.jsxs(nc,{children:[s.jsx(tx,{className:"h-4 w-4"}),s.jsx(rc,{children:"Secrets display mode"}),s.jsx(ac,{children:y?"This session is configured to show full tokens and secrets in network logs/exports.":"Sensitive values are hidden in the inspector for this session."})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[s.jsx(qe,{children:s.jsxs(We,{className:"pt-4",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Status"}),s.jsx("div",{className:"text-lg font-semibold",children:he.status})]})}),s.jsx(qe,{children:s.jsxs(We,{className:"pt-4",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Requests"}),s.jsx("div",{className:"text-lg font-semibold",children:he.networkSummary.requestCount})]})}),s.jsx(qe,{children:s.jsxs(We,{className:"pt-4",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Network errors"}),s.jsx("div",{className:"text-lg font-semibold",children:he.networkSummary.errorCount})]})}),s.jsx(qe,{children:s.jsxs(We,{className:"pt-4",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Validation findings"}),s.jsx("div",{className:"text-lg font-semibold",children:he.validations.length})]})})]}),s.jsxs(qe,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Key values"})}),s.jsxs(We,{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx(Fe,{className:"text-xs",children:"Issuer"}),s.jsx("p",{className:"text-sm break-all",children:he.summary?.issuer||"-"})]}),s.jsxs("div",{children:[s.jsx(Fe,{className:"text-xs",children:"Client ID"}),s.jsx("p",{className:"text-sm break-all",children:he.summary?.clientId||"-"})]}),s.jsxs("div",{children:[s.jsx(Fe,{className:"text-xs",children:"Redirect URI"}),s.jsx("p",{className:"text-sm break-all",children:he.summary?.redirectUri||"-"})]}),s.jsxs("div",{children:[s.jsx(Fe,{className:"text-xs",children:"Token endpoint status"}),s.jsx("p",{className:"text-sm",children:he.summary?.tokenEndpointStatus??"-"})]}),s.jsxs("div",{children:[s.jsx(Fe,{className:"text-xs",children:"Token type"}),s.jsx("p",{className:"text-sm",children:he.summary?.tokenType||"-"})]}),s.jsxs("div",{children:[s.jsx(Fe,{className:"text-xs",children:"Scopes granted"}),s.jsx("p",{className:"text-sm break-all",children:(he.summary?.grantedScopes??[]).join(", ")||"-"})]})]})]}),s.jsxs(qe,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Validation findings"})}),s.jsx(We,{className:"space-y-2",children:he.validations.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No validation findings recorded."}):he.validations.map((fe,De)=>s.jsxs("div",{className:"rounded-md border p-3",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"inline-flex h-5 min-w-5 items-center justify-center rounded-full border bg-muted px-1 text-[10px] font-semibold text-muted-foreground",children:De+1}),s.jsx("span",{className:"font-bold",children:fe.title})]}),s.jsx(Je,{variant:En(fe.severity),children:fe.severity})]}),s.jsxs("p",{className:"text-sm",children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",fe.detail]}),fe.recommendation&&s.jsxs("div",{className:"mt-2 rounded-md border px-2.5 py-2 text-xs",children:[s.jsx("div",{className:"mb-1 font-medium text-muted-foreground",children:"Suggested improvement"}),s.jsx("p",{children:fe.recommendation})]}),s.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Step: ",fe.stepId,fe.specReference&&s.jsxs(s.Fragment,{children:[" · ",s.jsx("a",{href:fe.specReference,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"Spec reference"})]})]})]},fe.id))})]})]})]})}const C1="mcplab.runEvaluation.activeJobId",pge=()=>{const[e]=Vo(),[t,n]=v.useState(""),[r,a]=v.useState("1"),[i,o]=v.useState(!1),[c,d]=v.useState(0),[f,h]=v.useState([]),[p,y]=v.useState(!1),[g,j]=v.useState(!1),[b,x]=v.useState(""),[S,N]=v.useState(null),[C,E]=v.useState([]),[_,k]=v.useState([]),[O,R]=v.useState(!0),[T,F]=v.useState(""),[L,$]=v.useState(""),[Y,H]=v.useState(!1),[K,J]=v.useState([]),[Q,D]=v.useState(null),B=v.useRef(null),Z=v.useRef(null),{configs:z,reload:M}=mf(),{source:re}=Tn(),te=og("snapshots",!1),{agents:G,scenarios:de,reload:ce}=Ka(),he=b.trim(),ie=he?`/results/${encodeURIComponent(he)}${t?`?configId=${encodeURIComponent(t)}`:""}`:"/results",ue=z.find(ee=>ee.id===t),Ae=e.get("configId"),ae=v.useMemo(()=>{if(!ue)return[];const ee=new Map,Ce=ue.agentEntries&&ue.agentEntries.length>0?ue.agentEntries:ue.agents.map(Ne=>({kind:"inline",agent:Ne}));for(const Ne of Ce){if(Ne.kind==="inline"){const Be=Ne.agent.id;ee.has(Be)||ee.set(Be,Ne.agent);continue}const Me=G.find(Be=>Be.id===Ne.ref);Me&&!ee.has(Me.id)&&ee.set(Me.id,Me)}return Array.from(ee.values())},[ue,G]),$e=v.useMemo(()=>{if(!ue)return[];const ee=new Map,Ce=ue.scenarioEntries&&ue.scenarioEntries.length>0?ue.scenarioEntries:ue.scenarios.map(Ne=>({kind:"inline",scenario:Ne}));for(const Ne of Ce){if(Ne.kind==="inline"){ee.has(Ne.scenario.id)||ee.set(Ne.scenario.id,Ne.scenario);continue}const Me=de.find(Be=>Be.id===Ne.ref);Me&&!ee.has(Me.id)&&ee.set(Me.id,Me)}return Array.from(ee.values())},[ue,de]);v.useEffect(()=>{Ae&&z.some(ee=>ee.id===Ae)&&n(Ae)},[Ae,z]);const W=v.useRef("");v.useEffect(()=>{const ee=ue?`${ue.id}::${ue.sourcePath??""}`:"";if(ee===W.current)return;if(W.current=ee,!ue){E([]),k([]);return}const Ce=ae.filter(Ne=>(ue.runDefaults?.selectedAgentNames??[]).includes(Ne.id)).map(Ne=>Ne.id);E(Ce.length>0?Ce:ae.map(Ne=>Ne.id)),k($e.map(Ne=>Ne.id)),R(!0)},[ue?.id,ue?.sourcePath,ae,$e]);const ve=async()=>{if(!ue?.sourcePath){h(Me=>[...Me,`[${new Date().toLocaleTimeString()}] Missing source path for selected config.`]);return}const ee=ae.filter(Me=>C.includes(Me.id));if(ee.length===0){h(Me=>[...Me,`[${new Date().toLocaleTimeString()}] Select at least one agent.`]);return}const Ce=$e.filter(Me=>_.includes(Me.id));if(Ce.length===0){h(Me=>[...Me,`[${new Date().toLocaleTimeString()}] Select at least one test.`]);return}o(!0),y(!1),j(!1),x("");const Ne=(ue.serverEntries??[]).some(Me=>Me.kind==="referenced")||(ue.agentEntries??[]).some(Me=>Me.kind==="referenced")||(ue.scenarioEntries??[]).some(Me=>Me.kind==="referenced")?"refs-composed":"single-file/inline";h([`[${new Date().toLocaleTimeString()}] Starting evaluation run...`,`[${new Date().toLocaleTimeString()}] Config=${ue.name} mode=${Ne} agents=${ee.map(Me=>Me.name||Me.id).join(", ")} tests=${Ce.map(Me=>Me.id).join(", ")} runs=${Number(r)} snapshotEval=${te&&O?"on":"off"}${T.trim()?` note=${T.trim()}`:""}`]),d(10);try{const{jobId:Me}=await re.startRun({configPath:ue.sourcePath,runsPerScenario:Number(r),agents:ee.map(Be=>Be.id),scenarioIds:Ce.map(Be=>Be.id),applySnapshotEval:te?O:!1,runNote:T.trim()?T.trim():void 0});N(Me),je(Me),qt(Me),Re()}catch(Me){const Be=Me instanceof Error?Me.message:String(Me),et=Be.includes("Anthropic model not found")?" Hint: this usually means the API key works but the model ID is not enabled for that Anthropic account. Change the agent model in Manage Agents (library) or inline config.":"";h(Et=>[...Et,`[${new Date().toLocaleTimeString()}] Error: ${Be}${et}`]),o(!1),d(0),N(null)}},oe=()=>{ve()},be=()=>{S&&re.stopRun(S),Z.current?.(),Z.current=null,Ye(),N(null),o(!1),y(!1),j(!0),h(ee=>[...ee,`[${new Date().toLocaleTimeString()}] Run aborted by user.`]),Re()},Ie=async()=>{if(b){H(!0);try{const ee=await re.createSnapshotFromRun(b,L.trim()||void 0);Pe({title:"Snapshot saved",description:`Created ${ee.name} (${ee.id})`}),L.trim()||$(ee.name)}catch(ee){Pe({title:"Could not save snapshot",description:ee instanceof Error?ee.message:String(ee),variant:"destructive"})}finally{H(!1)}}};v.useEffect(()=>{B.current&&(B.current.scrollTop=B.current.scrollHeight)},[f]),v.useEffect(()=>()=>{Z.current?.()},[]),v.useEffect(()=>{if(S||p)return;let ee="";try{ee=sessionStorage.getItem(C1)??""}catch{ee=""}if(ee)return N(ee),o(!0),y(!1),j(!1),h(Ce=>Ce.length>0?Ce:[`[${new Date().toLocaleTimeString()}] Reattached to in-progress evaluation run...`]),qt(ee),()=>{}},[S,p]);const Ye=()=>{try{sessionStorage.removeItem(C1)}catch{}},je=ee=>{try{sessionStorage.setItem(C1,ee)}catch{}},Re=async()=>{try{const ee=await re.getRunQueue();J(ee.queued),D(ee.active)}catch{}},Xe=()=>{M(),ce()};v.useEffect(()=>{Xe(),Re();const ee=()=>{Xe(),Re()};return window.addEventListener("focus",ee),()=>{window.removeEventListener("focus",ee)}},[M,ce]);const It=async ee=>{try{await re.removeQueuedRun(ee),J(Ce=>Ce.filter(Ne=>Ne.jobId!==ee))}catch(Ce){const Ne=Ce instanceof Error?Ce.message:String(Ce);if(Ne.includes("Use the /stop endpoint"))try{await re.stopRun(ee)}catch{}else Pe({title:"Could not remove queued run",description:Ne,variant:"destructive"})}Re()},qt=ee=>{Z.current?.(),Z.current=re.subscribeRunJob(ee,Ce=>{const Ne=new Date(Ce.ts).toLocaleTimeString();if(Ce.type==="queued"){h(Me=>{const Be=Ce.payload.position?` (position ${Ce.payload.position})`:"",et=`[${Ne}] Run queued${Be}. Waiting for active run to finish...`;return Me.includes(et)?Me:[...Me,et]}),d(5);return}if(Ce.type==="started"&&(h(Me=>{const Be=`[${Ne}] Run started.`;return Me.includes(Be)?Me:[...Me,Be]}),d(Me=>Math.max(Me,30)),j(!1)),Ce.type==="log"){const Me=String(Ce.payload.message??"").trim();Me&&(h(Be=>{const et=`[${Ne}] ${Me}`;return Be.includes(et)?Be:[...Be,et]}),d(Be=>{const et=Me.toLowerCase();if(et.startsWith("loading mcp evaluation config"))return Math.max(Be,15);if(et.startsWith("loaded config"))return Math.max(Be,20);if(et.startsWith("selected "))return Math.max(Be,30);if(et.startsWith("using requested agents")||et.startsWith("using resolved default agents"))return Math.max(Be,35);if(et.startsWith("expanded to "))return Math.max(Be,45);if(et.startsWith("running evaluation"))return Math.max(Be,50);const Et=et.match(/^scenario (\d+)\/(\d+) finished:/);if(Et){const Sn=Number(Et[1]),Nn=Number(Et[2]);return Math.max(Be,50+Math.round(Sn/Nn*25))}return et.startsWith("evaluation execution finished")?Math.max(Be,78):et.startsWith("applying snapshot evaluation policy")?Math.max(Be,82):et.includes("snapshot evaluation applied")||et.includes("snapshot evaluation enabled")?Math.max(Be,88):et.startsWith("writing results to ")?Math.max(Be,94):et.startsWith("run finished:")?Math.max(Be,98):Be}))}if(Ce.type==="completed"){const Me=String(Ce.payload.runId??"").trim();if(h(Be=>{const et=`[${Ne}] Run completed.`;return Be.includes(et)?Be:[...Be,et]}),Ce.payload.snapshotEval&&typeof Ce.payload.snapshotEval=="object"){const Be=Ce.payload.snapshotEval;h(et=>{const Et=`[${Ne}] Snapshot eval (${Be.mode??"warn"}) baseline=${Be.baseline_snapshot_id??"-"} score=${Be.overall_score??"-"} status=${Be.status??"-"}`;return et.includes(Et)?et:[...et,Et]})}d(100),o(!1),y(!0),j(!1),x(Me),Ye(),N(null),Z.current?.(),Z.current=null,Re()}if(Ce.type==="error"){const Me=String(Ce.payload.message??"Unknown error"),Be=Me.includes("Anthropic model not found")?" Hint: this usually means the API key works but the model ID is not enabled for that Anthropic account. Change the agent model in Manage Agents (library) or inline config.":"";h(et=>[...et,`[${Ne}] Error: ${Me}${Be}`]),o(!1),y(!1),j(!1),d(0),Ye(),N(null),Z.current?.(),Z.current=null,Re()}})};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(Gl,{className:"h-6 w-6"}),"Run Evaluation"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Execute evaluation scenarios against MCP servers"})]}),s.jsx(qe,{children:s.jsxs(We,{className:"pt-6 space-y-4",children:[s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Fe,{children:"MCP Evaluation"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(cn,{value:t,onValueChange:n,children:[s.jsx(tn,{children:s.jsx(un,{placeholder:"Select a config"})}),s.jsx(nn,{children:z.map(ee=>s.jsx(lt,{value:ee.id,children:ee.name},ee.id))})]}),s.jsx(le,{type:"button",variant:"outline",size:"icon",className:"h-10 w-10 shrink-0",onClick:Xe,"aria-label":"Refresh configs",title:"Refresh configs",children:s.jsx(Na,{className:"h-4 w-4"})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Fe,{children:"Variance Runs"}),s.jsx(mt,{type:"number",min:"1",max:"10",value:r,onChange:ee=>a(ee.target.value)})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Fe,{htmlFor:"run-note",children:"Run Note"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[T.length,"/500"]})]}),s.jsx(qa,{id:"run-note",value:T,onChange:ee=>F(ee.target.value.slice(0,500)),placeholder:"Optional context for this run (for example: mcp-server v1.8.2 #staging)",rows:2})]}),ue&&s.jsxs("div",{className:"space-y-2",children:[te&&ue.snapshotEval?.enabled&&s.jsxs("div",{className:"rounded-md border bg-amber-500/10 p-2 text-xs text-amber-700 dark:text-amber-300",children:["Snapshot eval active (",ue.snapshotEval.mode,") · baseline:"," ",s.jsx("span",{className:"font-mono",children:ue.snapshotEval.baselineSnapshotId??"none"})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Fe,{children:"Agents"}),s.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[s.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>E(ae.map(ee=>ee.id)),children:"Select all"}),s.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>E([]),children:"Clear"})]})]}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:ae.map(ee=>{const Ce=C.includes(ee.id);return s.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[s.jsx(na,{checked:Ce,onCheckedChange:Ne=>{const Me=Ne===!0;E(Be=>Me?[...Be,ee.id]:Be.filter(et=>et!==ee.id))}}),s.jsx("span",{children:ee.name||ee.id})]},ee.id)})}),ae.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents available in this config. Add inline agents or agent references."})]}),ue&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Fe,{children:"Tests"}),s.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[s.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>k($e.map(ee=>ee.id)),children:"Select all"}),s.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>k([]),children:"Clear"})]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[_.length," of ",$e.length," selected"]}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:$e.map(ee=>{const Ce=_.includes(ee.id);return s.jsxs("label",{className:"flex items-start gap-2 text-sm rounded-md border p-2",children:[s.jsx(na,{checked:Ce,onCheckedChange:Ne=>{const Me=Ne===!0;k(Be=>Me?[...Be,ee.id]:Be.filter(et=>et!==ee.id))}}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:"block font-medium",children:ee.name||ee.id}),s.jsx("span",{className:"block font-mono text-xs text-muted-foreground truncate",children:ee.id})]})]},ee.id)})})]}),te&&s.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[s.jsx(na,{checked:O,onCheckedChange:ee=>R(ee===!0)}),s.jsx("span",{children:"Apply snapshot evaluation policy (if configured)"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(le,{onClick:oe,disabled:!t||ae.length>0&&C.length===0||$e.length>0&&_.length===0,children:[s.jsx(Gl,{className:"mr-2 h-4 w-4"}),Q?"Queue Run":"Run"]}),i&&s.jsxs(le,{variant:"destructive",onClick:be,children:[s.jsx(ch,{className:"mr-2 h-4 w-4"}),"Stop"]})]})]})}),(i||f.length>0)&&s.jsxs(qe,{children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Nt,{className:"text-base",children:"Progress"}),s.jsxs("span",{className:"text-xs text-muted-foreground font-mono",children:[Math.round(c),"%"]})]})}),s.jsxs(We,{className:"space-y-4",children:[s.jsx(fg,{value:c,className:"h-2"}),s.jsx("div",{ref:B,className:"h-64 overflow-auto rounded-md border bg-muted/30 p-3 font-mono text-xs space-y-0.5",children:f.map((ee,Ce)=>s.jsx("div",{className:ee.includes("✓")?"text-success":ee.includes("aborted")?"text-destructive":"text-foreground",children:ee},Ce))})]})]}),s.jsxs(qe,{children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(Nt,{className:"inline-flex items-center gap-2 text-base",children:[s.jsx(of,{className:"h-4 w-4"}),"Run Queue"]}),s.jsx(le,{variant:"ghost",size:"sm",onClick:()=>{Re()},children:s.jsx(Na,{className:"h-3 w-3"})})]})}),s.jsx(We,{children:!Q&&K.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No active or queued runs. Start a run above."}):s.jsxs("div",{className:"space-y-2",children:[Q&&s.jsxs("div",{className:`flex items-center justify-between rounded-md border border-primary/30 bg-primary/5 p-2 text-sm cursor-pointer hover:bg-primary/10 transition-colors ${S===Q.jobId?"ring-2 ring-primary/40":""}`,onClick:()=>{S!==Q.jobId&&(N(Q.jobId),je(Q.jobId),o(!0),y(!1),j(!1),h([`[${new Date().toLocaleTimeString()}] Attached to running job ${Q.jobId}...`]),d(10),qt(Q.jobId))},title:"Click to view progress",children:[s.jsxs("div",{className:"min-w-0 flex items-center gap-2",children:[s.jsx("span",{className:"inline-flex items-center rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:"Running"}),s.jsx("span",{className:"font-mono text-xs",children:Q.runParams.configPath.split("/").pop()??Q.runParams.configPath}),Q.runParams.agents&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:["agents: ",Q.runParams.agents.join(", ")]}),Q.runParams.runNote&&s.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["note: ",Q.runParams.runNote]})]}),s.jsxs(le,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-destructive hover:text-destructive hover:bg-destructive/10",onClick:ee=>{ee.stopPropagation(),Q&&(re.stopRun(Q.jobId),Re())},title:"Stop running job",children:[s.jsx(ch,{className:"mr-1 h-3 w-3"}),"Stop"]})]}),K.map((ee,Ce)=>{const Ne=ee.runParams.configPath.split("/").pop()??ee.runParams.configPath;return s.jsxs("div",{className:"flex items-center justify-between rounded-md border p-2 text-sm",children:[s.jsxs("div",{className:"min-w-0 flex items-center gap-2",children:[s.jsxs("span",{className:"inline-flex items-center rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:["#",Ce+1," Queued"]}),s.jsx("span",{className:"font-mono text-xs",children:Ne}),ee.runParams.agents&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:["agents: ",ee.runParams.agents.join(", ")]}),ee.runParams.runNote&&s.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["note: ",ee.runParams.runNote]})]}),s.jsx(le,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:()=>{It(ee.jobId)},title:"Remove from queue",children:s.jsx(Ys,{className:"h-4 w-4"})})]},ee.jobId)})]})})]}),g&&!i&&!p&&s.jsx(qe,{className:"border-amber-300/60 bg-amber-50/40",children:s.jsx(We,{className:"pt-6",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsx(ch,{className:"h-5 w-5 text-amber-700"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"font-medium",children:"Run stopped"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"The evaluation was stopped before completion. You can start it again or clear the progress log."})]}),s.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[s.jsx(le,{type:"button",variant:"outline",onClick:()=>{h([]),d(0),j(!1)},children:"Clear Progress"}),s.jsxs(le,{type:"button",onClick:oe,disabled:!t,children:[s.jsx(Gl,{className:"mr-2 h-4 w-4"}),"Run Again"]})]})]})})}),p&&s.jsx(qe,{className:"border-success/50",children:s.jsxs(We,{className:"pt-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Kl,{className:"h-6 w-6 text-success"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Evaluation Complete"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"All scenarios have been evaluated successfully."})]}),s.jsx(le,{asChild:!0,className:"ml-auto",children:s.jsx(wt,{to:ie,children:he?"View Results":"View Runs"})})]}),te&&he&&s.jsxs("div",{className:"mt-4 flex flex-wrap items-end gap-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Snapshot name (optional)"}),s.jsx(mt,{value:L,onChange:ee=>$(ee.target.value),placeholder:"e.g. baseline-v1",className:"h-8 w-64"})]}),s.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:()=>{Ie()},disabled:Y,children:Y?"Saving...":"Save Snapshot"})]})]})})]})};function hge(e){const t=Array.from(new Map(e.scenarios.map(i=>{const o=String(i.scenarioId??"").trim(),c=String(i.scenarioName??"").trim();return!o&&!c?null:[o||c,c||o]}).filter(i=>!!i)).values()),n=Array.from(new Set(e.scenarios.map(i=>i.agentName).filter(Boolean))),r=t.slice(0,2).join(", "),a=t.length>2?` +${t.length-2}`:"";return{scenarioCount:t.length,agentCount:n.length,scenarioPreview:r?`${r}${a}`:"n/a"}}const mge=()=>{const{source:e}=Tn(),[t,n]=v.useState([]),[r,a]=v.useState(!1),[i,o]=v.useState(null),[c,d]=v.useState(!1),[f,h]=v.useState("timestamp"),[p,y]=v.useState("desc"),[g,j]=v.useState("all"),b=R=>{if(f===R){y(T=>T==="asc"?"desc":"asc");return}h(R),y(R==="timestamp"?"desc":"asc")},x=async()=>{a(!0);try{n(await e.listResults())}catch(R){Pe({title:"Could not load results",description:R instanceof Error?R.message:String(R),variant:"destructive"})}finally{a(!1)}};v.useEffect(()=>{let R=!0;return a(!0),e.listResults().then(T=>{R&&n(T)}).catch(T=>{R&&Pe({title:"Could not load results",description:T instanceof Error?T.message:String(T),variant:"destructive"})}).finally(()=>{R&&a(!1)}),()=>{R=!1}},[e]);const S=v.useMemo(()=>{const R=new Set;return t.forEach(T=>{T.scenarios.forEach(F=>{const L=String(F.scenarioName??"").trim(),$=String(F.scenarioId??"").trim(),Y=L||$;Y&&R.add(Y)})}),Array.from(R).sort((T,F)=>T.localeCompare(F))},[t]),N=v.useMemo(()=>g==="all"?t:t.filter(R=>R.scenarios.some(T=>{const F=String(T.scenarioName??"").trim(),L=String(T.scenarioId??"").trim();return(F||L)===g})),[t,g]),C=v.useMemo(()=>{const R=(F,L)=>F===null&&L===null?0:F===null?1:L===null?-1:p==="asc"?F-L:L-F;return[...N].sort((F,L)=>{if(f==="toolTokens")return R(F.toolTokenUsage?.totalTokens??null,L.toolTokenUsage?.totalTokens??null);let $=0;return f==="id"&&($=F.id.localeCompare(L.id)),f==="timestamp"&&($=new Date(F.timestamp).getTime()-new Date(L.timestamp).getTime()),f==="passRate"&&($=F.overallPassRate-L.overallPassRate),f==="scenarios"&&($=F.totalScenarios-L.totalScenarios),f==="avgToolCalls"&&($=F.avgToolCalls-L.avgToolCalls),p==="asc"?$:-$})},[N,f,p]),E=R=>f!==R?s.jsx(Hl,{className:"h-3.5 w-3.5 text-muted-foreground"}):p==="asc"?s.jsx(ds,{className:"h-3.5 w-3.5"}):s.jsx(Gt,{className:"h-3.5 w-3.5"}),_=R=>{const T=R.toolTokenUsage?.totalTokens;return typeof T=="number"?T.toLocaleString():"n/a"},k=v.useMemo(()=>{const R=new Map;for(const T of C)R.set(T.id,hge(T));return R},[C]),O=async R=>{d(!0);try{await e.deleteResult(R),n(T=>T.filter(F=>F.id!==R)),Pe({title:"Run deleted",description:R}),o(null)}catch(T){Pe({title:"Could not delete run",description:T instanceof Error?T.message:String(T),variant:"destructive"})}finally{d(!1)}};return s.jsxs("div",{className:"space-y-6",children:[s.jsx(Cs,{open:i!==null,onOpenChange:R=>{!R&&!c&&o(null)},children:s.jsxs(Ya,{children:[s.jsxs(Xa,{children:[s.jsx(Ja,{children:"Delete run?"}),s.jsxs(Za,{children:["This will permanently remove the run artifacts from disk for"," ",s.jsx("span",{className:"font-mono",children:i??""}),"."]})]}),s.jsxs(Qa,{children:[s.jsx(ts,{disabled:c,children:"Cancel"}),s.jsx(es,{disabled:c||!i,onClick:R=>{R.preventDefault(),i&&O(i)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:c?"Deleting...":"Delete run"})]})]})}),s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(fd,{className:"h-6 w-6"}),"Results"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Browse evaluation runs and open detailed results"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(cn,{value:g,onValueChange:j,children:[s.jsx(tn,{className:"w-[260px]",children:s.jsx(un,{placeholder:"Filter by scenario"})}),s.jsxs(nn,{children:[s.jsx(lt,{value:"all",children:"All scenarios"}),S.map(R=>s.jsx(lt,{value:R,children:R},R))]})]}),s.jsx(le,{variant:"outline",onClick:()=>{x()},disabled:r,children:r?"Refreshing...":"Refresh"})]})]}),s.jsx(qe,{children:s.jsx(We,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs(Mt,{children:[s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>b("id"),children:["Run ID",E("id")]})}),s.jsx(tt,{children:"Evaluated"}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>b("timestamp"),children:["Timestamp",E("timestamp")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>b("passRate"),children:["Pass Rate",E("passRate")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>b("scenarios"),children:["Scenarios",E("scenarios")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>b("avgToolCalls"),children:["Avg Tool Calls",E("avgToolCalls")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>b("toolTokens"),children:["Tool Tokens",E("toolTokens")]})}),s.jsx(tt,{className:"w-10"})]})}),s.jsx(Lr,{children:C.map(R=>s.jsxs(Mt,{children:[s.jsx(ze,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(wt,{to:`/results/${R.id}`,className:"font-mono text-xs text-primary hover:underline",children:R.id}),R.configId?s.jsx("div",{className:"text-[11px] text-muted-foreground",children:R.configId}):null,R.runNote?s.jsxs("div",{className:"text-[11px] text-muted-foreground break-words",children:["Note: ",R.runNote]}):null]})}),s.jsx(ze,{className:"text-[11px] text-muted-foreground",children:(()=>{const T=k.get(R.id);return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Evaluated: ",T.scenarioCount," scenario",T.scenarioCount===1?"":"s"," · ",T.agentCount," agent",T.agentCount===1?"":"s"]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:T.scenarioPreview})]})})()}),s.jsx(ze,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(of,{className:"h-3 w-3"}),new Date(R.timestamp).toLocaleString()]})}),s.jsx(ze,{children:s.jsx(zs,{rate:R.overallPassRate})}),s.jsx(ze,{className:"font-mono text-sm",children:R.totalScenarios}),s.jsx(ze,{className:"font-mono text-sm",children:R.avgToolCalls.toFixed(0)}),s.jsx(ze,{className:"font-mono text-sm",children:_(R)}),s.jsx(ze,{children:s.jsxs(Zc,{children:[s.jsx(eu,{asChild:!0,children:s.jsx(le,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Dm,{className:"h-4 w-4"})})}),s.jsxs(el,{align:"end",children:[s.jsx(yr,{asChild:!0,children:s.jsxs(wt,{to:`/results/${R.id}`,children:[s.jsx(L7,{className:"mr-2 h-3.5 w-3.5"}),"View"]})}),s.jsxs(yr,{children:[s.jsx(ja,{className:"mr-2 h-3.5 w-3.5"}),"Export JSON"]}),s.jsxs(yr,{className:"text-destructive",onSelect:T=>{T.preventDefault(),o(R.id)},children:[s.jsx(Ca,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]})})]},R.id))})]})})})]})};function dd({text:e,variant:t="assistant",className:n}){const r=vge(e);return s.jsx("div",{className:Se("space-y-2",t==="system"&&"text-xs",n),children:r.map((a,i)=>s.jsx(v.Fragment,{children:gge(a,i,t)},`md-${i}`))})}function vge(e){const t=e.replace(/\r\n/g,`
|
|
144
|
-
`).split(`
|
|
145
|
-
`),n=[];let r=0;const a=o=>o.trim()==="",i=o=>o.trimStart().startsWith("```");for(;r<t.length;){const o=t[r],c=o.trim();if(a(o)){r+=1;continue}if(i(o)){const y=c.replace(/^```/,"").trim()||void 0;r+=1;const g=[];for(;r<t.length&&!i(t[r]);)g.push(t[r]),r+=1;r<t.length&&i(t[r])&&(r+=1),n.push({type:"code",lang:y,code:g.join(`
|
|
146
|
-
`)});continue}if(/^---+$/.test(c)||/^\*\*\*+$/.test(c)){n.push({type:"hr"}),r+=1;continue}if(c.startsWith(">")){const y=[];for(;r<t.length&&t[r].trim().startsWith(">");)y.push(t[r].trim().replace(/^>\s?/,"")),r+=1;n.push({type:"blockquote",text:y.join(`
|
|
147
|
-
`)});continue}const d=c.match(/^(#{1,4})\s+(.+)$/);if(d){n.push({type:"heading",level:d[1].length,text:d[2].trim()}),r+=1;continue}if(EM(t,r)){const y=PM(t[r]);r+=2;const g=[];for(;r<t.length&&t[r].includes("|")&&!a(t[r]);)g.push(PM(t[r])),r+=1;n.push({type:"table",headers:y,rows:g});continue}const f=c.match(/^\d+\.\s+/),h=c.match(/^[-*+]\s+/);if(f||h){const y=!!f,g=[];for(;r<t.length;){const j=t[r].trim();if(y?/^\d+\.\s+/.test(j):/^[-*+]\s+/.test(j)){g.push(j.replace(y?/^\d+\.\s+/:/^[-*+]\s+/,"")),r+=1;continue}a(t[r])&&(r+=1);break}n.push({type:"list",ordered:y,items:g});continue}const p=[o];for(r+=1;r<t.length;){const y=t[r],g=y.trim();if(a(y)||i(y)||/^---+$/.test(g)||/^#{1,4}\s+/.test(g)||g.startsWith(">")||EM(t,r)||/^\d+\.\s+/.test(g)||/^[-*+]\s+/.test(g))break;p.push(y),r+=1}n.push({type:"paragraph",text:p.join(`
|
|
148
|
-
`)})}return n}function EM(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 PM(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>t.trim())}function gge(e,t,n){if(e.type==="hr")return s.jsx("hr",{className:"border-border/60"});if(e.type==="heading"){const r=e.level===1?"text-base font-semibold":e.level===2?"text-sm font-semibold":"text-sm font-medium";return s.jsx("h4",{className:r,children:Il(e.text,`${t}-h`)})}if(e.type==="paragraph")return s.jsx("p",{className:Se("whitespace-pre-wrap leading-relaxed",n==="system"&&"leading-normal"),children:Il(e.text,`${t}-p`)});if(e.type==="blockquote")return s.jsx("blockquote",{className:"border-l-2 border-muted-foreground/30 pl-3 text-muted-foreground italic",children:Il(e.text,`${t}-bq`)});if(e.type==="code")return s.jsxs("div",{className:"rounded-md border bg-muted/70",children:[e.lang&&s.jsx("div",{className:"border-b px-2 py-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:e.lang}),s.jsx("pre",{className:"max-h-72 overflow-auto p-2 text-xs",children:s.jsx("code",{children:e.code})})]});if(e.type==="list"){const r=e.ordered?"ol":"ul";return s.jsx(r,{className:Se("space-y-1 pl-5",e.ordered?"list-decimal":"list-disc"),children:e.items.map((a,i)=>s.jsx("li",{className:"leading-relaxed",children:Il(a,`${t}-li-${i}`)},`${t}-li-${i}`))})}return e.type==="table"?s.jsx("div",{className:"overflow-x-auto rounded-md border",children:s.jsxs("table",{className:"w-full min-w-[480px] border-collapse text-xs",children:[s.jsx("thead",{className:"bg-muted/40",children:s.jsx("tr",{children:e.headers.map((r,a)=>s.jsx("th",{className:"border-b px-2 py-1.5 text-left font-semibold align-top",children:Il(r,`${t}-thc-${a}`)},`${t}-th-${a}`))})}),s.jsx("tbody",{children:e.rows.map((r,a)=>s.jsx("tr",{className:"border-t",children:r.map((i,o)=>s.jsx("td",{className:"px-2 py-1.5 align-top",children:Il(i,`${t}-tdc-${a}-${o}`)},`${t}-td-${a}-${o}`))},`${t}-row-${a}`))})]})}):null}function Il(e,t){return e.split(/(`[^`]+`|\*\*[^*]+\*\*|\*[^*\n]+\*|_[^_\n]+_|~~[^~\n]+~~|\[[^\]]+\]\([^)]+\))/g).filter(Boolean).map((r,a)=>{if(r.startsWith("`")&&r.endsWith("`"))return s.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.92em]",children:r.slice(1,-1)},`${t}-${a}`);if(r.startsWith("**")&&r.endsWith("**"))return s.jsx("strong",{children:r.slice(2,-2)},`${t}-${a}`);if(r.startsWith("*")&&r.endsWith("*"))return s.jsx("em",{children:r.slice(1,-1)},`${t}-${a}`);if(r.startsWith("_")&&r.endsWith("_"))return s.jsx("em",{children:r.slice(1,-1)},`${t}-${a}`);if(r.startsWith("~~")&&r.endsWith("~~"))return s.jsx("s",{children:r.slice(2,-2)},`${t}-${a}`);const i=r.match(/^\[([^\]]+)\]\(([^)]+)\)$/);return i?s.jsx("a",{href:i[2],target:"_blank",rel:"noreferrer",className:"underline underline-offset-2",children:i[1]},`${t}-${a}`):s.jsx(v.Fragment,{children:r},`${t}-${a}`)})}function yge(e){const t=e.scenarios.reduce((c,d)=>c+d.runs.filter(f=>f.passed).length,0),n=e.totalRuns-t,r={};e.scenarios.forEach(c=>c.runs.forEach(d=>d.toolCalls.forEach(f=>{r[f.name]=(r[f.name]||0)+1})));const a=Object.keys(r),i=Object.values(r),o=e.scenarios.map(c=>`
|
|
149
|
-
<div class="scenario-card">
|
|
150
|
-
<div class="scenario-header" onclick="this.parentElement.classList.toggle('open')">
|
|
151
|
-
<span class="chevron">▶</span>
|
|
152
|
-
<span class="scenario-name">${yo(c.scenarioName)}</span>
|
|
153
|
-
<span class="scenario-agent">${yo(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">${yo(f.name)} <small>${f.duration}ms</small></span>`).join("")}
|
|
166
|
-
</div>
|
|
167
|
-
${d.failureReasons.length?`<div class="failure-reasons">${d.failureReasons.map(f=>yo(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 — ${yo(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">${yo(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">${yo(e.configHash)}</span></p>
|
|
224
|
-
|
|
225
|
-
<div class="stats">
|
|
226
|
-
<div class="stat"><div class="stat-label">Scenarios</div><div class="stat-value">${e.totalScenarios}</div></div>
|
|
227
|
-
<div class="stat"><div class="stat-label">Total Runs</div><div class="stat-value">${e.totalRuns}</div></div>
|
|
228
|
-
<div class="stat"><div class="stat-label">Pass Rate</div><div class="stat-value">${Math.round(e.overallPassRate*100)}%</div></div>
|
|
229
|
-
<div class="stat"><div class="stat-label">Avg Tool Calls</div><div class="stat-value">${e.avgToolCalls.toFixed(1)}</div></div>
|
|
230
|
-
<div class="stat"><div class="stat-label">Avg Latency</div><div class="stat-value">${e.avgLatency}ms</div></div>
|
|
231
|
-
</div>
|
|
232
|
-
|
|
233
|
-
<div class="charts">
|
|
234
|
-
<div class="chart-card"><h3>Pass / Fail</h3><canvas id="pieChart"></canvas></div>
|
|
235
|
-
<div class="chart-card"><h3>Tool Usage</h3><canvas id="barChart"></canvas></div>
|
|
236
|
-
</div>
|
|
237
|
-
|
|
238
|
-
<h2 style="font-size:1rem;font-weight:600;margin-bottom:.75rem">Scenarios</h2>
|
|
239
|
-
${o}
|
|
240
|
-
|
|
241
|
-
<div class="footer">Generated by MCPLab · ${new Date().toISOString()}</div>
|
|
242
|
-
|
|
243
|
-
<script>
|
|
244
|
-
new Chart(document.getElementById('pieChart'),{type:'doughnut',data:{labels:['Pass','Fail'],datasets:[{data:[${t},${n}],backgroundColor:['#059669','#dc2626'],borderWidth:0}]},options:{cutout:'60%',plugins:{legend:{position:'bottom',labels:{font:{size:11}}}}}});
|
|
245
|
-
new Chart(document.getElementById('barChart'),{type:'bar',data:{labels:${JSON.stringify(a)},datasets:[{data:${JSON.stringify(i)},backgroundColor:'#f59e0b',borderRadius:4}]},options:{indexAxis:'y',plugins:{legend:{display:false}},scales:{x:{grid:{display:false}},y:{grid:{display:false},ticks:{font:{family:'monospace',size:11}}}}}});
|
|
246
|
-
<\/script>
|
|
247
|
-
</body>
|
|
248
|
-
</html>`}function yo(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}const xge="mcplab.resultAssistantScenarioHandoff",bge=[{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 kM(e){const t=new Date().toISOString().replace(/[:]/g,"-").replace(/\..+/,"");return`mcplab/reports/result-assistant/${e}-${t}.md`}function OM(e){const t=e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}function xo(e){return typeof e=="number"?e.toLocaleString():"n/a"}const wge=()=>{const{id:e}=Wo(),t=_a(),[n]=Vo(),{source:r}=Tn(),a=og("snapshots",!1),{configs:i}=mf(),{scenarios:o}=Ka(),[c,d]=v.useState(void 0),[f,h]=v.useState(!0),[p,y]=v.useState(!1),[g,j]=v.useState(""),[b,x]=v.useState(!1),[S,N]=v.useState(new Set),[C,E]=v.useState(new Set),[_,k]=v.useState([]),[O,R]=v.useState(""),[T,F]=v.useState(null),[L,$]=v.useState(!1),[Y,H]=v.useState(""),[K,J]=v.useState(""),[Q,D]=v.useState(!1),[B,Z]=v.useState(!1),[z,M]=v.useState(null),[re,te]=v.useState([]),[G,de]=v.useState([]),[ce,he]=v.useState(""),[ie,ue]=v.useState(!1),[Ae,ae]=v.useState(!1),[$e,W]=v.useState("assistant"),[ve,oe]=v.useState(null),[be,Ie]=v.useState(null),[Ye,je]=v.useState(!1),[Re,Xe]=v.useState(""),[It,qt]=v.useState(""),[ee,Ce]=v.useState(!1),[Ne,Me]=v.useState(!1),[Be,et]=v.useState(!1),[Et,Sn]=v.useState([]),[Nn,cr]=v.useState(!1),[ur,Dn]=v.useState(""),[dr,_r]=v.useState(null),[Ur,qr]=v.useState(!1),[Yn,Xt]=v.useState(null),En=v.useRef(null),fe=v.useRef(null),De=v.useCallback(async(q,xe)=>{cr(!0);try{const Te=(await r.listMarkdownReports()).filter(Pt=>{const ft=String(Pt.relativePath??""),Vt=String(Pt.name??"");return ft.includes(q)||Vt.includes(q)});if(Sn(Te),xe&&Te.length>0){const Pt=Te.find(ft=>ft.relativePath===xe||ft.path===xe||ft.relativePath.endsWith(xe)||ft.path.endsWith(xe));Pt&&Dn(Pt.relativePath)}return Te}catch{return Sn([]),[]}finally{cr(!1)}},[r]);v.useEffect(()=>{if(!e)return;let q=!0;const xe=z;return xe&&(r.closeResultAssistantSession(xe).catch(()=>{}),M(null),te([]),de([]),Ie(null)),h(!0),r.getResult(e).then(rt=>{q&&(d(rt),j(rt?.runNote??""),y(!1),h(!1))}),()=>{q=!1}},[e,r]),v.useEffect(()=>{let q=!0;return r.listSnapshots().then(xe=>{q&&k(xe)}).catch(()=>{q&&k([])}),()=>{q=!1}},[r]),v.useEffect(()=>{if(!c?.id){Sn([]);return}let q=!0;return(async()=>{const xe=await De(c.id)})(),()=>{q=!1}},[c?.id,De]),v.useEffect(()=>{if(Et.length===0){Dn(""),_r(null),Xt(null);return}(!ur||!Et.some(q=>q.relativePath===ur))&&Dn(Et[0].relativePath)},[Et,ur]),v.useEffect(()=>{if(!B||$e!=="reports")return;if(!ur){_r(null),Xt(null);return}let q=!0;return qr(!0),Xt(null),r.getMarkdownReport(ur).then(xe=>{q&&_r(xe)}).catch(xe=>{q&&(_r(null),Xt(xe instanceof Error?xe.message:String(xe)))}).finally(()=>{q&&qr(!1)}),()=>{q=!1}},[B,$e,ur,r]);const st=n.get("configId")??"",xt=(n.get("agent")??"").trim(),$t=v.useMemo(()=>{const q=st?i.find(xe=>xe.id===st):void 0;return q||(c?i.find(xe=>xe.id===c.configId):void 0)},[i,st,c]),an=v.useMemo(()=>{const q=new Map;if($t){for(const xe of $t.scenarios)q.set(xe.id,xe),xe.name&&!q.has(xe.name)&&q.set(xe.name,xe);for(const xe of $t.scenarioEntries??[]){if(xe.kind!=="referenced")continue;const rt=o.find(Te=>Te.id===xe.ref);rt&&(q.set(rt.id,rt),rt.name&&q.set(rt.name,rt),q.has(xe.ref)||q.set(xe.ref,rt))}}for(const xe of o)q.has(xe.id)||q.set(xe.id,xe),xe.name&&!q.has(xe.name)&&q.set(xe.name,xe);return q},[$t,o]),fn=v.useMemo(()=>{if(!c?.snapshotEval?.baselineSnapshotId)return"";const q=i.filter(xe=>xe.snapshotEval?.baselineSnapshotId===c.snapshotEval?.baselineSnapshotId);return q.length===1?q[0].id:""},[i,c?.snapshotEval?.baselineSnapshotId]);v.useEffect(()=>{c?.snapshotEval?.baselineSnapshotId&&R(q=>q||c.snapshotEval.baselineSnapshotId)},[c?.snapshotEval?.baselineSnapshotId]),v.useEffect(()=>{if(st&&i.some(q=>q.id===st)){H(st);return}fn&&H(q=>q||fn)},[st,i,fn]),v.useEffect(()=>{if(!B)return;const q=window.setTimeout(()=>{En.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(q)},[B,re.length,ie]),v.useEffect(()=>()=>{z&&r.closeResultAssistantSession(z).catch(()=>{})},[z,r]),v.useEffect(()=>{const q=fe.current;if(!q)return;q.style.height="0px";const xe=Math.min(q.scrollHeight,160);q.style.height=`${Math.max(40,xe)}px`},[ce,B]);const{filteredScenarios:Xn,filteredTotalRuns:Cn,filteredPassCount:rr,displayPassRate:fr,displayAvgToolCalls:Wr,displayAvgLatency:oi,displayToolTokenUsage:li}=v.useMemo(()=>{if(!c)return{filteredScenarios:[],filteredTotalRuns:0,filteredPassCount:0,displayPassRate:0,displayAvgToolCalls:0,displayAvgLatency:0,displayToolTokenUsage:null};const q=xt?c.scenarios.filter(ft=>ft.agentId===xt||ft.agentName===xt):c.scenarios,xe=q.reduce((ft,Vt)=>ft+Vt.runs.length,0),rt=q.reduce((ft,Vt)=>ft+Vt.runs.filter(Ln=>Ln.passed).length,0),Te=q.reduce((ft,Vt)=>ft+Vt.runs.reduce((Ln,Qt)=>Ln+Qt.toolCalls.length,0),0),Pt=q.reduce((ft,Vt)=>ft+Vt.runs.reduce((Ln,Qt)=>Ln+Qt.duration,0),0);return{filteredScenarios:q,filteredTotalRuns:xe,filteredPassCount:rt,displayPassRate:xe===0?0:rt/xe,displayAvgToolCalls:xe===0?0:Te/xe,displayAvgLatency:xe===0?0:Math.round(Pt/xe),displayToolTokenUsage:bG(q.map(ft=>ft.toolTokenUsage))}},[c,xt]),tl=v.useMemo(()=>{const q={};return Xn.forEach(xe=>xe.runs.forEach(rt=>rt.toolCalls.forEach(Te=>{q[Te.name]=(q[Te.name]||0)+1}))),Object.entries(q).map(([xe,rt])=>({name:xe,count:rt})).sort((xe,rt)=>rt.count-xe.count)},[Xn]);if(f)return s.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Loading result..."});if(!c)return s.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Result not found"});const ye=Object.entries(c.mcpServerVersions??{}).map(([q,xe])=>`${q}: ${xe??"unknown"}`).join(", "),Ve=rr,ut=Math.max(0,Cn-Ve),kt=[{name:"Pass",value:Ve,color:"hsl(152, 69%, 40%)"},{name:"Fail",value:ut,color:"hsl(0, 72%, 51%)"}],Tt=q=>{N(xe=>{const rt=new Set(xe);return rt.has(q)?rt.delete(q):rt.add(q),rt})},Ot=(q,xe,rt,Te)=>`${q}:${xe}:${rt}:${Te}`,Pn=(q,xe)=>`${q}::${xe}`,He=q=>{E(xe=>{const rt=new Set(xe);return rt.has(q)?rt.delete(q):rt.add(q),rt})},Wt=q=>{const xe=!q.endsWith(":conversation");return C.has(q)?!xe:xe},Dt=new Map((T?.scenario_results??[]).map(q=>[q.scenario_id,q])),kn=async()=>{if(!(!c||!O)){$(!0);try{const q=await r.compareSnapshot(O,c.id);F(q)}finally{$(!1)}}},pn=async q=>{const xe=q||c.snapshotEval?.baselineSnapshotId;if(xe){R(xe),$(!0);try{const rt=await r.compareSnapshot(xe,c.id);F(rt)}catch(rt){Pe({title:"Could not review drift",description:rt instanceof Error?rt.message:String(rt),variant:"destructive"})}finally{$(!1)}}},pg=async()=>{if(!Y){Pe({title:"Select a configuration",description:"Choose which config should receive the new baseline.",variant:"destructive"});return}D(!0);try{const q=await r.generateSnapshotEvalBaseline(c.id,Y,K.trim()||void 0);k(xe=>[q.snapshot,...xe.filter(rt=>rt.id!==q.snapshot.id)]),R(q.snapshot.id),Pe({title:"Baseline updated",description:`${q.snapshot.name} is now linked to the selected config.`}),K.trim()||J(q.snapshot.name),c.snapshotEval?.applied&&pn(q.snapshot.id)}catch(q){Pe({title:"Could not accept new baseline",description:q instanceof Error?q.message:String(q),variant:"destructive"})}finally{D(!1)}},nl=async()=>{const q=ce.trim();if(!q||!c)return;const xe=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,rt={id:xe,role:"user",text:q,createdAt:new Date().toISOString()};he(""),te(Te=>[...Te,rt]),ue(!0);try{let Te=z;if(!Te){const ft=await r.createResultAssistantSession(c.id);Te=ft.sessionId,M(ft.session.id),de(ft.session.pendingToolCalls),Ie({assistantAgentName:ft.session.selectedAssistantAgentName,provider:ft.session.provider,model:ft.session.model}),te(Vt=>{const Ln=Vt.some(la=>la.id===xe),Qt=ft.session.messages;return Ln?[...Qt,rt]:Qt})}const Pt=await r.sendResultAssistantMessage(Te,q);ci(Pt.session)}catch(Te){te(Pt=>Pt.filter(ft=>ft.id!==xe)),Pe({title:"MCP Labs Assistant error",description:Te instanceof Error?Te.message:String(Te),variant:"destructive"})}finally{ue(!1)}},kf=q=>{he(q),requestAnimationFrame(()=>fe.current?.focus())},ci=q=>{M(q.id),te(q.messages),de(q.pendingToolCalls),Ie({assistantAgentName:q.selectedAssistantAgentName,provider:q.provider,model:q.model})},Of=async q=>{if(z){ue(!0);try{const xe=await r.approveResultAssistantToolCall(z,q);ci(xe.session)}catch(xe){Pe({title:"Could not approve assistant action",description:xe instanceof Error?xe.message:String(xe),variant:"destructive"})}finally{ue(!1)}}},ru=async q=>{if(z){ue(!0);try{const xe=await r.denyResultAssistantToolCall(z,q);ci(xe.session)}catch(xe){Pe({title:"Could not deny assistant action",description:xe instanceof Error?xe.message:String(xe),variant:"destructive"})}finally{ue(!1)}}},As=(q,xe)=>{W("assistant"),Z(!0),oe(xe?.scenarioId??null),re.length===0&&te([{id:`msg-${Date.now()}`,role:"assistant",text:"Ask me to explain failures, tool usage, snapshot drift, or suggest what to inspect next in this result.",createdAt:new Date().toISOString()}]),q&&he(q)},oa=q=>{W("reports"),Z(!0)},hg=()=>{W("note"),Z(!0)},Vr=q=>{if(!c)return;if(!ve){Pe({title:"No scenario context",description:"Ask about a specific scenario or run first, then send the suggestion.",variant:"destructive"});return}const xe=o.find(Te=>Te.id===ve)??o.find(Te=>Te.name===ve);if(!xe){Pe({title:"Scenario not found in library",description:`Could not find library scenario '${ve}' to open in Scenario Assistant.`,variant:"destructive"});return}const rt=[`I am sending a suggestion from the Result Assistant for scenario '${ve}' based on run '${c.id}'.`,"Please review the suggestion, check it against the current scenario configuration, and propose concrete updates to the Checks and/or Value Capture Rules if appropriate.","","Result Assistant suggestion:",q].join(`
|
|
249
|
-
`);try{window.sessionStorage.setItem(xge,JSON.stringify({type:"result-assistant-handoff-v1",runId:c.id,configId:st||c.configId||"",scenarioId:xe.id,prompt:rt,sourceReply:q})),t(`/libraries/test-cases/${encodeURIComponent(xe.id)}?assistantHandoff=1`)}catch(Te){Pe({title:"Could not create handoff",description:Te instanceof Error?Te.message:String(Te),variant:"destructive"})}},Rf=q=>{c&&(et(!1),Xe(q),qt(kM(c.id)),Ce(!1),je(!0))},mg=()=>{c&&(et(!0),Xe(""),qt(kM(c.id)),Ce(!1),je(!0))},vg=async()=>{if(!c)return;if(!Re.trim()){Pe({title:"No markdown to write",description:"The selected assistant response is empty.",variant:"destructive"});return}Me(!0);try{const xe=await r.applyResultAssistantReport({runId:c.id,markdown:Re,outputPath:It.trim()||void 0,overwrite:ee});Pe({title:"Markdown report written",description:typeof xe.path=="string"&&xe.path?xe.path:xe.outputPath}),await De(c.id,typeof xe.path=="string"&&xe.path||xe.outputPath||void 0),B&&W("reports"),je(!1)}catch(xe){Pe({title:"Could not write markdown report",description:xe instanceof Error?xe.message:String(xe),variant:"destructive"})}finally{Me(!1)}},rl=async q=>{try{await navigator.clipboard.writeText(q),Pe({title:"Copied"})}catch(xe){Pe({title:"Could not copy",description:xe instanceof Error?xe.message:String(xe),variant:"destructive"})}},al=async()=>{if(c){x(!0);try{const q=g.trim();await r.updateRunNote(c.id,q||void 0),d(xe=>xe&&{...xe,runNote:q||void 0}),j(q),y(!1),Pe({title:"Run note saved"})}catch(q){Pe({title:"Could not save run note",description:q instanceof Error?q.message:String(q),variant:"destructive"})}finally{x(!1)}}};return s.jsxs("div",{className:`${B?"xl:flex xl:h-[calc(100vh-2rem-48px)] xl:min-h-0 xl:flex-col xl:overflow-hidden":""}`,children:[s.jsx("div",{className:`${B?"xl:shrink-0 xl:pb-6":"mb-6"}`,children:s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[s.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[s.jsx(le,{variant:"ghost",size:"icon",asChild:!0,children:s.jsx(wt,{to:"/results",children:s.jsx(ko,{className:"h-4 w-4"})})}),s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("h1",{className:"text-2xl font-bold font-mono",children:c.id}),s.jsx(zs,{rate:fr}),a&&c.snapshotEval?.applied&&s.jsxs(Je,{variant:"outline",className:"text-xs",children:["Snapshot policy · ",c.snapshotEval.mode," · ",c.snapshotEval.status]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[new Date(c.timestamp).toLocaleString()," ","·",xt?` Agent: ${xt} ·`:""," Config hash: ",s.jsx("span",{className:"font-mono",children:c.configHash})]}),a&&c.snapshotEval?.applied&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Baseline: ",s.jsx("span",{className:"font-mono",children:c.snapshotEval.baselineSnapshotId})," · score: ",c.snapshotEval.overallScore]})]})]}),s.jsxs("div",{className:"ml-auto flex shrink-0 flex-wrap items-center justify-end gap-2",children:[ye?s.jsxs("span",{className:"inline-flex items-center rounded-sm border border-border/60 bg-muted/30 px-1.5 py-1 text-[11px] text-muted-foreground",children:[s.jsx("span",{className:"font-medium",children:"MCP:"}),s.jsx("span",{className:"ml-1 font-mono",children:ye})]}):null,a&&c.snapshotEval?.applied&&s.jsxs(le,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>{pn()},disabled:L,children:[s.jsx(LS,{className:"h-3.5 w-3.5"}),L?"Reviewing drift...":"Review Drift"]}),s.jsxs(le,{variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>{const q=yge(c),xe=new Blob([q],{type:"text/html"}),rt=URL.createObjectURL(xe),Te=document.createElement("a");Te.href=rt,Te.download=`mcplab-report-${c.id}.html`,Te.click(),URL.revokeObjectURL(rt)},children:[s.jsx(ja,{className:"h-3.5 w-3.5"}),"Download Report"]}),s.jsxs(le,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>oa(),disabled:Nn,children:[s.jsx(Bl,{className:"h-3.5 w-3.5"}),Nn?"Reference Reports...":`Reference Reports${Et.length?` (${Et.length})`:""}`]}),s.jsxs(le,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>hg(),children:[s.jsx(Bl,{className:"h-3.5 w-3.5"}),"Run Note"]}),s.jsxs(le,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>As(),children:[s.jsx(ya,{className:"h-3.5 w-3.5"}),"MCP Labs Assistant"]})]})]})}),s.jsxs("div",{className:`grid gap-6 items-start ${B?Ae?"xl:grid-cols-[minmax(0,1fr)_52rem] xl:flex-1 xl:min-h-0 xl:overflow-hidden":"xl:grid-cols-[minmax(0,1fr)_28rem] xl:flex-1 xl:min-h-0 xl:overflow-hidden":"grid-cols-1"}`,children:[s.jsxs("div",{className:`min-w-0 space-y-6 ${B?"xl:h-full xl:min-h-0 xl:overflow-y-auto xl:pr-2":""}`,children:[a&&c.snapshotEval?.applied&&s.jsxs(qe,{className:"border-amber-500/30",children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Snapshot Drift Review"})}),s.jsxs(We,{className:"space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[s.jsxs(Je,{variant:"outline",children:["Mode: ",c.snapshotEval.mode]}),s.jsxs(Je,{variant:"outline",children:["Status: ",c.snapshotEval.status]}),s.jsxs(Je,{variant:"outline",children:["Overall score: ",c.snapshotEval.overallScore]}),s.jsxs(Je,{variant:"outline",className:"font-mono",children:["Baseline: ",c.snapshotEval.baselineSnapshotId]})]}),c.snapshotEval.impactedScenarios.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Impacted scenarios: ",c.snapshotEval.impactedScenarios.join(", ")]}),s.jsxs("div",{className:"grid gap-3 lg:grid-cols-[1.2fr_1fr_auto] items-end",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Target config for baseline update"}),s.jsxs(cn,{value:Y,onValueChange:H,children:[s.jsx(tn,{className:"h-8",children:s.jsx(un,{placeholder:"Select config to update"})}),s.jsx(nn,{children:i.map(q=>s.jsx(lt,{value:q.id,children:q.name},q.id))})]}),!Y&&s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Tip: open results from the Run page to prefill the config automatically."})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"New snapshot name (optional)"}),s.jsx("div",{className:"relative",children:s.jsx("input",{value:K,onChange:q=>J(q.target.value),placeholder:`Snapshot ${c.id}`,className:"h-8 w-full rounded-md border bg-background px-2 text-xs"})})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(le,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5",onClick:()=>{pn()},disabled:L,children:[s.jsx(Na,{className:`h-3.5 w-3.5 ${L?"animate-spin":""}`}),"Review Drift"]}),s.jsx(le,{type:"button",size:"sm",className:"h-8",onClick:()=>{pg()},disabled:Q||fr!==1,children:Q?"Accepting...":"Accept as New Baseline"})]})]}),fr!==1&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"Baseline updates require a fully passing run (same rule as snapshot creation)."})]})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-6",children:[s.jsx(is,{title:"Scenarios",value:Xn.length,icon:O1}),s.jsx(is,{title:"Total Runs",value:Cn,icon:u$}),s.jsx(is,{title:"Pass Rate",value:`${Math.round(fr*100)}%`,icon:fd}),s.jsx(is,{title:"Avg Tool Calls",value:OM(Wr),icon:Kl}),s.jsx(is,{title:"Avg Latency",value:`${oi}ms`,icon:b$}),s.jsx(is,{title:"Tool Tokens",value:xo(li?.totalTokens),icon:os})]}),s.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[s.jsxs(qe,{children:[s.jsx(St,{className:"pb-2",children:s.jsx(Nt,{className:"text-base",children:"Pass / Fail"})}),s.jsxs(We,{className:"flex items-center justify-center",children:[s.jsxs(cfe,{width:180,height:180,children:[s.jsx(si,{data:kt,dataKey:"value",innerRadius:50,outerRadius:75,paddingAngle:3,children:kt.map((q,xe)=>s.jsx(wv,{fill:q.color},xe))}),s.jsx(Mr,{})]}),s.jsxs("div",{className:"ml-4 space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[s.jsx("div",{className:"h-3 w-3 rounded-full bg-success"}),Ve," passed"]}),s.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[s.jsx("div",{className:"h-3 w-3 rounded-full bg-destructive"}),ut," failed"]})]})]})]}),s.jsxs(qe,{children:[s.jsx(St,{className:"pb-2",children:s.jsx(Nt,{className:"text-base",children:"Tool Usage"})}),s.jsx(We,{children:s.jsx($h,{width:"100%",height:180,children:s.jsxs(lfe,{data:tl,layout:"vertical",children:[s.jsx(Wi,{type:"number",tick:{fontSize:11}}),s.jsx(Vi,{type:"category",dataKey:"name",tick:{fontSize:11},width:120}),s.jsx(Mr,{}),s.jsx(Qo,{dataKey:"count",fill:"hsl(38, 92%, 50%)",radius:[0,4,4,0]})]})})})]})]}),s.jsxs(qe,{children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx(Nt,{className:"text-base",children:"Scenarios"}),s.jsxs(le,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5 px-2 text-xs",onClick:()=>As("Summarize the scenario results in this run. Highlight failed scenarios/checks first, then mention notable tool usage and extracted values."),children:[s.jsx(ya,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]})}),s.jsxs(We,{className:"p-0",children:[a&&s.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-b p-3",children:[s.jsxs("div",{className:"min-w-60 space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Snapshot"}),s.jsxs(cn,{value:O,onValueChange:R,children:[s.jsx(tn,{className:"h-8",children:s.jsx(un,{placeholder:"Select snapshot"})}),s.jsx(nn,{children:_.map(q=>s.jsx(lt,{value:q.id,children:q.name},q.id))})]})]}),s.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:!O||L,onClick:()=>{kn()},children:L?"Comparing...":"Compare Snapshot"}),T&&s.jsxs(Je,{variant:"outline",className:"h-8 px-2 py-0 text-xs",children:["Overall snapshot score: ",T.overall_score]})]}),s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs(Mt,{children:[s.jsx(tt,{className:"w-8"}),s.jsx(tt,{children:"Scenario"}),s.jsx(tt,{children:"Agent"}),s.jsx(tt,{children:"Runs"}),s.jsx(tt,{children:"Pass Rate"}),s.jsx(tt,{children:"Tool Calls"}),s.jsx(tt,{children:"Tool Tokens"}),s.jsx(tt,{children:"Snapshot"})]})}),s.jsx(Lr,{children:Xn.map(q=>{const xe=Pn(q.scenarioId,q.agentName),rt=q.scenarioName||q.scenarioId;return s.jsx(Ti,{open:S.has(xe),onOpenChange:()=>Tt(xe),asChild:!0,children:s.jsxs(s.Fragment,{children:[s.jsx(Ls,{asChild:!0,children:s.jsxs(Mt,{className:"cursor-pointer hover:bg-muted/50",children:[s.jsx(ze,{children:s.jsx(Gt,{className:`h-4 w-4 transition-transform ${S.has(xe)?"rotate-180":""}`})}),s.jsx(ze,{className:"font-medium text-sm",children:q.scenarioName}),s.jsx(ze,{className:"text-sm",children:q.agentName}),s.jsx(ze,{className:"font-mono text-sm",children:q.runs.length}),s.jsx(ze,{children:s.jsx(zs,{rate:q.passRate})}),s.jsx(ze,{className:"font-mono text-sm",children:OM(q.avgToolCalls)}),s.jsx(ze,{className:"font-mono text-sm",children:xo(q.toolTokenUsage?.totalTokens)}),s.jsx(ze,{children:(()=>{const Te=Dt.get(q.scenarioId);if(!Te)return s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"});const Pt=Te.status==="Match"?"bg-success/15 text-success":Te.status==="Warn"?"bg-amber-500/15 text-amber-600":"bg-destructive/15 text-destructive";return s.jsxs(Je,{variant:"outline",className:`text-xs ${Pt}`,children:[Te.status," · ",Te.score]})})()})]})}),s.jsx(Ii,{asChild:!0,children:s.jsx("tr",{children:s.jsx("td",{colSpan:8,className:"p-0",children:s.jsxs("div",{className:"bg-muted/30 p-4 space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border bg-card px-3 py-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-xs font-semibold",children:"Scenario details"}),s.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[rt," · ",q.agentName," · ",Math.round(q.passRate*100),"% pass rate · ",xo(q.toolTokenUsage?.totalTokens)," tool tokens"]})]}),s.jsxs(le,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>As(`Explain why scenario '${rt}' failed (agent: ${q.agentName}). Summarize the likely cause from the result details and suggest what to inspect next.`,{scenarioId:q.scenarioId}),children:[s.jsx(ya,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]}),(()=>{const Te=Dt.get(q.scenarioId);return!Te||Te.reasons.length===0?null:s.jsxs("div",{className:"rounded-md border bg-card p-2",children:[s.jsx("p",{className:"mb-1 text-xs font-semibold text-muted-foreground",children:"Snapshot reasons"}),s.jsxs("p",{className:"mb-1 text-[11px] text-muted-foreground",children:["Baseline agents: ",Te.baseline_agents.join(", ")||"—"," · observed agents: ",Te.observed_agents.join(", ")||"—"]}),s.jsx("ul",{className:"space-y-1 text-xs text-muted-foreground",children:Te.reasons.map((Pt,ft)=>s.jsxs("li",{children:["• ",Pt]},ft))})]})})(),q.runs.map(Te=>s.jsxs("div",{className:"flex items-start gap-3 rounded-md border bg-card p-3 text-sm",children:[s.jsx("div",{className:"mt-0.5",children:Te.passed?s.jsx(Kl,{className:"h-4 w-4 text-success"}):s.jsx(lh,{className:"h-4 w-4 text-destructive"})}),s.jsxs("div",{className:"flex-1 space-y-1",children:[(()=>{const Pt=an.get(q.scenarioId),ft=Pt?Nge(Pt.evalRules,Te.failureReasons):[],Vt=ft.filter(Qt=>Qt.status==="failed"),Ln=ft.filter(Qt=>Qt.status==="passed");return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:["Run #",Te.runIndex+1]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[Te.duration,"ms"]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[xo(Te.toolTokenUsage?.totalTokens)," tool tokens"]}),!Te.passed&&s.jsx(Je,{variant:"outline",className:"h-5 border-destructive/30 bg-destructive/10 text-destructive text-[10px]",children:"Failed"})]}),Te.failureReasons.length>0&&s.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-2",children:[s.jsxs("p",{className:"mb-1 flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-destructive",children:[s.jsx(lh,{className:"h-3.5 w-3.5"}),"Failure reasons"]}),s.jsx("ul",{className:"space-y-1 text-xs text-destructive",children:Te.failureReasons.map((Qt,la)=>s.jsxs("li",{children:["• ",IM(Qt)]},la))})]}),ft.length>0&&s.jsx(Ti,{open:Wt(Ot(q.scenarioId,q.agentName,Te.runIndex,"checks")),onOpenChange:()=>He(Ot(q.scenarioId,q.agentName,Te.runIndex,"checks")),children:s.jsxs("div",{className:"rounded-md border bg-muted/20 p-2",children:[s.jsx(Ls,{asChild:!0,children:s.jsxs("button",{type:"button",className:"mb-2 flex w-full flex-wrap items-center gap-2 text-left",children:[s.jsx(Gt,{className:`h-3.5 w-3.5 transition-transform ${Wt(Ot(q.scenarioId,q.agentName,Te.runIndex,"checks"))?"rotate-180":""}`}),s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Checks"}),s.jsxs(Je,{variant:"outline",className:"h-5 border-success/30 bg-success/10 text-success text-[10px]",children:[Ln.length," passed"]}),s.jsxs(Je,{variant:"outline",className:`h-5 text-[10px] ${Vt.length>0?"border-destructive/30 bg-destructive/10 text-destructive":""}`,children:[Vt.length," failed"]})]})}),s.jsx(Ii,{children:s.jsx("div",{className:"space-y-1",children:ft.map((Qt,la)=>s.jsxs("div",{className:`flex items-start justify-between gap-2 rounded-md border px-2 py-1.5 text-xs ${Qt.status==="failed"?"border-destructive/20 bg-destructive/5":"border-success/20 bg-success/5"}`,children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[Qt.status==="failed"?s.jsx(lh,{className:"h-3.5 w-3.5 shrink-0 text-destructive"}):s.jsx(Kl,{className:"h-3.5 w-3.5 shrink-0 text-success"}),s.jsx("span",{className:"font-medium",children:Age(Qt.rule)})]}),Qt.failureReason&&s.jsx("p",{className:"mt-1 pl-5 text-[11px] text-destructive",children:IM(Qt.failureReason)})]}),s.jsx(Je,{variant:"outline",className:`shrink-0 text-[10px] ${Qt.status==="failed"?"border-destructive/30 text-destructive":"border-success/30 text-success"}`,children:Qt.status})]},`${Qt.rule.type}-${Qt.rule.value}-${la}`))})})]})})]})})(),s.jsx(Ti,{open:Wt(Ot(q.scenarioId,q.agentName,Te.runIndex,"extracts")),onOpenChange:()=>He(Ot(q.scenarioId,q.agentName,Te.runIndex,"extracts")),children:s.jsxs("div",{className:"rounded-md border border-violet-500/20 bg-violet-500/5 p-2",children:[s.jsx(Ls,{asChild:!0,children:s.jsxs("button",{type:"button",className:"mb-2 flex w-full flex-wrap items-center justify-between gap-2 text-left",children:[s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[s.jsx(Gt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${Wt(Ot(q.scenarioId,q.agentName,Te.runIndex,"extracts"))?"rotate-180":""}`}),s.jsxs("p",{className:"flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:[s.jsx(O1,{className:"h-3.5 w-3.5 text-violet-600"}),"Extracted values"]})]}),s.jsxs(Je,{variant:"outline",className:"h-5 text-[10px]",children:[Object.keys(Te.extractedValues??{}).length," total"]})]})}),s.jsx(Ii,{children:Object.keys(Te.extractedValues??{}).length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No extracted values captured for this run."}):s.jsx("div",{className:"grid gap-1.5 sm:grid-cols-2",children:Object.entries(Te.extractedValues??{}).map(([Pt,ft])=>s.jsxs("div",{className:"rounded-md border bg-background px-2 py-1.5 text-xs",children:[s.jsx("div",{className:"mb-0.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:Pt}),s.jsx("div",{className:"font-mono break-all text-foreground",children:ft===null?"null":String(ft)})]},Pt))})})]})}),s.jsx(Ti,{open:Wt(Ot(q.scenarioId,q.agentName,Te.runIndex,"tools")),onOpenChange:()=>He(Ot(q.scenarioId,q.agentName,Te.runIndex,"tools")),children:s.jsxs("div",{className:"rounded-md border border-sky-500/20 bg-sky-500/5 p-2",children:[s.jsx(Ls,{asChild:!0,children:s.jsxs("button",{type:"button",className:"mb-2 flex w-full flex-wrap items-center justify-between gap-2 text-left",children:[s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[s.jsx(Gt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${Wt(Ot(q.scenarioId,q.agentName,Te.runIndex,"tools"))?"rotate-180":""}`}),s.jsxs("p",{className:"flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:[s.jsx(os,{className:"h-3.5 w-3.5 text-sky-600"}),"Tool call sequence"]})]}),s.jsxs(Je,{variant:"outline",className:"h-5 text-[10px]",children:[Te.toolCalls.length," total"]})]})}),s.jsx(Ii,{children:Te.toolCalls.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No tool calls captured for this run."}):s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"flex flex-wrap gap-1",children:Te.toolCalls.map((Pt,ft)=>s.jsxs(Je,{variant:"outline",className:"font-mono text-xs bg-background",children:[s.jsxs("span",{className:"mr-1 text-muted-foreground",children:["#",ft+1]}),Pt.name,s.jsxs("span",{className:"ml-1 text-muted-foreground",children:[Pt.duration,"ms"]})]},ft))}),s.jsxs("div",{className:"rounded-md border bg-background p-2",children:[s.jsxs("div",{className:"mb-1.5 flex items-center justify-between gap-2",children:[s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Tool token estimate"}),s.jsx(Je,{variant:"outline",className:"h-5 text-[10px]",children:"estimated"})]}),Object.keys(Te.toolTokenUsageByTool??{}).length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"n/a"}):s.jsx("div",{className:"grid gap-1.5 sm:grid-cols-2",children:Object.entries(Te.toolTokenUsageByTool??{}).map(([Pt,ft])=>s.jsxs("div",{className:"rounded border bg-muted/30 px-2 py-1.5 text-xs",children:[s.jsx("div",{className:"font-mono text-[11px]",children:Pt}),s.jsxs("div",{className:"text-muted-foreground",children:["total: ",xo(ft.totalTokens)," · in: ",xo(ft.inputTokens)," · out: ",xo(ft.outputTokens)]})]},Pt))})]})]})})]})}),s.jsx(Ti,{open:Wt(Ot(q.scenarioId,q.agentName,Te.runIndex,"final")),onOpenChange:()=>He(Ot(q.scenarioId,q.agentName,Te.runIndex,"final")),children:s.jsxs("div",{className:"rounded-md border border-muted-foreground/20 bg-card p-2",children:[s.jsx(Ls,{asChild:!0,children:s.jsxs("button",{type:"button",className:"mb-2 flex w-full items-center gap-2 text-left",children:[s.jsx(Gt,{className:`h-3.5 w-3.5 transition-transform ${Wt(Ot(q.scenarioId,q.agentName,Te.runIndex,"final"))?"rotate-180":""}`}),s.jsxs("p",{className:"flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:[s.jsx(ba,{className:"h-3.5 w-3.5"}),"Final answer"]})]})}),s.jsx(Ii,{children:s.jsx(RS,{text:Te.finalAnswer||"No final answer captured.",maxLength:1200,className:"text-xs text-foreground"})})]})}),s.jsx(Ti,{open:Wt(Ot(q.scenarioId,q.agentName,Te.runIndex,"conversation")),onOpenChange:()=>He(Ot(q.scenarioId,q.agentName,Te.runIndex,"conversation")),children:s.jsxs("div",{className:"rounded-md border bg-muted/10 p-2",children:[s.jsxs("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[s.jsx(Ls,{asChild:!0,children:s.jsxs("button",{type:"button",className:"flex min-w-0 items-center gap-2 text-left",children:[s.jsx(Gt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${Wt(Ot(q.scenarioId,q.agentName,Te.runIndex,"conversation"))?"rotate-180":""}`}),s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Conversation trace"})]})}),s.jsx("div",{className:"flex flex-wrap gap-2",children:s.jsxs(le,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>As(`Explain Run #${Te.runIndex+1} for scenario '${rt}'. It ${Te.passed?"passed":"failed"} in ${Te.duration}ms. Focus on the tool sequence and ${Te.passed?"why it passed":"what caused the failure"}.`,{scenarioId:q.scenarioId}),children:[s.jsx(ya,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})})]}),s.jsx(Ii,{children:s.jsx("div",{className:"space-y-2 rounded-md border bg-muted/20 p-2",children:Te.conversation.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No conversation trace captured."}):Te.conversation.map(Pt=>s.jsx(jge,{item:Pt,fallbackUserPrompt:an.get(q.scenarioId)?.prompt},Pt.id))})}),!Wt(Ot(q.scenarioId,q.agentName,Te.runIndex,"conversation"))&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"Expand to inspect user/assistant/tool messages for this run."})]})})]})]},Te.runIndex))]})})})})]})},xe)})})]})]})]})]}),B&&s.jsxs("div",{className:"min-w-0 space-y-0 xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[s.jsx(yC,{value:$e,onValueChange:q=>W(q),className:"min-w-0 -mb-px px-3 pt-1",children:s.jsxs(eg,{className:"h-auto w-full justify-start rounded-none border-b bg-transparent p-0",children:[s.jsx(Fi,{value:"assistant",className:"-mb-px h-9 rounded-none rounded-t border border-border border-b-border bg-muted/20 px-3 text-xs text-muted-foreground data-[state=active]:z-10 data-[state=active]:bg-card data-[state=active]:text-foreground data-[state=active]:border-border data-[state=active]:border-b-card data-[state=active]:shadow-none",children:"Assistant"}),s.jsx(Fi,{value:"reports",className:"-mb-px h-9 rounded-none rounded-t border border-border border-b-border bg-muted/20 px-3 text-xs text-muted-foreground data-[state=active]:z-10 data-[state=active]:bg-card data-[state=active]:text-foreground data-[state=active]:border-border data-[state=active]:border-b-card data-[state=active]:shadow-none",children:"Reports"}),s.jsx(Fi,{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"})]})}),$e==="assistant"?s.jsxs(qe,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[s.jsx(St,{className:"border-b px-4 py-3",children:s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(Nt,{className:"flex items-center gap-2 text-base",children:[s.jsx(ya,{className:"h-4 w-4 text-amber-500"}),"MCP Labs Assistant"]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(le,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>ae(q=>!q),children:[Ae?s.jsx(nx,{className:"h-3.5 w-3.5"}):s.jsx(rx,{className:"h-3.5 w-3.5"}),Ae?"Compact":"Expand"]}),s.jsx(le,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>Z(!1),children:"Hide"})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Ask questions about this run result, failures, tool usage, and snapshot drift."})]})}),s.jsxs(We,{className:"flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1",children:[s.jsx(Rm,{className:"min-h-0 flex-1 bg-muted/15 px-4 py-4",children:s.jsxs("div",{className:"space-y-3 pr-2",children:[re.map((q,xe)=>{const rt=q.role==="user",Te=q.role==="assistant",Pt=q.role==="system",ft=q.role==="tool",Vt=q.pendingToolCallId?G.find(sl=>sl.id===q.pendingToolCallId):void 0,Ln=Te&&!!q.pendingToolCallId;if(ft&&/^(Approved|Denied) tool call\b/i.test(String(q.text??"").trim()))return null;Vt?.server??q.toolRequestServer;const Qt=Vt?.tool??q.toolRequestName,la=Vt?.publicToolName??q.toolRequestPublicName,Ft=Te&&!Ln&&Sge(q.text,!!ve);if(Ln){const sl=Qt??la??"unknown_tool";return Qt&&Qt.replace(/^mcplab_/,"").replace(/_/g," "),s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700",children:s.jsx(ba,{className:"h-3 w-3"})}),s.jsxs("details",{open:!!Vt,className:"group min-w-0 w-full max-w-[92%] overflow-hidden rounded-md border border-border/60 bg-background",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2",children:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(os,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:`Tool call ${sl}`}),s.jsx("span",{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${Vt?"bg-amber-100 text-amber-900":"bg-muted text-muted-foreground"}`,children:Vt?"Needs approval":"Completed"})]})}),s.jsx(Gt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),s.jsxs("div",{className:"min-w-0 space-y-2 border-t border-border/50 px-3 py-2",children:[s.jsx(dd,{text:q.text,className:"text-sm"}),Vt&&s.jsxs(s.Fragment,{children:[s.jsx("pre",{className:"max-h-40 min-w-0 w-full max-w-full overflow-x-auto overflow-y-auto whitespace-pre-wrap break-words rounded border bg-muted/50 p-2 text-xs",children:s.jsx("code",{className:"break-words",children:JSON.stringify(Vt.arguments??{},null,2)})}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(le,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:ie,onClick:()=>{ru(Vt.id)},children:"Deny"}),s.jsx(le,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:ie,onClick:()=>{Of(Vt.id)},children:"Approve"})]})]})]})]})]},`${q.id??`${q.role}-${xe}`}:${Vt?"pending":"completed"}`)}const Tf=rt||Te&&!ft&&!Pt;return s.jsxs("div",{className:`flex items-start gap-2 ${rt?"justify-end":"justify-start"}`,children:[!rt&&s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700",children:Pt?s.jsx(y$,{className:"h-3 w-3"}):s.jsx(ba,{className:"h-3 w-3"})}),s.jsxs("div",{className:"relative max-w-[92%]",children:[s.jsxs("div",{className:`max-w-full rounded-md border p-3 text-sm ${rt?"border-primary/20 bg-primary/10":Pt?"border-amber-400/30 bg-amber-50/70":ft?"border-blue-300/30 bg-blue-50/50":"border-border/80 bg-background shadow-sm"}`,children:[!(rt||Pt)&&s.jsx("p",{className:`mb-2 text-[11px] font-semibold text-muted-foreground ${rt?"text-right":""}`,children:ft?"Tool":"Assistant"}),s.jsx(dd,{text:q.text,className:"text-sm"}),Ft&&s.jsxs("div",{className:"mt-3 flex max-w-full flex-wrap justify-end gap-2 overflow-x-auto pb-1",children:[s.jsxs(le,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>Vr(q.text),children:[s.jsx(ya,{className:"h-3.5 w-3.5"}),"Send to Scenario Assistant"]}),s.jsxs(le,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>Rf(q.text),children:[s.jsx(os,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})]}),!Ft&&Te&&!Ln&&s.jsx("div",{className:"mt-3 flex max-w-full justify-end overflow-x-auto pb-1",children:s.jsxs(le,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>Rf(q.text),children:[s.jsx(os,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})})]}),Tf&&s.jsx(le,{type:"button",variant:"ghost",size:"icon",className:"absolute -right-8 bottom-1 h-6 w-6 text-muted-foreground",onClick:()=>{rl(q.text)},"aria-label":"Copy message",title:"Copy message",children:s.jsx(zi,{className:"h-3.5 w-3.5"})})]}),rt&&s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-primary/30 bg-primary/15 text-primary",children:s.jsx(zS,{className:"h-3 w-3"})})]},q.id??`${q.role}-${xe}`)}),G.filter(q=>!re.some(xe=>xe.pendingToolCallId===q.id)).length>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Pending actions (approve/deny)"}),G.filter(q=>!re.some(xe=>xe.pendingToolCallId===q.id)).map(q=>s.jsxs("details",{open:!0,className:"group min-w-0 rounded-md border bg-background",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-2 p-3",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"break-all font-mono text-xs font-semibold",children:q.publicToolName}),s.jsxs("p",{className:"break-all text-xs text-muted-foreground",children:[q.server,"::",q.tool]})]}),s.jsx(Gt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),s.jsxs("div",{className:"border-t px-3 pb-3 pt-2",children:[s.jsx("pre",{className:"max-h-48 min-w-0 w-full max-w-full overflow-x-auto overflow-y-auto whitespace-pre-wrap break-words rounded border bg-muted/50 p-2 text-xs",children:s.jsx("code",{className:"break-words",children:JSON.stringify(q.arguments??{},null,2)})}),s.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[s.jsx(le,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:ie,onClick:()=>{ru(q.id)},children:"Deny"}),s.jsx(le,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:ie,onClick:()=>{Of(q.id)},children:"Approve"})]})]})]},q.id))]}),ie&&s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700",children:s.jsx(ba,{className:"h-3 w-3"})}),s.jsxs("div",{className:"inline-flex items-center gap-2 rounded-md border bg-background px-3 py-2 text-sm text-muted-foreground",children:[s.jsx(or,{className:"h-4 w-4 animate-spin"}),"Thinking..."]})]}),s.jsx("div",{ref:En})]})}),s.jsx("div",{className:"border-t bg-background px-4 py-3",children:s.jsxs("div",{className:"rounded-xl border bg-background p-2 shadow-sm",children:[s.jsx(qa,{ref:fe,value:ce,onChange:q=>he(q.target.value),placeholder:"Ask about this result...",rows:1,className:"min-h-10 max-h-40 resize-none border-0 bg-transparent px-2 py-1 text-sm shadow-none focus-visible:ring-0 focus-visible:ring-offset-0",onKeyDown:q=>{q.key==="Enter"&&!q.shiftKey&&(q.preventDefault(),ie||nl())}}),s.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 px-1 pt-1",children:[s.jsxs(Zc,{children:[s.jsx(eu,{asChild:!0,children:s.jsxs(le,{type:"button",variant:"ghost",size:"sm",className:"h-7 shrink-0 gap-1 px-1.5 text-[11px] font-normal text-muted-foreground/80 hover:text-muted-foreground",disabled:ie,children:[s.jsx(ms,{className:"h-3 w-3"}),"Snippets",s.jsx(Gt,{className:"h-3 w-3"})]})}),s.jsxs(el,{align:"start",className:"w-[360px]",children:[s.jsx(mC,{children:"Result Assistant Snippets"}),s.jsx(vC,{}),bge.map(q=>s.jsx(yr,{className:"items-start whitespace-normal px-2 py-2",onSelect:()=>kf(q.prompt),children:s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("div",{className:"text-xs font-medium leading-tight",children:q.label}),s.jsx("div",{className:"text-[11px] leading-snug text-muted-foreground",children:q.description})]})},q.label))]})]}),s.jsx(le,{type:"button",size:"icon",className:"h-8 w-8 shrink-0 rounded-full",onClick:()=>{nl()},disabled:ie||!ce.trim(),"aria-label":"Send assistant message",title:"Send assistant message",children:ie?s.jsx(or,{className:"h-4 w-4 animate-spin"}):s.jsxs(s.Fragment,{children:[s.jsx(x$,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Ask"})]})})]})]})})]})]}):$e==="reports"?s.jsxs(qe,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[s.jsx(St,{className:"border-b px-4 py-3",children:s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(Nt,{className:"flex items-center gap-2 text-base",children:[s.jsx(Bl,{className:"h-4 w-4 text-muted-foreground"}),"Reference Reports"]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(le,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>ae(q=>!q),children:[Ae?s.jsx(nx,{className:"h-3.5 w-3.5"}):s.jsx(rx,{className:"h-3.5 w-3.5"}),Ae?"Compact":"Expand"]}),s.jsx(le,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>Z(!1),children:"Hide"})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Review markdown reports for this run while keeping the result visible."})]})}),s.jsxs(We,{className:"flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1",children:[(Nn||Et.length===0||Et.length>1)&&s.jsx("div",{className:"border-b px-4 py-3",children:Nn?s.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading reference reports..."}):Et.length===0?s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"No reference reports for this run yet."}),s.jsxs(le,{type:"button",size:"sm",variant:"outline",className:"shrink-0 gap-1.5",onClick:()=>mg(),children:[s.jsx(ms,{className:"h-3.5 w-3.5"}),"New Report"]})]}):s.jsx("div",{className:"space-y-2",children:Et.length>1?s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Selected report"}),s.jsxs(cn,{value:ur,onValueChange:Dn,children:[s.jsx(tn,{className:"h-8",children:s.jsx(un,{placeholder:"Select a report"})}),s.jsx(nn,{children:Et.map(q=>s.jsx(lt,{value:q.relativePath,children:q.name},q.path))})]})]}):null})}),s.jsx(Rm,{className:"min-h-0 flex-1 bg-muted/15 px-4 py-4",children:Et.length===0?s.jsx("div",{className:"text-sm text-muted-foreground",children:"No report selected."}):Ur?s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(or,{className:"h-4 w-4 animate-spin"}),"Loading report..."]}):Yn?s.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive",children:["Could not load report: ",Yn]}):dr?s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"rounded-md border bg-background p-3",children:[s.jsx("p",{className:"font-mono text-xs font-semibold",children:dr.name}),s.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:dr.relativePath}),s.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:new Date(dr.mtime).toLocaleString()})]}),s.jsx("div",{className:"rounded-md border bg-background p-3",children:s.jsx(dd,{text:dr.content,className:"text-sm"})})]}):s.jsx("div",{className:"text-sm text-muted-foreground",children:"Select a report to preview."})})]})]}):s.jsxs(qe,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[s.jsx(St,{className:"border-b px-4 py-3",children:s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(Nt,{className:"flex items-center gap-2 text-base",children:[s.jsx(Bl,{className:"h-4 w-4 text-muted-foreground"}),"Run Note"]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(le,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>ae(q=>!q),children:[Ae?s.jsx(nx,{className:"h-3.5 w-3.5"}):s.jsx(rx,{className:"h-3.5 w-3.5"}),Ae?"Compact":"Expand"]}),s.jsx(le,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>Z(!1),children:"Hide"})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Add context for this run, such as server version or environment details."})]})}),s.jsx(We,{className:"flex h-[70vh] min-h-[520px] flex-col p-4 xl:h-auto xl:min-h-0 xl:flex-1",children:p?s.jsxs("div",{className:"w-full max-w-xl space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("p",{className:"text-xs font-medium",children:"Run note"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[g.length,"/500"]})]}),s.jsx(qa,{value:g,onChange:q=>j(q.target.value.slice(0,500)),placeholder:"Optional context for this run",rows:3,className:"min-h-20 resize"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(le,{size:"sm",onClick:()=>{al()},disabled:b,children:b?"Saving...":"Save note"}),s.jsx(le,{size:"sm",variant:"outline",onClick:()=>{j(c.runNote??""),y(!1)},disabled:b,children:"Cancel"})]})]}):s.jsxs("div",{className:"flex w-full max-w-3xl items-center gap-2 rounded-md border bg-muted/20 px-2 py-1 text-xs",children:[s.jsxs("div",{className:"min-w-0 flex items-center gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"Run note:"}),s.jsx("span",{className:`break-words ${c.runNote?"text-foreground":"text-muted-foreground"}`,children:c.runNote||"none"})]}),s.jsx(le,{size:"sm",variant:"ghost",className:"ml-auto h-6 px-2 text-xs",onClick:()=>y(!0),children:c.runNote?"Edit":"Add note"})]})})]})]}),s.jsx(Cs,{open:Ye,onOpenChange:q=>!Ne&&je(q),children:s.jsxs(Ya,{className:"max-w-2xl",children:[s.jsxs(Xa,{children:[s.jsx(Ja,{children:Be?"Create markdown report":"Approve MCP action: write markdown report"}),s.jsx(Za,{children:Be?"Write a custom markdown report and save it to the workspace.":s.jsxs(s.Fragment,{children:["This will call ",s.jsx("code",{children:"mcplab_write_markdown_report"})," via the local MCPLab MCP server."]})})]}),s.jsxs("div",{className:"space-y-3",children:[!Be&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Output path"}),s.jsx(mt,{value:It,onChange:q=>qt(q.target.value),placeholder:"mcplab/reports/result-assistant/my-report.md",disabled:Ne})]}),s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx(na,{checked:ee,onCheckedChange:q=>Ce(q===!0),disabled:Ne}),s.jsx("span",{children:"Overwrite if file exists"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:Be?"Markdown content":"Markdown preview (to be written)"}),s.jsx(qa,{value:Re,onChange:q=>Xe(q.target.value),rows:10,className:"font-mono text-xs",disabled:Ne})]})]}),s.jsxs(Qa,{children:[s.jsx(ts,{disabled:Ne,children:"Cancel"}),s.jsx(es,{onClick:q=>{q.preventDefault(),vg()},disabled:Ne,children:Ne?"Writing...":Be?"Save Report":"Approve & Write"})]})]})})]})]})};function jge({item:e,fallbackUserPrompt:t}){if(e.kind==="tool_call")return s.jsx(TM,{variant:"call",title:`Tool call · ${e.toolName||"unknown"}`,text:e.text});if(e.kind==="tool_result"){const d=e.ok?s.jsx(Kl,{className:"h-3.5 w-3.5 text-emerald-700 dark:text-emerald-300"}):s.jsx(lh,{className:"h-3.5 w-3.5 text-rose-700 dark:text-rose-300"});return s.jsx(TM,{variant:e.ok?"result_ok":"result_error",title:`Tool result · ${e.toolName||"unknown"} · ${e.ok?"ok":"error"}${typeof e.durationMs=="number"?` · ${e.durationMs}ms`:""}`,text:e.text,icon:d})}const n=e.kind==="user_prompt",r=RM(e.text,e.kind),a=t?RM(t,"user_prompt"):"",i=n&&!r&&a?a:r,o=n?"User prompt":e.kind==="assistant_final"?"Agent final":"Agent",c=n?zS:ba;return s.jsxs("div",{className:`flex items-start gap-2 text-xs ${n?"justify-end":"justify-start"}`,children:[!n&&s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:s.jsx(c,{className:"h-3 w-3"})}),s.jsxs("div",{className:`max-w-[90%] rounded-md p-2 ${n?"bg-primary/10":"bg-muted/50"}`,children:[s.jsx("p",{className:`mb-1 text-[11px] font-semibold text-muted-foreground ${n?"text-right":""}`,children:o}),n?s.jsx(RS,{text:i,maxLength:280,className:"text-xs"}):s.jsx(RS,{text:i,maxLength:500,className:"text-xs"})]}),n&&s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-primary/30 bg-primary/15 text-primary",children:s.jsx(c,{className:"h-3 w-3"})})]})}function RM(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 Sge(e,t){if(!t)return!1;const n=String(e??"").toLowerCase();if(!n.trim())return!1;const r=["check","checks","rule","rules","regex","pattern","value capture","extract rule","update","change","replace","modify","adjust","use ","set "],a=["change ","replace ","update ","use ","set the","suggested","you should","try ","text match failed","text must match pattern"];if(["i can only read","i don't have write access","i cannot directly edit","what happened","summary"].some(h=>n.includes(h))&&!a.some(h=>n.includes(h)))return!1;const o=r.some(h=>n.includes(h)),c=a.some(h=>n.includes(h)),d=/(^|\n)\s*[-*]\s+/.test(e)||/(^|\n)\s*\d+\.\s+/.test(e),f=/["'`][^"'`\n]{2,}["'`]/.test(e);return o&&(c||d||f)}function TM({variant:e,title:t,text:n,icon:r}){const[a,i]=v.useState(!1),o={call:"border-sky-500/30 bg-sky-500/10 text-sky-700 dark:text-sky-300",result_ok:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",result_error:"border-rose-500/30 bg-rose-500/10 text-rose-700 dark:text-rose-300"};return s.jsx(Ti,{open:a,onOpenChange:i,children:s.jsxs("div",{className:`rounded-md border p-2 text-xs ${o[e]}`,children:[s.jsx(Ls,{asChild:!0,children:s.jsxs("button",{type:"button",className:"flex w-full items-center justify-between gap-2 text-left",children:[s.jsxs("div",{className:"flex items-center gap-1.5 font-mono text-[11px]",children:[r??s.jsx(os,{className:"h-3.5 w-3.5"}),s.jsx("span",{children:t})]}),s.jsx("span",{className:"text-[11px] font-semibold",children:a?"Hide content":"Show content"})]})}),s.jsx(Ii,{children:s.jsx("p",{className:"mt-2 font-mono whitespace-pre-wrap text-foreground",children:n})})]})})}function RS({text:e,maxLength:t,className:n}){const[r,a]=v.useState(!1),i=e.length>t,o=r||!i?e:`${e.slice(0,t)}...`;return s.jsxs("div",{children:[s.jsx(dd,{text:o,className:n}),i&&s.jsx("button",{type:"button",className:"mt-1 text-[11px] font-medium text-primary hover:underline",onClick:()=>a(c=>!c),children:r?"Show less":"Show all"})]})}function Nge(e,t){return e.map(n=>{const r=Cge(n,t);return{rule:n,status:r?"failed":"passed",failureReason:r}})}function Cge(e,t){const n=e.type==="required_tool"?`Required tool not used: ${e.value}`:e.type==="forbidden_tool"?`Forbidden tool used: ${e.value}`:`Regex assertion failed: ${e.value}`,r=t.find(a=>a===n);if(r)return r;if(e.type==="response_contains"||e.type==="response_not_contains")return t.find(a=>a.startsWith("Regex assertion failed:")&&a.includes(e.value))}function Age(e){return e.type==="required_tool"?`Required tool · ${e.value}`:e.type==="forbidden_tool"?`Forbidden tool · ${e.value}`:e.type==="response_contains"?`Text must match pattern · ${e.value}`:e.type==="response_not_contains"?`Text must not match pattern · ${e.value}`:`${e.type} · ${e.value}`}function IM(e){const t=String(e??"").trim(),n=t.match(/^Regex assertion failed:\s*(.+)$/i);return n?`Text match failed: ${n[1]}`:t}const A1=["hsl(38, 92%, 50%)","hsl(200, 80%, 50%)","hsl(152, 69%, 40%)","hsl(280, 60%, 50%)","hsl(0, 72%, 51%)"];function _ge(e){const t=Array.from(new Set(e.scenarios.map(i=>i.scenarioId).filter(Boolean))),n=Array.from(new Set(e.scenarios.map(i=>i.agentId).filter(Boolean))),r=t.slice(0,2).join(", "),a=t.length>2?` +${t.length-2}`:"";return{scenarioCount:t.length,agentCount:n.length,scenarioPreview:r?`${r}${a}`:"n/a"}}const Ege=()=>{const{source:e}=Tn(),[t,n]=Vo(),[r,a]=v.useState([]),[i,o]=v.useState(!1),[c,d]=v.useState(new Set),[f,h]=v.useState("timestamp"),[p,y]=v.useState("desc"),[g,j]=v.useState("all"),x=t.get("mode")==="within-run"?"within-run":"runs",S=t.get("runId")??"",N=(t.get("agents")??"").split(",").map(W=>W.trim()).filter(Boolean),C=t.get("scenario")??"all",[E,_]=v.useState(x),[k,O]=v.useState(S),[R,T]=v.useState(N),[F,L]=v.useState(C),$=async()=>{o(!0);try{a(await e.listResults())}catch(W){Pe({title:"Could not load results",description:W instanceof Error?W.message:String(W),variant:"destructive"})}finally{o(!1)}};v.useEffect(()=>{let W=!0;return o(!0),e.listResults().then(ve=>{W&&a(ve)}).catch(ve=>{W&&Pe({title:"Could not load results",description:ve instanceof Error?ve.message:String(ve),variant:"destructive"})}).finally(()=>{W&&o(!1)}),()=>{W=!1}},[e]);const Y=W=>{if(f===W){y(ve=>ve==="asc"?"desc":"asc");return}h(W),y(W==="timestamp"?"desc":"asc")},H=W=>{d(ve=>{const oe=new Set(ve);return oe.has(W)?oe.delete(W):oe.add(W),oe})},K=v.useMemo(()=>{const W=new Set;return r.forEach(ve=>{ve.scenarios.forEach(oe=>{const be=String(oe.scenarioName??"").trim(),Ie=String(oe.scenarioId??"").trim(),Ye=be||Ie;Ye&&W.add(Ye)})}),Array.from(W).sort((ve,oe)=>ve.localeCompare(oe))},[r]),J=v.useMemo(()=>g==="all"?r:r.filter(W=>W.scenarios.some(ve=>{const oe=String(ve.scenarioName??"").trim(),be=String(ve.scenarioId??"").trim();return(oe||be)===g})),[r,g]),Q=v.useMemo(()=>[...J].sort((ve,oe)=>{let be=0;return f==="id"&&(be=ve.id.localeCompare(oe.id)),f==="timestamp"&&(be=new Date(ve.timestamp).getTime()-new Date(oe.timestamp).getTime()),f==="passRate"&&(be=ve.overallPassRate-oe.overallPassRate),f==="scenarios"&&(be=ve.totalScenarios-oe.totalScenarios),p==="asc"?be:-be}),[J,f,p]),D=v.useMemo(()=>Q.filter(W=>c.has(W.id)),[Q,c]),B=W=>f!==W?s.jsx(Hl,{className:"h-3.5 w-3.5 text-muted-foreground"}):p==="asc"?s.jsx(ds,{className:"h-3.5 w-3.5"}):s.jsx(Gt,{className:"h-3.5 w-3.5"}),Z=v.useMemo(()=>{const W=new Map;for(const ve of Q)W.set(ve.id,_ge(ve));return W},[Q]),z=W=>{const ve=Array.from(new Set(W.scenarios.map(oe=>oe.agentId).filter(Boolean)));return ve.slice(0,Math.min(2,ve.length))},M=W=>{_("within-run"),O(W.id),T(z(W)),L("all")},re=v.useMemo(()=>[...new Set(D.flatMap(W=>W.scenarios.map(ve=>ve.scenarioId)))],[D]),te=v.useMemo(()=>r.find(W=>W.id===k),[r,k]),G=v.useMemo(()=>{if(!te)return[];const W=new Map;for(const ve of te.scenarios)W.set(ve.agentId,ve.agentName||ve.agentId);return Array.from(W.entries()).map(([ve,oe])=>({id:ve,name:oe})).sort((ve,oe)=>ve.name.localeCompare(oe.name))},[te]),de=v.useMemo(()=>{if(!te)return[];const W=new Set;for(const ve of te.scenarios){const oe=String(ve.scenarioName??"").trim(),be=String(ve.scenarioId??"").trim(),Ie=oe||be;Ie&&W.add(Ie)}return Array.from(W).sort((ve,oe)=>ve.localeCompare(oe))},[te]),ce=v.useMemo(()=>R.join(","),[R]);v.useEffect(()=>{if(E!=="within-run"||r.length===0)return;let W=k;(!W||!r.some(Re=>Re.id===W))&&(W=r[0].id);const ve=r.find(Re=>Re.id===W),oe=(()=>{if(!ve)return[];const Re=new Map;for(const Xe of ve.scenarios)Re.set(Xe.agentId,Xe.agentName||Xe.agentId);return Array.from(Re.keys())})(),be=new Set(oe);let Ie=ce.split(",").map(Re=>Re.trim()).filter(Re=>!!Re).filter(Re=>be.has(Re));Ie.length===0&&oe.length>0&&(Ie=oe.slice(0,Math.min(2,oe.length)));const Ye=(()=>{if(!ve)return[];const Re=new Set;for(const Xe of ve.scenarios){const It=String(Xe.scenarioName??"").trim(),qt=String(Xe.scenarioId??"").trim(),ee=It||qt;ee&&Re.add(ee)}return new Set(Re)})(),je=F!=="all"&&!Ye.has(F)?"all":F;W!==k&&O(W),Ie.join(",")!==ce&&T(Ie),je!==F&&L(je)},[E,r,k,ce,F]),v.useEffect(()=>{const W=new URLSearchParams(t);E==="within-run"?(W.set("mode","within-run"),k?W.set("runId",k):W.delete("runId"),R.length>0?W.set("agents",R.join(",")):W.delete("agents"),F!=="all"?W.set("scenario",F):W.delete("scenario")):(W.delete("mode"),W.delete("runId"),W.delete("agents"),W.delete("scenario"));const ve=t.toString(),oe=W.toString();ve!==oe&&n(W,{replace:!0})},[E,k,R,F,n]);const he=v.useMemo(()=>{if(!te)return[];const W=new Map;for(const oe of te.scenarios){const be=String(oe.scenarioId??"").trim(),Ie=String(oe.scenarioName??"").trim(),Ye=Ie||be;if(!be&&!Ye)continue;const je=be||Ye,Re=W.get(je);if(Re){Re.byAgent[oe.agentId]=oe;continue}W.set(je,{scenarioId:be||Ye,scenarioName:Ie,displayLabel:Ye||be,byAgent:{[oe.agentId]:oe}})}const ve=Array.from(W.values()).sort((oe,be)=>{const Ie=(oe.displayLabel||oe.scenarioId).toLowerCase(),Ye=(be.displayLabel||be.scenarioId).toLowerCase();return Ie.localeCompare(Ye)});return F==="all"?ve:ve.filter(oe=>oe.displayLabel===F)},[te,F]),ie=v.useMemo(()=>{const W=new Map(G.map(ve=>[ve.id,ve]));return R.map(ve=>W.get(ve)).filter(ve=>!!ve)},[R,G]),ue=v.useMemo(()=>{if(!te||ie.length!==2)return null;const[W,ve]=ie;return{left:W,right:ve,link:`/compare/results?left=${encodeURIComponent(te.id)}&right=${encodeURIComponent(te.id)}&leftConfig=${encodeURIComponent(te.configId)}&rightConfig=${encodeURIComponent(te.configId)}&leftAgent=${encodeURIComponent(W.id)}&rightAgent=${encodeURIComponent(ve.id)}`}},[te,ie]),Ae=v.useMemo(()=>!te||ie.length===0?[]:ie.map(W=>{const oe=he.map(Re=>Re.byAgent[W.id]).filter(Re=>!!Re).flatMap(Re=>Re.runs),be=oe.length,Ie=oe.filter(Re=>Re.passed).length,Ye=oe.reduce((Re,Xe)=>Re+Xe.toolCalls.length,0),je=oe.reduce((Re,Xe)=>Re+Xe.duration,0);return{agentId:W.id,agentName:W.name,passRate:be===0?0:Ie/be,totalRuns:be,avgToolCalls:be===0?0:Ye/be,avgLatency:be===0?0:je/be}}),[te,ie,he]),ae=W=>{T(ve=>ve.includes(W)?ve.filter(oe=>oe!==W):[...ve,W])},$e=W=>s.jsxs("div",{className:"rounded border bg-muted/20 px-2 py-1.5",children:[s.jsxs("div",{className:"text-xs",children:[s.jsxs("span",{className:"font-mono",children:["#",W.runIndex+1]})," ",s.jsx("span",{className:W.passed?"text-emerald-700":"text-destructive",children:W.passed?"PASS":"FAIL"})," ","· tools: ",W.toolCalls.length," · ",W.duration,"ms"]}),!W.passed&&W.failureReasons.length>0&&s.jsx("div",{className:"mt-1 text-[11px] text-muted-foreground",children:W.failureReasons.join("; ")})]},W.runIndex);return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(LS,{className:"h-6 w-6"}),"Compare Runs"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:E==="runs"?"Select 2–5 runs to compare":"Compare agents side-by-side within one run"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[E==="runs"&&s.jsxs(cn,{value:g,onValueChange:j,children:[s.jsx(tn,{className:"w-[260px]",children:s.jsx(un,{placeholder:"Filter by scenario"})}),s.jsxs(nn,{children:[s.jsx(lt,{value:"all",children:"All scenarios"}),K.map(W=>s.jsx(lt,{value:W,children:W},W))]})]}),s.jsx(le,{variant:"outline",onClick:()=>{$()},disabled:i,children:i?"Refreshing...":"Refresh"})]})]}),s.jsx(qe,{children:s.jsx(We,{className:"pt-6",children:s.jsx("div",{className:"flex flex-wrap gap-2",children:s.jsx(le,{type:"button",variant:E==="runs"?"default":"outline",size:"sm",onClick:()=>_("runs"),children:"Run vs Run"})})})}),E==="within-run"&&s.jsxs(qe,{children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(Nt,{className:"text-base",children:"Within One Run Controls"}),s.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:()=>_("runs"),children:"Back to run list"})]})}),s.jsxs(We,{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Run"}),s.jsxs(cn,{value:k,onValueChange:O,children:[s.jsx(tn,{children:s.jsx(un,{placeholder:"Select run"})}),s.jsx(nn,{children:r.map(W=>s.jsx(lt,{value:W.id,children:W.id},W.id))})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Scenario filter"}),s.jsxs(cn,{value:F,onValueChange:L,children:[s.jsx(tn,{children:s.jsx(un,{placeholder:"All scenarios"})}),s.jsxs(nn,{children:[s.jsx(lt,{value:"all",children:"All scenarios"}),de.map(W=>s.jsx(lt,{value:W,children:W},W))]})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Agents (select 2+)"}),s.jsxs("div",{className:"flex flex-wrap gap-3 rounded-md border p-3",children:[G.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents available for selected run."}),G.map(W=>s.jsxs("label",{className:"inline-flex items-center gap-2 text-sm",children:[s.jsx(na,{checked:R.includes(W.id),onCheckedChange:()=>ae(W.id)}),s.jsx("span",{children:W.name})]},W.id))]})]})]})]}),E==="runs"&&s.jsx(qe,{children:s.jsx(We,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs(Mt,{children:[s.jsx(tt,{className:"w-10"}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>Y("id"),children:["Run ID",B("id")]})}),s.jsx(tt,{children:"Evaluated"}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>Y("timestamp"),children:["Timestamp",B("timestamp")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>Y("passRate"),children:["Pass Rate",B("passRate")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>Y("scenarios"),children:["Scenarios",B("scenarios")]})}),s.jsx(tt,{children:"Agents"}),s.jsx(tt,{className:"w-[140px] text-right",children:"Action"})]})}),s.jsx(Lr,{children:Q.map(W=>s.jsxs(Mt,{children:[s.jsx(ze,{children:s.jsx(na,{checked:c.has(W.id),onCheckedChange:()=>H(W.id),disabled:!c.has(W.id)&&c.size>=5})}),s.jsx(ze,{className:"font-mono text-xs",children:W.id}),s.jsx(ze,{className:"text-[11px] text-muted-foreground",children:(()=>{const ve=Z.get(W.id);return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Evaluated: ",ve.scenarioCount," scenario",ve.scenarioCount===1?"":"s"," · ",ve.agentCount," agent",ve.agentCount===1?"":"s"]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:ve.scenarioPreview})]})})()}),s.jsx(ze,{className:"text-xs text-muted-foreground",children:new Date(W.timestamp).toLocaleString()}),s.jsx(ze,{children:s.jsx(zs,{rate:W.overallPassRate})}),s.jsx(ze,{className:"font-mono text-sm",children:W.totalScenarios}),s.jsx(ze,{className:"font-mono text-sm",children:Z.get(W.id)?.agentCount??0}),s.jsx(ze,{className:"text-right",children:(Z.get(W.id)?.agentCount??0)>1?s.jsx(le,{type:"button",size:"sm",variant:"outline",onClick:()=>M(W),children:"Compare agents"}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})})]},W.id))})]})})}),E==="runs"&&D.length>=2&&s.jsxs(s.Fragment,{children:[D.length===2&&s.jsx(qe,{children:s.jsx(We,{className:"pt-6",children:s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Need a deeper comparison?"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Open the two selected runs in a dedicated side-by-side full result compare view."})]}),s.jsx(le,{asChild:!0,size:"sm",children:s.jsx(wt,{to:`/compare/results?left=${encodeURIComponent(D[0].id)}&right=${encodeURIComponent(D[1].id)}&leftConfig=${encodeURIComponent(D[0].configId)}&rightConfig=${encodeURIComponent(D[1].configId)}`,children:"Compare full results"})})]})})}),s.jsxs(qe,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Summary Comparison"})}),s.jsx(We,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs(Mt,{children:[s.jsx(tt,{children:"Metric"}),D.map((W,ve)=>s.jsx(tt,{style:{color:A1[ve]},className:"font-mono text-xs",children:W.id},W.id))]})}),s.jsxs(Lr,{children:[s.jsxs(Mt,{children:[s.jsx(ze,{className:"font-medium",children:"Pass Rate"}),D.map(W=>s.jsx(ze,{children:s.jsx(zs,{rate:W.overallPassRate})},W.id))]}),s.jsxs(Mt,{children:[s.jsx(ze,{className:"font-medium",children:"Total Runs"}),D.map(W=>s.jsx(ze,{className:"font-mono",children:W.totalRuns},W.id))]}),s.jsxs(Mt,{children:[s.jsx(ze,{className:"font-medium",children:"Tool Calls"}),D.map(W=>s.jsx(ze,{className:"font-mono",children:W.avgToolCalls.toFixed(1)},W.id))]}),s.jsxs(Mt,{children:[s.jsx(ze,{className:"font-medium",children:"Avg Latency"}),D.map(W=>s.jsxs(ze,{className:"font-mono",children:[W.avgLatency,"ms"]},W.id))]})]})]})})]}),s.jsxs(qe,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Scenario Breakdown"})}),s.jsx(We,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs(Mt,{children:[s.jsx(tt,{children:"Scenario"}),D.map((W,ve)=>s.jsx(tt,{style:{color:A1[ve]},className:"font-mono text-xs",children:W.id},W.id))]})}),s.jsx(Lr,{children:re.map(W=>s.jsxs(Mt,{children:[s.jsx(ze,{className:"font-medium text-sm",children:W}),D.map(ve=>{const oe=ve.scenarios.find(be=>be.scenarioId===W);return s.jsx(ze,{children:oe?s.jsx(zs,{rate:oe.passRate}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},ve.id)})]},W))})]})})]})]}),E==="runs"&&D.length>=2&&s.jsxs(qe,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Pass Rate Trend"})}),s.jsx(We,{className:"h-72",children:s.jsx($h,{width:"100%",height:"100%",children:s.jsxs(vS,{data:D.map((W,ve)=>({idx:ve+1,runId:W.id,passRate:Number((W.overallPassRate*100).toFixed(1))})),children:[s.jsx(Wi,{dataKey:"idx",tickFormatter:W=>String(W)}),s.jsx(Vi,{unit:"%",domain:[0,100]}),s.jsx(Mr,{formatter:W=>[`${W}%`,"Pass Rate"],labelFormatter:W=>`Run ${W}`}),s.jsx(_o,{}),s.jsx(Lo,{type:"monotone",dataKey:"passRate",stroke:A1[0],strokeWidth:2.5,dot:!0})]})})})]}),E==="within-run"&&te&&ie.length<2&&s.jsx(qe,{children:s.jsx(We,{className:"pt-6 text-sm text-muted-foreground",children:"Select at least 2 agents to compare side-by-side within this run."})}),E==="within-run"&&te&&ie.length>=2&&s.jsxs(s.Fragment,{children:[s.jsx(qe,{children:s.jsx(We,{className:"pt-6",children:s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Need full result details?"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:ue?"Open a side-by-side full result view filtered by the selected agents.":"Open the complete run result page for all details and trace navigation."})]}),s.jsx(le,{asChild:!0,size:"sm",children:ue?s.jsx(wt,{to:ue.link,children:"Compare full results"}):s.jsx(wt,{to:`/results/${encodeURIComponent(te.id)}${te.configId?`?configId=${encodeURIComponent(te.configId)}`:""}`,children:"Open full result"})})]})})}),s.jsxs(qe,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Agent Summary"})}),s.jsx(We,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs(Mt,{children:[s.jsx(tt,{children:"Metric"}),Ae.map(W=>s.jsx(tt,{className:"font-mono text-xs",children:W.agentName},W.agentId))]})}),s.jsxs(Lr,{children:[s.jsxs(Mt,{children:[s.jsx(ze,{className:"font-medium",children:"Pass Rate"}),Ae.map(W=>s.jsx(ze,{children:s.jsx(zs,{rate:W.passRate})},W.agentId))]}),s.jsxs(Mt,{children:[s.jsx(ze,{className:"font-medium",children:"Total Runs"}),Ae.map(W=>s.jsx(ze,{className:"font-mono",children:W.totalRuns},W.agentId))]}),s.jsxs(Mt,{children:[s.jsx(ze,{className:"font-medium",children:"Avg Tool Calls"}),Ae.map(W=>s.jsx(ze,{className:"font-mono",children:W.avgToolCalls.toFixed(1)},W.agentId))]}),s.jsxs(Mt,{children:[s.jsx(ze,{className:"font-medium",children:"Avg Latency"}),Ae.map(W=>s.jsxs(ze,{className:"font-mono",children:[Math.round(W.avgLatency),"ms"]},W.agentId))]})]})]})})]}),s.jsxs(qe,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Scenario × Agent Matrix"})}),s.jsx(We,{className:"p-0",children:s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs(Mt,{children:[s.jsx(tt,{className:"w-[260px]",children:"Scenario"}),ie.map(W=>s.jsx(tt,{className:"font-mono text-xs",children:W.name},W.id))]})}),s.jsx(Lr,{children:he.map(W=>s.jsxs(Mt,{children:[s.jsx(ze,{className:"font-medium text-sm",children:W.displayLabel}),ie.map(ve=>{const oe=W.byAgent[ve.id];return oe?s.jsx(ze,{className:"align-top",children:s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"text-xs text-muted-foreground",children:[s.jsx(zs,{rate:oe.passRate})," ",s.jsxs("span",{className:"ml-2",children:["runs: ",oe.runs.length]})," ","· calls: ",oe.avgToolCalls.toFixed(1)," · latency: ",Math.round(oe.avgDuration),"ms"]}),oe.runs.length>0?s.jsx("div",{className:"space-y-1.5",children:oe.runs.map(be=>$e(be))}):s.jsx("div",{className:"text-xs text-muted-foreground",children:"No runs captured."})]})},ve.id):s.jsx(ze,{children:s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},ve.id)})]},W.scenarioId))})]})})]})]})]})},MM=(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()}`},$M=(e,t,n)=>{const r=new URLSearchParams;t&&r.set("configId",t),n&&r.set("agent",n);const a=r.toString();return`/results/${encodeURIComponent(e)}${a?`?${a}`:""}`},Pge=()=>{const[e]=Vo(),t=e.get("left")??"",n=e.get("right")??"",r=e.get("leftConfig"),a=e.get("rightConfig"),i=e.get("leftAgent"),o=e.get("rightAgent"),c=i?`${t} · ${i}`:t,d=o?`${n} · ${o}`:n;return!t||!n?s.jsxs(qe,{children:[s.jsx(St,{children:s.jsx(Nt,{className:"text-base",children:"Full Result Compare"})}),s.jsxs(We,{className:"space-y-3",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Select exactly two runs in Compare and use the “Compare full results” action."}),s.jsx(le,{asChild:!0,variant:"outline",children:s.jsx(wt,{to:"/compare",children:"Back to Compare"})})]})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Full Result Compare"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:i||o?"Side-by-side Result Detail views for deep inspection, filtered by selected agents.":"Side-by-side Result Detail views for deep inspection."})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(le,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs(wt,{to:"/compare",children:[s.jsx(M7,{className:"mr-1.5 h-4 w-4"}),"Back to Compare"]})}),s.jsx(le,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:$M(t,r,i),target:"_blank",rel:"noreferrer",children:["Open Left",s.jsx(mh,{className:"ml-1.5 h-3.5 w-3.5"})]})}),s.jsx(le,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:$M(n,a,o),target:"_blank",rel:"noreferrer",children:["Open Right",s.jsx(mh,{className:"ml-1.5 h-3.5 w-3.5"})]})})]})]}),s.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[s.jsxs(qe,{className:"overflow-hidden",children:[s.jsx(St,{className:"py-3",children:s.jsx(Nt,{className:"text-sm font-mono",children:c})}),s.jsx(We,{className:"p-0",children:s.jsx("iframe",{title:`Result ${c}`,src:MM(t,r,i),className:"h-[calc(100vh-15rem)] w-full border-0"})})]}),s.jsxs(qe,{className:"overflow-hidden",children:[s.jsx(St,{className:"py-3",children:s.jsx(Nt,{className:"text-sm font-mono",children:d})}),s.jsx(We,{className:"p-0",children:s.jsx("iframe",{title:`Result ${d}`,src:MM(n,a,o),className:"h-[calc(100vh-15rem)] w-full border-0"})})]})]})]})};function kge(e){return e.match(/(?:^|\/)(?:result-assistant|results?)\/([0-9]{8}-[0-9]{6})(?:-|\/)/i)?.[1]??null}function Oge(){const{source:e}=Tn(),[t,n]=v.useState([]),[r,a]=v.useState(!0),[i,o]=v.useState(null),[c,d]=v.useState(!1),f=async()=>{a(!0);try{n(await e.listMarkdownReports())}catch(g){Pe({title:"Could not load markdown reports",description:g instanceof Error?g.message:String(g),variant:"destructive"})}finally{a(!1)}};v.useEffect(()=>{f()},[]);const h=v.useMemo(()=>t[0],[t]),p=v.useMemo(()=>t.find(g=>g.relativePath===i)??null,[t,i]),y=async()=>{if(i){d(!0);try{await e.deleteMarkdownReport(i),n(g=>g.filter(j=>j.relativePath!==i)),Pe({title:"Markdown report deleted"}),o(null)}catch(g){Pe({title:"Could not delete markdown report",description:g instanceof Error?g.message:String(g),variant:"destructive"})}finally{d(!1)}}};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(Bl,{className:"h-6 w-6"}),"Markdown Reports"]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Browse Markdown files under ",s.jsx("code",{children:"mcplab/reports"}),"."]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(le,{variant:"outline",onClick:()=>{f()},children:"Refresh"}),h?s.jsx(le,{asChild:!0,variant:"outline",children:s.jsx(wt,{to:`/markdown-reports/view?path=${encodeURIComponent(h.relativePath)}`,children:"Open latest"})}):null]})]}),s.jsx(qe,{children:s.jsx(We,{className:"p-0",children:r?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Loading markdown reports..."}):t.length===0?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"No markdown reports found yet."}):s.jsxs($r,{children:[s.jsx(Dr,{children:s.jsxs(Mt,{children:[s.jsx(tt,{children:"Report"}),s.jsx(tt,{children:"Result"}),s.jsx(tt,{children:"Folder"}),s.jsx(tt,{children:"Timestamp"}),s.jsx(tt,{className:"w-10"})]})}),s.jsx(Lr,{children:t.map(g=>s.jsxs(Mt,{children:[s.jsx(ze,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(wt,{to:`/markdown-reports/view?path=${encodeURIComponent(g.relativePath)}`,className:"font-mono text-xs text-primary hover:underline",children:g.name}),s.jsx("div",{className:"font-mono text-[11px] text-muted-foreground",children:g.relativePath})]})}),s.jsx(ze,{className:"text-xs text-muted-foreground font-mono",children:(()=>{const j=kge(g.relativePath);return j?s.jsx(wt,{to:`/results/${encodeURIComponent(j)}`,className:"text-primary hover:underline",children:j}):s.jsx("span",{className:"text-muted-foreground",children:"—"})})()}),s.jsx(ze,{className:"text-xs text-muted-foreground font-mono",children:g.relativePath.includes("/")?g.relativePath.slice(0,g.relativePath.lastIndexOf("/")):"."}),s.jsx(ze,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(of,{className:"h-3 w-3"}),new Date(g.mtime).toLocaleString()]})}),s.jsx(ze,{children:s.jsxs(Zc,{children:[s.jsx(eu,{asChild:!0,children:s.jsx(le,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Dm,{className:"h-4 w-4"})})}),s.jsxs(el,{align:"end",children:[s.jsx(yr,{asChild:!0,children:s.jsx(wt,{to:`/markdown-reports/view?path=${encodeURIComponent(g.relativePath)}`,children:"View"})}),s.jsxs(yr,{className:"text-destructive",onSelect:j=>{j.preventDefault(),o(g.relativePath)},children:[s.jsx(Ca,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},g.path))})]})})}),s.jsx(Cs,{open:!!i,onOpenChange:g=>!g&&o(null),children:s.jsxs(Ya,{children:[s.jsxs(Xa,{children:[s.jsx(Ja,{children:"Delete markdown report?"}),s.jsx(Za,{children:p?`Delete '${p.name}' from disk? This cannot be undone.`:"Delete this report from disk? This cannot be undone."})]}),s.jsxs(Qa,{children:[s.jsx(ts,{disabled:c,children:"Cancel"}),s.jsx(es,{onClick:g=>{g.preventDefault(),y()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}function Rge(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Tge(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 Ige(){const{source:e}=Tn(),[t]=Vo(),n=(t.get("path")??"").trim(),[r,a]=v.useState(null),[i,o]=v.useState(!0),[c,d]=v.useState(!1),[f,h]=v.useState(!1);if(v.useEffect(()=>{let y=!0;if(a(null),d(!1),!n){o(!1);return}return o(!0),e.getMarkdownReport(n).then(g=>{y&&a(g)}).catch(g=>{if(!y)return;const j=g instanceof Error?g.message:String(g);if(j.includes("(404)")){d(!0);return}Pe({title:"Could not load markdown report",description:j,variant:"destructive"})}).finally(()=>{y&&o(!1)}),()=>{y=!1}},[n,e]),!n)return s.jsxs("div",{className:"space-y-4",children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Markdown Report"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Missing report path."}),s.jsx(le,{asChild:!0,variant:"outline",children:s.jsx(wt,{to:"/markdown-reports",children:"Back to Markdown Reports"})})]});if(i)return s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading markdown report..."});if(c||!r)return s.jsxs("div",{className:"space-y-4",children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Markdown Report"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Report not found."}),s.jsx(le,{asChild:!0,variant:"outline",children:s.jsx(wt,{to:"/markdown-reports",children:"Back to Markdown Reports"})})]});const p=Tge(r);return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("h1",{className:"font-mono text-xl font-semibold",children:r.name}),s.jsx("p",{className:"truncate text-sm text-muted-foreground",children:r.relativePath}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[new Date(r.mtime).toLocaleString()," "," · "," ",Rge(r.sizeBytes)]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[p?s.jsxs(s.Fragment,{children:[s.jsx(le,{variant:"outline",size:"sm",onClick:()=>h(!0),children:"Open Result Panel"}),s.jsx(le,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(wt,{to:`/results/${encodeURIComponent(p)}`,children:"Open Result"})})]}):null,s.jsx(le,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(wt,{to:"/markdown-reports",children:"Back to reports"})})]})]}),s.jsx(qe,{children:s.jsx(We,{className:"pt-6",children:s.jsx(dd,{text:r.content,variant:"assistant"})})}),p?s.jsx(r3,{open:f,onOpenChange:h,children:s.jsxs(lN,{side:"right",className:"w-[96vw] max-w-none p-0 sm:max-w-5xl",children:[s.jsx(s3,{className:"border-b px-4 py-3 pr-12",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(i3,{className:"text-base",children:["Result ",p]}),s.jsx(le,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(wt,{to:`/results/${encodeURIComponent(p)}`,target:"_blank",rel:"noreferrer",children:"Open full page"})})]})}),s.jsx("div",{className:"h-[calc(100vh-64px)]",children:s.jsx("iframe",{title:`Result ${p}`,src:`/results/${encodeURIComponent(p)}?embed=1`,className:"h-full w-full border-0"})})]})}):null]})}const Mge=()=>{const e=ws();return v.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),s.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),s.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})},$ge=new xV;function Dge(){const{scenarioId:e}=Wo();return s.jsx(CD,{to:e?`/libraries/test-cases/${encodeURIComponent(e)}`:"/libraries/test-cases",replace:!0})}const Lge=()=>s.jsx(wV,{client:$ge,children:s.jsx(oD,{children:s.jsx(TG,{children:s.jsx(DG,{children:s.jsxs($G,{children:[s.jsx(Aq,{}),s.jsx(a9,{}),s.jsx(jH,{children:s.jsxs(pH,{children:[s.jsxs(Zt,{element:s.jsx(MG,{}),children:[s.jsx(Zt,{path:"/",element:s.jsx(ufe,{})}),s.jsx(Zt,{path:"/mcp-evaluations",element:s.jsx(zpe,{})}),s.jsx(Zt,{path:"/mcp-evaluations/:id",element:s.jsx(fM,{})}),s.jsx(Zt,{path:"/mcp-evaluations/:id/:tab",element:s.jsx(fM,{})}),s.jsx(Zt,{path:"/tool-analysis",element:s.jsx(sge,{})}),s.jsx(Zt,{path:"/tool-analysis-results",element:s.jsx(ige,{})}),s.jsx(Zt,{path:"/tool-analysis-results/:id",element:s.jsx(oge,{})}),s.jsx(Zt,{path:"/oauth-debugger",element:s.jsx(fge,{})}),s.jsx(Zt,{path:"/libraries/servers",element:s.jsx(Cme,{})}),s.jsx(Zt,{path:"/libraries/servers/:serverId",element:s.jsx(_me,{})}),s.jsx(Zt,{path:"/libraries/agents",element:s.jsx(Eme,{})}),s.jsx(Zt,{path:"/libraries/agents/:agentName",element:s.jsx(Bve,{})}),s.jsx(Zt,{path:"/libraries/test-cases",element:s.jsx(bM,{})}),s.jsx(Zt,{path:"/libraries/test-cases/:testCaseId",element:s.jsx(bM,{})}),s.jsx(Zt,{path:"/libraries/scenarios",element:s.jsx(CD,{to:"/libraries/test-cases",replace:!0})}),s.jsx(Zt,{path:"/libraries/scenarios/:scenarioId",element:s.jsx(Dge,{})}),s.jsx(Zt,{path:"/settings",element:s.jsx(zve,{})}),s.jsx(Zt,{path:"/run",element:s.jsx(pge,{})}),s.jsx(Zt,{path:"/results",element:s.jsx(mge,{})}),s.jsx(Zt,{path:"/results/:id",element:s.jsx(wge,{})}),s.jsx(Zt,{path:"/markdown-reports",element:s.jsx(Oge,{})}),s.jsx(Zt,{path:"/markdown-reports/view",element:s.jsx(Ige,{})}),s.jsx(Zt,{path:"/compare",element:s.jsx(Ege,{})}),s.jsx(Zt,{path:"/compare/results",element:s.jsx(Pge,{})})]}),s.jsx(Zt,{path:"*",element:s.jsx(Mge,{})})]})})]})})})})});kU.createRoot(document.getElementById("root")).render(s.jsx(Lge,{}));
|